Skip to content

Commit

Permalink
can update signer wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattMufson committed Mar 7, 2024
1 parent d234934 commit 67bf288
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/DoGClaim.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ contract DoGClaim is AccessControlUpgradeable {
emit BalanceLoaded(_msgSender(), amount, _balance);
}

function updateSignerWallet(address newSignerWallet) public onlyRole(ADMIN_ROLE) {
if (newSignerWallet == address(0)) {
revert InvalidAddress(newSignerWallet);
}
signer = newSignerWallet;
}

function updateFeeWallet(address newFeeWallet) public onlyRole(ADMIN_ROLE) {
if (newFeeWallet == address(0)) {
revert InvalidAddress(newFeeWallet);
Expand Down
15 changes: 15 additions & 0 deletions test/DoGClaim.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,21 @@ contract DoGClaimTest is Test {
dogClaim.updateFeeWallet(sender);
}

function test_updateSignerWallet() public {
address sender = vm.addr(2);

vm.prank(sender);
vm.expectRevert();
dogClaim.updateSignerWallet(sender);

vm.prank(admin);
vm.expectRevert();
dogClaim.updateSignerWallet(address(0));

vm.prank(admin);
dogClaim.updateSignerWallet(sender);
}

function test_updateFeeRate() public {
address sender = vm.addr(2);

Expand Down

0 comments on commit 67bf288

Please sign in to comment.