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.
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.
- Users can choose their favourite achievements to display in a minified form next to their Meow Domain.
- 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.
- A fixed fee is sent to creator of when shares are created.
- Behind the scenes deferring to the AMM model if more than two outcomes.
- Customise the UI of the frontpage for the info
- Stack ranking is done for automated updating of frontpage
- Campaign report functionality. Images are screened automatically for bad content with CSAM
- API to update campaign by the original sender
- 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 name | Deployment address |
---|---|
Proxy admin | |
Factory 1 implementation | |
Factory 2 implementation | |
Trading mint impl | |
Trading extras impl | |
Factory proxy | |
ERC20 implementation | |
LensesV1 |
Superposition testnet
Deployment name | Deployment address |
---|---|
Proxy admin | 0xFEb6034FC7dF27dF18a3a6baD5Fb94C0D3dCb6d5 |
Factory 1 implementation | 0x4e01d5c351d35410e4f04403caee0eca16527ce9 |
Factory 2 implementation | 0x8960ad1a9a7f99616606b2fd71be1bbc82e62507 |
Lockup implementation | 0xf6a9a9ddfcb37da2e9b9aa1f96b51ea83ffa4fef |
Optimistic infra predict impl | 0x16f0d98e0f6d45081c66cedfac36739217a7f636 |
Optimistic infra sweep impl | 0x23d6d1d2658bdff1b28633eeb650a78d7c0858e2 |
Optimistic infra extras impl | 0x81efdc7105249c67a55abda84aa6f6773df5f5eb |
Trading DPM mint impl | 0xc547b71c9252ba8084f051fb365d08cdeaba7a12 |
Trading DPM extras impl | 0x11c302d4ce84db5e27c8526676b11989f648a188 |
Trading DPM price impl | 0xe53043d6454003a6367842221455b6f5a6238d12 |
Trading DPM quotes impl | 0xe14253cf4fcda54e5bfb4c37667f017db313fbac |
Trading DPM price impl | 0xe53043d6454003a6367842221455b6f5a6238d12 |
Trading AMM mint impl | 0x96ffb2dfc97bd5ec15793983c0f13c5093cc1d05 |
Trading AMM extras impl | 0x4bdbacc936b1f23ce5f0b74bf84274284fe3ef4c |
Trading AMM price impl | 0x427c6936fbb7546cce3d772a293b5836d7b49383 |
Trading AMM quotes impl | 0x1603dd14bd87c785dd9711cd401755cb8137b00c |
Trading AMM price impl | 0x427c6936fbb7546cce3d772a293b5836d7b49383 |
Share implementation | 0xD8b1066bBb37789F478749d8eA224A89Fbf179be |
Lockup token implementation | 0x75b86E643371A9BC4F5047e2F826080Ce4e3bDee |
Infrastructure market proxy | 0x156768470de4685349c6033b9c6210dc94f22dca |
Lockup proxy | 0x0eb32077a3b9dadbc1e62f8009645fce2d085b75 |
Lockup token proxy | 0x8e9c329d316b7c31ea1409bdf54ef15bb324c0c6 |
Factory proxy | 0xa499aa7d8f65abd496b3d75e1ff6b9d8fb3eb0ff |
Helper factory | 0x0b859867B461246d687E1Fb5d72BCabEBacaFa5F |
LensesV1 | 0x5F173EB43F869f4A887f99c2230536cc26F7e0e1 |
AI resolver | 0x15bebdf285bfe0039fd266af207f6d278aaac7f3 |
Beauty contest | 0xf09bf77cc7829e535c513b840ec7e452802c63b3 |
InfraMarket
Functions
ctor
function ctor(address emergency, ILockup lockup, address lockedArbToken, INineLivesFactory factoryAddr) external;
Lockup
Functions
ctor
function ctor(address tokenImpl, address infraMarket) external;
Factory
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
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
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
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
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
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
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
Name | Type | Description |
---|---|---|
trading | address | contract to check the results of |
outcome | bytes8 | to 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
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
Name | Type | Description |
---|---|---|
amount | uint256 | to lock up. |
untilTimestamp | uint256 | to do the lockup for, to earn extra power. |
recipient | address | to 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
Name | Type | Description |
---|---|---|
holder | address | to 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
Name | Type | Description |
---|---|---|
victim | address | to 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
Name | Type | Description |
---|---|---|
victim | address | to take money from, setting their staked arb to 0. |
recipient | address | to 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
Functions
quote72E2ADE7
function quote72E2ADE7(address, bool, int256, uint256) external;
FactoryOutcome
struct FactoryOutcome {
bytes8 identifier;
uint256 sqrtPrice;
string name;
}
INineLivesFactory
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
Name | Type | Description |
---|---|---|
outcomes | FactoryOutcome[] | to set up as the default |
oracle | address | to 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. |
timeStart | uint64 | to begin this contract at. This should be in the future. |
timeEnding | uint64 | to end this contract at. This should be in the future. |
documentation | bytes32 | keccak'd hash of the information that makes up the description for infrastructure markets. This is sent out there. |
feeRecipient | address | to send fees earned from the 10% commission to. |
Returns
Name | Type | Description |
---|---|---|
tradingAddr | address | address 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
Name | Type | Description |
---|---|---|
addr | address | is 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
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
Name | Type | Description |
---|---|---|
outcomes | bytes8[] | to use to use as betting outcomes in this contract. |
oracle | address | to use as the resolver for this contract. |
timeStart | uint256 | to begin this contract by. |
timeEnding | uint256 | to end this contract by. |
feeRecipient | address | to send fees earned from trading. |
shareImpl | address | |
shouldBufferTime | bool | to 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
Name | Type | Description |
---|---|---|
outcome | bytes8 | to test for |
value | uint256 | to test spending for |
priceA827ED27
Get the price of an outcome in fUSDC.
function priceA827ED27(bytes8 outcome) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
outcome | bytes8 | to 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
Name | Type | Description |
---|---|---|
outcome | bytes8 | to set as the winner. |
payoff91FA8C2E
Collect the payoff if holding winning shares!
function payoff91FA8C2E(bytes8 outcomeId, uint256 amount, address recipient) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
outcomeId | bytes8 | to collect the payoff for. |
amount | uint256 | of share to use for receiving the payoff. |
recipient | address | to 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
Name | Type | Description |
---|---|---|
outcomeId | bytes8 | to 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
Functions
balanceOf
function balanceOf(address) external view returns (uint256);
LensesV1
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
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
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
Functions
upgradeAndCall
function upgradeAndCall(address, address, bytes memory) external;
ProxyAdmin
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
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
Functions
getAddressSlot
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r);
Structs
AddressSlot
struct AddressSlot {
address value;
}
UpgradeableInfraMarketProxy
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
Name | Type | Description |
---|---|---|
<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
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
Functions
getAddressSlot
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r);
Structs
AddressSlot
struct AddressSlot {
address value;
}
UpgradeableTwoProxy
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
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
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);