Quantstamp reviewed Pheasant Network on 2 Aug 2023: 24 findings, 0 critical; 14 marked fixed, 10 acknowledged; 8 more marked mitigated.
Report hosted on certificate.quantstamp.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed | Mitigated |
|---|---|---|---|---|
| Critical | 0 | 0 | 0 | 0 |
| High | 0 | 2 | 8 | 3 |
| Medium | 0 | 3 | 2 | 1 |
| Low | 0 | 5 | 4 | 4 |
The firm marks these findings Mitigated. They are not counted as open, acknowledged or fixed.
The slash period lasts for `14` days, but `blockhash()` will not work beyond the last `256` blocks (which, at a rate of `12` seconds per block, equals `51` minutes). If the block hash has not been uploaded to the checkpoint manager within `51` minutes, the block hash will not exist, and the transaction will revert.
The public documentation greatly differs from the code. In general, the protocol is less decentralized and trustless and provides less user protection than what is stated in the documentation. We will elaborate on some of the inconsistencies in individual issues, for now an overview of collected inconsistencies: * Undocumented possibility of unslashable networks; * Relayer does not necessarily have to hold a bond while subject to slashing; * Inaccurate reimbursements of user funds in case of slashing; * There is no decentralized liquidity, as there is only a single relayer. Therefore, the liquidity is centralized in the `BondManager`; * Pheasant Fee is unimplemented; * Cheaper gas fees are not enforced on the protocol level, as the relayer can arbitrarily set them; * Undocumented pause mechanism; * Undocumented possibility of updating most of the global state variables associated to fees and slashing by the owner;
The current system has only one Relayer, one Bond Manager, and one contract `PheasantNetworkBridgeChild`, even if the system was planned to be run with several relayers. The contract `PheasantNetworkBridgeChild` has two roles and associated modifiers: `owner` and `relayer`. However, the relayer can update system settings such as the available networks, the mapping of tokens, and the addresses of the Bond Manager and the Dispute Manager. These roles must be separated to let the owner of the contract control what the relayer is allowed to do or not. As an illustration, the Relayer can deposit to the `BondManager` `1 WETH` (`tokenId = 0`) and 1M token B (`tokenId = 1`). Then, he can call the function `executeTokenAddressUpdate()` to inverse the mapping between token ids and token addresses. If he makes the `tokenId` 0 map to token B and `tokenId` 1 map to WETH, it will now be considered that the Relayer has 1M WETH and 1 token B in the `BondManager`. Another illustration is for the Relayer to temporarily disable the slashing mechanism on a network where he could be slashed with the function `finalizeNetworkSettingUpdate()`.
In case of a successful dispute for a trade of `n` tokens, the system will slash from the bond manager an amount of `tradableBondRatio * n / 100` and will distribute 50% to the initiator of the trade and 50% to the disputer. An integrity constraint in `PheasantNetworkBridgeChild.finalizeTradeParamUpdate()` ensures that `tradableBondRatio` is strictly higher than 100. However, if e.g. `tradableBondRatio = 110`, in case of a dispute, the user will only receive 55% of its amount, which may convince him not to use the system. Another side of this logic is if the relayer submits wrong evidence and calls `slash()`, it will not lose funds. This is even more problematic if `tradableBondRatio` is set to less than `200`. For any value under `200`, it is profitable for the relayer to withdraw L2 tokens by submitting wrong evidence and slashing itself.
As the contract `PolygonRootCheckpointManager.sol` is expected to be run as a facet contract following the diamond pattern, a function `polygonInit()` exists to play the role of the constructor that can be called a single time provided that `_childCheckpointManager` address is not the zero address. The drawback is that, once deployed, anyone can call that function and will get ownership of the contract. Note that this function can be called both directly and via the diamond pattern proxy. That situation can also be found in the contracts `ArbitrumRootCheckpointManager.sol` and `OptimismRootCheckpointManager.sol`.
Some functions do not validate their inputs, which can result in unexpected behavior by the contracts. A non-exhaustive list includes: 1. **[FIXED]** `PolygonRootCheckpointManager.polygonInit()`: the two parameters should be non-zero addresses; 2. **[FIXED]** `PolygonChildCheckpointManager.executeRootCheckpointManagerUpdate()`: the parameter should not be `address(0)`. 3. **[FIXED]** `ArbitrumRootCheckpointManager.arbitrumInit()`: the two parameters should be non-zero addresses; 4. **[FIXED]** `OptimismChildCheckpointManager.constructor()`: the parameter `_l2CrossDomainMessenger` should be non-zero address; 5. **[FIXED]** `OptimismRootCheckpointManager.optimismInit()`: the two parameters should be non-zero addresses; 6. **[FIXED]** `CoreChildCheckpointManager.constructor()`: the parameter `_rootCheckpointManager` should be non-zero address; 7. **[FIXED]** `CoreChildCheckpointManager.executeRootCheckpointManagerUpdate()`: the parameter should not be `address(0)`. 8. **[FIXED]** `BridgeDisputeManager.constructor()`: the parameter `_checkpointManager` should be non-zero address; 9. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.bulkWithdraw()`: the arrays `_userTrades` and `_evidences` should have the same length; 10. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.bulkAcceptUpwardTrade()`: the arrays `_tokenTypeIndices` and `_evidences` should have the same length; 11. **[FIXED]** `PheasantNetworkBridgeChild.tokenTransferFrom()`: consider using `""` instead of `new bytes(0)`; 12. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.executeFeeListUpdate()`: a. there is no integrity constraint making sure that in `_newFeeList`: `low <= medium <= high`, `gasPriceTLow <= gasPriceTHigh` and that no new fee value exceeds the max threshold defined for a given `_tokenTypeIndex`; b. the `_tokenTypeIndex` must match an existing token in the system; 13. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.cancelTradeByRelayer()`: there is no max length check for the parameter `_reason`, that could contain malicious code injection; 14. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.constructor()`: </br> a. the addresses `_bondManager` and `_disputeManager` must be smart contracts. </br> b. the constraint integrity `_tradeParam.tradeMinimumAmount <= _tradeParam.tradeThreshold` must be respected; </br>c. `feeList` values should be consistent (e.g. `high` > `low`). </br> d. `tradableBondRatio` should be equal or greater than a value that satisfies our recommendation. 15. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.executeNetworkSettingUpdate()`: the three lists sent as parameters must have the same non-zero length, and each operation must be in the range [0,1,2]; 16. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.finalizeTradeParamUpdate()`: </br>a. the constraint integrity `_tradeParam.tradeMinimumAmount <= _tradeParam.tradeThreshold` must be respected; </br>b. there are no min and max limits for the new value of `withdrawalBlockPeriod`; 17. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.finalizeTokenAddressUpdate()`: it is possible to use a `networkId` with more than 4 digits 18. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.executeTradeParamUpdate()`: the value of the parameter `operation` must be in the range [0,1,2,3]; 19. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.executeManagerUpdate()`: </br>a. the value of the parameter `operation` must be in the range [0,1]; </br>b. the address `newManager` must be a smart contract; 20. **[ACKNOWLEDGED]** The first element of an `enum` is always zero. It means that an uninitialized variable will match this first element. In functions such as `finalizeNetworkSettingUpdate()`, `finalizeTradeParamUpdate()` or `executeManagerUpdate()`, using an `enum` as parameter can have unexpected effects if the input is wrong (e.g. human error). To minimize this errors, we recommend declaring the first parameter of the `enum` as an "uninitialized" state, and revert if this value is passed to the functions. 21. **[ACKNOWLEDGED]** `PheasantNetworkBridgeChild.newTrade()` should validate that the `_to` parameter is not the zero address. 22. **[ACKNOWLEDGED]** `BondManager.deposit()` and `executeWithdrawBond()` should check that `_amount > 0`.
Some ERC20 tokens do not revert but instead, return 'false' when a transfer fails. To ensure that the transfer is valid, simply checking the receipt is insufficient, as it only verifies the successful execution of the transaction, not the actual token transfer.
The function `deposit()` relies on the parameter `_amount` to account for the internal tokens received. However, the mechanism would fail if the ERC20 tokens take a fee or if the token is a rebasing token. Integrating non-standard ERC20 tokens can have severe consequences, such as insolvent contracts, as the system accounts for a different value than what is collected. It would also be the case in the functions `PheasantNetworkBridgeChild.tokenTransfer()`, `PheasantNetworkBridgeChild.tokenTransferFrom()`, and `PheasantNetworkBridgeChild.tokenReceive()` where the expected amount may not be the same as what has been received.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (17)
240 projects reviewed · 338 reports · latest Nov 2026
See Quantstamp’s auditsSomething 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