Axelar Network

Decentralized interoperability network.

  • Start date8 Aug 2024
  • End date26 Aug 2024
  • Total awards$85,000 in USDC
  • Duration18 days

Axelar Network audit details

  • Total Prize Pool: $85,000 in USDC
    • HM awards: $71,500 in USDC
    • QA awards: $3,000 in USDC
    • Judge awards: $6,000 in USDC
    • Validator awards: $4,000 in USDC
    • Scout awards: $500 in USDC
  • Join C4 Discord to register
  • Submit findings using the C4 form
  • Read our guidelines for more details
  • Starts August 8, 2024 20:00 UTC
  • Ends August 26, 2024 20:00 UTC

Automated Findings / Publicly Known Issues

The 4naly3er report can be found here.

Note for C4 wardens: Anything included in this Automated Findings / Publicly Known Issues section is considered a publicly known issue and is ineligible for awards.

  • Please refer to previous audits, especially for AxelarAmplifierGateway, interchain-token-service, axelar-amplifier

Publicly Known Issues:

ITS hub balance tracking should be applied when minter isn't set (https://github.com/axelarnetwork/interchain-token-service/issues/270)

  • ITS Hub balance tracking should only be applied when the minter isn't set in the deploy Interchain Token message type. If a minter is set, then the balance invariants can't be preserved since the minter address can mint on the remote chain. This is a fine trade off for custom tokens who want more control. The balance invariant is more so intended for the common use case of deploying a canonical ITS token or a trustless native interchain token to remote chains via the Factory, where the minter isn't set.
    Hence, additionally check if minter length is 0 in ITS hub to enable tracking.

Overview

What is Axelar?

Axelar delivers secure cross-chain communication for Web3, enabling you to build Interchain dApps that grow beyond a single chain. Secure means Axelar is built on proof-of-stake, the battle-tested approach used by Ethereum, Polygon, Cosmos, and more. Cross-chain communication means you can build a complete experience for your users that lets them interact with any asset, any application, on any chain with one click.

Interchain Token Service (ITS):

The Interchain Token Service allows users and developers to easily create their own token bridge, handling all underlying interchain communication. Users can either use the provided InterchainToken or implement their own. There are multiple configuration options for bridges, and users must trust the deployer of any bridge they use, similar to how they must trust the operator of a token.

Interchain Amplifier:

The Interchain Amplifier enables developers to permissionlessly set up connections to the Axelar network. Developers gain access to Axelar's interconnected network of chains and can "amplify" their resources by paying the cost equivalent to developing only one connection. They can establish connections between new ecosystems or existing chains to add new network properties, such as improved security or better delivery and availability.

Axelar Amplifier Gateway:

Axelar Amplifier Gateway is a smart contract that lives on the external chain connecting to the Axelar Network. It facilitates the sending and receiving of cross-chain messages to other chains via the Axelar Network. AxelarAmplifierGateway is the EVM reference implementation of the external gateway.

ITS Token Hub for Amplifier

Links


Scope

Files in scope

ContractSLOCPurposeLibraries used
contracts/gateway/BaseAmplifierGateway.sol130
contracts/gateway/AxelarAmplifierGateway.sol68
contracts/gateway/AxelarAmplifierGatewayProxy.sol13
contracts/governance/BaseWeightedMultisig.sol129
TOTAL340
ContractSLOCPurposeLibraries used
interchain-token-service/src/abi.rs524
interchain-token-service/src/contract/execute.rs523
interchain-token-service/src/state.rs224
interchain-token-service/src/primitives.rs109
interchain-token-service/src/contract.rs108
interchain-token-service/src/msg.rs52
contracts/axelarnet-gateway/src/state.rs202
contracts/axelarnet-gateway/src/contract.rs139
contracts/axelarnet-gateway/src/client.rs126
contracts/axelarnet-gateway/src/contract/execute.rs118
contracts/axelarnet-gateway/src/executable.rs67
contracts/axelarnet-gateway/src/msg.rs33
TOTAL2225
ContractSLOCPurposeLibraries used
interchain-token-service/contracts/InterchainTokenService.sol565
interchain-token-service/contracts/utils/GatewayCaller.sol64
interchain-token-service/contracts/utils/Minter.sol21
interchain-token-service/contracts/interchain-token/InterchainTokenStandard.sol30
interchain-token-service/contracts/utils/RolesConstants.sol8
interchain-token-service/contracts/utils/TokenManagerDeployer.sol12
interchain-token-service/contracts/interchain-token/ERC20Permit.sol31
interchain-token-service/contracts/utils/InterchainTokenDeployer.sol26
interchain-token-service/contracts/interchain-token/InterchainToken.sol63
interchain-token-service/contracts/utils/Create3Fixed.sol21
interchain-token-service/contracts/interchain-token/ERC20.sol55
interchain-token-service/contracts/TokenHandler.sol136
interchain-token-service/contracts/utils/Create3AddressFixed.sol12
interchain-token-service/contracts/utils/FlowLimit.sol69
interchain-token-service/contracts/utils/Operator.sol21
interchain-token-service/contracts/InterchainTokenFactory.sol144
interchain-token-service/contracts/proxies/InterchainProxy.sol5
interchain-token-service/contracts/proxies/TokenManagerProxy.sol37
interchain-token-service/contracts/token-manager/TokenManager.sol83
interchain-token-service/contracts/executable/InterchainTokenExecutable.sol18
interchain-token-service/contracts/executable/InterchainTokenExpressExecutable.sol11
TOTAL1432

Files out of scope

Any files not under the scope tables are OUT OF SCOPE

Scoping Q & A

General questions

QuestionAnswer
ERC20 used by the protocolAny (all possible ERC20s)
Test coverageinterchain-token-service: Functions 100%, Lines 99.11% - EVM Amplifier Gateway: Functions 97.65%, Lines 99.86%
ERC721 used by the protocolNone
ERC777 used by the protocolNone
ERC1155 used by the protocolNone
Chains the protocol will be deployed onOther: N/A. These contracts are on Axelar Network protocol.

ERC20 token behaviors in scope

External integrations (e.g., Uniswap) behavior in scope:

QuestionAnswer
Enabling/disabling fees (e.g. Blur disables/enables fees)No
Pausability (e.g. Uniswap pool gets paused)No
Upgradeability (e.g. Uniswap gets upgraded)No

EIP compliance checklist

Only Interchain Token adheres to EIP-20.

Additional context

Main invariants

  • Security: Identify and mitigate vulnerabilities to prevent exploits and attacks.
  • Reliability: Ensure the contract behaves consistently under various conditions.
  • Efficiency: Verify that the contract performs optimally without unnecessary gas consumption.
  • Correctness: Ensure the smart contract logic correctly implements the intended functionality without errors.

Attack ideas (where to focus for bugs)

Security Concerns - Access Control, Signature Verification, Reply Protection, Data integrity

  • Does the access control mechanism correctly restrict access to sensitive functions?
  • Are role-based access controls (onlyRole) correctly implemented for managing flow limiters and operator roles?
  • Does the storage function correctly reference the intended storage slots and ensure security?
  • Can the signature verification function correctly verify the required signatures?
  • Does the function handling signature proofs properly reject invalid or malicious proofs?
  • Can the message validation function correctly update the message status to prevent replay attacks?
  • Does the message approval function properly check if a message has already been approved to avoid double approvals?
  • Are token details, such as addresses and flow limits, securely managed and protected from tampering?
  • Does the contract ensure that minting and burning of tokens are properly authorized and logged?
  • Any misbehavior by the token which identified through its token ID, does not impact other tokens registered by ITS?

Functional Concerns - Message Approval and Execution, Signer Rotation, Event Emission

  • Can the message approval functions correctly handle and store message approvals?
  • Does the message validation function accurately validate messages and update their status?
  • Does the signer rotation function correctly handle signer rotation, enforce the minimum rotation delay, and prevent rotation to duplicate signers?
  • Can the signer rotation function address potential edge cases and ensure proper updates to the signer set?
  • Does the contract emit all necessary events correctly and include appropriate data?
  • Can event emissions avoid inadvertently exposing sensitive information?

Upgradability Concerns - Upgrade Mechanism, Storage Compatibility

  • Does the upgrade mechanism correctly delegate calls to the implementation contract?
  • Can the initialization and upgrade functions handle scenarios without introducing vulnerabilities?
  • Does the storage layout remain compatible with future upgrades to prevent data corruption or loss?
  • Can the storage structures be correctly defined and used?

Potential Edge Cases - Error Handling, Gas Efficiency

  • Does the contract have proper error handling and revert statements for invalid inputs, unauthorized access, and other potential failure scenarios?
  • Can the contract be optimized for gas efficiency, particularly in loops and storage access patterns?

All trusted roles in the protocol

N/A

Describe any novel or unique curve logic or mathematical models implemented in the contracts:

N/A

Running tests

  • Clone the repo:
git clone --recurse https://github.com/code-423n4/2024-08-axelar-network.git
npm ci
npm run build
npm run test

To run gas benchmarks:

REPORT_GAS=true npm run test

To run code coverage:

npm run coverage

More detailed info here.

npm ci
npm run build
npm run test

To run gas benchmarks:

REPORT_GAS=true npm run test

To run code coverage:

npm run coverage

More detailed info here.

  • For Cosmwasm/Rust ITS Hub contracts (make sure you´re at the axelar-amplifier folder :
rustup update
cargo build
cargo test
  • More info about EVM contract deployments here.

  • Test Coverage for Interchain Token Service contracts:

File% Stmts% Branch% Funcs% LinesUncovered Lines
contracts/10095.7610099.18
InterchainTokenFactory.sol100100100100
InterchainTokenService.sol10095.68100100
TokenHandler.sol10094.2310095.3878,116,155
contracts/executable/100100100100
InterchainTokenExecutable.sol100100100100
InterchainTokenExpressExecutable.sol100100100100
contracts/interchain-token/100100100100
ERC20.sol100100100100
ERC20Permit.sol100100100100
InterchainToken.sol100100100100
InterchainTokenStandard.sol100100100100
contracts/interfaces/100100100100
IAddressTracker.sol100100100100
IBaseTokenManager.sol100100100100
IERC20BurnableFrom.sol100100100100
IERC20MintableBurnable.sol100100100100
IERC20Named.sol100100100100
IFlowLimit.sol100100100100
IGatewayCaller.sol100100100100
IInterchainToken.sol100100100100
IInterchainTokenDeployer.sol100100100100
IInterchainTokenExecutable.sol100100100100
IInterchainTokenExpressExecutable.sol100100100100
IInterchainTokenFactory.sol100100100100
IInterchainTokenService.sol100100100100
IInterchainTokenStandard.sol100100100100
IMinter.sol100100100100
IOperator.sol100100100100
ITokenHandler.sol100100100100
ITokenManager.sol100100100100
ITokenManagerDeployer.sol100100100100
ITokenManagerImplementation.sol100100100100
ITokenManagerProxy.sol100100100100
ITokenManagerType.sol100100100100
ITransmitInterchainToken.sol100100100100
contracts/proxies/100100100100
InterchainProxy.sol100100100100
TokenManagerProxy.sol100100100100
contracts/token-manager/10096.15100100
TokenManager.sol10096.15100100
contracts/types/100100100100
InterchainTokenServiceTypes.sol100100100100
contracts/utils/10087.510097.44
Create3AddressFixed.sol100100100100
Create3Fixed.sol10083.33100100
FlowLimit.sol100100100100
GatewayCaller.sol10083.3310085.7164,116
InterchainTokenDeployer.sol10075100100
Minter.sol100100100100
Operator.sol100100100100
RolesConstants.sol100100100100
TokenManagerDeployer.sol10050100100
All files10095.4510099.11
  • Test coverage for EVM Amplifier Gateway contracts:
File% Stmts% Branch% Funcs% LinesUncovered Lines
deploy/10094.44100100
ConstAddressDeployer.sol100100100100
Create2.sol100100100100
Create2Deployer.sol100100100100
Create3.sol10083.33100100
Create3Address.sol100100100100
Create3Deployer.sol100100100100
CreateDeploy.sol100100100100
Deployer.sol100100100100
executable/10010081.82100
AxelarExecutable.sol10010060100
AxelarGMPExecutable.sol100100100100
AxelarGMPExecutableWithToken.sol100100100100
express/97.7395.2483.33100
AxelarExpressExecutable.sol10010071.43100
AxelarValuedExpressExecutable.sol95.9291.6777.78100
ExpressExecutorTracker.sol100100100100
gas-estimation/10091.6710097.83
InterchainGasEstimation.sol10091.6710097.83103
gateway/100100100100
AxelarAmplifierGateway.sol100100100100
AxelarAmplifierGatewayProxy.sol100100100100
BaseAmplifierGateway.sol100100100100
governance/100100100100
AxelarServiceGovernance.sol100100100100
BaseMultisig.sol100100100100
BaseWeightedMultisig.sol100100100100
InterchainGovernance.sol100100100100
InterchainMultisig.sol100100100100
Multisig.sol100100100100
interfaces/100100100100
IAxelarAmplifierAuth.sol100100100100
IAxelarAmplifierGateway.sol100100100100
IAxelarAmplifierGatewayAuth.sol100100100100
IAxelarExecutable.sol100100100100
IAxelarExpressExecutable.sol100100100100
IAxelarGMPExecutable.sol100100100100
IAxelarGMPExecutableWithToken.sol100100100100
IAxelarGMPGateway.sol100100100100
IAxelarGMPGatewayWithToken.sol100100100100
IAxelarGasService.sol100100100100
IAxelarGateway.sol100100100100
IAxelarServiceGovernance.sol100100100100
IAxelarValuedExpressExecutable.sol100100100100
IBaseAmplifierGateway.sol100100100100
IBaseMultisig.sol100100100100
IBaseWeightedMultisig.sol100100100100
ICaller.sol100100100100
IContractExecutor.sol100100100100
IContractIdentifier.sol100100100100
IDeploy.sol100100100100
IDeployer.sol100100100100
IERC20.sol100100100100
IERC20MintableBurnable.sol100100100100
IFinalProxy.sol100100100100
IGovernable.sol100100100100
IImplementation.sol100100100100
IInitProxy.sol100100100100
IInterchainAddressTracker.sol100100100100
IInterchainGasEstimation.sol100100100100
IInterchainGovernance.sol100100100100
IInterchainMultisig.sol100100100100
IMulticall.sol100100100100
IMultisig.sol100100100100
IOperators.sol100100100100
IOwnable.sol100100100100
IPausable.sol100100100100
IProxy.sol100100100100
IReentrancyGuard.sol100100100100
IRoles.sol100100100100
IRolesBase.sol100100100100
ITimeLock.sol100100100100
IUpgradable.sol100100100100
libs/10084.38100100
AddressBytes.sol100100100100
AddressString.sol100100100100
Bytes32String.sol100100100100
ContractAddress.sol100100100100
ECDSA.sol10050100100
SafeNativeTransfer.sol100100100100
SafeTransfer.sol10075100100
StringStorage.sol100100100100
types/100100100100
AmplifierGatewayTypes.sol100100100100
GasEstimationTypes.sol100100100100
WeightedMultisigTypes.sol100100100100
upgradable/100100100100
BaseProxy.sol100100100100
FinalProxy.sol100100100100
FixedProxy.sol100100100100
Implementation.sol100100100100
InitProxy.sol100100100100
Proxy.sol100100100100
Upgradable.sol100100100100
utils/100100100100
Caller.sol100100100100
InterchainAddressTracker.sol100100100100
Multicall.sol100100100100
Operators.sol100100100100
Ownable.sol100100100100
Pausable.sol100100100100
ReentrancyGuard.sol100100100100
Roles.sol100100100100
RolesBase.sol100100100100
TimeLock.sol100100100100
All files99.6497.5997.6599.86

Miscellaneous

Employees of AXELAR and employees' family members are ineligible to participate in this audit.

Code4rena's rules cannot be overridden by the contents of this README. In case of doubt, please check with C4 staff.