Skip to content

Commit

Permalink
fix: check amount after normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
frolvanya committed Jan 12, 2025
1 parent 7da7acc commit 704963c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions near/omni-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@ impl Contract {
) -> Promise {
let transfer_message = self.get_transfer_message(transfer_id);

require!(transfer_message.amount.0 > 0, "Invalid amount");

if let Some(fee) = &fee {
require!(&transfer_message.fee == fee, "Invalid fee");
}
Expand All @@ -417,6 +415,8 @@ impl Contract {
decimals,
);

require!(amount_to_transfer > 0, "Invalid amount to transfer");

let transfer_payload = TransferMessagePayload {
prefix: PayloadType::TransferMessage,
destination_nonce: transfer_message.destination_nonce,
Expand Down

0 comments on commit 704963c

Please sign in to comment.