Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofianel5 committed Dec 15, 2023
1 parent aa65f65 commit 281dabb
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions contracts/contracts/paymasters/PrivateMerklePaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ contract PrivateMerklePaymaster is MerkleTreeWithHistory, ReentrancyGuard {
uint256 fee;
bytes encryptedOutput1;
bytes encryptedOutput2;
bool isL1Withdrawal;
}

event NewCommitment(bytes32 commitment, uint256 index, bytes encryptedOutput);
Expand Down Expand Up @@ -72,11 +71,10 @@ contract PrivateMerklePaymaster is MerkleTreeWithHistory, ReentrancyGuard {
}
}

function transact() public {
function transact(Proof memory _args, ExtData memory _extData) public {
if (_extData.extAmount > 0) {
// for deposits from L2
token.transferFrom(msg.sender, address(this), uint256(_extData.extAmount));
require(uint256(_extData.extAmount) <= maximumDepositAmount, "amount is larger than maximumDepositAmount");
// for deposits from L2
token.transferFrom(msg.sender, address(this), uint256(_extData.extAmount));
}
_transact(_args, _extData);
}
Expand All @@ -96,11 +94,7 @@ contract PrivateMerklePaymaster is MerkleTreeWithHistory, ReentrancyGuard {

if (_extData.extAmount < 0) {
require(_extData.recipient != address(0), "Can't withdraw to zero address");
if (_extData.isL1Withdrawal) {
token.transferAndCall(omniBridge, uint256(-_extData.extAmount), abi.encodePacked(l1Unwrapper, _extData.recipient));
} else {
token.transfer(_extData.recipient, uint256(-_extData.extAmount));
}
token.transfer(_extData.recipient, uint256(-_extData.extAmount));
}
if (_extData.fee > 0) {
token.transfer(_extData.relayer, _extData.fee);
Expand Down

0 comments on commit 281dabb

Please sign in to comment.