-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Echidna won't start if the ERC20
name or symbol begins with 0x
#909
Comments
This is a pretty niche use case (symbols and names with
As I am not entirely sure how the |
This looks like a legitimate issue and I think I know why it fails. Thanks a lot for the report, we will try to fix it for the next release 😄 |
@ggrieco-tob Awesome, thank you! |
Small reproducer: contract A {
string public x = "0xa";
function f() public returns(string) { return x; }
} |
The contract below is taken from the NaughtCoin level 15 of the Ethernaut wargame.
If you import this contract into any Echidna test file, Echidna will freeze with the
Starting up, please wait...
log (similar to the [#889]).When run with the
--format text
flag it returns:Steps to reproduce the issue
I've prepared an example repository.
git clone https://github.com/ChmielewskiKamil/naught-coin.git && cd naught-coin
echidna-test src/TestNaughtCoin.sol --contract TestNaughtCoin --config src/config.yaml
echidna-test: invalid b16 decoding of: "0x0"
As soon as you change the symbol to something different, like so:
It starts fuzzing correctly.
If the token's name starts with
0x
, it does not work either.This results in the same issue:
echidna-test: invalid b16 decoding of: "0xNaughtCoin"
.Additional info
This was a bit of a headache to debug as I had no idea about the
--format text
flag or theformat = text
option in the config.This option is mentioned at the end of the FAQ section of the building secure contracts repo. I had this "freezing" problem a couple of times in the past and didn't know how to solve it. Adding the information about this
format text
debug option in a couple more places would be great for newer users to solve problems on their own.I would be happy to help update the documentation. I had a couple of ideas where such info could be present:
Let me know what you think
Thanks!
The text was updated successfully, but these errors were encountered: