#41635 [SC-Low] MoneyBrinter contract is EIP-4626 incompliant
Previous#41633 [SC-High] Users might lose some of the rewards they’re supposed to get.Next#41639 [SC-Insight] Cross-Vault Reward Arbitrage in StakeV2 Allows Yield Theft
Was this helpful?
Was this helpful?
Was this helpful?
function testWithdrawSuccessWithFee() public {
uint256 feeBps = 100; // 1%
_setExitFee(feeBps);
uint max = vault.maxWithdraw(bob);
console.log(max);
vm.prank(bob);
vault.withdraw(max, bob, bob);
} [71669] VaultWithdrawTest::testWithdrawSuccessWithFee()
├─ [0] VM::prank(Identity: [0x0000000000000000000000000000000000000004])
│ └─ ← [Return]
├─ [26472] MoneyBrinter::setExitFeeBasisPoints(100)
│ ├─ emit ExitFeeBasisPointsSet(oldFeeBps: 0, newFeeBps: 100)
│ └─ ← [Stop]
├─ [15095] MoneyBrinter::maxWithdraw(SHA-256: [0x0000000000000000000000000000000000000002]) [staticcall]
│ ├─ [2918] BeradromeFarmMock::balanceOf(MoneyBrinter: [0xD455fFdBc64B8da6fC1054237a60a8c377aecb72]) [staticcall]
│ │ └─ ← [Return] 1000000000000000000000000 [1e24]
│ └─ ← [Return] 1000000000000000000000000 [1e24]
├─ [0] console::log(1000000000000000000000000 [1e24]) [staticcall]
│ └─ ← [Stop]
├─ [0] VM::prank(SHA-256: [0x0000000000000000000000000000000000000002])
│ └─ ← [Return]
├─ [11675] MoneyBrinter::withdraw(1000000000000000000000000 [1e24], SHA-256: [0x0000000000000000000000000000000000000002], SHA-256: [0x0000000000000000000000000000000000000002])
│ ├─ [918] BeradromeFarmMock::balanceOf(MoneyBrinter: [0xD455fFdBc64B8da6fC1054237a60a8c377aecb72]) [staticcall]
│ │ └─ ← [Return] 1000000000000000000000000 [1e24]
│ ├─ [918] BeradromeFarmMock::balanceOf(MoneyBrinter: [0xD455fFdBc64B8da6fC1054237a60a8c377aecb72]) [staticcall]
│ │ └─ ← [Return] 1000000000000000000000000 [1e24]
│ └─ ← [Revert] ERC20InsufficientBalance(0x0000000000000000000000000000000000000002, 100000000000000000000000000000 [1e29], 101000000000000000000000000000 [1.01e29])
└─ ← [Revert] ERC20InsufficientBalance(0x0000000000000000000000000000000000000002, 100000000000000000000000000000 [1e29], 101000000000000000000000000000 [1.01e29])
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 1.33ms (180.88µs CPU time)
Ran 1 test suite in 1.20s (1.33ms CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests)
Failing tests:
Encountered 1 failing test in test/vault/VaultWithdrawTest.t.sol:VaultWithdrawTest
[FAIL: ERC20InsufficientBalance(0x0000000000000000000000000000000000000002, 100000000000000000000000000000 [1e29], 101000000000000000000000000000 [1.01e29])] testWithdrawSuccessWithFee() (gas: 71669)