CertiK reviewed TrustSwap (Trustswap #2) on 27 Dec 2022: 23 findings, 0 critical; 10 marked fixed, 6 acknowledged, 7 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 | 5 | 0 |
| Medium | 0 | 1 | 1 |
| Low | 7 | 0 | 9 |
A reentrancy attack can occur when the contract creates a function that makes an external call to another untrusted contract before resolving any effects. If the attacker can control the untrusted contract, they can make a recursive call back to the original function, repeating interactions that would have otherwise not run after the external call resolved the effects. *This finding is considered minor because the reentrancy only causes out-of-order events or because the state variable is only incremented or decremented. So, the effect of out-of-order increments may be unobservable after the transaction. However, the reentrancy vulnerability may still cause other issues in the middle of a transaction.* ----- Although in `LockToken` many functions are using the `ReentrancyGuard` modifier, some functions changing state variables are not using it. Moreover, the function `setNotEntered()` can be used to deactivate this modifier and reenter the functions supposedly protected.
There should always be events emitted in the sensitive functions that are controlled by centralization roles.
The linked statements do not affect the functionality of the codebase and appear to be either remnant of test code or older functionality.
Solidity frequently releases new compiler versions. Using an old version prevents access to new Solidity security features. ```solidity=1 pragma solidity 0.6.2; ``` ```solidity=1 pragma solidity ^0.6.0; ``` are not recommended for deployment ----- Multiple Solidity versions are used in the codebase. Versions used: `^0.6.2`, `^0.6.0`, `>=0.4.24<0.7.0`, `0.8.9`
The contract is serving as the underlying entity to interact with one or more third-party protocols. The scope of the audit treats third-party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. --- ```solidity=48 address public usdTokenAddress; ``` - The contract `LockToken` interacts with third party contract with `IERC20Extended` interface via `usdTokenAddress`. --- ```solidity=136 address _tokenAddress, ``` - The function `LockToken.lockToken` interacts with third party contract with `IERC20` interface via `_tokenAddress`. --- ```solidity=174 address _tokenAddress, ``` - The function `LockToken.lockNFT` interacts with third party contract with `IERC721` interface via `_tokenAddress`. --- ```solidity=12 (address tokenAddress, ,uint256 tokenAmount, uint256 unlockTime, , uint256 nftTokenId, bool isNFT , ,) = lockToken.getDepositDetails(tokenId); ``` - The function `NFTDescriptor.tokenURI` interacts with third party contract with `IERC20Extended` interface via `tokenAddress`. --- ```solidity=11 IUniswapV2Router02 internal uniswapRouter; ``` - The contract `PriceEstimator` interacts with third party contract with `IUniswapV2Router02` interface via `uniswapRouter`.
One or more logic contracts do not protect their initializers. An attacker can call the initializer and assume ownership of the logic contract, whereby she can perform privileged operations that trick unsuspecting users into believing that she is the owner of the upgradeable contract. ```solidity=10 contract LockNFT is Initializable, OwnableUpgradeable, ERC721Upgradeable{ ``` - `LockNFT` is an upgradeable contract that does not protect its initializer. ```solidity=21 function initialize(string calldata _name, string calldata _symbol, address _lockTokenAddress, address _descriptorAddress) ``` - `initialize` is an unprotected initializer function. --- ```solidity=15 contract LockToken is Initializable, OwnableUpgradeSafe, PausableUpgradeSafe, IERC721Receiver { ``` - `LockToken` is an upgradeable contract that does not protect its initializer. ```solidity=108 function initialize() ``` - `initialize` is an unprotected initializer function. --- ```solidity=8 contract NFT is Initializable, ERC721UpgradeSafe, OwnableUpgradeSafe{ ``` - `NFT` is an upgradeable contract that does not protect its initializer. ```solidity=9 function initialize(string calldata _name, string calldata _symbol) ``` - `initialize` is an unprotected initializer function. --- ```solidity=9 contract NFTDescriptor is Initializable{ ``` - `NFTDescriptor` is an upgradeable contract that does not protect its initializer. ```solidity=10 function initialize() external{} ``` - `initialize` is an unprotected initializer function. --- ```solidity=8 contract PriceEstimator is IPriceEstimator, Initializable, OwnableUpgradeSafe { ``` - `PriceEstimator` is an upgradeable contract that does not protect its initializer. ```solidity=19 function initialize(address uniswapRouterAddress) ``` - `initialize` is an unprotected initializer function.
The linked functions are equivalent to the compiler-generated getter functions for the respective variables.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (12)
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