Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Oct 23, 2024
1 parent f72a4a4 commit a1e510d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions contracts/interfaces/IBiconomySponsorshipPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ interface IBiconomySponsorshipPaymaster {
event TokensWithdrawn(address indexed token, address indexed to, uint256 indexed amount, address actor);
event WithdrawalRequestSubmitted(address withdrawAddress, uint256 amount);
event WithdrawalRequestCancelledFor(address paymasterId);
event TrustedPaymasterIdSet(address indexed paymasterId, bool isTrusted);
event EthWithdrawn(address indexed recipient, uint256 indexed amount);
event MinDepositChanged(uint256 indexed oldValue, uint256 indexed newValue);

function depositFor(address paymasterId) external payable;

Expand Down
7 changes: 6 additions & 1 deletion contracts/sponsorship/BiconomySponsorshipPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ contract BiconomySponsorshipPaymaster is
*/
function setTrustedPaymasterId(address paymasterId, bool isTrusted) external payable onlyOwner {
if (paymasterId == address(0)) revert PaymasterIdCanNotBeZero();
_trustedPaymasterIds[paymasterId] = isTrusted;
if (_trustedPaymasterIds[paymasterId] != isTrusted) {
_trustedPaymasterIds[paymasterId] = isTrusted;
emit TrustedPaymasterIdSet(paymasterId, isTrusted);
}
}

/**
Expand All @@ -148,6 +151,7 @@ contract BiconomySponsorshipPaymaster is
*/
function setMinDeposit(uint256 newMinDeposit) external payable onlyOwner {
minDeposit = newMinDeposit;
emit MinDepositChanged(minDeposit, newMinDeposit);
}

/**
Expand Down Expand Up @@ -243,6 +247,7 @@ contract BiconomySponsorshipPaymaster is
if (!success) {
revert WithdrawalFailed();
}
emit EthWithdrawn(recipient, amount);
}

function withdrawTo(address payable withdrawAddress, uint256 amount) external virtual override {
Expand Down

0 comments on commit a1e510d

Please sign in to comment.