Sapien security record

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.

Critical findings
No open critical findings
Across 2 reports.
Open the latest report
Your label, live
Get the label for your site

Record last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Audits2

Newest first

ReportSecurity firmDateScopeCritical findingsSource
Sapien - 2Security firm: QuantstampDate: Scope: Files listedNone opencertificate.quantstamp.com ↗
SapienSecurity firm: QuantstampDate: Scope: Files listedNone opencertificate.quantstamp.com ↗

Findings27

Statuses are the security firm’s own, from each report.

SeverityOpenAcknowledgedFixed
Critical000
High006
Medium026
Low036
High`processQAPenalty()` Function Incorrectly Double Counts Tokens in CooldownSapien - 2 · Quantstamp · 2 Jul 2025Fixed

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 report
HighCooldown Period Can Be Bypassed Allowing Instant UnstakingSapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
HighLockup Period for Unstaking Can Be Decreased by Staking Again with Shorter Lockup PeriodSapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
HighQA Penalty Can Be Avoided by Unstaking Before Penalty ProcessingSapien - 2 · Quantstamp · 2 Jul 2025Fixed

Typical 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 report
HighMissing Balance Deduction in Unstaking Functions Allows Contract Drainage and Lock Period BypassSapien · Quantstamp · 30 Mar 2025Fixed

The `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 report
HighSignature Replay Attack Possible Between Stake, Unstake and Reward Functions Enabling Unauthorized Token ClaimsSapien · Quantstamp · 30 Mar 2025Fixed

A 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 report
MediumInconsistent Lockup Period Calculation Allows Users to Game the SystemSapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
MediumMissing Expiration Check when Adding to Existing Stake Allows Timelock BypassSapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
MediumBloom Filter Implementation Can Lead to False Positives Preventing Valid Reward ClaimsSapien · Quantstamp · 30 Mar 2025Fixed

The `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 report
MediumEmergency Pause Functionality Not ImplementedSapien · Quantstamp · 30 Mar 2025Fixed

The `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 report
Show 8 more
MediumGetting Max Staking Rewards Possible While Bypassing the Lockup PeriodsSapien · Quantstamp · 30 Mar 2025Fixed

The 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 report
MediumMissing Access Control on Token Release FunctionSapien · Quantstamp · 30 Mar 2025Fixed

The `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 report
LowAuthorized `emergencyWithdraw()` Function Is Vulnerable to Reentrancy AttackSapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
LowContracts Could End up without an Admin if Deployer Is Also the AdminSapien - 2 · Quantstamp · 2 Jul 2025Fixed

In 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 report
LowEIP-712 `QA_DECISION_TYPEHASH` Declares `string` but Encodes `bytes32`Sapien - 2 · Quantstamp · 2 Jul 2025Fixed

The `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 report
LowMissing `_disableInitializers()` Call in the ConstructorSapien · Quantstamp · 30 Mar 2025Fixed

To 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 report
LowThe Received Allocations Might Not Be the Expected Ones.Sapien · Quantstamp · 30 Mar 2025Fixed

The `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 report
LowVesting Can Be Updated in Any Way Desired by the MultisigSapien · Quantstamp · 30 Mar 2025Fixed

The `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 report

Contracts

No deployed address is recorded for these audits.

The reports name a repository or files. Open a report to see its scope.

The repositories and files the reports name

Show this on your site

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.

Content

Facts

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.

Fixed as
Language

Style

Layout
Theme
Accent
Corners

Format

Size
Date
Embed as
HTML
<head>
<script src="https://widget.trustblock.run/project-widget.min.js" defer></script>
</head>
<body>
<div
data-tb-project-widget
data-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