Organization
- @monad
Engagement Type
Cantina Reviews
Period
-
Repositories
Findings
Informational
6 findings
3 fixed
3 acknowledged
Informational6 findings
Allowing removeWallets(...) in any stage may prevent accidentally removed wallets from being added again
State
- Acknowledged
Severity
- Severity: Informational
Submitted by
0xRajeev
Description
removeWallets(...)does not have theonlyInStagemodifier, which means this can be called byREMOVE_ROLEin any of the stages to remove unauthorized wallets that have been added accidentally. However, ifremoveWallets(...)is called afterCLAIM_DETAILSis finalized, then any wallets that may be incorrectly removed (i.e. eligible recipients of the due amounts) cannot be added again.Recommendation
Consider if
onlyInStage(EscrowStage.CLAIM_DETAILS)should be enforced onremoveWallets(...)so that any eligible wallets incorrectly removed can be added back again. The trade-off is that if ineligible wallets added in this stage are not removed even after offchain manual checks then they cannot be removed in theSENDINGstage. Such wallets (if identified) can however be skipped for sends and their amounts accordingly accounted for inowedwhile sending MON to the contract or while rescuing.WalletNotAdded can be named better to account for other revert scenarios
Description
WalletNotAddederror inremoveWallets(...)can be triggered not only when operating on a wallet not added, but also on wallets that have been deleted because they have been already removed or already sent their due amounts. The nameWalletNotAddedtherefore accounts for one of the three possible revert scenarios.Recommendation
Consider if this can be named
WalletNotAddedOrAlreadySentOrAlreadyRemovedor a shorter but more generic name.WalletRemoved event is missing the amount parameter for consistency
Description
Unlike
WalletAdded(wallet, amount)andTokensSent(wallet, amountDue)events,WalletRemoved(wallet)does not include theamount = balanceOf[wallet]as a event emit parameter, which is inconsistent.Recommendation
Consider including the amount parameter for consistency.
receive() may be restricted to SENDING stage to prevent premature crediting of funds
Description
The planned flow expects MON to be sent to the Distribution Escrow contract only in the
SENDINGstage after all the eligible wallets have been added and manually verified as being correct.However, this is not enforced in the
receive()function. If an incorrect amount (e.g. because of ineligible wallets accidentally included but removed thereafter) is accidentally sent to the contract in the earlierCLAIM_DETAILSstage then the differential amount will have to be rescued thereafter.Recommendation
Consider restricting
receive()toSENDINGstage to prevent premature crediting of funds.Verification of added wallets and amounts should have sufficient rigor and redundancy
State
- Acknowledged
Severity
- Severity: Informational
Submitted by
0xRajeev
Description
The
ADD_ROLEandSENDER_ROLEare expected to be temporarily granted to wallets that may be assumed to be compromised in the threat model. The planned flow therefore includes a verification step of added wallets and amounts, which includes running scripts and manual checking to top+random accounts as indicated. Any mistake/miss here may lead to ineligible/incorrect wallets/amounts being sent.Recommendation
Ensure that this verification step of added wallets and amounts has sufficient rigor and redundancy by comparing the added wallets/amounts against multiple redundant offline lists several times in different ways.
DEFAULT_ADMIN_ROLE should have the highest possible security
State
- Acknowledged
Severity
- Severity: Informational
Submitted by
0xRajeev
Description
DEFAULT_ADMIN_ROLEis used to access controlfinalizeCurrentStage()andrescueTokens(...). It can also grant/revokeADD_ROLE,REMOVE_ROLEandSENDER_ROLE, which are used to add/remove eligible wallets and send them their due amounts. Given the criticality of this admin role, it should have the highest possible security. This is currently planned to be a 4/7 multisig wallet.Recommendation
Ensure that
DEFAULT_ADMIN_ROLEis a 4/7 or higher threshold multisig wallet with diverse signers and platforms using dedicated and isolated devices along with offline verification of calldata and clear signing to minimize compromise.