CertiK reviewed Project SEED (PS.io #2) on 29 Mar 2023: 27 findings, 1 critical; 16 marked fixed, 1 acknowledged, 10 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 | 1 |
| High | 0 | 1 | 0 |
| Medium | 1 | 0 | 3 |
| Low | 9 | 0 | 12 |
The 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.
The pointed error code are generic and are used for handling different kind of errors.
Comments at the pointed lines report numbers about accounts ordering in contexts, but some are missing or not consistent with the current codebase.
The `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)
In 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.
In 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.
The error handling code can be simplified using the `require` macro. Ref. [Anchor Book](https://book.anchor-lang.com/anchor_in_depth/errors.html)
Code 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.
The 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.
The linked parameters are required as instruction inputs but are never used in the functions.
The report names a repository or files. Open the report to see its scope.
1,045 projects reviewed · 1,376 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