Project SEED has 2 public audit reports from CertiK; the latest is CertiK, 4 Apr 2023; 5 critical findings, 3 open, 2 marked fixed.
Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.
Statuses are the security firms’ own
29 findings are still open or acknowledged in the firms’ reports: 3 critical, 5 high, 1 medium, 20 low (28 open, 1 acknowledged).
All the staked funds can be stolen via `unstake()
PS. · CertiK · 4 Apr 2023 · Report ↗
Reward earning mechanism is flawed
PS. · CertiK · 4 Apr 2023 · Report ↗
Unlimited reward can be extracted via `unstake()`
PS. · CertiK · 4 Apr 2023 · Report ↗
Calling `claimReward()` after `stopTime` breaks u
PS. · CertiK · 4 Apr 2023 · Report ↗
Centralization Related Risks
PS. · CertiK · 4 Apr 2023 · Report ↗
Initial Token Distribution
PS. · CertiK · 4 Apr 2023 · Report ↗
Owner can extract all stakes via `recoverTokens()
PS. · CertiK · 4 Apr 2023 · Report ↗
Program Upgrade Centralization Risk
PS.io #2 · CertiK · 29 Mar 2023 · Report ↗
Unsafe Mathematical Operations
PS.io #2 · CertiK · 29 Mar 2023 · Report ↗
`if` condition will never be met
PS. · CertiK · 4 Apr 2023 · Report ↗
Newest first
| Report | Security firm | Date | Scope | Critical findings | Findings | Source |
|---|---|---|---|---|---|---|
| PS. | Security firm: CertiK | Date: | Scope: Files listed | 3 open critical findings | Findings: 4 critical · 5 high · 15 low 6 fixed · 18 open | skynet.certik.com ↗ |
| PS.io #2 | Security firm: CertiK | Date: | Scope: —Not recorded; see the report | 1 critical finding, fixed | Findings: 1 critical · 1 high · 4 medium · 21 low 16 fixed · 1 acknowledged · 10 open | skynet.certik.com ↗ |
Statuses are the security firm’s own, from each report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 3 | 0 | 2 |
| High | 4 | 1 | 1 |
| Medium | 1 | 0 | 3 |
| Low | 20 | 0 | 16 |
`unstake(_amount)` decrements `stakeholder.staked` by `_amount`, however, `_withdrawStaked(stakeholder.staked)` is performed. So, all the `totalStaked` can be extracted by calls `unstake(1)`.
Open the report`stakeholder.timestamp` is used for both `_getTimeSinceStaked()` (as a first deposit time) and as last `claimReward()` call time. Consider the scenario: 1. The `duration` is 10 seconds. 1. User calls `stake(1)` at `startTime`. The user gets `stakedRatio = 10` and `timestamp = startTime`. 2. After 5 seconds user calls `stake(1000)`. The user gets `stakedRatio = 5010`. `timestamp` left intact. 3. Let's assume `rewardAmount == totalStakedRatio == 5010`. 4. `earned()` becomes `5010 * 5 / 10 = 2505`. 5. User can **immediately** `claimReward()` and get 2505 `rewardToken`. This is not expected by the contract logic. 6. `timestamp` becomes `startTime + 5`, and `stakedRatio` is still 5010. 7. After 5 seconds more user calls `claimReward()` and gets 5010 `rewardToken` **again**. `earned()` returns `5010 * 5 / 5`. This is not expected by the contract logic.
Open the reportIn `claimReward()` after the call `_withdrawReward()` the `stakeholder.timestamp` is updated to `block.timestamp`. That means that the reward was claimed until the current moment. However, in `unstake()` after the call `_withdrawReward()` the `stakeholder.timestamp` is not updated. That means, that by calling `unstake(1)` full `earned()` reward can be claimed multiple times.
Open the report`claimReward()` sets `stakeholder.timestamp = block.timestamp`. Since `earned()` uses `stopTime - stakeholder.timestamp`, claiming the reward and unstaking becomes impossible if `claimReward()` was executed after `stopTime`.
Open the reportIn the contract `ShillLock` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and drain all tokens by calling function `releaseTokens()`.  In the contract `NFTEngine` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and mint NFTs to attacker-controlled addresses by calling function `issueToken()` or `issueBatch()`.  In the contract `Staking` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and drain all tokens from the contract, as well as pause the main utility of the contract, keeping users from claiming rewards or unstaking their tokens.  In the contract `CappableStaking` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and change the cap amount, making it difficult for users to call `stake()`.  In the contract `AccessProtected` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and set an attacker-controlled address as an admin or revoke original admins by calling function `setAdmin()`. 
Open the reportTokens are minted to the contract owner when deploying the contract. This is a centralization risk as the contract owner can distribute tokens without obtaining the consensus of the community.
Open the report`recoverTokens()` allows the contract owner to extract all funds including `rewardToken` and `stakingToken`. This will break the contract logic.
Open the reportThe pointed mathematic operations have the potential risk to overflow or to divide by zero at runtime, because of the usage of the raw arithmetic "+", "*" and "/". This could lead to unexpected behaviors and incorrect outputs, above all with inputs and variable that are near to their maximum/minimum representable value. Moreover, when compiling for a production release through the `--release` flag, the default configuration of the compiler is to remove all the math validations that are, instead, made when compiling in debug/test mode. As a result, the final artifact deployed on-chain may have a different behavior with mathematical operations.
Open the reportThe condition, ```solidity if (stakeholder.timestamp == 0) ``` will never be met, because in the previous line `stakeholder.timestamp` is set to `block.timestamp`. Therefore, the `if` block logic will never be executed.
Open the report```solidity=177 emit Withdraw(msg.sender, reward); ``` Event uses `msg.sender`, however, using of `_to` argument would be more accurate.
Open the report`getTimeRemaining()` and `getTimeElapsed()` are hard to read. Brackets or `if` statements can simplify the code logic.
Open the reportWhen transferring deflationary ERC20 tokens, the input amount may not be equal to the received amount due to the charged transaction fee. For example, if a user sends 100 deflationary tokens (with a 10% transaction fee), only 90 tokens actually arrived to the contract. However, a failure to discount such fees may allow the same user to withdraw 100 tokens from the contract, which causes the contract to lose 10 tokens in such a transaction. ```solidity=96 IERC20(stakingToken).transferFrom(msg.sender, address(this), _amount); ``` - Transferring tokens by `_amount`. ```solidity=85 stakeholder.staked += _amount; ``` - The `_amount` appears to be used for bookkeeping purposes without compensating the potential transfer fees.
Open the reportThe cited functions lack important checks that the input addresses are never `address(0)`.
Open the reportA reentrancy attack can occur when the contract creates a function that makes an external call to another untrusted contract before resolving any effects. If the attacker can control the untrusted contract, they can make a recursive call back to the original function, repeating interactions that would have otherwise not run after the external call resolved the effects. The `stake()` function calls `stakingToken` functions that potentially can lead to the execution of the attacker's code and re-entering other functions in `Staking` contract. This can lead to events reordering.
Open the report```solidity=120 if(stakeholder.stakedRatio == 0){ stakeholder.timestamp = 0; } ``` `stakeholder.stakedRatio` will never be zero if something was staked for at least 1 second. The code is redundant and ambiguous.
Open the reportUser is allowed to `stake()` at exactly `block.timestamp == stopTime`. If that is the first staking, `stakeholder.timestamp` is set to `block.timestamp`. This prevents the call to `_withdrawReward()` and to `unstake()` since `earned()` can't be calculated due to division by zero.
Open the reportThe user can't `claimReward()` and `earned()` returns 0, if `stakeholder.staked == 0`. Consider the scenario: 1. User stakes 100 tokens for 10 seconds, gets `stakeholder.stakedRatio += 1000` 2. After 5 seconds user withdraws 100 tokens, gets half of the reward - `earned()` returns 500, gets `stakeholder.stakedRatio -= 500` 3. After that 500 `stakeholder.stakedRatio` can't be claimed because `stakeholder.staked == 0`. 4. `stakedRatio` can still be claimed if `staked == 1`
Open the reportThe contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=11 IERC20 public immutable token; ``` - The contract `ShillLock` interacts with third party contract with `IERC20` interface via `token`. --- ```solidity=13 address public override stakingToken; ``` - The contract `Staking` interacts with third party contract with `IERC20` interface via `stakingToken`. --- ```solidity=14 address public override rewardToken; ``` - The contract `Staking` interacts with third party contract with `IERC20` interface via `rewardToken`. --- ```solidity=26 string memory hash ``` - The contract `NFTEngine` has functions `issueToken()` and `issueBatch()` which rely on a third party to provide input `hash` that is unique for the purposes of minting ERC721 tokens.
Open the reportThe return value of the transfer()/transferFrom() call is not checked. ```solidity=60 IERC20(rewardToken).transferFrom(msg.sender, address(this), rewardAmount); ``` --- ```solidity=66 _token.transfer(owner(), balance); ``` --- ```solidity=96 IERC20(stakingToken).transferFrom(msg.sender, address(this), _amount); ``` --- ```solidity=165 IERC20(stakingToken).transfer(_to, _amount); ``` --- ```solidity=170 IERC20(rewardToken).transfer(_to, reward); ```
Open the reportThe pointed error code are generic and are used for handling different kind of errors.
Open the reportComments at the pointed lines report numbers about accounts ordering in contexts, but some are missing or not consistent with the current codebase.
Open the reportThe `Sell` account has a total required size of `72` plus the variable bytes to be assigned to the dynamic `String`s fields as shown below: ```rust pub struct Sell { pub authority: Pubkey, //32 pub mint_address: String,//4+length of string in bytes pub price: u64, //8 pub uri: String,//4+length of string in bytes pub serial_number: u64, //8 pub collection: String,//4+length of string in bytes pub owner: String, //4+length of string in bytes pub timestamp: i64,//8 } ``` The required space is far less than the space value specified at the init time, currently set at `10000`. Since extra memory is reserved, it may lead to an unnecessary higher rent to be paid. [Reference](https://book.anchor-lang.com/anchor_references/space.html)
Open the reportIn the `staking` program, the `init_staking`, `stake`, `unstake`, and `claim_rewards` instruction modify the program state and cause token transfers. Such instruction should emit events as notifications to users, since transaction logs parsing is the main way to detect on-chain events.
Open the reportIn rust, `unwrap` is used to directly the result of a function execution or to terminate program execution if such execution was not successful. In particular, when the unwrapped brings a failure, a `panic` is thrown out and no further error handling mechanism is adopted. Throwing out a panic may not always be desired in the production codebase since the lack of an error handling mechanism reduces the robustness of the program and, in the specific case of Solana programs, users or external application can not automatically obtain a quick feedback on why the requested instruction failed. The code at the pointed location uses `unwrap` instead of managing the possible error condition that may arise.
Open the reportThe error handling code can be simplified using the `require` macro. Ref. [Anchor Book](https://book.anchor-lang.com/anchor_in_depth/errors.html)
Open the reportCode at the pointed location unnecessarily declares and assign a value to a variable or a variable to another variable when the right value can be directly used for subsequent purposes.
Open the reportThe marketplace program (named dapp) has "input" instruction but no "action" instructions; in other words, users can add data to the program by setting `Sell` PDAs with information about an NFT and its selling price but this PDA has no direct usage in the program and there is no reference to external usage by other program or system. Moreover, the declaration of unused packages like the Metaplex crate, suggest some missing implementation about the core functionalities of the program.
Open the reportThe linked parameters are required as instruction inputs but are never used in the functions.
Open the reportThe reports name a repository or files. Open a report to see its scope.
Trustblock holds 2 public audit reports for Project SEED, dated 29 Mar 2023 to 4 Apr 2023. The latest is by CertiK (“PS.”).
CertiK wrote the 2 reports Trustblock holds for Project SEED.
29 findings are still open or acknowledged in the firms’ reports: 3 critical, 5 high, 1 medium, 20 low (28 open, 1 acknowledged). Of 5 critical findings: 3 open, 2 marked fixed. Statuses are the security firms’ own.
Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.
Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.
<head><script src="https://widget.trustblock.run/project-widget.min.js" defer></script></head><body><divdata-tb-project-widgetdata-tb-project-slug="project-seed"></div></body>
Paste the code where the label should appear. It uses no API credit and updates by itself.
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