crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://www.trailofbits.com/
GNU Affero General Public License v3.0
271 stars 33 forks source link

Option to set Medusa initial balance using integers same as Echidna #306

Open devdacian opened 4 months ago

devdacian commented 4 months ago

Echidna allows the initial balance to be set using integers, for example to set the initial balance to type(uint256).max:

balanceContract: 115792089237316195423570985008687907853269984665640564039457584007913129639935

Ideally Medusa would also allow initial balance to be set the same way as this is much more natural than using hex notation.

When using chisel to get the hex for various balances then using that hex as input to Medusa, this can result in some weird errors, eg: type(uint256).max 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

error Failed to initialize the test chain ‣ test chain state write error when adding tx to pending block: insufficient funds for gas * price + value: address 0x0000000000000000000000000000000000030000 have 28948022309329048855892746252171976963317496166410141009864396001978282409983 want 115792089237316195423570985008687907853269984665640564039457584007913129639935

0xalpharush commented 1 month ago

I believe the balances can be a base-10 integer. The error seems unrelated to supporting integers and caused by an insufficient balance. Could you share an example of what you're trying to accomplish so we could get clarity on what needs to be fixed?