Platform: Code4rena
Start Date: 12/07/2023
Pot Size: $80,000 USDC
Total HM: 11
Participants: 47
Period: 9 days
Judge: berndartmueller
Total Solo HM: 1
Id: 260
League: ETH
Rank: 24/47
Findings: 1
Award: $145.35
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: pcarranzav
Also found by: Jeiwan, K42, MrPotatoMagic, Sathish9098, libratus, niloy
I took a systematic approach to analyzing the provided smart contracts:
The contracts implement an architecture for cross-chain token transfers and interchain communication. Key components:
TokenManager
handles token locking/minting/burning
InterchainTokenService
facilitates messaging for cross-chain transfersStandardizedToken
provides common token functionalityTimelock
, Multisig
, etcThis is a well-designed architecture that encapsulates functionality into appropriate contracts. The use of interfaces allows flexible integration of components.
Overall the codebase follows best practices and is of good quality:
From a security perspective, the key risks identified include:
The contracts have some centralization risks stemming from reliance on owner addresses and privileged roles like operators:
InterchainTokenService
contract is initialized with an operator who has privileged control. This could be decentralized by using a DAO-controlled operator role.Operatable
contract allows the operator to be changed by the current operator. A Timelock
could be added for changing critical privilege roles.TokenManager
and StandardizedToken
contracts also rely on a distributor role. Again a Timelock
should be considered for changing this privileged role.FinalProxy
and InitProxy
contracts allow the owner full control. A Timelock
should be used for upgrading proxies or transferring ownership.Reentrancy
is prevented in critical state-changing functions:
InterchainTokenService._processSendToken
uses an effect-interaction pattern to update state before calling external contracts.TokenManager._takeToken
and _giveToken
update balances before transferring tokens.StandardizedToken._mint
and _burn
update balances before calling the token manager.InterchainTokenService._execute
.Proper input validation helps prevent abuse of multi-call functions:
Multicall
contract checks for matching input and output array lengths.InterchainTokenService
does array length checks in _execute.Additional validation on destination addresses and token amounts would further improve security.
@## Access Controls
The use of modifiers provides access control restrictions:
Operatable
and Distributable
restrict access to privileged roles.OnlyProxy
prevents direct calls to proxy implementations.Upgradable
restricts upgrading to owner.Timelock
enforces time-based restrictions.Consider using a whitelist rather than onlyRemoteService
in InterchainTokenService
for more flexibility.
To fully assess logic risks, thorough testing of core functions like:
Thank you for having the look into my analysis of Axelar Network codebase.
17 hours
#0 - c4-judge
2023-09-04T10:48:25Z
berndartmueller marked the issue as grade-b