Skip to content

Commit

Permalink
update names
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiago Pittella authored and Santiago Pittella committed Dec 21, 2023
1 parent 204bf00 commit 090c1a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ethereum/contracts/zksync/facets/Mailbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,14 @@ contract MailboxFacet is Base, IMailbox {
refundRecipient = AddressAliasHelper.applyL1ToL2Alias(refundRecipient);
}

address l1TokenAddress = address($(L1_NATIVE_TOKEN_ADDRESS));
// The address of the token that is used in the L2 as native.
address nativeTokenAddress = address($(L1_NATIVE_TOKEN_ADDRESS));
// Check balance and allowance.
require(IERC20(l1TokenAddress).balanceOf(msg.sender) >= _amount, "Not enough balance");
require(IERC20(l1TokenAddress).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance");
require(IERC20(nativeTokenAddress).balanceOf(msg.sender) >= _amount, "Not enough balance");
require(IERC20(nativeTokenAddress).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance");

// Transfer tokens to the contract.
IERC20(l1TokenAddress).safeTransferFrom(msg.sender, address(this), _amount);
IERC20(nativeTokenAddress).safeTransferFrom(msg.sender, address(this), _amount);

params.sender = _sender;
params.txId = s.priorityQueue.getTotalPriorityTxs();
Expand Down

0 comments on commit 090c1a8

Please sign in to comment.