-
Notifications
You must be signed in to change notification settings - Fork 6
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
Paymaster audit fixes #33
Conversation
Contract comparison - from 3ec6ea1 to 55d4dae
|
…master_audit_fixes
@@ -5,7 +5,6 @@ multiversx_sc::imports!(); | |||
pub mod forward_call; | |||
const FEE_PAYMENT: usize = 0; |
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.
Maybe rename to FEE_PAYMENT_INDEX for more clarity.
@@ -5,7 +5,6 @@ multiversx_sc::imports!(); | |||
pub mod forward_call; | |||
const FEE_PAYMENT: usize = 0; | |||
|
|||
/// An empty contract. To be used as a template when starting a new contract from scratch. | |||
#[multiversx_sc::contract] | |||
pub trait PaymasterContract: forward_call::ForwardCall { | |||
#[init] |
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.
I can't add a comment on the unmodified code, but to have a safer approach regarding the fees in the forwardExecution endpoint, I would change the fee_payment nonce for the relayer_addr to fee_payment.token_nonce, instead of hardcoding the value 0, as the code would crash (without having a custom error) if the user would send an SFT. Now, if you want to allow only fungible tokens, do the check that the payment's nonce is 0. But still, I would keep the token_nonce approach.
No description provided.