INineLivesTrading

Git Source

Functions

ctor

ctor to set the values for this contract.

function ctor(
    bytes8[] memory outcomes,
    address oracle,
    uint256 timeStart,
    uint256 timeEnding,
    address feeRecipient,
    address shareImpl,
    bool shouldBufferTime
) external;

Parameters

NameTypeDescription
outcomesbytes8[]to use to use as betting outcomes in this contract.
oracleaddressto use as the resolver for this contract.
timeStartuint256to begin this contract by.
timeEndinguint256to end this contract by.
feeRecipientaddressto send fees earned from trading.
shareImpladdress
shouldBufferTimeboolto extend time by 3 hours for every purchase within a 3 hour window. If this is enabled, the contract will enforce purchases to exceed $10 if they are taking place within 3 hours of the contract's scheduled end time.

mintPermitE90275AB

Mint some shares in exchange for fUSDC. Optionally branches to permit or a classic approval based on the deadline argument (if set to 0, assumes approval)

function mintPermitE90275AB(
    bytes8 outcome,
    uint256 value,
    address recipient,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (uint256);

quoteC0E17FC7

Quote function for testing the amount that could be minted.

function quoteC0E17FC7(bytes8 outcome, uint256 value) external returns (uint256);

Parameters

NameTypeDescription
outcomebytes8to test for
valueuint256to test spending for

priceA827ED27

Get the price of an outcome in fUSDC.

function priceA827ED27(bytes8 outcome) external returns (uint256);

Parameters

NameTypeDescription
outcomebytes8to test for

shutdown

Shutdown this contract by disabling associated pools. Compensates callers of this function by distributing them a small amount of token for doing so. This can only be called when the contract has exceeded its deadline.

function shutdown() external returns (uint256);

decide

Decide an outcome. Only callable by the oracle!

function decide(bytes8 outcome) external;

Parameters

NameTypeDescription
outcomebytes8to set as the winner.

payoff91FA8C2E

Collect the payoff if holding winning shares!

function payoff91FA8C2E(bytes8 outcomeId, uint256 amount, address recipient) external returns (uint256);

Parameters

NameTypeDescription
outcomeIdbytes8to collect the payoff for.
amountuint256of share to use for receiving the payoff.
recipientaddressto send the winnings to.

details

Details that're available for this outcome.

function details(bytes8 outcomeId)
    external
    view
    returns (uint256 shares, uint256 invested, uint256 globalInvested, bytes8 winner);

Parameters

NameTypeDescription
outcomeIdbytes8to get the details for

isDpm

is this trading contract running the DPM?

function isDpm() external view returns (bool);

globalShares

global shares minted.

function globalShares() external view returns (uint256);

invested

Invested amount of fusdc in the betting pool.

function invested() external view returns (uint256);

shareAddr

get a share address using the identifier given instead of an online check.

function shareAddr(bytes8 outcomeId) external view returns (address);