CertiK reviewed Byte Masons - Reliquary (Bytemasons - Multistrategy Vault) on 8 Nov 2022: 24 findings, 0 critical; 9 marked fixed, 3 acknowledged, 12 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 2 | 0 |
| Medium | 0 | 1 | 0 |
| Low | 12 | 0 | 9 |
The linked declarations do not conform to the [Solidity style guide](https://solidity.readthedocs.io/en/v0.7.3/style-guide.html#naming-conventions) with regards to its naming convention. Particularly: - `camelCase`: Should be applied to function names, argument names, local and state variable names, modifiers - `UPPER_CASE`: Should be applied to `constant` variables - `CapWords`: Should be applied to contract names, struct names, event names and enums
The `initialize()` function of **ReaperStrategyTombMai** contract defines a ERC20 token hardcoded address as `0x45f4682B560d4e3B8FF1F1b3A38FDBe775C7177b`. The hardcoded address belongs to UniSwapV2Pair as can be confirmed in [FTMScan Explorer](https://ftmscan.com/address/0x45f4682B560d4e3B8FF1F1b3A38FDBe775C7177b#code) ```solidity=60 __ReaperBaseStrategy_init(_vault, 0x45f4682B560d4e3B8FF1F1b3A38FDBe775C7177b, _strategists, _multisigRoles); ```
In Solidity, the functions that write or update the status of sensitive state variables should emit descriptive events as notifications.
When calculating the conversion between assets and shares, the input amount is not validated. Affected functions are: ```solidity=51 function convertToShares(uint256 assets) ``` ```solidity=66 function convertToAssets(uint256 shares) ``` Input data of public and external functions should always be verified.
During the definition of **ReaperStrategyTombMai** contract, the `poolId` variable is defined as follows: ```solidity=49 uint256 public poolId; ``` However, the `poolId` is set to be 2 in function `initialize()` and not modified at any point of the code, so could be declared as constant.
There is the risk that attackers could become the unintended administrators of deployed contracts. The initialization of `ReaperBaseStrategyv4` based contracts, including inherited contract, can only be done by calling function `__ReaperBaseStrategy_init()`. In theory, hackers and automatic bots can monitor the transaction of new contract deployment and front-run contracts with a similar transaction to initialize it. As a consequence, the frontrunner will become the unintended administrator of the contract and will be to control upgrades.
The functions `IUniswapV2Router02(_router).swapExactTokensForTokensSupportingFeeOnTransferTokens()` and `IUniswapV2Router02(TOMB_ROUTER).addLiquidity()` in the aforementioned lines are executed without setting restrictions on slippage, which would make the swapping and liquidity-adding processes sensitive to price fluctuation from the DEX. In this case, it would be vulnerable to potential sandwich attacks, and thus the project might suffer unexpected losses.
In **ReaperStrategyTombMai** the function `_swap()` is declared as follows: ```solidity=133 function _swap( uint256 _amount, address[] memory _path, address _router ) internal { if (_path.length < 2 || _amount == 0) { return; } IERC20Upgradeable(_path[0]).safeIncreaseAllowance(_router, _amount); IUniswapV2Router02(_router).swapExactTokensForTokensSupportingFeeOnTransferTokens( _amount, 0, _path, address(this), block.timestamp ); } ``` This function silently fails when: 1. Input path contains less than two elements 2. Swap amount is zero In the previous two conditions, the caller won't be notified that the swap failed and the execution will continue as if the call to `_swap()` succeeded. An example of a malicious call could be crafted as: ```solidity function doSwap(uint256 _debt) public { _debt = 0; _swap(_debt, tombToMaiPath, TOMB_ROUTER); } ```
The contract has unlocked compiler version. An unlocked compiler version in the source code of the contract permits the user to compile it at or above a particular version. This, in turn, leads to differences in the generated bytecode between compilations due to differing compiler version numbers. This can lead to an ambiguity when debugging as compiler specific bugs may occur in the codebase that would be hard to identify over a span of multiple compiler versions rather than a specific one.
The return value of an external call is not used as a function return nor `require()` function check. ```solidity=162 IUniswapV2Router02(TOMB_ROUTER).addLiquidity( lpToken0, lpToken1, lp0Bal, lp1Bal, 0, 0, address(this), block.timestamp ); ```
The variable `PERCENT_DIVISOR` is declared but the current code logic doesn't use it. ```solidity=15 uint256 public constant PERCENT_DIVISOR = 10_000; ```
The variables `numStrategists` and `numRoles` can be inlined since no more references to them are found in the code.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (11)
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’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