CertiK reviewed KyotoSwap on 21 Apr 2023: 17 findings, 0 critical; 5 marked fixed, 3 acknowledged, 9 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 | 0 | 0 |
| Medium | 0 | 3 | 1 |
| Low | 9 | 0 | 4 |
In the contract `MasterChef`, the burnt token would not be transferred to the `address(0)` or the burn address(`0x000000000000000000000000000000000000dEaD`). It actually transfers the tokens to the `_owner` address. Also, almost 99%(`989202815829/1e12`) of the reward Kswap tokens will be transferred to the `_owner` address.
In the contract `TokenLocker`, the function `redeem()` will call the function `LibTokenLocker.enforceLockExistsAndExpired()` to check the lock status before calling `LibTokenLocker.redeem()`. The function `LibTokenLocker.enforceLockExistsAndExpired()` will revert the transaction if the lock expiration time has not passed(`block.timestamp < lock.expiresAt`). However, the function `LibTokenLocker.redeem()` supports partial redemption before the `lock.expiresAt` by the following code snippet. The `if` condition will never be true when calling from `TokenLocker.redeem()`, otherwise, the transaction has already been reverted in the function `LibTokenLocker.enforceLockExistsAndExpired()`. On the contrary, the function `TokenLocker.deposit` supports partial redemption without calling the function `LibTokenLocker.enforceLockExistsAndExpired()`. Thus, the user can get partial redemption and all the previously locked token back. ```solidity=144 if (block.timestamp < lock.expiresAt) { reward = calculateRewardDiff( reward, lock.duration, (block.timestamp - lock.lockedAt) ); } ``` Also, the function `LibTokenLocker.redeem()` will burn all the locked amount and this contradicts the logic that the user can partially unlock and get the rewards.
The `lastRewardBlock` is initialize to `block.number + 200` when the `block.number >= _startBlockNumber`. Thus, the user may deposit immediately to the new added pool, but can only get rewards after 200 blocks.
Addresses should be checked before assignment or external call to make sure they are not zero addresses. ```solidity=530 treasury = _treasury; ``` - `_treasury` is not zero-checked before being used.
There's no sanity check to validate if a pool is existing.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (11)
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