-
Notifications
You must be signed in to change notification settings - Fork 36
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
Custom ABIs #60
Comments
If you just add interfaces in your contracts folder, that should be used and given more preference than 4bytes dir. You can also turn off usage of 4bytes using this config. |
I have the interfaces defined in the contracts folder, but it still prefers to pick from the 4bytes dir in a special case. Assuming the interface is let contractAddress := `some address`
// 4 bytes sighash + 32 bytes data size + 10 bytes data
// If do the function call in solidity, the insize will be 4 + 32 + 32, but including the ending zeros is not necessary and consumes more gas
let insize := 46
pop(call(gas(), contractAddress, 0, 0, insize, 0, 0)) If |
Hmm, interesting. I'm using ethers.js ABI decoder which expects the calldata to be adhering to the ABI spec. If you are not passing the zeros for the last value, it works in solidity because it doesn't check calldata length. Solidity also accepts more bytes in calldata than needed but ethers would throw an exception for these both cases. Maybe it could be fine to fill missing bytes by not requiring exact calldata length to reflect the behaviour of solidity, I can try patching it on my side. |
Is there any way to add custom ABIs via config, the ABIs from 4byte.directory may not always correct.
The text was updated successfully, but these errors were encountered: