GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

No Two-Step Admin Transfer in `CharityRegistry.sol`

Description: Admin transfer happens in a single step, which could lead to permanent loss of admin access if wrong address is provided.

Impact:

  • Risk of losing admin access through typos

  • No confirmation from new admin

  • No way to recover from mistakes

Recommended Mitigation: Implement a two-step transfer pattern like the given below:

address public pendingAdmin;
function initiateAdminTransfer(address newAdmin) public onlyAdmin nonZeroAddress(newAdmin) {
pendingAdmin = newAdmin;
emit AdminTransferInitiated(admin, newAdmin);
}
function acceptAdminTransfer() public {
require(msg.sender == pendingAdmin, "Only pending admin can accept");
admin = pendingAdmin;
pendingAdmin = address(0);
emit AdminTransferCompleted(admin);
}
Updates

Lead Judging Commences

n0kto Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.