AxieInfinity audit reports

BNB Chain, Ethereumaxieinfinity.comX

AxieInfinity has 1 public audit report from CertiK; dated 21 Jun 2022; no critical findings reported.

Critical findings
No open critical findings
In 1 report.
Open the latest report
Your label, live
Get the label for your site

Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Open findings across every firm14

Statuses are the security firms’ own

14 findings are still open or acknowledged in the firms’ reports: 2 high, 4 medium, 8 low (12 open, 2 acknowledged).

High
2
Medium
4
Low
8
  • High Acknowledged

    Centralization Related Risks

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • High Acknowledged

    No delay in Governance tasks

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Medium Open

    External dependencies

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Medium Open

    No storage gap in Logical contracts

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Medium Open

    Potential Lack of Liquidity

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Medium Open

    Validators could be too powerful

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Low Open

    `_minimumVoteWeight()` can be set to a low value

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Low Open

    Design violation

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Low Open

    Inappropriate Upper Limits for Fees

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

  • Low Open

    Incompatibility With Deflationary Tokens

    Axie Infinity - Audit · CertiK · 21 Jun 2022 · Report ↗

All 14 open and acknowledged findings

Audits1

Newest first

ReportSecurity firmDateScopeCritical findingsFindingsSource
Axie Infinity - AuditSecurity firm: CertiKDate: Scope: Files listedNone openFindings: 2 high · 5 medium · 12 low
5 fixed · 2 acknowledged · 12 open
skynet.certik.com ↗

Findings19

Statuses are the security firm’s own, from each report.

SeverityOpenAcknowledgedFixed
Critical000
High020
Medium401
Low804
MediumExternal dependenciesAxie Infinity - Audit · CertiK · 21 Jun 2022Open

The Ronin bridge relies on external parties to function correctly. For instance, for the bridge to work, some servers must exist, that will be in charge of capturing events, and triggering actions associated with private keys (cf Bridge Workers/Relayers). In particular, Ronin Network relies on : - A Frontend server : So users can ask for the bridge of their assets; - Bridge relayers : Servers to relay proposals on other chains; - Ronin Validators : Who also validate deposits and withdrawals; - Potentially, some other servers : Who listen events, and trigger actions upon event reception; - Ronin Ethereum Sidechain ecosystem. Those elements are critical to Ronin Bridge's functioning and security, and need to be audited. Some other smart contracts dependancies exist: - `ECDSA`, `AccessControlEnumerable`, `IQuorum`, `IWeightedValidator` for the `GovernanceAdmin` contract; - `Initializable`, `Strings`, `StorageSlot` for the `RoninValidator` contract; - `Strings` for the `GatewayGovernance` contract; - `Strings`, `SignatureConsumer` for the `Governance` contract; - `Pausable`, `IQuorum`, `IWeightedValidator` for the `GatewayV2` contract; - `StorageSlot` for the `HasProxyAdmin` contract; - `TransparentUpgradeableProxy` for the `TransparentUpgradeableProxyV2` contract; - `ECDSA` for the `GlobalProposal` contract; - `Address` for the `Proposal` contract; - `IERC20`, `IERC721`, `Strings`, `IWETH` for the `Token` contract; - `ECDSA`, `IERC20`, `Strings` for the `Transfer` contract; - `AccessControlEnumerable`, `Initializable` for the `MainchainGatewayV2` contract; - `Ownable`, `IERC20` for the `BridgeMigration` contract; - `AccessControlEnumerable`, `Initializable`, `IERC20Mintable`, `IERC721Mintable` for the `RoninGatewayV2` contract. The above contract dependencies are considered secure in the context of the current audit.

Open the report
MediumNo storage gap in Logical contractsAxie Infinity - Audit · CertiK · 21 Jun 2022Open

Ronin has implemented proxyfiable contracts. Those contracts inherit from the following contracts (Interfaces are not mentionned) : - `RoninValidator` : Inherits from `Initializable`, `HasProxyAdmin`. - `RoninGatewayV2` : Inherits from `GatewayV2`, `GatewayGovernance`, `Initializable`, `MinimumWithdrawal`, `AccessControlEnumerable`; - `MainchainGatewayV2` : Inherits from `WithdrawalLimitation`, `Initializable`, `AccessControlEnumerable`. Some of those contracts do not implement a storage gap: - `HasProxyAdmin`; - `GatewayV2`; - `MinimumWithdrawal`; - `AccessControlEnumerable`; - `WithdrawalLimitation`. Because of this, if the logical contract is upgraded to a new version, and if variables are added in the dependencies, storage conflict could occur in the proxyfiable contracts, causing negative consequences over the functioning of the `VolumeWars` contract.

Open the report
MediumPotential Lack of LiquidityAxie Infinity - Audit · CertiK · 21 Jun 2022Open

Both the `MainchainGatewayV2` and `RoninGatewayV2` contracts, upon Deposits and Withdrawals, use the `handleAssetTransfer()` to forward the funds to the final user. The transfers might fail if there is not enough tokens in the contract. For instance, if there is not enough `_wrappedNativeToken` in the contract, the transaction will revert in the `transfer()` function: ```solidity=111 function transfer( Info memory _info, address _to, address _token ) internal { bool _success; if (_info.erc == Standard.ERC20) { _success = tryTransferERC20(_token, _to, _info.quantity); } else if (_info.erc == Standard.ERC721) { _success = tryTransferERC721(_token, _to, _info.id); } if (!_success) { revert( string( abi.encodePacked( "Token: could not transfer ", toString(_info), " to ", Strings.toHexString(uint160(_to), 20), " token ", Strings.toHexString(uint160(_token), 20) ) ) ); } } ``` However, no event is emitted, so the Ronin network might not be alerted of this problem. Additionally, if the `submitWithdrawal()` function on the Mainchain side reverted, there is no function on the Ronin Chain side to withdraw the locked funds in the Ronin Gateway contract. Therefore, the user might lose their funds forever.

Open the report
MediumValidators could be too powerfulAxie Infinity - Audit · CertiK · 21 Jun 2022Open

The function `submitWithdrawal()` verifies the signatures from validators. When all signatures are verified and when the threshold is met, assets will be transferred to the user specified in the `_receipt` parameter. ```solidity=122 function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) { return _submitWithdrawal(_receipt, _signatures); } ``` The concern is, if the attacker exploited the private keys of the validators, the attacker can spoof the `receipt` and signatures, thus stealing the funds within the contract. As the validator's logic is unknown, we propose a potential workaround to add a restriction on the caller of `submitWithdrawal()` and separate the caller with validators. The caller could be a server that calls `submitWithdrawal()` after having received the deposit events (`DepositRequested`). In this way, by adding another layer of verification, even if the validators' private keys are compromised, the attacker cannot steal funds because the attacker needs to spoof a deposit event on the other chain.

Open the report
Low`_minimumVoteWeight()` can be set to a low valueAxie Infinity - Audit · CertiK · 21 Jun 2022Open

When a withdrawal or a deposit operation is submitted, validators agree to validate an operation. For example, in `_submitWithdrawal()` function, when enough validators have validated the operation with their signatures, tokens are sent to users. File `MainchainGatewayV2` ```solidity=278 (...) _weight += _validatorContract.getValidatorWeight(_signer); if (_weight >= _minimumVoteWeight) { _passed = true; break; } } require(_passed, "MainchainGatewayV2: query for insufficient vote weight"); withdrawalHash[_id] = _receiptHash; } (...) _recordWithdrawal(_tokenAddr, _quantity); _receipt.info.handleAssetTransfer(payable(_receipt.mainchain.addr), _tokenAddr, wrappedNativeToken); emit Withdrew(_receiptHash, _receipt); ``` This is intended in order to ensure that multiple validators vote on the same proposal, and one validator should usually not be able to pass a vote on his own. The `_minimumVoteWeight` mentioned above is computed as follows: ```solidity (...) function _computeMinVoteWeight( Token.Standard _erc, address _token, uint256 _quantity, IWeightedValidator _validatorContract ) internal virtual returns (uint256 _weight, bool _locked) { uint256 _totalWeights = _validatorContract.totalWeights(); _weight = _minimumVoteWeight(_totalWeights); (...) ``` The `_weight` is computed as follows: ```solidity=164 function _minimumVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) { return (_num * _totalWeight + _denom - 1) / _denom; } ``` However, when `_num` and `_denom` are configured, the only restriction is : ```solidity=188 function _setThreshold(uint256 _numerator, uint256 _denominator) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { require(_numerator <= _denominator, "GatewayV2: invalid threshold"); ``` `_denom` can be very large compared to `_num`. To take a concrete example, imagine that: - 9 validators exist, - Each validator has a weight of 100 (`_totalWeights` = 900), - `_num` is 1, - `_denom` is 1*10e18. This kind of configuration would put `minimumVoteWeight()` to: \ $$minimumVoteWeight()=(\_num * \_totalWeights + \_denom - 1) / \_denom$$\ $$minimumVoteWeight()=(900 + 1*10e18 ) / (1*10e18)$$\ $$minimumVoteWeight()=1$$ This means that **any validator could validate any proposal**. The value `1` has been validated with the following PoC: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract numDenom { uint256 public _num; uint256 public _denom; uint256 public _totalWeights; constructor(){ _denom = 1 ether; _num=1; _totalWeights=900; } function _minimumVoteWeight() public view virtual returns (uint256) { return (_num * _totalWeights + _denom - 1) / _denom; } } ```

Open the report
LowDesign violationAxie Infinity - Audit · CertiK · 21 Jun 2022Open

The `TransparentUpgradeableProxy` is designed as follows: - When `users` call the proxy, calls are forwarded to the implementation contract with `delegatecall`; - When an `admin` calls the proxy, the call is executed on the proxy contract. This design is meant to prevent [`Proxy selector clashing` attacks](https://medium.com/nomic-foundation-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357). The `TransparentUpgradeableProxyV2` contract implemented by Ronin violates this design, by allowing administrators to call the implementation contract, with the addition of the `functionDelegateCall()` function.

Open the report
LowInappropriate Upper Limits for FeesAxie Infinity - Audit · CertiK · 21 Jun 2022Open

The fee is calculated via the function `_computeFeePercentage()`: ```solidity=220 function _computeFeePercentage(uint256 _amount, uint256 _percentage) internal view virtual returns (uint256) { return (_amount * _percentage) / _MAX_PERCENTAGE; } ``` The percentage of the fee is set via function `_setUnlockFeePercentages()`. However, when setting the fee percentage, the fee percentage can be set as `_MAX_PERCENTAGE`, meaning all the transferred asset will be collected as fee. ```solidity=151 function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual { require(_tokens.length == _percentages.length, "WithdrawalLimitation: invalid array length"); for (uint256 _i; _i < _tokens.length; _i++) { require(_percentages[_i] <= _MAX_PERCENTAGE, "WithdrawalLimitation: invalid percentage"); unlockFeePercentages[_tokens[_i]] = _percentages[_i]; } emit UnlockFeePercentagesUpdated(_tokens, _percentages); } ```

Open the report
LowIncompatibility With Deflationary TokensAxie Infinity - Audit · CertiK · 21 Jun 2022Open

When transferring standard ERC20 deflationary tokens, the input amount may not be equal to the received amount due to the charged transaction fee. As a result, an inconsistency in the amount will occur and the transaction may fail due to the validation checks. For example, if a user deposit deflationary tokens (with a 10% transaction fee) into mainchain gateway contract, only 90 tokens actually arrive in the contract. However, the user can still withdraw 100 tokens (before fees) from the contract of the ronin side, which causes a lose 10 tokens in such a transaction. Reference: https://thoreum-finance.medium.com/what-exploit-happened-today-for-gocerberus-and-garuda-also-for-lokum-ybear-piggy-caramelswap-3943ee23a39f

Open the report
LowPotential re-entrancy on `handleAssetTransfer()`Axie Infinity - Audit · CertiK · 21 Jun 2022Open

In the `handleAssetTransfer()` function of the `Token` contract, if the `_token` is a `Token.Standard.ERC20`, the flow is as following to send the tokens: ```solidity } else if (_info.erc == Token.Standard.ERC20) { uint256 _balance = IERC20(_token).balanceOf(address(this)); if (_balance < _info.quantity) { // bytes4(keccak256("mint(address,uint256)")) (_success, ) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); require(_success, "Token: ERC20 minting failed"); } transfer(_info, _to, _token); ``` After analysis, it does not seem that a practical scenario is possible, in which Ronin Network funds would be at risk. The scenario below intends to describe where the issue lies. \ In the hypothetical case that `_token` is a proxified and valuable ERC20 token controlled by an attacker, a re-entrancy could occur by abusing the `balanceOf()` function. The flow is as following : 1. Attacker modifies the implementation of `_token` to modify the `balanceOf()` function, to call `handleAssetTransfer()`. 2. Attacker calls `handleAssetTransfer()`; 3. When the contract will call `IERC20(_token).balanceOf(address(this))`, the call will go to `handleAssetTransfer()`, performing the re-entrancy. It is after the re-entrancy that the `transfer()` call is actually performed to send the tokens, making the attack possible.

Open the report
LowQuestions about Tiers modelAxie Infinity - Audit · CertiK · 21 Jun 2022Open

The auditors do not see how the Tiers model is implemented through the code, especially : - Tiers 2: All signatures from validators are required; - Tiers 3: All signatures from validators are required, one additional human review to unlock the fund The documentation states: "There will be another constraint on the number of token that can be withdraw in a day. We propose to cap the value at $50M. Since withdrawal of Tier 3 already requires human review, it will not be counted in daily withdrawal limit.". However, within the `_setDailyWithdrawalLimits()` function, there is no validation that this limit cannot be pushed beyond 50M: ```solidity=250 function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual { require(_tokens.length == _limits.length, "WithdrawalLimitation: invalid array length"); for (uint256 _i; _i < _tokens.length; _i++) { dailyWithdrawalLimit[_tokens[_i]] = _limits[_i]; } emit DailyWithdrawalLimitsUpdated(_tokens, _limits); } ```

Open the report
Show 2 more
LowUnlocked PragmaAxie Infinity - Audit · CertiK · 21 Jun 2022Open

Contracts should be deployed using the same compiler version/flags with which they have been tested. Locking the pragma (e.g. by not using ^ in pragma solidity 0.8.0) ensures that contracts do not accidentally get deployed using an older compiler version with unfixed bugs. Reference: [SWC-103] https://swcregistry.io/docs/SWC-103

Open the report
LowUsing of Default ValueAxie Infinity - Audit · CertiK · 21 Jun 2022Open

When request a deposit with a fallback function, the `info` varaible was filled with default values, meaning `info.erc` is `ERC20` and `info.id` is 0. ```solidity function _fallback() internal virtual whenNotPaused { if (msg.sender != address(wrappedNativeToken)) { Transfer.Request memory _request; _request.recipientAddr = msg.sender; _request.info.quantity = msg.value; _requestDepositFor(_request, _request.recipientAddr); } } ```

Open the report

Contracts

No deployed address is recorded for these audits.

The reports name a repository or files. Open a report to see its scope.

The repositories and files the reports name

AxieInfinity: questions

Is AxieInfinity audited?

Trustblock holds 1 public audit report for AxieInfinity, dated 21 Jun 2022. The latest is by CertiK (“Axie Infinity - Audit”).

Who audited AxieInfinity?

CertiK wrote the report Trustblock holds for AxieInfinity.

Are there open findings in AxieInfinity’s audits?

14 findings are still open or acknowledged in the firms’ reports: 2 high, 4 medium, 8 low (12 open, 2 acknowledged). No critical finding is reported. Statuses are the security firms’ own.

Show this on your site

Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.

Content

Facts

Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.

Fixed as
Language

Style

Layout
Theme
Accent
Corners

Format

Size
Date
Embed as
HTML
<head>
<script src="https://widget.trustblock.run/project-widget.min.js" defer></script>
</head>
<body>
<div
data-tb-project-widget
data-tb-project-slug="axie-infinity"
></div>
</body>

Paste the code where the label should appear. It uses no API credit and updates by itself.

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us