-
Notifications
You must be signed in to change notification settings - Fork 193
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
Mat/prevent invalid funtoken #2150
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
x/evm/keeper/validate_contract.go:101
- The function name 'CheckAllethods' contains a typo. It should be 'CheckAllMethods'.
func (k Keeper) CheckAllethods(
x/evm/keeper/validate_contract.go:112
- [nitpick] The error message could be more descriptive. Suggestion: "The method '%q' was not found in the contract at address %s."
return fmt.Errorf("Method %q not found in contract at %s", name, contractAddr)
…untoken t p# the commit.
Purpose / Abstract
This pull request includes several changes to the
x/evm/keeper
package to enhance the functionality and testing of ERC20 token operations. The most important changes include verifying ERC20 token functions, adding new methods for contract validation, and updating related test cases.Enhancements to ERC20 token operations:
x/evm/keeper/funtoken_from_erc20.go
: Updated the functioncreateFunTokenFromERC20
to include a new verification step that checks if the ERC20 token implements all required functions. This step ensures the token's compatibility before proceeding with further operations. [1] [2] [3] [4] [5]New methods for contract validation:
x/evm/keeper/validate_contract.go
: Added new methodsHasMethodInContract
andCheckAllethods
to validate the presence of specific methods in a smart contract. These methods perform static calls to check method signatures and ensure that the contract includes the expected functions.Updates to test cases:
x/evm/keeper/validate_contract_test.go
: Added new test casesTestHasMethodInContract_RealKeeper
andTestCheckAllMethods_RealKeeper
to verify the functionality of the newly added contract validation methods. These tests deploy a real ERC20 contract and check for the presence and absence of specific methods.