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

NineLivesFactory

Git Source

Inherits: IEvents, INineLivesFactory

Constants

BEACON_ADDR

address immutable BEACON_ADDR

DPPM_HOUR_CREATOR_ADDR

address immutable DPPM_HOUR_CREATOR_ADDR

DPPM_15_MIN_CREATOR_ADDR

address immutable DPPM_15_MIN_CREATOR_ADDR

DPPM_5_MIN_CREATOR_ADDR

address immutable DPPM_5_MIN_CREATOR_ADDR

ORACLE_ADDR

address immutable ORACLE_ADDR

VAULT_ADDR

INineLivesVault immutable VAULT_ADDR

SHARE_IMPL_ADDR

address immutable SHARE_IMPL_ADDR

State Variables

version

uint8 public version

operator

address public operator

enabled

bool public enabled

shouldTakeModFee

bool public shouldTakeModFee

tradingOwners

mapping(address => address) public tradingOwners

tradingAddresses

mapping(bytes32 => address) public tradingAddresses

tradingBackends

mapping(address => uint8) public tradingBackends

daoClaimable

uint256 public daoClaimable

Functions

constructor

constructor(
    address beaconAddr,
    address dppmHourCreatorAddr,
    address dppm15MinCreatorAddr,
    address dppm5MinCreatorAddr,
    address oracleAddr,
    address vaultAddr,
    address shareImplAddr
) ;

ctor

function ctor(address _operator) external;

isModerationFeeEnabled

is the current fee that’s taken for moderation reasons active?

function isModerationFeeEnabled() external view returns (bool);

getOwner

gets the owner address from the trading contract address

function getOwner(address addr) external view returns (address);

Parameters

NameTypeDescription
addraddressis trading address to get the owner

getBackend

function getBackend(address addr) external view returns (uint8);

getTradingAddr

function getTradingAddr(bytes32 id) external view returns (address);

shareImpl

function shareImpl() external view returns (address);

dppmTradingHash

return the keccak256 hash of the trading contract in DPPM form.

function dppmTradingHash() external view returns (bytes32);

ammTradingHash

return the keccak256 hash of the trading contract in AMM form.

function ammTradingHash() external view returns (bytes32);

erc20Hash

return the keccak256 hash of the ERC20

function erc20Hash() external view returns (bytes32);

createTradingId

function createTradingId(bytes8[] memory outcomes) internal pure returns (bytes32);

createErc20Id

function createErc20Id(address tradingAddr, bytes8 outcomeId) internal pure returns (bytes32);

makeBeaconSelProxySel

function makeBeaconSelProxySel(bytes4 sel, address beacon) internal pure returns (bytes memory);

deployTrading

function deployTrading(bool isDppm, bytes32 seed) internal returns (INineLivesTrading);

deployErc20

function deployErc20(address implAddr, bytes32 id) internal returns (IShare);

newTrading37E9F4BE

set up new trading contract, seeding the initial amounts

function newTrading37E9F4BE(
    FactoryOutcome[] memory factoryOutcomes,
    address oracle,
    uint64 timeStart,
    uint64 timeEnding,
    bytes32,
    /* documentation */
    address feeRecipient,
    uint64 feeCreator,
    uint64 feeLp,
    uint64 feeMinter,
    uint64 feeReferrer,
    bool backendIsDppm,
    uint256 seedLiq
) external returns (INineLivesTrading trading);

Parameters

NameTypeDescription
factoryOutcomesFactoryOutcome[]
oracleaddressto use as the provider. If set to 0, then a beauty contest is taking place, and when an oracle resolves it checks its own invested state to determine the winner. If set to the address of the infra market oracle as set up during the initialisation of the proxy contract, then an infrastructure market is taking place. If set to anything else, then a contract interaction is assumed being active (or, an AI resolver, depending on the circumstances). If the infrastructure market was chosen, then the code calls the Infrastructure Market to create a new market there with its own creation time.
timeStartuint64to begin this contract at. This should be in the future.
timeEndinguint64to end this contract at. This should be in the future.
<none>bytes32
feeRecipientaddressto send fees earned from the creator commission to.
feeCreatoruint64pct to take as fees for the creator given.
feeLpuint64pct to take as fees for LPs who use the add/remove liquidity features.
feeMinteruint64pct to take as fees for users using the mint function.
feeReferreruint64
backendIsDppmbool
seedLiquint256

Returns

NameTypeDescription
tradingINineLivesTradingtradingAddr address of the newly created Trading contract deployment.

disableShares

function disableShares(bytes8[] calldata) external;