Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow zero address to be used as proposed admin address #9695

Merged
merged 4 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ contract KeeperRegistryLogicB2_1 is KeeperRegistryBase2_1 {
function transferUpkeepAdmin(uint256 id, address proposed) external {
_requireAdminAndNotCancelled(id);
if (proposed == msg.sender) revert ValueNotChanged();
if (proposed == ZERO_ADDRESS) revert InvalidRecipient();

if (s_proposedAdmin[id] != proposed) {
s_proposedAdmin[id] = proposed;
Expand Down
19 changes: 12 additions & 7 deletions contracts/test/v0.8/automation/KeeperRegistry2_1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4318,13 +4318,18 @@ describe('KeeperRegistry2_1', () => {
)
})

it('reverts when transferring to zero address', async () => {
await evmRevert(
registry
.connect(admin)
.transferUpkeepAdmin(upkeepId, ethers.constants.AddressZero),
'InvalidRecipient()',
)
it('allows transferring to zero address', async () => {
const tx = await registry
.connect(admin)
.transferUpkeepAdmin(upkeepId, ethers.constants.AddressZero)

await expect(tx)
.to.emit(registry, 'UpkeepAdminTransferRequested')
.withArgs(
upkeepId,
await admin.getAddress(),
ethers.constants.AddressZero,
)
})

it('does not change the upkeep admin', async () => {
Expand Down
Loading