Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BuyHelper2

Git Source

Constants

FACTORY

INineLivesFactory public immutable FACTORY

FUSDC

IERC20 public immutable FUSDC

WETH

IWETH10 public immutable WETH

CAMELOT_SWAP_ROUTER

ICamelotSwapRouter public immutable CAMELOT_SWAP_ROUTER

ERC20_HASH

bytes32 public immutable ERC20_HASH

Functions

constructor

constructor(INineLivesFactory _factory, address _fusdc, IWETH10 _weth, ICamelotSwapRouter _camelotSwapRouter) ;

mint

Mint some shares at the trading id and outcome given, using Longtail to make a swap to fUSDC from the asset given.

function mint(
    address _tradingAddr,
    address _asset,
    bytes8 _outcome,
    uint256 _minShareOut,
    uint256 _maxSharesOut,
    uint256 _amount,
    address _referrer,
    uint256 _rebate,
    uint256 _deadline,
    address _recipient
) external payable returns (uint256);

mintTwice

Mint more than one outcome at once, without any protections for slippage. Best used when the market was created for the first time.

function mintTwice(address _tradingAddr, MintTwice[] memory _outcomes, address _recipient) external;

burn

function burn(
    address _tradingAddr,
    bytes8 _outcome,
    uint256 _minFusdc,
    uint256 _sharesToBurn,
    uint256 _minShareOut,
    uint256 _maxShareBurned,
    address _referrer
) external returns (uint256, uint256);

getShareAddr

function getShareAddr(INineLivesFactory _factory, address _tradingAddr, bytes8 _outcomeId)
    public
    view
    returns (IERC20);

addLiquidity

function addLiquidity(
    address _tradingAddr,
    address _asset,
    uint256 _amount,
    address _recipient,
    uint256 _minLiquidity,
    uint256 _maxLiquidity,
    uint256 _rebate,
    AddLiquidityTokens[] calldata _tokens,
    uint256 _deadline
) external payable returns (AddLiquidityRes memory res);

Structs

MintTwice

struct MintTwice {
    bytes8 outcome;
    uint256 amount;
}

AddLiquidityResToken

struct AddLiquidityResToken {
    bytes8 token;
    uint256 amt;
}

AddLiquidityRes

struct AddLiquidityRes {
    uint256 liq;
    AddLiquidityResToken[] tokens;
}