S&P Global Completes Acquisition of OpenZeppelin Read the announcement

Spiko InstantRedemption Audit

  • OpenZeppelin Security

Findings
Total issues: 4 (2 resolved)
Critical: 0 (0 resolved) · High: 0 (0 resolved) · Medium: 0 (0 resolved) · Low: 1 (1 resolved)

Notes & Additional Information
3 notes raised (1 resolved)

Client Reported Issues
0 reported issues (0 resolved)

Scope

OpenZeppelin performed an audit of the spiko-tech/contracts repository at commit 9c46d43.

In scope were the following files:

contracts
    └── token
        └── InstantRedemption.sol

System Overview

Spiko issues shares of regulated money market funds, such as USTBL and EUTBL, as permissioned ERC-20 tokens. Fund subscriptions and redemptions settle once per business day, after the cut-off hour of the fund. The fund administrator computes a Net Asset Value (NAV) after each cut-off, and settlement uses this NAV. The NAV is also published on-chain, in the Spiko Oracle or in a Chainlink feed, for contracts that need a price. The InstantRedemption contract lets authorized investors exchange fund tokens for stablecoins in a single transaction, without waiting for the primary settlement.

Buffer and Settlement: InstantRedemption holds a stablecoin buffer. When an investor redeems, the contract takes the fund tokens and pays the stablecoin output from the buffer. In the same transaction, the contract forwards the fund tokens to the existing Redemption contract through ERC-1363 transferAndCall. This creates a regular redemption request that InstantRedemption owns. A Spiko operator later executes the request through the primary redemption process and pays the stablecoin proceeds back to InstantRedemption. These proceeds refill the buffer. If a request is not executed within 14 days, anyone can cancel it, and the fund tokens return to InstantRedemption.

Pairs and Pricing: An administrator configures each pair of fund token and stablecoin with an oracle and a maximum age for the latest oracle update (oracleTTL). When the administrator configures a pair, the contract checks that the oracle reports the same fund token and caches the decimal scaling factors. The output is the fund token amount multiplied by the latest oracle price, rounded down. If the age of the latest oracle update reaches oracleTTL, the redemption reverts. The pricing treats one unit of the stablecoin as equal to one unit of the fund currency.

Daily Limits: An administrator sets a daily limit, denominated in the stablecoin, for each pair and each user. The limit is zero by default, and usage resets at each UTC day boundary. If the output exceeds the remaining limit or falls below the minimum output that the caller sets, the redemption reverts. The contract also rejects a zero output.

InstantRedemption is a UUPS-upgradeable contract that inherits Multicall. Like the other Spiko contracts, it delegates access control to the shared PermissionManager.

Security Model and Trust Assumptions

InstantRedemption is intended for deployment on Ethereum mainnet only. The contract relies on the out-of-scope Token, PermissionManager, Redemption, and Oracle contracts, and these are assumed to behave as documented. The primary settlement process, which runs off-chain, and Spiko's backend are also outside the scope of this audit.

Administrator: The administrator belongs to the ADMIN group of the PermissionManager. Members of this group can call every restricted function. The administrator configures and removes pairs, chooses the oracle and the oracleTTL of each pair, and sets the daily limit of each user. The administrator can also withdraw any token balance of the contract, including the full stablecoin buffer and fund tokens refunded by a canceled request. The administrator can upgrade the contract implementation, and an upgrade can change any behavior of the contract. For these reasons, the administrator has full control over the funds that the contract holds. Each implementation also fixes the authority and redemption addresses as immutable values at deployment, so they live in the implementation bytecode rather than in the proxy storage. The upgrade authorization itself is a restricted call that consults authority. If the administrator upgrades the proxy to an implementation with a wrong authority, every restricted function of the proxy reverts, including the upgrade function. The contract can then no longer be administered or upgraded. The administrator is therefore trusted to verify the constructor arguments of every new implementation before upgrading. The administrator is trusted to pair each fund token only with a stablecoin denominated in the currency of the fund. The administrator is also trusted to set an oracleTTL that matches the update schedule of the configured oracle.

Instant Redeemers: Addresses in the instant-redeemer group can call redeem up to their daily limit. A redeemer must also be allowed to hold and transfer the fund token. Redeemers are not trusted beyond these permissions. The daily limit bounds the stablecoin amount that each redeemer can take from the buffer per day.

NAV Publishers: Each pair reads its price from an oracle that implements the Chainlink AggregatorV3Interface and reports the fund token it prices. At the audited commit, the Spiko Oracle, where a restricted publisher posts the NAV, is the only price source that satisfies this requirement. The Spiko team intends to use the Chainlink USTBL NAV feed for the mainnet pair. This requires an adapter or a code change. The price source is trusted to publish an accurate NAV in the currency of the fund and to update it on schedule. The instant payout depends directly on the latest published price.

Spiko Operator: The Spiko operator belongs to the group that may call executeRedemption on Redemption. It has no permission in InstantRedemption. It executes the requests that InstantRedemption creates and transfers the stablecoin proceeds back to the buffer. The operator is trusted to execute every such request before its 14-day deadline and to pay the full proceeds to InstantRedemption. The instant payout uses the latest published NAV, while the primary settlement uses a later NAV. The Spiko team stated that the NAV of the targeted funds only increases, so the settlement is expected to return at least the instant payout. If a NAV ever decreases between the two, the buffer absorbs the difference. The administrator can recover any surplus through withdraw.

Buffer Solvency and Liquidity: The contract keeps no record of the repayments it is owed. The contract emits each advance in the InstantRedemptionExecuted event together with its request ID, but no state links a later stablecoin inflow to an advance. The withdraw function can move any balance, including funds that back pending advances. The solvency of the buffer is therefore an off-chain responsibility of Spiko. The daily limit resets at every UTC day boundary, including weekends and bank holidays, while requests settle on business days only. Advances accumulate over every non-business day before the first repayment arrives. A redeemer can also use its limit twice within minutes around a day boundary. Both redemptions fall into the same primary settlement cycle. If the buffer cannot cover a redemption, the transaction reverts and no state changes. Spiko is assumed to size and replenish the buffer for these periods.

Additional Considerations

For redemptions to succeed, the deployment must meet the following conditions:

  • InstantRedemption is allowed to hold and transfer each configured fund token.
  • Each configured stablecoin is a registered output of the fund token in Redemption.
  • The stablecoin buffer holds enough balance to cover the expected redemptions.

Low Severity

The setPair function configures the oracle of a pair. It requires that the token getter of the oracle returns the fund token, and it types the oracle as the Spiko Oracle contract. The Spiko team stated that the mainnet pair will read the NAV from the live Chainlink USTBL NAV feed. A Chainlink aggregator proxy implements AggregatorV3Interface but does not implement token. The proxy of the Chainlink USTBL NAV feed, at 0x477e363c51Ab0C4D13B22CD6B57D56d4a3Cb7Abe, reverts on that call, so setPair reverts and the pair cannot be configured. The Spiko Oracle for USTBL on mainnet does implement token, but its latest round dates from January 2025, so any practical oracleTTL rejects its price. No adapter between the two contracts exists in the repository or in the mainnet deployment cache. As a result, the contract cannot enter service as planned without a code change or a new, unaudited contract in the pricing path.

Consider accepting an AggregatorV3Interface in setPair together with an explicit binding between the pair and the fund token, so that the Chainlink proxy can be configured directly. Alternatively, consider deploying an adapter that exposes token and forwards decimals and latestRoundData from the Chainlink proxy without altering updatedAt.

Update: Resolved in pull request #62 at commit 2a15bbc. The team stated:

“Fixed: setPair no longer calls token(), so any AggregatorV3Interface feed works, including the Chainlink USTBL NAV proxy configured directly with no adapter. The pair key (token, stablecoin) binds the feed to the fund token. It is up to the admin during the configuration to sanitize it.”

Notes & Additional Information

Shared Salt Namespace Can Cause Redemption Request ID Collisions

Every instant redemption creates a Redemption request owned by InstantRedemption. The request ID is the hash of the owner, the fund token, the stablecoin, the amount, and the salt that the caller provides. Redemption rejects a repeated ID. Because the owner is the same contract for every caller, two redeemers using the same pair, the same amount, and the same salt produce the same ID. The second redeem reverts. The same happens when one redeemer reuses a salt with the same amount. The redeem function forwards the salt unchanged, so uniqueness depends on every caller choosing distinct salts.

Consider deriving the forwarded salt from the caller address and the provided salt, so that each redeemer has its own ID namespace. Consider also computing the emitted redemptionId from the derived salt, so that off-chain systems can still match the request.

Update: Acknowledged, not resolved. The team stated:

“This smart contract will not be used by many users, so the collision surface is not big. In addition, we want to keep the redemption id easy to compute (off chain) from the parameter sent by the user (without per smart contract custom logic).”

oracleTTL Does Not Bound the NAV Age When the Oracle Republishes by Heartbeat

The _getLatestPrice function rejects a price when block.timestamp reaches updatedAt + oracleTTL. The documentation describes oracleTTL as the maximum age of the price. This holds for the Spiko Oracle, where updatedAt is the valuation time that the publisher supplies. It does not hold for the Chainlink feed that the Spiko team intends to use once it can be configured. The Chainlink USTBL NAV feed republishes the unchanged NAV every 27 hours by heartbeat, so updatedAt stays recent while the NAV can be days old. With the planned oracleTTL of 475200 seconds, the check only rejects a feed that has been silent for more than five days. Between 15 and 22 October 2026, the on-chain NAV did not change across four business days while heartbeat rounds kept updatedAt within 27 hours. Because the NAV of the targeted funds only increases, a stale price underpays the redeemer and does not overpay the buffer. However, the check does not detect a situation where redemptions should stop, such as the fund administrator no longer delivering a NAV. In addition, the Spiko Oracle accepts a future timepoint through publishPrice, and the check treats such a price as fresh.

Consider documenting that oracleTTL bounds the liveness of the configured feed rather than the age of the NAV, so that the parameter is sized with the real logic in mind. In addition, consider rejecting an updatedAt later than block.timestamp, so that a mistaken or malicious future timepoint in the Spiko Oracle cannot extend the validity of a price. Before any deployment on a layer 2 network, consider also adding a sequencer uptime check.

Update: Acknowledged, not resolved. The team stated:

“Acknowledged. oracleTTL works as a liveness bound on the feed. Chainlink should be updated daily like our in-house oracle in under normal condition. We accept the residual risk: a stale NAV can only underpay the redeemer, a NAV outage is handled operationally by the admin pausing the pair.”

setPair Accepts Unusable Configurations and removePair Keeps Daily Limits

The setPair function does not check that the stablecoin is a registered output of the fund token in Redemption. For such a pair, previewRedeem returns an output, but redeem reverts when the request reaches Redemption. The preview therefore does not predict whether a redemption succeeds. Similarly, setPair accepts an oracle that has not published a round. For such a pair, previewRedeem and redeem revert with an arithmetic underflow in latestRoundData instead of a descriptive error, until the first price is published. In addition, the removePair function deletes the pair but keeps the daily limits and the usage of its users. If the same pair is configured again, the previous limits apply immediately, and no DailyLimitUpdated event signals it.

Consider documenting that a pair requires the stablecoin to be registered as an output in Redemption and an oracle that has already published a price. Neither condition produces a descriptive error when it is not met. Consider also clearing the daily limits of a pair when it is removed, or documenting that they persist.

Update: Resolved in pull request #63 at commit d1cc9ba. The team stated:

“We added documentation”

Conclusion

The InstantRedemption contract lets authorized investors exchange Spiko fund tokens for stablecoins in a single transaction, paid from a buffer that the primary redemption process later refills. OpenZeppelin audited the InstantRedemption contract.

The contract is compact, and its redemption flow is easy to follow. The accompanying test suite covers the main redemption paths, the daily limit boundaries, and the settlement and cancellation flows. One low-severity issue and three notes were identified. The low-severity issue concerns the deployment plan: as the contract stands, the administrator cannot configure the Chainlink feed that the Spiko team intends to use as a pair oracle. The notes call for documenting the actual behavior of the oracle freshness check and of pair configuration, and for small hardening changes such as deriving request salts from the caller.

The safety of the buffer depends largely on factors outside the contract. These include an accurate and timely NAV, a suitable oracle for each pair, and the repayment of every request through the primary settlement process. The daily limit bounds the amount that each redeemer can draw from the buffer per day.

The Spiko team is appreciated for its responsiveness and for the detailed documentation provided throughout the engagement.

Appendix

Issue Classification

OpenZeppelin classifies smart contract vulnerabilities on a 5-level scale:

  • Critical
  • High
  • Medium
  • Low
  • Note/Information

Critical Severity

This classification is applied when the issue’s impact is catastrophic, threatening extensive damage to the client's reputation and/or causing severe financial loss to the client or users. The likelihood of exploitation can be high, warranting a swift response. Critical issues typically involve significant risks such as the permanent loss or locking of a large volume of users' sensitive assets or the failure of core system functionalities without viable mitigations. These issues demand immediate attention due to their potential to compromise system integrity or user trust significantly.

High Severity

These issues are characterized by the potential to substantially impact the client’s reputation and/or result in considerable financial losses. The likelihood of exploitation is significant, warranting a swift response. Such issues might include temporary loss or locking of a significant number of users' sensitive assets or disruptions to critical system functionalities, albeit with potential, yet limited, mitigations available. The emphasis is on the significant but not always catastrophic effects on system operation or asset security, necessitating prompt and effective remediation.

Medium Severity

Issues classified as being of medium severity can lead to a noticeable negative impact on the client's reputation and/or moderate financial losses. Such issues, if left unattended, have a moderate likelihood of being exploited or may cause unwanted side effects in the system. These issues are typically confined to a smaller subset of users' sensitive assets or might involve deviations from the specified system design that, while not directly financial in nature, compromise system integrity or user experience. The focus here is on issues that pose a real but contained risk, warranting timely attention to prevent escalation.

Low Severity

Low-severity issues are those that have a low impact on the client's operations and/or reputation. These issues may represent minor risks or inefficiencies to the client's specific business model. They are identified as areas for improvement that, while not urgent, could enhance the security and quality of the codebase if addressed.

Notes & Additional Information Severity

This category is reserved for issues that, despite having a minimal impact, are still important to resolve. Addressing these issues contributes to the overall security posture and code quality improvement but does not require immediate action. It reflects a commitment to maintaining high standards and continuous improvement, even in areas that do not pose immediate risks.