Reports

Smart Contract Security Assessment

Origami - CowSwapper

Origami CowSwapper is used to swap farmed tokens

3
Issues
0
C/H/M
Period
Jul 14, 2025 - Jul 15, 2025
Auditors
Panda, Watermelon

Review Summary

Protocol Overview

Origami CowSwapper is used to swap farmed tokens

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

Audit Overview

Scope and Resources

Scope

This audit covers 1 smart contracts totaling approximately 120 lines of code across two days of review.

Overall Assessment

No concerns

Evaluation Matrix

access control
High

[good](https://google.com)

mathematics

complexity

libraries

decentralization

code stability

documentation

monitoring

testing

Key Findings

Findings Summary

0
Critical
0
High
0
Medium
0
Low
3
Informational
0
Gas
I-1 Finding

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-2 Finding

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-3 Finding

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.

Methodology

Severity Classification

Critical

Immediate threat to user funds or protocol integrity

Direct loss of funds, protocol compromise

High

Significant security risk requiring urgent attention

Potential fund loss, major functionality disruption

Medium

Important issue that should be addressed

Limited fund risk, functionality concerns

Low

Minor issue with minimal impact

Best practice violations, minor inefficiencies

Gas

Findings that improve gas efficiency

Increased transaction costs

Informational

Code quality and best practice recommendations

Reduced maintainability and readability