-
Notifications
You must be signed in to change notification settings - Fork 178
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
Fix/evm gas estimation cherry pick #1201
Conversation
🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨It looks like you are trying to merge a hotfix PR into If you are trying to merge a hotfix PR, please complete the following essential steps:
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to |
let amount: U256 = handle.context().apparent_value; | ||
let method = get_slice(txdata, 0, 4)?; | ||
if get_method_id("transfer(bytes32)") != method { | ||
return Ok(PrecompileOutput { |
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.
it is better to return Err if the method not found in the contract.
let address_bytes_dst: &[u8] = get_slice(txdata, 4, 36)?; | ||
let account_id_src = bytes_to_account_id(&ADDRESS_BYTES_SRC)?; | ||
let account_id_dst = bytes_to_account_id(address_bytes_dst)?; | ||
if amount_sub.is_zero() { |
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.
the same as last comment. return Err if the parameter is invalid.
Description
Cherry-picked evm gas estimation fix from #1184