Citrus Token - Audit Report PDF
Citrus Token - Audit Report PDF
August, 2021
01
Contents
Scope of Audit 01
Issue Categories 03
Automated Testing 09
Disclaimer 10
Summary 11
Scope of Audit
The scope of this audit was to analyze and document the Citrus Token
smart contract codebase for quality, security, and correctness.
Checked Vulnerabilities
We have scanned the smart contract for commonly known and more
specific vulnerabilities. Here are some of the commonly known
vulnerabilities that we considered:
Re-entrancy
Timestamp Dependence
Gas Limit and Loops
DoS with Block Gas Limit
Transaction-Ordering Dependence
Use of tx.origin
Exception disorder
Gasless send
Balance equality
Byte array
Transfer forwards all gas
BEP20 API violation
Malicious libraries
Compiler version not fixed
Redundant fallback function
Send instead of transfer
Style guide violation
Unchecked external call
Unchecked math
Unsafe type inference
Implicit visibility level
01
04
05
Techniques and Methods
Throughout the audit of smart contract, care was taken to ensure:
The overall quality of code.
Use of best practices.
Code documentation and comments match logic and expected behaviour.
Token distribution and calculations are as per the intended behaviour
mentioned in the whitepaper.
Implementation of BEP-20 token standards.
Efficient use of gas.
Code is safe from re-entrancy and other vulnerabilities.
The following techniques, methods and tools were used to review all the
smart contracts.
Structural Analysis
In this step we have analyzed the design patterns and structure of smart
contracts. A thorough check was done to ensure the smart contract is
structured in a way that will not result in future problems.
SmartCheck.
Static Analysis
Static Analysis of Smart Contracts was done to identify contract
vulnerabilities. In this step a series of automated tools are used to test
security of smart contracts.
Gas Consumption
In this step we have checked the behaviour of smart contracts in
production. Checks were done to know how much gas gets consumed and
possibilities of optimization of code to reduce gas consumption.
02
05
Tools and Platforms used for Audit
Remix IDE, Truffle, Truffle Team, Ganache, Solhint, Mythril, Slither,
SmartCheck.
Issue Categories
Every issue in this report has been assigned with a severity level. There
are four levels of severity and each of them has been explained below.
Informational
These are severity four issues which indicate an improvement request, a
general question, a cosmetic or documentation error, or a request for
information. There is low-to-no impact.
03
02
Number of issues per severity
Open 0 0 1 2
Acknowledged 0 0 1 2
Closed 0 0 0 0
Introduction
During the period of August 11, 2021 to August 15, 2021 - QuillAudits Team
performed a security audit for Citrus smart contracts.
The code for the audit was taken from the following official link:
https://github.com/CitrusTech/CitrusTechContract/blob/master/
CitrusToken.sol
04
Issues Found – Code Review / Manual Testing
High severity issues
No issues were found.
Line Code
Description
As the function can be only called by ‘Owner’, the use of require
statement will only consume more gas, as an owner can instruct to not
use 0 as a value while locking to waste Gas.
Remediation
Remove require statement to save GAS.
Line Code
Description
The return value is not used when a function is returning a value.
05
Remediation
Use Require statement.
require(BEP(address(this)).transfer(msg.sender, amount));
Status: Open
Informational
3. Does not use safemath for operations
Description
Safemath operation is missing where operators are used directly without
considering overflow and underflow.
Remediation
Use Safemath at all operations.
Description
The following public functions that are never called by the contract
should be declared external to save gas:
wned.changeOwnership (./citrus.sol#10-12) should be declared
external
BEP20.balanceOf (./citrus.sol#38) should be declared external
BEP20.transferFrom (./citrus.sol#48-55) should be declared
external
BEP20.approve (./citrus.sol#57-61) should be declared external
BEP20.allowance (./citrus.sol#63-65) should be declared external
TimeLock.timelock (./citrus.sol#110-118) should be declared external
TimeLock.release (./citrus.sol#120-133) should be declared external
TimeLock.lockedAccountDetails (./citrus.sol#135-151) should be
declared external
06
05
Remediation
Use the external attribute for functions that are never called from the
contract.
Status: Open
Description
It will be safer if the mint function is used in the Constructor, to mint the
initial supply of tokens instead of directly updating the balances and
total supply variables.
Remediation
emit Transfer(address(0), account, amount);
Status: Open
Description
The transfer function in the BEP20 contract is missing the require
statements.
Remediation
a) In function transfer(address _to, uint256 _amount) , missing:
require(_to != address(0), "BEP20: transfer from the zero address");
07
05
Functional
. test
Read Functions()
Write Functions()
08
05
Automated Testing
Slither
Results
No major issues were found. Some false positive errors were reported by
the tool. All the other issues have been categorized above according to
their level of severity.
09
05
Disclaimer
Quillhash audit is not a security warranty, investment advice, or an
endorsement of the Citrus platform. This audit does not provide a security
or correctness guarantee of the audited smart contracts. The statements
made in this document should not be interpreted as investment or legal
advice, nor should its authors be held accountable for decisions made
based on them. Securing smart contracts is a multistep process. One audit
cannot be considered enough. We recommend that the Citrus Team put in
place a bug bounty program to encourage further analysis of the smart
contract by other third parties.
10
05
Closing Summary
Overall, smart contracts are very well written and adhere to guidelines.
11
05
17