As of 19 Nov 2026, Sapien has 2 audit reports by 1 security firm on Trustblock; the latest is by Quantstamp, dated 2 Jul 2025. Those reports list no open critical findings.
Record last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.
Newest first
| Report | Security firm | Date | Scope | Critical findings | Source |
|---|---|---|---|---|---|
| Sapien - 2 | Security firm: Quantstamp | Date: | Scope: Files listed | None open | certificate.quantstamp.com ↗ |
| Sapien | Security firm: Quantstamp | Date: | Scope: Files listed | None open | certificate.quantstamp.com ↗ |
Statuses are the security firm’s own, from each report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 0 | 6 |
| Medium | 0 | 2 | 6 |
| Low | 0 | 3 | 6 |
The `_calculateApplicablePenalty()` function incorrectly calculates available tokens for penalties by adding `userStake.amount + userStake.cooldownAmount`. However, `cooldownAmount` represents tokens that are already included in `amount` but are queued for unstaking. This double counting allows penalties to exceed the user's actual stake balance, potentially leading to accounting errors or failed penalty applications when the contract attempts to transfer more tokens than available.
Open the reportThe `initiateUnstake()` function in the `SapienVault` contract sets the cooldown start timestamp only if the user is not already in a cooldown state, as controlled by the condition `if (uint256(userStake.cooldownStart) == 0)`. This design creates an opportunity to bypass the intended cooldown period for the majority of a user's stake. Specifically, a user may initiate unstaking for a small portion of their stake, wait for the cooldown to complete, and then unstake the remaining amount without waiting again, effectively circumventing the cooldown for most of their tokens.
Open the reportThe `SapienVault` contract recalculates the effective lockup period when a user adds to an existing stake using the `stake()` function. The recalculation uses a **weighted average** between the current effective lockup period and the newly provided lockup period. This mechanism allows users to **reduce** their overall lockup duration by staking additional tokens with a shorter lockup period. As a result, users can strategically lower their lockup commitment after the initial stake, undermining the intended locking mechanism.
Open the reportTypical unstaking within the protocol requires a two day cooldown period to pass before unstaking can be completed. The intention of this is to allow a sufficient window for any QA penalties to be applied before the user can unstake their tokens. However, in the case of the `earlyUnstake()` function, users are able to instantly withdraw their funds by paying a 20 percent penalty. In cases where a user is expecting to be slashed a value greater than 20 percent they can call the `earlyUnstake()` function to immediately withdraw their tokens and avoid the impending larger QA penalty.
Open the reportThe `initiateUnstake()` and `unstake()` functions in the staking contract contain a critical vulnerability that allows users to drain the entire contract's token balance. When unstaking, the functions fail to deduct the staked amount from the user's balance in the `StakingInfo` struct. This means a user can: 1. Stake tokens once to create a valid staking position 2. Call `initiateUnstake()` to start the cooldown period 3. After the cooldown period, call `unstake()` multiple times with the same `orderId` to repeatedly withdraw tokens 4. Each withdrawal succeeds since the staking position remains active and the balance is never decremented As a result, a malicious user could drain all tokens from the contract by repeatedly calling `unstake()` with a single valid staking position, far exceeding their initial stake. This also tricks the reward mechanism off-chain, because the user `isActive` state variable is never updated, which signals that the user stake is still active, as well as having the original amount that was staked. In addition to the above, the lock duration is not checked during unstaking. Meaning that an attacker can game the reward system by staking for the maximum duration, and then unstake immediately.
Open the reportA critical signature replay vulnerability exists in the `SapienRewards` and `SapienStaking` contracts. The `verifyOrder()` function in both contracts uses the same signature format and validation logic: ```solidity bytes32 messageHash = keccak256(abi.encodePacked(userWallet, rewardAmount, orderId)); ``` This allows signatures to be reused across different contract functions. Specifically: 1. A signature generated for staking tokens can be replayed to claim rewards in the `SapienRewards` contract 2. The same signature can also be replayed multiple times for staking and unstaking within `SapienStaking` This means an attacker who obtains a valid signature meant for staking could: - Use it to claim unauthorized rewards from `SapienRewards` - Drain tokens through repeated unstaking operations (see SAP-1) - Accidentally overwrite existing staking positions, causing themselves to lose their staked tokens The vulnerability allows: - Unauthorized claiming of rewards using stake signatures - Multiple drains of the same stake amount - Overwriting of legitimate user stakes
Open the reportThe `SapienVault` contract exhibits an inconsistency in the `effectiveLockupPeriod` calculation methodology. When users stake multiple times, the contract calculates a new weighted start time and a new weighted effective lockup period. Also when users increase their stake amount, the contract calculates a new weighted start time. However, the `increaseLockup()` function bypasses this weighted calculation for a new lockup period, and instead uses a direct addition of the remaining lockup time and the additional lockup period. This inconsistency allows users to game the system by strategically choosing whether to add new stakes or increase lockup on existing stakes to get the shortest lockup period, as the mathematical approach differs between these operations.
Open the reportThe `stake()` and `increaseAmount()` functions allow users to add tokens to stakes without validation that the initial stake's lockup period has not ended. This can allow for some stakes where the new `weightedStartTime + effectiveLockUpPeriod < block.timestamp` meaning the stake is immediately unlocked. This allows users to benefit from an increased multiplier while being able to unlock their tokens at any time.
Open the reportThe `Rewards` contract uses a Bloom filter to track redeemed order IDs, but this implementation can lead to false positives that prevent users from claiming legitimate rewards. The issue arises from the limited size of the filter (256 bits) combined with multiple hash insertions per order. Each order sets 3 bits in the 256-bit filter. With users expected to claim up to 1000 rewards, this results in up to 3000 bits being set in a 256-bit space, leading to a high probability of collisions. **Impact** - As users claim more rewards, the Bloom filter becomes increasingly saturated - This increases the probability of hash collisions causing false positives - Valid orders may be incorrectly identified as already redeemed - Users will be unable to claim legitimate rewards once collisions occur
Open the reportThe `Rewards` contract inherits from `PausableUpgradeable` and includes pause checks in critical functions, but does not implement the actual `pause()` and `unpause()` functions. This means the contract cannot be paused in case of an emergency, despite functions being marked with `whenNotPaused` modifier.
Open the reportThe staking contract determines the multiplier a user gets depending on the staking amount and the lockup period. Where the lockup period is the most important factor since it determines the max multiplier. However, any of the unstake-related functions check if the lockup period has actually elapsed. There are two consequences: 1. A user can stake the needed amount for the max multiplier for 12 months to get the maximum rewards but only lock up the funds for two days after calling `initiateUnstake()` immediately after staking. 2. A user can mistakenly call `instantUnstake()` after the lockup period has ended which would cost an unnecessary penalty.
Open the reportThe `releaseTokens()` function in the `SapTestToken` contract lacks access control, allowing any address to call it. The intention is that it is only callable via the `SapienRewards.releaseTokenRewards()` function by the owner of that contract. However, a user is able to bypass this and instead directly call `releaseTokens()` on the `SapTestToken` contract.
Open the reportThe `emergencyWithdraw()` function performs ether transfer via a `.call()` without reentrancy protection. While this function is access-controlled to admin only, reentrancy vulnerabilities in emergency functions can be particularly dangerous as they may be called during compromised states. An attacker who gains admin access could potentially exploit reentrancy to drain funds beyond intended amounts.
Open the reportIn both `SapienVault` and `SapienRewards`, the `initialize()` function grants the `DEFAULT_ADMIN_ROLE` to the specified `admin` address and then unconditionally revokes the same role from `msg.sender`. If the deployer and the admin are the **same address**, this logic leads to a scenario where **no account holds the `DEFAULT_ADMIN_ROLE`**, effectively rendering the contract **administratively locked** and unmanageable.
Open the reportThe `QA_DECISION_TYPEHASH` in `SapienQA` is defined as: ```solidity keccak256("QADecision(address userAddress,uint8 actionType,uint256 penaltyAmount,bytes32 decisionId,string reason)") ``` However, when encoding the struct for signature verification, the `reason` field is encoded as `keccak256(bytes(reason))`, which is a `bytes32`, not a `string`. This means the actual encoded struct does not match the declared type hash, potentially breaking EIP-712 signature compatibility and causing signature verification to fail or be non-standard.
Open the reportTo prevent initialization of the implementation contract, lock it down by calling `_disableInitializers()` in the constructor. Read more in the OpenZeppelin documentation for the [initializable contract](https://docs.openzeppelin.com/contracts/5.x/api/proxy#Initializable).
Open the reportThe `initialize()` function mints the amount of `_totalSupply`. However, there is no guarantee that it is the sum of all the expected allocations (1B tokens). If `_totalSupply` is less than the sum of all allocations, the vesting schedules will be created with amounts that can never be fully claimed. If `_totalSupply` is greater than 1B, the excess tokens will be minted to the Gnosis Safe but won't be part of any vesting schedule.
Open the reportThe `updateVestingSchedule()` function allows the Gnosis Safe to modify any parameter of a vesting schedule without restrictions. This includes: * Setting `amount` to 0 even after tokens have been released or reducing it below what has already been released creates an inconsistent state. * Setting the `duration` lower than the `cliff` period, which breaks the vesting logic. Users would have to wait for the cliff to be able to claim everything at once instead of periodically. * Modifying start time to a future date even after vesting has begun also creates an inconsistent state. * Changing the safe address mid-vesting could break integration with other contracts expecting specific safe addresses.
Open the reportThe reports name a repository or files. Open a report to see its scope.
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="sapien"></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