CertiK reviewed Fetch.ai (Fetch.ai - Atomix Smart Contracts) on 12 Feb 2021: 39 findings, 4 critical; 35 marked fixed, 4 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 | 4 |
| High | 0 | 0 | 0 |
| Medium | 0 | 0 | 7 |
| Low | 4 | 0 | 24 |
The public onRegistryUpdate function in the InterestManager contract does not implement access restriction, which allows anyone to call the function and supply their own IContractRegistry value, pausing the system and effectively overriding the tokenValueStorageContract , rateModelLPContract , rateModelLLContract , lendingPoolContract , loanLiquidatorContract , utilizationRatioContract and spread state variables with the sender's own supplied values.
The public onRegistryUpdate function in the LendingPoolStorageModifier contract does not implement access restriction, which allows anyone to call the function and supply their own IContractRegistry value, pausing the system and effectively overriding the interestManagerContract and lendingPoolStorageContract state variables with the sender's own supplied values.
The public onRegistryPostUpdate function in the InterestManager contract does not implement access restriction, which allows anyone to call the function and supply their own IContractRegistry value, unpausing the system if the paused state has changed and initializing the tokenValueStorage with their own values if it has not already been initialized.
The public onRegistryUpdate function in the LendingPool contract does not implement access restriction, which allows anyone to call the function and supply their own IContractRegistry value, pausing the system and effectively overriding the actContract , stableCoinContract , breachMonitorContract , lendingPoolStorageContract , rateModelLPContract , tokenValueStorageContract , xSCContract , tokenizerContract , spread , lendingPoolWalletAddress , spreadDestinationWallet , breachAddress and lendingPoolStorageModifierContract state variables with the sender's own supplied values.
The private getFracLookup function in the InterestCalculator contract contains a contradictory requirement that the supplied utilisationRatio uint256 parameter is greater than or equal to zero, which will always be true regardless of the supplied value due to being unsigned.
The public getBorrowerLnAPRRate function in the InterestCalculator contract performs primitive arithmetic without requiring the values to be valid beforehand, which can result in over/underflow or multiplying/dividing by zero: ```solidity borrowingRateData[minIndex] + (fracIndex * (borrowingRateData[maxIndex] - borrowingRateData[minIndex])) / (10**18) ```
The external borrow function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The external deposit function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The external redeem function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The external repayAll function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The public transferSpread function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The secsPerYear , a0 , a1 , a2 , a3 , a4 , a5 and numBins constant variables in the InterestCalculator contract are not named in upper-case with underscores, which goes against the recommended Solidity naming conventions.
The public getLoanDetails function in the PoolStorageBase contract should be redeclared as external.
The public getSPRRates and getLoanSPRRate functions in the InterestManager contract should be re-declared as external.
The public getTotalSCDepositValue , getXSCValue , isDebtOverLimit , withdrawAct functions in the LendingPool contract should be re-declared as external.
The public uploadRateData , getBorrowerAPRRate , minBorrowingApr and maxBorrowingApr functions in the InterestCalculator contract is should be re-declared as external.
The external repay function in the LendingPool contract has the potential for re-entrancy due to transfering from the supplied payee address parameter to the arbitrary lendingPoolWalletAddress address, which can lead to emitting events out of order.
The external borrow function in the LendingPool contract has the potential for re-entrancy due to transfering from the arbitrary lendingPoolWalletAddress address to msg.sender , which can lead to emitting events out of order.
The external deposit function in the LendingPool contract has the potential for re-entrancy due to transfering from the supplied account address parameter to the arbitrary lendingPoolWalletAddress address, which can lead to emitting events out of order.
The external redeem function in the LendingPool contract has the potential for re-entrancy due to transfering from the arbitrary lendingPoolWalletAddress address to the supplied account address parameter, which can lead to emitting events out of order.
The external repayAll function in the LendingPool contract has the potential for reentrancy due to transfering from the supplied payee address parameter to the arbitrary lendingPoolWalletAddress address, which can lead to emitting events out of order.
The public depositAct function in the LendingPool contract has the potential for reentrancy due to transfering from msg.sender to the arbitrary lendingPoolWalletAddress address, which can lead to emitting events out of order.
The public transferSpread function in the LendingPool contract has the potential for reentrancy due to transfering from the arbitrary lendingPoolWalletAddress to the arbitrary spreadDestinationWallet address, which can lead to emitting events out of order.
The public withdrawAct function in the LendingPool contract has the potential for reentrancy due to transfering from the arbitrary lendingPoolWalletAddress address to msg.sender , which can lead to emitting events out of order.
The public getAvailableBorrowerLimit function in the LendingPool contract performs a primitive subtraction on the local totalBorrowingLimit and loanValue variables without checking if their values are valid beforehand, which has the potential for underflow.
The public uploadRateData function in the InterestCalculator contract queries the length of the supplied rateData array parameter multiple times, which is inefficient.
The private getFracLookup function in the InterestCalculator contract performs a redundant calculation on lines 113 and 117 of subtracting 1 from the numBins state variable and multiplying it by the supplied utilisationRatio parameter: ```solidity uint256 _minIndex = (numBins.sub(1)).mul(utilisationRatio).div(10**18); ``` ```solidity uint256 _fracIndex = (numBins.sub(1)).mul(utilisationRatio).sub(_minIndex.mul(10**18)); ```
The public getUtilizationRatio function in the LendingPool contract performs zerochecks on the local iSCTotalValue and xSCTotalValue variables before utilizing the SafeMath.mul and SafeMath.div functions, which is unnecessary and inefficient.
The private generateHashNames function in the LendingPool contract declares a named hashNames return variable, yet declares a local _hashNames variable and explicitly returns that instead of utilizing the return variable, which is inefficient.
The public getLoanSPRRate function in the InterestManager contract declares a named loanSPR return variable, yet it is never referenced and an explicit return statement is used instead, which is inefficient.
The external calcNewValues function in the RateModelLP contract declares named finalValueIn and finalValueOut return variables, yet declares local _finalValueIn and _finalValueOut variables and explicitly returns those instead of using the return variables, which is inefficient.
The private generateHashNames and generateAllHashNames functions in the InterestManager contract declares a named hashNames return variable, yet declares a local _hashNames variable and explicitly returns that instead of utilizing the return variable, which is inefficient.
The private getFracLookup function in the InterestCalculator contract declares named minIndex , maxIndex and fracIndex return variables, yet declares local _minIndex , _maxIndex and _fracIndex variables and explicitly returns those instead of using the return variables, which is inefficient.
The public getSPRRates function in the InterestManager contract declares named lenderLPSPR , borrowerLPSPR and borrowerLLSPR return variables, yet declares local lenderLPSPR , borrowerLPSPR and borrowerLLSPR variables and returns those instead, which is inefficient.
The external repay function in the LendingPool contract ignores the value returned from the call to the transferFrom function.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (8)
1,044 projects reviewed · 1,375 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