Contact
Reports

Smart Contract Security Assessment

Origami - CowSwapper

Protocol
Origami
Timeline
Jul 14, 2025 - Jul 15, 2025
Audit Team
Panda, Watermelon
Contents

Protocol Overview

Origami CowSwapper is used to swap farmed tokens
This audit covers 1 smart contracts totaling approximately 120 lines of code across two days of review.

Severity Classification

SeverityDescriptionPotential Impact
CriticalImmediate threat to user funds or protocol integrityDirect loss of funds, protocol compromise
HighSignificant security risk requiring urgent attentionPotential fund loss, major functionality disruption
MediumImportant issue that should be addressedLimited fund risk, functionality concerns
LowMinor issue with minimal impactBest practice violations, minor inefficiencies
UndeterminedFindings whose impact could not be fully assessed within the time constraints of the engagement. These issues may range from low to critical severity, and although their exact consequences remain uncertain, they present a sufficient potential risk to warrant attention and remediation.Varies based on actual severity
GasFindings that can improve the gas efficiency of the contracts.Increased transaction costs
InformationalCode quality and best practice recommendationsReduced maintainability and readability

Key Findings

0
Critical
0
High
0
Medium
0
Low
3
Informational
0
Gas

Evaluation Matrix

access control
High
[good](https://google.com)

Overall Assessment

No concerns

Findings Summary

I-1Finding

I-1: Insufficient minimum validation for CoW Swap order expiry period

Informational

Description:

The setOrderConfig() function only checks that expiryPeriodSecs is non-zero:

if (config.expiryPeriodSecs == 0) revert CommonEventsAndErrors.ExpectedNonZero();

A value of 1 second is technically valid but impractical. The CoW Swap Watchtower polls every block, so orders with very short expiry periods will expire before they can be detected and executed.

Impact:

Informational

Recommendation:

A minimal value of 5 minutes seems more inline with a reasonable operational window for CoW Swap's infrastructure.

Developer Response:

Acknowledged - The check is to ensure the caller has at least set it to something non-zero.

I-2Finding

I-2: Reduce post hooks gas limit

Informational

Description:

The current post hook gas limit is set to 250,000 gas. Analysis of historical transactions from addresses 0x25dd72cc1de50e963948e464c09aeba0d9312349 and 0xeb32f71b700b75ad6bf84c9b0374f388740c266f using Tenderly shows variable gas consumption based on the stalking contract used in the post hook:

  • SPK → USDS swaps: ~60,000 gas
  • SKY → SKY swaps: ~165,000 gas

In CoW Swap's fee structure, the full reserved gas amount (250,000) is deducted as a fee regardless of actual consumption, with no refund for unused gas. Overall yield is decreased due to inflated execution costs.

Impact:

Informational.

Recommendation:

Adjust the gas limits for the hooks.

Developer Response:

Acknowledged.

I-3Finding

I-3: `config.limitPriceAdjustmentBps` isn't validated when an oracle is provided

Informational

Summary:

OrigamiCowSwapper.setOrderConfig is used by an authorized party to set crucial data to be used when creating an order for a given token. OrigamiSowSwapper.updateAmountsAndAdjustmentBps may be used to update selected, existing order configurations.

Description:

When config.limitPriceOracle != address(0), the setOrderConfig() method doesn't verify config.limitPriceAdjustmentBps to be within an expected range, whether within [-100%, 100%] or a stricter one.

Within updateAmountsAndAdjustmentBps(), the same holds: the limitPriceAdjustmentBps is only validated to be non zero if config.limitPriceOracle != address(0).

Impact:

Informational.

Recommendation:

Add validation within both mentioned methods to enforce the highlighted config value is within a selected range.

Developer Response:

Updated in PR#1937.