We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b1f5ad commit 4235572Copy full SHA for 4235572
near/omni-bridge/src/lib.rs
@@ -203,10 +203,11 @@ impl FungibleTokenReceiver for Contract {
203
// User has to pay for storage and we can't trust sender_id.
204
let signer_id = env::signer_account_id();
205
206
- if self.acl_has_role(Role::NativeFeeRestricted.into(), signer_id.clone())
207
- && parsed_msg.native_token_fee.0 > 0
208
- {
209
- env::panic_str("ERR_ACCOUNT_RESTRICTED_FROM_USING_NATIVE_FEE");
+ // Avoid extra storage read by verifying native fee before checking the role
+ if parsed_msg.native_token_fee.0 > 0 {
+ if self.acl_has_role(Role::NativeFeeRestricted.into(), signer_id.clone()) {
+ env::panic_str("ERR_ACCOUNT_RESTRICTED_FROM_USING_NATIVE_FEE");
210
+ }
211
}
212
213
require!(
0 commit comments