Fetch.ai - Atomix Smart Contracts

CertiKFiles named in the report

CertiK reviewed Fetch.ai (Fetch.ai - Atomix Smart Contracts) on 12 Feb 2021: 39 findings, 4 critical; 35 marked fixed, 4 open.

4 critical findings, fixed
Open the reportOpen Fetch.ai’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings39

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

SeverityOpenAcknowledgedFixed
Critical004
High000
Medium007
Low4024
CriticalLack of access restriction allows overriding staFixed

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.

CriticalLack of access restriction allows overriding staFixed

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.

CriticalLack of access restriction allows overriding statFixed

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.

CriticalLack of access restriction allows overriding statFixed

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.

MediumContradictory requirementFixed

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.

MediumPotential integer truncationFixed

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) ```

MediumUnused result from call to transferFromFixed

The external borrow function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

MediumUnused result from call to transferFromFixed

The external deposit function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

MediumUnused result from call to transferFromFixed

The external redeem function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

MediumUnused result from call to transferFromFixed

The external repayAll function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

Show 10 more
MediumUnused result from call to transferFromFixed

The public transferSpread function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

LowConstant variables not following naming conventioFixed

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.

LowFunction should be re-declared as externalFixed

The public getLoanDetails function in the PoolStorageBase contract should be redeclared as external.

LowFunctions should be re-declared as externalFixed

The public getSPRRates and getLoanSPRRate functions in the InterestManager contract should be re-declared as external.

LowFunctions should be re-declared as externalFixed

The public getTotalSCDepositValue , getXSCValue , isDebtOverLimit , withdrawAct functions in the LendingPool contract should be re-declared as external.

LowFunctions should be re-declared as externalFixed

The public uploadRateData , getBorrowerAPRRate , minBorrowingApr and maxBorrowingApr functions in the InterestCalculator contract is should be re-declared as external.

LowPotential for minor re-entrancy; Out-of-order evFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

Show 10 more
LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential for minor re-entrancy; Out-of-order eveFixed

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.

LowPotential integer underflowFixed

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.

LowRedundant array length calculationFixed

The public uploadRateData function in the InterestCalculator contract queries the length of the supplied rateData array parameter multiple times, which is inefficient.

LowRedundant calculationFixed

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)); ```

LowUnnecessary usage of SafeMath functionalityFixed

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.

LowUnused named return variableFixed

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.

LowUnused named return variableFixed

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.

Show 5 more
LowUnused named return variablesFixed

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.

LowUnused named return variablesFixed

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.

LowUnused named return variablesFixed

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.

LowUnused named return variablesFixed

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.

LowUnused result from call to transferFromFixed

The external repay function in the LendingPool contract ignores the value returned from the call to the transferFrom function.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (8)

  • contracts/ALP/RateModelLL.sol
  • contracts/ALP/LendingPoolStorage.sol
  • contracts/ALP/LendingPool.sol
  • contracts/ALP/LendingPoolStorageModifier.sol
  • contracts/ALP/PoolStorageBase.sol
  • contracts/ALP/RateModelLP.sol
  • contracts/ALP/InterestManager.sol
  • contracts/ALP/InterestCalculator.sol

Part of Fetch.ai’s security record

Fetch.ai
Audits2 audits by 1 firmLast audit Feb 2021, by CertiK.
Critical findingsNo open critical findingsAcross the 2 reports, 4 critical findings were reported. Each is marked fixed by the firm that reported it.
Open Fetch.ai’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

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