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

Infra Markets are prediction markets where Staked ARB is locked up as LARB, which is used to predict the outcome of another prediction market with a commit and reveal scheme. These markets exist in an optimistic state where anyone can "call" the outcome, before being challenged with a "whinge", which begins the process of a commit and reveal system. Following this, amounts can be claimed with a slashing process based on amounts staked.

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

Interrogation of the deployment in the end to end testing library could be done using the build.rs use of environment.lst, which could be in turn read with a fresh deploy (and a clean artifacts directory):

sort $(find target -name environment.lst) | uniq

You could clear the recorded environment variables the same way with a test harness:

rm $(find target -name environment.lst)

You could use this to test the code by making a debug build, which includes more information about reverts, then simulate your calldata against it using stylus-interpreter, making debugging a breeze.

Errors

This table is a helpful reference for the types of errors the contracts might produce. To generate these, run ./print-error-table.sh.

Error nameError hex
AlreadyConstructed0x999000
MustContainOutcomes0x999001
OddsMustBeSet0x999002
U256TooLarge0x999003
TooSmallNumber0x999004
TooBigNumber0x999005
NegNumber0x999006
LongtailError0x9900
ShareError0x9902
ERC20ErrorTransfer0x99010000000000000000000000000000000000000000
TradingError0x9903
ERC20UnableToUnpack0x99900b
ERC20ReturnedFalse0x99900c
NotOracle0x99900d
DoneVoting0x99900e
NotTradingContract0x99900f
NotWinner0x999010
NegU2560x999011
CheckedPowOverflow0x999012
CheckedMulOverflow0x999013
CheckedAddOverflow0x999014
CheckedSubOverflow0x999015
CheckedDivOverflow0x999016
TwoOutcomesOnly0x999017
Infinity0x999018
NegativeFixedToUintConv0x999019
UnusualAmountCreated0x99901a
SqrtOpNone0x99901b
ERC20ErrorTransferFrom0x99040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
ERC20ErrorPermit0x99050000000000000000000000000000000000000000
ERC20ErrorBalanceOf0x99060000000000000000000000000000000000000000
ZeroShares0x99901f
CamelotError0x999020
BadSeedAmount0x999021
LockedARBError0x99070000000000000000000000000000000000000000
LockedARBUnableToUnpack0x999023
AlreadyRegistered0x999024
NotFactoryContract0x999025
NotInfraMarket0x999026
InfraMarketHasNotStarted0x999027
InfraMarketTooMuchVested0x999028
InfraMarketHasExpired0x999029
LockupError0x99902a
NotInsideSweepingPeriod0x99902b
IncorrectSweepInvocation0x99902c
UserAlreadyTargeted0x99902d
InfraMarketWindowClosed0x99902e
IsShutdown0x99902f
FactoryCallError0x9907
FactoryCallUnableToUnpack0x999031
CallerIsNotFactory0x999032
NotEnabled0x999033
LockupUnableToUnpack0x999034
BadVictim0x999035
VictimCannotClaim0x999036
NoVestedPower0x999037
ZeroAmount0x999038
InfraMarketCallError0x9908
NinelivesLockedArbCreateError0x99903a
NonexistentOutcome0x99903b
DeployError0x99903c
CalledTimeUnset0x99903d
WhingedTimeUnset0x99903e
NotInsideCallingPeriod0x99903f
CampaignAlreadyCalled0x999040
PredictingNotStarted0x999041
InCallingPeriod0x999042
SomeoneWhinged0x999043
WinnerAlreadyDeclared0x999044
NotInWhingingPeriod0x999045
PreferredOutcomeIsZero0x999046
AlreadyWhinged0x999047
OutcomeDuplicated0x999048
NotPastDeadline0x999049
ZeroDesc0x99904a
ZeroTradingAddr0x99904b
NotRegistered0x99904c
NotOperator0x99904d
TradingEmpty0x99904e
TradingUnableToUnpack0x99904f
BeautyContestBadOutcomes0x999050
BelowThreeHourBuyin0x999051
NoDAOMoney0x999052
ZeroCallDeadline0x999053
InconclusiveAnswerToCall0x999054
PastCallingDeadline0x999055
CannotEscape0x999056
NotAfterWhinging0x999057
NotInCommitReveal0x999058
CommitNotTheSame0x999059
AlreadyRevealed0x99905a
NotAllowedZeroCommit0x99905b
ZeroBal0x99905c
StakedArbUnusual0x99905d
TooEarlyToWithdraw0x99905e
VictimLowBal0x99905f
CampaignWinnerSet0x999060
OutcomesEmpty0x999061
InvalidEpoch0x999062
PotAlreadyClaimed0x999063
CampaignZeroCaller0x999064
WinnerUnset0x999065
BadWinner0x999066
CantWhingeCalled0x999067
NotReadyToDeclare0x999068
AlreadyCommitted0x999069
DPMOnly0x99906a

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 implementation0x1736213dc056931ac544e114c74408c9aab44b26
Factory 2 implementation0x8487351dd709efac014d5b834edb7678e34574d9
Lockup implementation0x771fa829ba1b445b03dae165d59d418b389fda0d
Infrastructure market proxy0xbdce46aca28a05f969cf675cb2777bae23bd7ff8
Lockup proxy0x8ab2b21084e2145a5338b3cf7cd45dad2f01222e
Lockup token proxy0x3ca49832937a86c0a99dd897e775ed9b7d6b38db
Factory proxy0x048db37b4bf07744bca95498e078af490c7b66fd
Helper factory0x2790A6F7aA7679385Af917F06cFF0C0ff484F0d7
LensesV10xe5d515eC8ECa5d70518e452b594dD0EFb715cB7d
Beauty contest0x3f8cd5a3a67b57f8370c5699064e642d5924608b
Sarp AI Resolver0x15bebdf285bfe0039fd266af207f6d278aaac7f3

InfraMarket

Git Source

Functions

ctor

function ctor(address admin, 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 infraMarketImpl;
    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

Create with the Infra Market, transferring the amount needed for the oracle, as well as the Trading contract itself.

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

createWithCustom

It doesn't make sense to use this. It's better to do the setup work yourself with the factory, this is left for convinience reasons. It transfers some fUSDC to the contract for setup.

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

createWithCustomPermit

Read the developer comment for createWithCustom.

function createWithCustomPermit(
    address oracle,
    FactoryOutcome[] calldata outcomes,
    uint64 timeEnding,
    bytes32 documentation,
    address feeRecipient,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
) public 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);

InfraMarketEnabled

event InfraMarketEnabled(bool indexed status);

MarketCreated2

event MarketCreated2(
    address indexed incentiveSender,
    address indexed tradingAddr,
    bytes32 indexed desc,
    uint64 launchTs,
    uint64 callDeadline
);

CallMade

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

InfraMarketClosed

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

DAOMoneyDistributed

event DAOMoneyDistributed(uint256 indexed amount, address indexed recipient);

Committed

event Committed(address indexed trading, address indexed predictor, bytes32 indexed commitment);

CommitmentRevealed

event CommitmentRevealed(
    address indexed trading, address indexed revealer, bytes8 indexed outcome, address caller, uint256 bal
);

CampaignEscaped

CampaignEscaped, because a campaign is in an indeterminate state! The DAO may be needed to step in.

event CampaignEscaped(address indexed tradingAddr);

LockupEnabled

event LockupEnabled(bool indexed status);

LockedUp

event LockedUp(uint256 indexed amount, address indexed recipient);

Withdrew

event Withdrew(uint256 indexed amount, address indexed recipient);

Slashed

event Slashed(address indexed victim, address indexed recipient, uint256 indexed slashedAmount);

Frozen

event Frozen(address indexed victim, uint64 indexed until);

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;

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

createPool653F395E

function createPool653F395E(address pool, uint256 price, uint32 fee) external;

enablePool579DA658

function enablePool579DA658(address pool, bool enabled) external;

quote72E2ADE7

function quote72E2ADE7(address pool, bool zeroForOne, int256 amount, uint256 priceLimitX96) 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.

oracle

oracle that's in use in this trading contract.

function oracle() external view returns (address);

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

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;

IProxy

Git Source

Functions

upgradeAndCall

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

TwoProxyAdmin

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

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