Platform: Code4rena
Start Date: 08/09/2023
Pot Size: $70,000 USDC
Total HM: 8
Participants: 84
Period: 6 days
Judge: gzeon
Total Solo HM: 2
Id: 285
League: ETH
Rank: 61/84
Findings: 1
Award: $34.69
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ciphermarco
Also found by: 0x3b, 0xbrett8571, 0xmystery, 0xnev, K42, Kral01, Sathish9098, castle_chain, catellatech, cats, emerald7017, fouzantanveer, foxb868, grearlake, hals, jaraxxus, kaveyjoe, lsaudit, rokinot
34.6879 USDC - $34.69
Centrifuge operates on a hub-and-spoke model, managing RWA pools on its dedicated Centrifuge Chain and deploying Liquidity Pools on other networks. This facilitates efficient communication and expands accessibility. The audited codebase encompasses approximately 2657 non-commented source lines of code (nSLoC), distributed across 18 contracts.
Audit approach encompassed several key steps:
Root
contract inherits some authorization logic from Auth
, but this logic is also repeated within the contract. Consolidating this logic would streamline contract maintenance.The Root
contract holds the authoritative position as the ward (authorized entity) over all project contracts. The Root
contract's wards can grant or revoke permissions (add or remove wards) on any contract within the system. This setup presents centralization risks, as every ward wields control over the addition and removal of wards across the entire system.
transfer
, transferFrom
, and approve
).Root
contract can circumvent the timelock requirement for adding wards by directly calling the Root.rely
function, which doesn't enforce the execution delay.Root
contract's functions lack checks to verify if the contract is paused before executing executeScheduledRely
.Root
contract inaccessible if the last contract ward removes themselves, effectively denying any further access.ERC20.transfer
and ERC20.transferFrom
functions may result in silent balance overflows during the receiver's update.Root
Contract Enhancements: Implement a wards counter in the Root
contract, which can be checked when wards are removed. This ensures that the contract doesn't become inaccessible when all wards are removed.Root.rely
: Disable the inherited Root.rely
function to enforce that adding wards follows the timelock delay instead of immediate addition.Root
contract.The audit process consumed approximately 24 hours, divided between manual code review, thorough analysis of the provided documentation, and documenting my findings.
24 hours
#0 - c4-pre-sort
2023-09-17T02:07:31Z
raymondfam marked the issue as sufficient quality report
#1 - c4-judge
2023-09-26T17:16:20Z
gzeon-c4 marked the issue as grade-b