Description:
Upon deployment, the Deploy contract inadvertently becomes the owner of the MerkleAirdrop contract as it inherits from Ownable. This ownership change prevents the protocol team from calling the claimFees function to claim fees, as the claimFees function is restricted to the owner of the contract.
Impact:
This issue significantly impacts the protocol team's ability to manage and operate the MerkleAirdrop contract effectively. Without the ability to claim fees, the ether gathered in fee remains stuck inside the contract forever.
Proof of Code:
Make the following changes to MerkleAirdrop.t.sol-
Add the following test and run forge test --zksync --mt testDeployerIsOwnerOfAirdrop and forge test --zksync --mt testOwnerCannotClaimFees
Recommended Mitigation:
To resolve this issue, the ownership should be transferred from the deployer to the account that runs the Deploy script using the transferOwnership method. This mitigation ensures that the protocol team can regain control over the MerkleAirdrop contract and access the claimFees function.
Tools Used: Manual review and Foundry for POC
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.