Ante.xyz
  • Stake a commitment on Ante.xyz
    • Settling an Ante
    • How payouts work
  • Technical Stuff
    • Deployed Contracts
    • Security & Trust
    • Settling an Ante using a smart contract
      • Settling by token price
      • Settle by stablecoin depeg
  • Misc
    • Ante = Credible Commitments
  • Verify relayed Antes
Powered by GitBook
On this page
  1. Technical Stuff

Settling an Ante using a smart contract

Last updated 10 months ago

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.

Settling by token price
Settle by stablecoin depeg