Skip to content

When Upgrading to V1 of compact will need to resolve missing function asBool(uint256 a) and update tests #13

@johnwhitton

Description

@johnwhitton

Overview

The v1 version of the compact removed function asBool(uint256 a) internal pure returns (bool b) in this commit Uniswap/the-compact@0d98ca5 However it currently used here.

Also it uses an updated solady which is stricter and causes tests to fail.

Suggested Fix

asBool

Replace

        // Require that target block & decay curve were correctly designated.
        if (errorBuffer.asBool()) {
            revert InvalidTargetBlockDesignation();
        }

with

        // Require that target block & decay curve were correctly designated.
        if (errorBuffer != 0) {
            revert InvalidTargetBlockDesignation();
        }

or add the function back in to the-compact.

Tests

For tests using 0xDEAD using a valid token and approve before claiming resolved the issue, see jincubator@7cb81a1

replace

token: address(0xDEAD),

with

token: address(token),

add

// Approve tokens for settlement
token.approve(address(tribunal), type(uint256).max);  

Further information

For reference here is a fork of the compact in line with the v1 branch and here is a fork of Tribunal using the that fork.

jincubator@fbffaf3 and jincubator@7cb81a1 are the commits made to resolve the issue in that fork.

Feedback Request

Is there any documentation or reference code bases using the tribunal functionality (specifically the use of mandate for defining intent output criteria) on a single chain?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions