9Lives

9Lives is an Arbitrum Stylus smart contract implemented with a simple factory/pair pattern. A factory takes a list of outcomes, and creates a variable number of contracts with a minimal viable proxy pointing to share ERC20s, and a trading contract.

Inventors create campaigns (the prediction markets) by locking up "incentive" amounts, and by picking the type of oracle they want to use. Any fees earned in the campaign are sent to the Inventor, which provides incentive to create markets. Markets must be created with a hard deadline and a Beauty Contest or a Infrastructure Market, or with a Contract Interaction type of outcome. The Inventor must communicate to the Factory which oracle they would like to use, and provide the hash of the string that must be used to determine the outcome. This will then set the correct behaviour.

flowchart TD
    Trader --> |Locks up incentive amount, sets parameters| Factory
    Factory --> |Sets start, end, description, if infra market oracle chosen| Infra[Infra market]
    Factory --> |Deploys contract. Sets parameters| Trading
    Factory --> |Configures Longtail pool| Longtail
    Factory --> |Deploys ERC20 assets for each outcome| ERC20s
    Trading --> |Disables Longtail once trading is done| Factory
    ERC20s --> |Burns and mints supply| Trading
    Infra --> |Tells Trading who won| Trading

Optimistic Infra Markets are betting situations where Staked ARB is locked up as LARB, which is used to predict the outcome of a situation. They exist in an "optimistic" state where anyone can claim which outcome took place for 2 days, then for a grace period of two days, anyone can "whinge" about the outcome, supplying collateral that is slashed if they are incorrect. This begins a stage of betting on the outcome. A voting ERC20 from OpenZeppellin is used as the wrapped asset. Lockup does the conversion. The outcome voting power is a linear curve that decays until the end of the voting period. Optimistic Infra Markets in progress are markets that are created which resolve after a period of 3 days. These markets are designed to be risk free positions that infrastructure providers can take to "call" an outcome based on the results of a text field. These text fields can be empty or purely textual (as is the case with a string), or a description of a oracle's requirement for voting. Losers that bet incorrectly in the Optimistic Infra Market have their funds slashed. After 3 days, a 2 day period begins where correct bettors can slash loser Infra Market predictions and receive the funds themselves. After this 2 day window (5 days has elapsed in total), a "ANYTHING GOES" period begins, where users can slash any bad bettors prediction without regard for their token position (as long as they bet correctly).

stateDiagram
    [*] --> Locked_up : Lock in Lockup
    Locked_up --> Spent : Vest
    [*] --> Waiting : Create Trading
    Spent --> Predicting : Vested`
    Waiting --> Calling : Declare
    Calling --> Whinged : Contest
    Whinged --> Predicting : Predict
    Predicting --> Predicting_over : Time Passes
    Calling --> Calling_over : Time Passes
    Predicting_over --> Completed : End
    Calling_over --> Completed : End
    Completed --> Slashing_begun : Start Slashing
    Completed --> Oracle_submission : Oracle submission
    Slashing_begun --> Slashed : Slash
    Slashed --> Slashing_two_days_over : End Period
    Slashing_two_days_over --> Anything_goes_slash : Slash
    Anything_goes_slash --> Anything_goes_slashing_over : End Period
    Created --> Traded : Trade
    Traded --> Deadline_passed : Deadline
    Deadline_passed --> Oracle_submission : Submit Oracle
    Oracle_submission --> Claim : Claim

Oracle State oracles are very simple comparatively, as presumably the associated Trading contract was configured to allow early activation, so all a caller must do is activate the associated Oracle State contract. These could communicate with LayerZero to pull information from another chain, and the contract will simply check the result of the message. If it's not activated by the date that's given, then it defaults to a "DEFAULT" clause that could be "no" if a user were to try to estimate the price of something.


Diagram of the system

Roadmap

  • UX improvements (shares are more visible, smart account behaviour)
  • Mainnet is supported as well. Mainnet has disclosure that funds are locked up until the election is over.
  • Achievements and portfolio page is supported. Some socialfi elements.
    1. Users can choose their favourite achievements to display in a minified form next to their Meow Domain.
    2. Meow domains is supported in the UI.
  • Collect payoff from the campaign ending in the frontend.
  • Custom fee collection and pool configuration supported (use beauty contest with fixed date, many outcomes if they want)
  • Anyone can create pools. Custom display of pools a la Ebay customisation.
    1. A fixed fee is sent to creator of when shares are created.
    2. Behind the scenes deferring to the AMM model if more than two outcomes.
    3. Customise the UI of the frontpage for the info
    4. Stack ranking is done for automated updating of frontpage
    5. Campaign report functionality. Images are screened automatically for bad content with CSAM
    6. API to update campaign by the original sender
    7. Custom embed when sharing URL
  • Prediction market DAO. Token launch

Building contracts

make build

Updating docs (after editing markdown files)

forge doc -b

Testing

Testing must be done with no trading or contract feature enabled. Testing is only possible on the local environment, or with end to end tests with an Arbitrum node.

./tests.sh

Deployments

Superposition mainnet

Deployment nameDeployment address
Proxy admin
Factory 1 implementation
Factory 2 implementation
Trading mint impl
Trading extras impl
Factory proxy
ERC20 implementation
LensesV1

Superposition testnet

Deployment nameDeployment address
Proxy admin0xFEb6034FC7dF27dF18a3a6baD5Fb94C0D3dCb6d5
Factory 1 implementation0x4e01d5c351d35410e4f04403caee0eca16527ce9
Factory 2 implementation0x8960ad1a9a7f99616606b2fd71be1bbc82e62507
Lockup implementation0xf6a9a9ddfcb37da2e9b9aa1f96b51ea83ffa4fef
Optimistic infra predict impl0x16f0d98e0f6d45081c66cedfac36739217a7f636
Optimistic infra sweep impl0x23d6d1d2658bdff1b28633eeb650a78d7c0858e2
Optimistic infra extras impl0x81efdc7105249c67a55abda84aa6f6773df5f5eb
Trading DPM mint impl0xc547b71c9252ba8084f051fb365d08cdeaba7a12
Trading DPM extras impl0x11c302d4ce84db5e27c8526676b11989f648a188
Trading DPM price impl0xe53043d6454003a6367842221455b6f5a6238d12
Trading DPM quotes impl0xe14253cf4fcda54e5bfb4c37667f017db313fbac
Trading DPM price impl0xe53043d6454003a6367842221455b6f5a6238d12
Trading AMM mint impl0x96ffb2dfc97bd5ec15793983c0f13c5093cc1d05
Trading AMM extras impl0x4bdbacc936b1f23ce5f0b74bf84274284fe3ef4c
Trading AMM price impl0x427c6936fbb7546cce3d772a293b5836d7b49383
Trading AMM quotes impl0x1603dd14bd87c785dd9711cd401755cb8137b00c
Trading AMM price impl0x427c6936fbb7546cce3d772a293b5836d7b49383
Share implementation0xD8b1066bBb37789F478749d8eA224A89Fbf179be
Lockup token implementation0x75b86E643371A9BC4F5047e2F826080Ce4e3bDee
Infrastructure market proxy0x156768470de4685349c6033b9c6210dc94f22dca
Lockup proxy0x0eb32077a3b9dadbc1e62f8009645fce2d085b75
Lockup token proxy0x8e9c329d316b7c31ea1409bdf54ef15bb324c0c6
Factory proxy0xa499aa7d8f65abd496b3d75e1ff6b9d8fb3eb0ff
Helper factory0x0b859867B461246d687E1Fb5d72BCabEBacaFa5F
LensesV10x5F173EB43F869f4A887f99c2230536cc26F7e0e1
AI resolver0x15bebdf285bfe0039fd266af207f6d278aaac7f3
Beauty contest0xf09bf77cc7829e535c513b840ec7e452802c63b3

InfraMarket

Git Source

Functions

ctor

function ctor(address emergency, ILockup lockup, address lockedArbToken, INineLivesFactory factoryAddr) external;

Lockup

Git Source

Functions

ctor

function ctor(address tokenImpl, address infraMarket) external;

Factory

Git Source

Functions

ctor

function ctor(
    address shareImpl,
    address tradingDpmExtrasImpl,
    address tradingDpmMintImpl,
    address tradingDpmQuotesImpl,
    address tradingDpmPriceImpl,
    address tradingAMMExtrasImpl,
    address tradingAMMMintImpl,
    address tradingAmmQuotesImpl,
    address tradingAmmPriceImpl,
    address infraMarketOracle,
    address operator
) external;

DeployArgs

Git Source

struct DeployArgs {
    address admin;
    address emergencyCouncil;
    address lockupTokenImpl;
    address shareImpl;
    address factory1Impl;
    address factory2Impl;
    address infraMarketImplPredict;
    address infraMarketImplSweep;
    address infraMarketImplExtras;
    address lockupImpl;
    address tradingDpmExtrasImpl;
    address tradingDpmMintImpl;
    address tradingDpmQuotesImpl;
    address tradingDpmPriceImpl;
    address tradingAmmExtrasImpl;
    address tradingAmmMintImpl;
    address tradingAmmQuotesImpl;
    address tradingAmmPriceImpl;
}

DeployHelper

Git Source

Functions

constructor

constructor(DeployArgs memory _a);

Events

FactoryDeployed

event FactoryDeployed(address indexed addr);

InfraMarketDeployed

event InfraMarketDeployed(address indexed addr);

LockupDeployed

event LockupDeployed(address indexed addr);

IERC20Permit

Git Source

Functions

permit

function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
    external;

approve

function approve(address spender, uint256 amount) external;

transferFrom

function transferFrom(address owner, address spender, uint256 amount) external;

HelperFactory

Git Source

State Variables

FUSDC

IERC20Permit immutable FUSDC;

FACTORY

INineLivesFactory immutable FACTORY;

INFRA_MARKET

address immutable INFRA_MARKET;

BEAUTY_CONTEST

address immutable BEAUTY_CONTEST;

SARP_AI

address immutable SARP_AI;

Functions

constructor

constructor(
    IERC20Permit _fusdc,
    INineLivesFactory _factory,
    address _infraMarket,
    address _beautyContest,
    address _sarpAi
);

create

function create(
    address oracle,
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient
) internal returns (address);

createWithInfraMarket

function createWithInfraMarket(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient
) public returns (address tradingAddr);

createWithInfraMarketPermit

function createWithInfraMarketPermit(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (address tradingAddr);

createWithBeautyContest

function createWithBeautyContest(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient
) public returns (address tradingAddr);

createWithBeautyContestPermit

function createWithBeautyContestPermit(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (address tradingAddr);

createWithAI

function createWithAI(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient
) public returns (address tradingAddr);

createWithAIPermit

function createWithAIPermit(
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (address tradingAddr);

IEvents

Git Source

Events

LockupTokenProxyDeployed

event LockupTokenProxyDeployed(address indexed token);

NewTrading2

event NewTrading2(bytes32 indexed identifier, address indexed addr, address indexed oracle, uint8 backend);

OutcomeCreated

event OutcomeCreated(bytes32 indexed tradingIdentifier, bytes32 indexed erc20Identifier, address indexed erc20Addr);

OutcomeDecided

event OutcomeDecided(bytes8 indexed identifier, address indexed oracle);

SharesMinted

event SharesMinted(
    bytes8 indexed identifier,
    uint256 indexed shareAmount,
    address indexed spender,
    address recipient,
    uint256 fusdcSpent
);

PayoffActivated

event PayoffActivated(
    bytes8 indexed identifier,
    uint256 indexed sharesSpent,
    address indexed spender,
    address recipient,
    uint256 fusdcReceived
);

DeadlineExtension

event DeadlineExtension(uint64 indexed timeBefore, uint64 indexed timeAfter);

MarketCreated2

event MarketCreated2(address indexed incentiveSender, address indexed tradingAddr, bytes8 indexed defaultWinner);

UserPredicted

event UserPredicted(
    address indexed trading, address indexed predictor, uint256 indexed tokenAmount, uint256 powerAmount, bytes8 outcome
);

InfraMarketClosed

event InfraMarketClosed(address indexed incentiveRecipient, address indexed tradingAddr, bytes8 indexed winner);

IInfraMarket

Git Source

Functions

register

function register(address trading, address incentiveSender, bytes32 desc, uint64 launchTs, bytes8 defaultWinner)
    external
    returns (uint256);

predict

function predict(address trading, bytes8 winner, uint256 amount) external;

winner

function winner(address trading) external returns (bytes8 winnerId);

call

function call(address trading, bytes8 winner, address incentiveRecipient) external;

close

function close(address trading, address feeRecipient) external;

whinge

function whinge(address trading, bytes8 preferredOutcome, address bondRecipient) external;

marketPowerVested

marketPowerVested to this trading and outcome

function marketPowerVested(address trading, bytes8 outcome) external returns (uint256);

Parameters

NameTypeDescription
tradingaddresscontract to check the results of
outcomebytes8to check

globalPowerVested

function globalPowerVested(address trading) external returns (uint256);

userPowerVested

function userPowerVested(address trading, address spender) external returns (uint256);

sweep

function sweep(
    address trading,
    address victim,
    bytes8[] calldata outcomes,
    address onBehalfOfAddr,
    address feeRecipientAddr
) external returns (uint256 yieldForCaller);

ILockup

Git Source

Functions

lockup

lockup funds to receive StakedARB until the deadline given.

a debt id that's needed to redeem amounts deposited.

function lockup(uint256 amount, uint256 untilTimestamp, address recipient) external returns (uint256 debtId);

Parameters

NameTypeDescription
amountuint256to lock up.
untilTimestampuint256to do the lockup for, to earn extra power.
recipientaddressto send the Locked ARB to.

tokenAddr

function tokenAddr() external view returns (address);

stakedArbBal

Staked ARB vested by the user at this point in time.

function stakedArbBal(address holder) external view returns (uint256);

Parameters

NameTypeDescription
holderaddressto query for

slash

slash a user's entire position portfolio on request. only usable by InfraMarket. This can be called repeatedly safely without context. When this is used the user's amount before they started to lose funds is tracked to be drawn down.

function slash(address victim) external;

Parameters

NameTypeDescription
victimaddressto take money from

confiscate

confiscate from the victim that bet incorrectly. This should be called after slash, and the infra market is responsible for doing this correctly.

function confiscate(address victim, address recipient) external returns (uint256 amountTaken);

Parameters

NameTypeDescription
victimaddressto take money from, setting their staked arb to 0.
recipientaddressto send the staked arb to

freeze

freeze a user's position to prevent it from being taken until after this deadline. If the amount is already set, then we use the latest value. The infra market is responsible for a correct interaction here.

function freeze(address spender, uint256 until) external;

ILongtail

Git Source

Functions

quote72E2ADE7

function quote72E2ADE7(address, bool, int256, uint256) external;

FactoryOutcome

Git Source

struct FactoryOutcome {
    bytes8 identifier;
    uint256 sqrtPrice;
    string name;
}

INineLivesFactory

Git Source

Functions

newTrading09393DA8

set up new trading contract, seeding the initial amounts

function newTrading09393DA8(
    FactoryOutcome[] memory outcomes,
    address oracle,
    uint64 timeStart,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient
) external returns (address tradingAddr);

Parameters

NameTypeDescription
outcomesFactoryOutcome[]to set up as the default
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.
documentationbytes32keccak'd hash of the information that makes up the description for infrastructure markets. This is sent out there.
feeRecipientaddressto send fees earned from the 10% commission to.

Returns

NameTypeDescription
tradingAddraddressaddress of the newly created Trading contract deployment.

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 pure returns (address);

dpmTradingHash

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

function dpmTradingHash() 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);

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);

IERC20

Git Source

Functions

balanceOf

function balanceOf(address) external view returns (uint256);

LensesV1

Git Source

State Variables

longtail

ILongtail public immutable longtail;

factory

INineLivesFactory public immutable factory;

Functions

constructor

constructor(ILongtail _longtail, INineLivesFactory _factory);

getLongtailQuote

function getLongtailQuote(address _pool, bool _zeroForOne, int256 _amount, uint256 _priceLimit)
    external
    returns (string memory data);

getShareAddr

function getShareAddr(address _tradingAddr, bytes8 _outcomeId) public view returns (address shareAddr);

balances

function balances(address _tradingAddr, bytes32[] calldata _words, address _spender)
    external
    view
    returns (uint256[] memory bals);

LockupToken

Git Source

Inherits: Initializable, ERC20Upgradeable, ERC20BurnableUpgradeable, OwnableUpgradeable, ERC20PermitUpgradeable, ERC20VotesUpgradeable

Functions

constructor

Note: oz-upgrades-unsafe-allow: constructor

constructor();

ctor

function ctor(address initialOwner) public initializer;

mint

function mint(address to, uint256 amount) public onlyOwner;

_update

function _update(address from, address to, uint256 value) internal override(ERC20Upgradeable, ERC20VotesUpgradeable);

nonces

function nonces(address owner) public view override(ERC20PermitUpgradeable, NoncesUpgradeable) returns (uint256);

NinelivesLockedARB

Git Source

Inherits: Initializable, ERC20Upgradeable, ERC20BurnableUpgradeable, OwnableUpgradeable, ERC20PermitUpgradeable, ERC20VotesUpgradeable

Functions

constructor

Note: oz-upgrades-unsafe-allow: constructor

constructor();

ctor

function ctor(address initialOwner) public initializer;

mint

function mint(address to, uint256 amount) public onlyOwner;

clock

function clock() public view override returns (uint48);

CLOCK_MODE

function CLOCK_MODE() public pure override returns (string memory);

_update

function _update(address from, address to, uint256 value) internal override(ERC20Upgradeable, ERC20VotesUpgradeable);

nonces

function nonces(address owner) public view override(ERC20PermitUpgradeable, NoncesUpgradeable) returns (uint256);

transfer

function transfer(address, uint256) public pure override returns (bool);

transferFrom

function transferFrom(address, address, uint256) public pure override returns (bool);

IProxy

Git Source

Functions

upgradeAndCall

function upgradeAndCall(address, address, bytes memory) external;

ProxyAdmin

Git Source

State Variables

admin

address public admin;

Functions

constructor

constructor(address _admin);

transferOwnership

function transferOwnership(address _newAdmin) external;

upgrade

function upgrade(address _proxy, address _impl1, address _impl2, bytes memory _data) external;

Events

TransferOwnership

event TransferOwnership(address old, address new_);

Share

Git Source

Inherits: Initializable, ERC20Upgradeable, OwnableUpgradeable, ERC20PermitUpgradeable

Functions

constructor

constructor();

ctor

function ctor(string calldata name, address admin) public initializer;

decimals

We do this to protect the user from being distracted by other tokens.

function decimals() public pure override returns (uint8);

mint

function mint(address to, uint256 amount) public onlyOwner;

burn

function burn(address owner, uint256 value) public onlyOwner;

StorageSlot

Git Source

Functions

getAddressSlot

function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r);

Structs

AddressSlot

struct AddressSlot {
    address value;
}

UpgradeableInfraMarketProxy

Git Source

Inherits: IInfraMarket

Functions

directDelegate

function directDelegate(address to) internal;

constructor

constructor(address _admin, address _implPredict, address _implSweep, address _implExtras);

upgradeProxy

function upgradeProxy(address _implPredict, address _implSweep, address _implExtras) external;

register

function register(address, address, bytes32, uint64, bytes8) external returns (uint256);

call

function call(address, bytes8, address) external;

close

function close(address, address) external;

whinge

function whinge(address, bytes8, address) external;

predict

function predict(address, bytes8, uint256) external;

winner

function winner(address) external returns (bytes8);

globalPowerVested

function globalPowerVested(address) external returns (uint256);

marketPowerVested

marketPowerVested to this trading and outcome

function marketPowerVested(address, bytes8) external returns (uint256);

Parameters

NameTypeDescription
<none>address
<none>bytes8

userPowerVested

function userPowerVested(address, address) external returns (uint256);

sweep

function sweep(address, address, bytes8[] calldata, address, address) external returns (uint256);

fallback

fallback() external;

Events

UpgradedPredict

event UpgradedPredict(address impl);

UpgradedSweep

event UpgradedSweep(address impl);

UpgradedExtras

event UpgradedExtras(address impl);

AdminChanged

event AdminChanged(address previousAdmin, address newAdmin);

Constants

Git Source

ADMIN_SLOT

bytes32 constant ADMIN_SLOT = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1);

IMPL_PREDICT_SLOT

bytes32 constant IMPL_PREDICT_SLOT = bytes32(uint256(keccak256("9lives.impl.predict")) - 1);

IMPL_SWEEP_SLOT

bytes32 constant IMPL_SWEEP_SLOT = bytes32(uint256(keccak256("9lives.impl.sweep")) - 1);

IMPL_EXTRAS_SLOT

bytes32 constant IMPL_EXTRAS_SLOT = bytes32(uint256(keccak256("9lives.impl.sweep")) - 1);

StorageSlot

Git Source

Functions

getAddressSlot

function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r);

Structs

AddressSlot

struct AddressSlot {
    address value;
}

UpgradeableTwoProxy

Git Source

UpgradeableTwoProxy is a proxy that does delegation based on the 3rd byte of the signature used in the message received to the contract.

State Variables

admin_

address private immutable admin_;

Functions

constructor

constructor(address _admin, address _impl1, address _impl2, bytes memory _data);

fallback

fallback() external;

Events

Upgraded1

event Upgraded1(address impl);

Upgraded2

event Upgraded2(address impl);

AdminChanged

event AdminChanged(address previousAdmin, address newAdmin);

Constants

Git Source

ADMIN_SLOT

bytes32 constant ADMIN_SLOT = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1);

IMPL_1_SLOT

bytes32 constant IMPL_1_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation.1")) - 1);

IMPL_2_SLOT

bytes32 constant IMPL_2_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation.2")) - 1);

WordPackingLib

Git Source

Functions

pack

function pack(bytes8 word1, bytes8 word2, bytes8 word3, bytes8 word4) external pure returns (bytes32 word);

unpack

function unpack(bytes32 word) external pure returns (bytes8, bytes8, bytes8, bytes8);