Settling an Ante using a smart contract

In order to settle an Ante with a smart contract you first need to write a settlement contract. This contract is responsible for determining the winning side of the Ante and must implement the IAnteSettlement interface.

/// @title The interface for a AnteSettlement smart contract
interface IAnteSettlement {
    enum WinningSide {
        NONE,
        A,
        B
    }

    /// @notice Settles the outcome of a given commitment
    /// @param data Arbitrary data used to determine the outcome
    /// @return the winning side
    function settle(bytes memory data) external returns (WinningSide);
}

Examples of settlement contracts:

You have to be careful about what the settle function returns because the return value constitutes a definitive result. For example, if your commitment is outside of the settlement window you might want to revert instead of returning a definitive result.

After you have written and deployed your settlement contract on Base, you can then fill in the smart contract address as the settler address when creating your Ante.

Last updated