Omniscia Gnosis Guild Audit

CowswapOrderSigner Code Style Findings

CowswapOrderSigner Code Style Findings

COS-01C: Inconsistent Invocation Style

Description:

The CowswapOrderSigner::signOrder function will invoke a library-level function directly instead of exposing it via a primitive type in contrast to GPv2Signing.

Example:

contracts/CowswapOrderSigner.sol
43GPv2Order.packOrderUidParams(
44 orderUid,
45 orderDigest,
46 address(this),
47 order.validTo
48);

Recommendation:

We advise a using GPv2Order for bytes; statement to be introduced to the codebase, permitting the GPv2Order::packOrderUidParams function to be invoked via the orderUid variable directly in the referenced statement.

Alleviation (da3062f6b3ff452092a0b6daa6f226f0f3b696c6):

The code was updated per our recommendation, using the GPv2Order library as exposed by the orderUid member directly.

COS-02C: Redundant Existence of Abstract Contract

Description:

The GPv2Signing abstract contract present in the codebase is redundant as in the CowswapOrderSigner implementation it is solely utilized as an interface.

Example:

contracts/CowswapOrderSigner.sol
8import "./cowProtocol/libraries/GPv2Order.sol";
9import "./cowProtocol/mixins/GPv2Signing.sol";
10import "./cowProtocol/interfaces/IERC20.sol";
11
12contract CowswapOrderSigner {
13 using GPv2Order for GPv2Order.Data;
14
15 GPv2Signing public immutable signing;

Recommendation:

We advise the implementation to be replaced by an interface, minimizing the code footprint of the Gnosis Guild codebase.

Alleviation (da3062f6b3ff452092a0b6daa6f226f0f3b696c6):

The Gnosis Guild team evaluated this exhibit and opted to retain the original Cowswap codebase as untouched as possible, preferring to utilize the abstract contract declaration. As such, we consider this exhibit safely acknowledged.