# 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.

```solidity
/// @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:

{% content-ref url="settling-an-ante-using-a-smart-contract/settling-by-token-price" %}
[settling-by-token-price](https://docs.ante.org/v0.8/technical-stuff/settling-an-ante-using-a-smart-contract/settling-by-token-price)
{% endcontent-ref %}

{% content-ref url="settling-an-ante-using-a-smart-contract/settle-by-stablecoin-depeg" %}
[settle-by-stablecoin-depeg](https://docs.ante.org/v0.8/technical-stuff/settling-an-ante-using-a-smart-contract/settle-by-stablecoin-depeg)
{% endcontent-ref %}

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.
