-
Notifications
You must be signed in to change notification settings - Fork 9
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
Empty EVM bytecode after upload #11
Comments
After a day of debugging, I found the root cause of the bug. The Ethermint repo was querying an EVM contract's bytecodes from an EVM account casted from the AccountI of Below is the |
A simple fix is to add the following logic to if !ok && account.IsContract() {
if baseAcct, isBaseAccount := acct.(*authtypes.BaseAccount); isBaseAccount {
acct = ðermint.EthAccount{
BaseAccount: baseAcct,
CodeHash: codeHash.Hex(),
}
} else {
return errorsmod.Wrapf(types.ErrInvalidAccount, "type %T, address %s", acct, addr)
}
} It will check if the account is a contract. If it is, then it will cast the |
This bug is resolved in #13. The actual implementation is in oraichain/ethermint-cosmos-0.50@3c8d318 |
Context
When running the e2e test, I encountered an EVM bug of not being able to query or execute any EVM contracts after uploading. The request always returned an empty response.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A
decimals()
query should return the contract's decimals()Screenshots
The text was updated successfully, but these errors were encountered: