If you notice some outdated information please let us know!
FAIL
The final review score is indicated as a percentage. The percentage is calculated as Achieved Points due to MAX Possible Points. For each element the answer can be either Yes/No or a percentage. For a detailed breakdown of the individual weights of each question, please consult this document.
Very simply, the audit looks for the following declarations from the developer's site. With these declarations, it is reasonable to trust the smart contracts.
This report is for informational purposes only and does not constitute investment advice of any kind, nor does it constitute an offer to provide investment advisory or other services. Nothing in this report shall be considered a solicitation or offer to buy or sell any security, token, future, option or other financial instrument or to offer or provide any investment advice or service to any person in any jurisdiction. Nothing contained in this report constitutes investment advice or offers any opinion with respect to the suitability of any security, and the views expressed in this report should not be taken as advice to buy, sell or hold any security. The information in this report should not be relied upon for the purpose of investing. In preparing the information contained in this report, we have not taken into account the investment needs, objectives and financial circumstances of any particular investor. This information has no regard to the specific investment objectives, financial situation and particular needs of any specific recipient of this information and investments discussed may not be suitable for all investors.
Any views expressed in this report by us were prepared based upon the information available to us at the time such views were written. The views expressed within this report are limited to DeFiSafety and the author and do not reflect those of any additional or third party and are strictly based upon DeFiSafety, its authors, interpretations and evaluation of relevant data. Changed or additional information could cause such views to change. All information is subject to possible correction. Information may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.
This completed report is copyright (c) DeFiSafety 2023. Permission is given to copy in whole, retaining this copyright label.
This section looks at the code deployed on the relevant chain that gets reviewed and its corresponding software repository. The document explaining these questions is here.
1. Are the smart contract addresses easy to find? (%)
2. How active is the primary contract? (%)
3. Does the protocol have a public software repository? (Y/N)
Zyberswap is closed source - no public GitHub repositories are available.
4. Is there a development history visible? (%)
As Zyberswap is closed source, we cannot verify development history.
5. Is the team public (not anonymous)?
While Zyberswap team members are anonymous, they have undergone a KYC procedure.
This section looks at the software documentation. The document explaining these questions is here.
6. Is there a whitepaper? (Y/N)
Location: https://docs.zyberswap.io/
7. Is the protocol's software architecture documented? (Y/N)
Zyberswap does not document the functions of their smart contracts' solidity code.
8. Does the software documentation fully cover the deployed contracts' source code? (%)
Zyberswap does not document the functions of their smart contracts' solidity code.
9. Is it possible to trace the documented software to its implementation in the protocol's source code? (%)
Since Zyberswap does not document the functions of their smart contracts' solidity code, and their source code is closed source, no traceability is possible.
10. Has the protocol tested their deployed code? (%)
Since Zyberswap has not open-sourced their code, it is impossible for us to quantify their testing suite.
11. How covered is the protocol's code? (%)
No code coverage of Zyberswap's code is evident.
12. Does the protocol provide scripts and instructions to run their tests? (Y/N)
Since Zyberswap's testing suite is generally unavailable, so are the scripts and instructions to run then.
13. Is there a detailed report of the protocol's test results?(%)
Since Zyberswap's testing suite is generally unavailable, so are the test reports.
14. Has the protocol undergone Formal Verification? (Y/N)
Zyberswap has not undergone a formal verification.
15. Were the smart contracts deployed to a testnet? (Y/N)
No testnet deployment is evident.
This section looks at the 3rd party software audits done. It is explained in this document.
16. Is the protocol sufficiently audited? (%)
Zyberswap has undergone two pre-deployment audits. However, due to the protocol being closed-source, it is impossible to verify whether the audited code is the one currently deployed or maintained. As such, 25% will be deducted.
17. Is the bounty value acceptably high (%)
Zyberswap offers no bug bounty program.
This section covers the documentation of special access controls for a DeFi protocol. The admin access controls are the contracts that allow updating contracts or coefficients in the protocol. Since these contracts can allow the protocol admins to "change the rules", complete disclosure of capabilities is vital for user's transparency. It is explained in this document.
18. Is the protocol's admin control information easy to find?
Zyberswap's admin controls are not documented anywhere.
19. Are relevant contracts clearly labelled as upgradeable or immutable? (%)
While upgradeability is implicitly stated in Zyberswap's docs, no explicit mentions of which contracts are upgradeable exists.
20. Is the type of smart contract ownership clearly indicated? (%)
No smart contract ownership parameters are defined in Zyberswap's docs.
21. Are the protocol's smart contract change capabilities described? (%)
No smart contract upgrade capabilities are described in Zyberswap's docs.
22. Is the protocol's admin control information easy to understand? (%)
There exists no degree of admin control information in Zyberswap's docs.
23. Is there sufficient Pause Control documentation? (%)
Zyberswap's docs do not mention any smart contract pausing functions.
24. Is there sufficient Timelock documentation? (%)
Zyberswap's timelock is documented here. While a duration is not stated in the docs, it can be verified on Arbiscan.
25. Is the Timelock of an adequate length? (Y/N)
Zyberswap's timelock is 24 hours.
This section goes over the documentation that a protocol may or may not supply about their Oracle usage. Oracles are a fundamental part of DeFi as they are responsible for relaying tons of price data information to thousands of protocols using blockchain technology. Not only are they important for price feeds, but they are also an essential component of transaction verification and security. These questions are explained in this document.
26. Is the protocol's Oracle sufficiently documented? (%)
Zyberswap, as an AMM, used the classic x * y = k formula to assure a continuous balance within the liquidity pools.
27. Is front running mitigated by this protocol? (Y/N)
Zyberswap does not document any countermeasures against front running.
28. Can flashloan attacks be applied to the protocol, and if so, are those flashloan attack risks mitigated? (Y/N)
Zyberswap does not document any countermeasures against liquidity attacks or flash loan-related exploits.
1contract ZyberChef is Ownable, ReentrancyGuard {
2 using BoringERC20 for IBoringERC20;
3
4 // Info of each user.
5 struct UserInfo {
6 uint256 amount; // How many LP tokens the user has provided.
7 uint256 rewardDebt; // Reward debt. See explanation below.
8 uint256 rewardLockedUp; // Reward locked up.
9 uint256 nextHarvestUntil; // When can the user harvest again.
10 }
11
12 // Info of each pool.
13 struct PoolInfo {
14 IBoringERC20 lpToken; // Address of LP token contract.
15 uint256 allocPoint; // How many allocation points assigned to this pool. Zyber to distribute per block.
16 uint256 lastRewardTimestamp; // Last block number that Zyber distribution occurs.
17 uint256 accZyberPerShare; // Accumulated Zyber per share, times 1e18. See below.
18 uint16 depositFeeBP; // Deposit fee in basis points
19 uint256 harvestInterval; // Harvest interval in seconds
20 uint256 totalLp; // Total token in Pool
21 IMultipleRewards[] rewarders; // Array of rewarder contract for pools with incentives
22 }
23
24 IBoringERC20 public zyber;
25
26 // Zyber tokens created per second
27 uint256 public zyberPerSec;
28
29 // Max harvest interval: 14 days
30 uint256 public constant MAXIMUM_HARVEST_INTERVAL = 14 days;
31
32 // Maximum deposit fee rate: 10%
33 uint16 public constant MAXIMUM_DEPOSIT_FEE_RATE = 1000;
34
35 // Info of each pool
36 PoolInfo[] public poolInfo;
37
38 // Info of each user that stakes LP tokens.
39 mapping(uint256 => mapping(address => UserInfo)) public userInfo;
40
41 // Total allocation points. Must be the sum of all allocation points in all pools.
42 uint256 public totalAllocPoint;
43
44 // The timestamp when Zyber mining starts.
45 uint256 public startTimestamp;
46
47 // Total locked up rewards
48 uint256 public totalLockedUpRewards;
49
50 // Total Zyber in Zyber Pools (can be multiple pools)
51 uint256 public totalZyberInPools;
52
53 // marketing address.
54 address public marketingAddress;
55
56 // deposit fee address if needed
57 address public feeAddress;
58
59 // Percentage of pool rewards that goto the marketing.
60 uint256 public marketingPercent = 45; // 4.5%
61
62 // Percentage of pool rewards that goto the marketing.
63 uint256 public teamPercent = 90; // 9%
64
65 address public teamAddress;
66
67 // The precision factor
68 uint256 private constant ACC_TOKEN_PRECISION = 1e12;
69
70 modifier validatePoolByPid(uint256 _pid) {
71 require(_pid < poolInfo.length, "Pool does not exist");
72 _;
73 }
74
75 event Add(
76 uint256 indexed pid,
77 uint256 allocPoint,
78 IBoringERC20 indexed lpToken,
79 uint16 depositFeeBP,
80 uint256 harvestInterval,
81 IMultipleRewards[] indexed rewarders
82 );
83
84 event Set(
85 uint256 indexed pid,
86 uint256 allocPoint,
87 uint16 depositFeeBP,
88 uint256 harvestInterval,
89 IMultipleRewards[] indexed rewarders
90 );
91
92 event UpdatePool(
93 uint256 indexed pid,
94 uint256 lastRewardTimestamp,
95 uint256 lpSupply,
96 uint256 accZyberPerShare
97 );
98
99 event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
100
101 event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
102
103 event EmergencyWithdraw(
104 address indexed user,
105 uint256 indexed pid,
106 uint256 amount
107 );
108
109 event EmissionRateUpdated(
110 address indexed caller,
111 uint256 previousValue,
112 uint256 newValue
113 );
114
115 event RewardLockedUp(
116 address indexed user,
117 uint256 indexed pid,
118 uint256 amountLockedUp
119 );
120
121 event AllocPointsUpdated(
122 address indexed caller,
123 uint256 previousAmount,
124 uint256 newAmount
125 );
126
127 event SetmarketingAddress(
128 address indexed oldAddress,
129 address indexed newAddress
130 );
131
132 event SetTeamAddress(
133 address indexed oldAddress,
134 address indexed newAddress
135 );
136
137 event SetFeeAddress(address indexed oldAddress, address indexed newAddress);
138
139 event SetInvestorAddress(
140 address indexed oldAddress,
141 address indexed newAddress
142 );
143
144 event SetmarketingPercent(uint256 oldPercent, uint256 newPercent);
145
146 event SetTeamPercent(uint256 oldPercent, uint256 newPercent);
147
148 constructor(
149 IBoringERC20 _zyber,
150 uint256 _zyberPerSec,
151 address _marketingAddress,
152 uint256 _marketingPercent,
153 address _teamAddress,
154 uint256 _teamPercent,
155 address _feeAddress
156 ) {
157 require(
158 _marketingPercent <= 1000,
159 "constructor: invalid marketing percent value"
160 );
161
162 startTimestamp = block.timestamp + (60 * 60 * 24 * 365);
163
164 zyber = _zyber;
165 zyberPerSec = _zyberPerSec;
166 marketingAddress = _marketingAddress;
167 teamAddress = _teamAddress;
168 feeAddress = _feeAddress;
169 teamPercent = _teamPercent;
170 }