Documentation ¶
Index ¶
- Constants
- func PairFor(factory, tokenA, tokenB common.Address) (common.Address, error)
- func SortTokens(tokenA, tokenB common.Address) (common.Address, common.Address, error)
- func TestOptimalCubicRoot(fee uint64, amountIn *big.Int, reserve *big.Int) (float64, error)
- func TestOptimalCubicRoot2(fee uint64, amountIn *big.Int, reserve *big.Int) (float64, error)
- func UniGetAmountIn(fee uint64, amountOut, reserveIn, reserveOut *big.Int) (*big.Int, error)
- func UniGetAmountOut(fee uint64, amountIn, reserveIn, reserveOut *big.Int) (*big.Int, error)
- func UniGetOptimalOneCoin(cubicRootType uint8, fee uint64, ...) (*big.Int, *big.Int, error)
- func UniQuote(amountA, reserveA, reserveB *big.Int) (*big.Int, error)
- type Exchange
- func (self *Exchange) Address() common.Address
- func (self *Exchange) Init(addr common.Address, master common.Address)
- func (self *Exchange) Master() common.Address
- func (self *Exchange) OnReward(cc *types.ContractContext, b *types.Block, CountMap map[common.Address]uint32) (map[common.Address]*amount.Amount, error)
- type LPToken
- type StableSwap
- type StableSwapConstruction
- type StableSwapFront
- func (f *StableSwapFront) A(cc types.ContractLoader) *big.Int
- func (f *StableSwapFront) APrecise(cc types.ContractLoader) *big.Int
- func (f *StableSwapFront) AddLiquidity(cc *types.ContractContext, _amounts []*amount.Amount, ...) (*amount.Amount, error)
- func (f *StableSwapFront) AdminActionsDeadline(cc types.ContractLoader) uint64
- func (f *StableSwapFront) AdminBalances(cc *types.ContractContext, idx uint8) (*amount.Amount, error)
- func (f *StableSwapFront) AdminFee(cc types.ContractLoader) uint64
- func (f *StableSwapFront) Allowance(cc types.ContractLoader, owner, spender common.Address) *amount.Amount
- func (f *StableSwapFront) ApplyNewFee(cc *types.ContractContext) error
- func (f *StableSwapFront) ApplyNewWhiteList(cc *types.ContractContext) error
- func (f *StableSwapFront) ApplyTransferOwnerWinner(cc *types.ContractContext) error
- func (f *StableSwapFront) Approve(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
- func (f *StableSwapFront) BalanceOf(cc types.ContractLoader, from common.Address) *amount.Amount
- func (f *StableSwapFront) BlockTimestampLast(cc types.ContractLoader) uint64
- func (f *StableSwapFront) CalcLPTokenAmount(cc *types.ContractContext, _amounts []*amount.Amount, _is_deposit bool) (*amount.Amount, uint64, error)
- func (f *StableSwapFront) CalcWithdrawCoins(cc types.ContractLoader, _amount *amount.Amount) ([]*amount.Amount, error)
- func (f *StableSwapFront) CalcWithdrawOneCoin(cc *types.ContractContext, liquidity *amount.Amount, out uint8) (*amount.Amount, *amount.Amount, *amount.Amount, error)
- func (f *StableSwapFront) CommitNewFee(cc *types.ContractContext, ...) error
- func (f *StableSwapFront) CommitNewWhiteList(cc *types.ContractContext, new_whiteList common.Address, ...) error
- func (f *StableSwapFront) CommitTransferOwnerWinner(cc *types.ContractContext, new_owner, new_winner common.Address, ...) error
- func (f *StableSwapFront) Decimals(cc types.ContractLoader) *big.Int
- func (f *StableSwapFront) DecreaseAllowance(cc *types.ContractContext, spender common.Address, ...) error
- func (f *StableSwapFront) DonateAdminFees(cc *types.ContractContext) error
- func (f *StableSwapFront) ExType(cc types.ContractLoader) uint8
- func (f *StableSwapFront) Exchange(cc *types.ContractContext, in, out uint8, dx, _min_dy *amount.Amount, ...) (*amount.Amount, error)
- func (f *StableSwapFront) Factory(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) Fee(cc *types.ContractContext) uint64
- func (f *StableSwapFront) FeeAddress(cc *types.ContractContext, from common.Address) (uint64, error)
- func (f *StableSwapFront) FeeWhiteList(cc *types.ContractContext, from common.Address) ([]byte, error)
- func (f *StableSwapFront) FutureA(cc types.ContractLoader) *big.Int
- func (f *StableSwapFront) FutureATime(cc types.ContractLoader) uint64
- func (f *StableSwapFront) FutureAdminFee(cc types.ContractLoader) uint64
- func (f *StableSwapFront) FutureFee(cc types.ContractLoader) uint64
- func (f *StableSwapFront) FutureGroupId(cc types.ContractLoader) hash.Hash256
- func (f *StableSwapFront) FutureOwner(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) FutureWhiteList(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) FutureWinner(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) FutureWinnerFee(cc types.ContractLoader) uint64
- func (f *StableSwapFront) GetDy(cc *types.ContractContext, in, out uint8, dx *amount.Amount, ...) (*amount.Amount, error)
- func (f *StableSwapFront) GetVirtualPrice(cc types.ContractLoader) (*amount.Amount, error)
- func (f *StableSwapFront) GroupId(cc types.ContractLoader) hash.Hash256
- func (f *StableSwapFront) IncreaseAllowance(cc *types.ContractContext, spender common.Address, addAmount *amount.Amount) error
- func (f *StableSwapFront) InitialA(cc types.ContractLoader) *big.Int
- func (f *StableSwapFront) InitialATime(cc types.ContractLoader) uint64
- func (f *StableSwapFront) IsKilled(cc types.ContractLoader) bool
- func (f *StableSwapFront) KillMe(cc *types.ContractContext) error
- func (f *StableSwapFront) NTokens(cc *types.ContractContext) uint8
- func (f *StableSwapFront) Name(cc types.ContractLoader) string
- func (f *StableSwapFront) Owner(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) PayToken(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) PayTokenIndex(cc types.ContractLoader) (uint8, error)
- func (f *StableSwapFront) PrecisionMul(cc types.ContractLoader) []uint64
- func (f *StableSwapFront) RampA(cc *types.ContractContext, _future_A *big.Int, _future_time uint64) error
- func (f *StableSwapFront) Rates(cc types.ContractLoader) []*big.Int
- func (f *StableSwapFront) RemoveLiquidity(cc *types.ContractContext, _amount *amount.Amount, ...) ([]*amount.Amount, error)
- func (f *StableSwapFront) RemoveLiquidityImbalance(cc *types.ContractContext, _amounts []*amount.Amount, ...) (*amount.Amount, error)
- func (f *StableSwapFront) RemoveLiquidityOneCoin(cc *types.ContractContext, liquidity *amount.Amount, out uint8, ...) (*amount.Amount, error)
- func (f *StableSwapFront) Reserves(cc types.ContractLoader) ([]*amount.Amount, uint64)
- func (f *StableSwapFront) RevertNewFee(cc *types.ContractContext) error
- func (f *StableSwapFront) RevertNewWhiteList(cc *types.ContractContext) error
- func (f *StableSwapFront) RevertTransferOwnerWinner(cc *types.ContractContext) error
- func (f *StableSwapFront) SetName(cc *types.ContractContext, name string) error
- func (f *StableSwapFront) SetPayToken(cc *types.ContractContext, _token common.Address) error
- func (f *StableSwapFront) SetSymbol(cc *types.ContractContext, symbol string) error
- func (f *StableSwapFront) StopRampA(cc *types.ContractContext) error
- func (f *StableSwapFront) Symbol(cc types.ContractLoader) string
- func (f *StableSwapFront) TokenIndex(cc types.ContractLoader, _token common.Address) (uint8, error)
- func (f *StableSwapFront) TokenTransfer(cc *types.ContractContext, token, to common.Address, amt *amount.Amount) error
- func (f *StableSwapFront) Tokens(cc types.ContractLoader) []common.Address
- func (f *StableSwapFront) TotalSupply(cc types.ContractLoader) *amount.Amount
- func (f *StableSwapFront) Transfer(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
- func (f *StableSwapFront) TransferFrom(cc *types.ContractContext, From common.Address, To common.Address, ...) error
- func (f *StableSwapFront) TransferOwnerWinnerDeadline(cc types.ContractLoader) uint64
- func (f *StableSwapFront) UnkillMe(cc *types.ContractContext) error
- func (f *StableSwapFront) WhiteList(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) WhiteListDeadline(cc types.ContractLoader) uint64
- func (f *StableSwapFront) Winner(cc types.ContractLoader) common.Address
- func (f *StableSwapFront) WinnerFee(cc types.ContractLoader) uint64
- func (f *StableSwapFront) WithdrawAdminFees(cc *types.ContractContext) ([]*amount.Amount, []*amount.Amount, error)
- type UniSwap
- type UniSwapConstruction
- type UniSwapFront
- func (f *UniSwapFront) AdminActionsDeadline(cc types.ContractLoader) uint64
- func (f *UniSwapFront) AdminBalance(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) AdminFee(cc types.ContractLoader) uint64
- func (f *UniSwapFront) Allowance(cc types.ContractLoader, owner, spender common.Address) *amount.Amount
- func (f *UniSwapFront) ApplyNewFee(cc *types.ContractContext) error
- func (f *UniSwapFront) ApplyNewWhiteList(cc *types.ContractContext) error
- func (f *UniSwapFront) ApplyTransferOwnerWinner(cc *types.ContractContext) error
- func (f *UniSwapFront) Approve(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
- func (f *UniSwapFront) BalanceOf(cc types.ContractLoader, from common.Address) *amount.Amount
- func (f *UniSwapFront) BlockTimestampLast(cc types.ContractLoader) uint64
- func (f *UniSwapFront) Burn(cc *types.ContractContext, to common.Address) (*amount.Amount, *amount.Amount, error)
- func (f *UniSwapFront) CommitNewFee(cc *types.ContractContext, ...) error
- func (f *UniSwapFront) CommitNewWhiteList(cc *types.ContractContext, new_whiteList common.Address, ...) error
- func (f *UniSwapFront) CommitTransferOwnerWinner(cc *types.ContractContext, new_owner, new_winner common.Address, ...) error
- func (f *UniSwapFront) Decimals(cc types.ContractLoader) *big.Int
- func (f *UniSwapFront) DecreaseAllowance(cc *types.ContractContext, spender common.Address, ...) error
- func (f *UniSwapFront) ExType(cc types.ContractLoader) uint8
- func (f *UniSwapFront) Factory(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) Fee(cc *types.ContractContext) uint64
- func (f *UniSwapFront) FeeAddress(cc *types.ContractContext, from common.Address) (uint64, error)
- func (f *UniSwapFront) FeeWhiteList(cc *types.ContractContext, from common.Address) ([]byte, error)
- func (f *UniSwapFront) FutureAdminFee(cc types.ContractLoader) uint64
- func (f *UniSwapFront) FutureFee(cc types.ContractLoader) uint64
- func (f *UniSwapFront) FutureGroupId(cc types.ContractLoader) hash.Hash256
- func (f *UniSwapFront) FutureOwner(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) FutureWhiteList(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) FutureWinner(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) FutureWinnerFee(cc types.ContractLoader) uint64
- func (f *UniSwapFront) GetMintAdminFee(cc types.ContractLoader, _reserve0, _reserve1 *amount.Amount) *amount.Amount
- func (f *UniSwapFront) GroupId(cc types.ContractLoader) hash.Hash256
- func (f *UniSwapFront) IncreaseAllowance(cc *types.ContractContext, spender common.Address, addAmount *amount.Amount) error
- func (f *UniSwapFront) IsKilled(cc types.ContractLoader) bool
- func (f *UniSwapFront) KLast(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) KillMe(cc *types.ContractContext) error
- func (f *UniSwapFront) Mint(cc *types.ContractContext, to common.Address) (*amount.Amount, error)
- func (f *UniSwapFront) MintedAdminBalance(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) NTokens(cc types.ContractLoader) uint8
- func (f *UniSwapFront) Name(cc types.ContractLoader) string
- func (f *UniSwapFront) Owner(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) PayToken(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) PayTokenIndex(cc types.ContractLoader) (uint8, error)
- func (f *UniSwapFront) Price0CumulativeLast(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) Price1CumulativeLast(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) Reserve0(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) Reserve1(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) Reserves(cc types.ContractLoader) ([]*amount.Amount, uint64)
- func (f *UniSwapFront) RevertNewFee(cc *types.ContractContext) error
- func (f *UniSwapFront) RevertNewWhiteList(cc *types.ContractContext) error
- func (f *UniSwapFront) RevertTransferOwnerWinner(cc *types.ContractContext) error
- func (f *UniSwapFront) SetName(cc *types.ContractContext, name string) error
- func (f *UniSwapFront) SetPayToken(cc *types.ContractContext, _token common.Address) error
- func (f *UniSwapFront) SetSymbol(cc *types.ContractContext, symbol string) error
- func (f *UniSwapFront) Skim(cc *types.ContractContext, to common.Address) error
- func (f *UniSwapFront) Swap(cc *types.ContractContext, amount0Out, amount1Out *amount.Amount, ...) error
- func (f *UniSwapFront) Symbol(cc types.ContractLoader) string
- func (f *UniSwapFront) Sync(cc *types.ContractContext) error
- func (f *UniSwapFront) Token0(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) Token1(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) TokenTransfer(cc *types.ContractContext, token, to common.Address, amt *amount.Amount) error
- func (f *UniSwapFront) Tokens(cc types.ContractLoader) []common.Address
- func (f *UniSwapFront) TotalSupply(cc types.ContractLoader) *amount.Amount
- func (f *UniSwapFront) Transfer(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
- func (f *UniSwapFront) TransferFrom(cc *types.ContractContext, From common.Address, To common.Address, ...) error
- func (f *UniSwapFront) TransferOwnerWinnerDeadline(cc types.ContractLoader) uint64
- func (f *UniSwapFront) UnkillMe(cc *types.ContractContext) error
- func (f *UniSwapFront) WhiteList(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) WhiteListDeadline(cc types.ContractLoader) uint64
- func (f *UniSwapFront) Winner(cc types.ContractLoader) common.Address
- func (f *UniSwapFront) WinnerFee(cc types.ContractLoader) uint64
- func (f *UniSwapFront) WithdrawAdminFees(cc *types.ContractContext) (*amount.Amount, *amount.Amount, *amount.Amount, *amount.Amount, *amount.Amount, ...)
- func (f *UniSwapFront) WithdrawAdminFees2(cc *types.ContractContext) (*amount.Amount, *amount.Amount, *amount.Amount, *amount.Amount, *amount.Amount, ...)
Constants ¶
const ( //exchangeType uint8 UNI = uint8(1) STABLE = uint8(2) //exchange FEE_DENOMINATOR = 10000000000 PRECISION = amount.FractionalMax MAX_FEE = FEE_DENOMINATOR / 2 // 50% MAX_ADMIN_FEE = FEE_DENOMINATOR // 100% MAX_WINNER_FEE = FEE_DENOMINATOR // 100% //uniswap MINIMUM_LIQUIDITY = 1000 //stableswap MAX_A = 1000000 MAX_A_CHANGE = 10 MIN_RAMP_TIME = 86400 // 1 day A_PRECISION = 100 )
Variables ¶
This section is empty.
Functions ¶
func SortTokens ¶
///////// Exchange /////////// Sort two Token Address
func TestOptimalCubicRoot ¶
func TestOptimalCubicRoot2 ¶
func UniGetAmountIn ¶
given an output amount of an asset and pair reserves, returns a required input amount of the other asset
func UniGetAmountOut ¶
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
Types ¶
type Exchange ¶
Contract 가 아님
type StableSwap ¶
func (*StableSwap) Front ¶
func (cont *StableSwap) Front() interface{}
func (*StableSwap) OnCreate ¶
func (self *StableSwap) OnCreate(cc *types.ContractContext, Args []byte) error
type StableSwapConstruction ¶
type StableSwapConstruction struct { Name string Symbol string Factory common.Address NTokens uint8 Tokens []common.Address PayToken common.Address Owner common.Address Winner common.Address Fee uint64 AdminFee uint64 WinnerFee uint64 WhiteList common.Address GroupId hash.Hash256 Amp *big.Int PrecisionMul []uint64 Rates []*big.Int }
type StableSwapFront ¶
type StableSwapFront struct {
// contains filtered or unexported fields
}
func (*StableSwapFront) A ¶
func (f *StableSwapFront) A(cc types.ContractLoader) *big.Int
func (*StableSwapFront) APrecise ¶
func (f *StableSwapFront) APrecise(cc types.ContractLoader) *big.Int
func (*StableSwapFront) AddLiquidity ¶
func (f *StableSwapFront) AddLiquidity(cc *types.ContractContext, _amounts []*amount.Amount, _min_mint_amount *amount.Amount) (*amount.Amount, error)
func (*StableSwapFront) AdminActionsDeadline ¶
func (f *StableSwapFront) AdminActionsDeadline(cc types.ContractLoader) uint64
func (*StableSwapFront) AdminBalances ¶
func (f *StableSwapFront) AdminBalances(cc *types.ContractContext, idx uint8) (*amount.Amount, error)
func (*StableSwapFront) AdminFee ¶
func (f *StableSwapFront) AdminFee(cc types.ContractLoader) uint64
func (*StableSwapFront) Allowance ¶
func (f *StableSwapFront) Allowance(cc types.ContractLoader, owner, spender common.Address) *amount.Amount
func (*StableSwapFront) ApplyNewFee ¶
func (f *StableSwapFront) ApplyNewFee(cc *types.ContractContext) error
func (*StableSwapFront) ApplyNewWhiteList ¶
func (f *StableSwapFront) ApplyNewWhiteList(cc *types.ContractContext) error
func (*StableSwapFront) ApplyTransferOwnerWinner ¶
func (f *StableSwapFront) ApplyTransferOwnerWinner(cc *types.ContractContext) error
func (*StableSwapFront) Approve ¶
func (f *StableSwapFront) Approve(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
func (*StableSwapFront) BalanceOf ¶
func (f *StableSwapFront) BalanceOf(cc types.ContractLoader, from common.Address) *amount.Amount
func (*StableSwapFront) BlockTimestampLast ¶
func (f *StableSwapFront) BlockTimestampLast(cc types.ContractLoader) uint64
func (*StableSwapFront) CalcLPTokenAmount ¶
func (f *StableSwapFront) CalcLPTokenAmount(cc *types.ContractContext, _amounts []*amount.Amount, _is_deposit bool) (*amount.Amount, uint64, error)
//////////////////////////////////////////////// StableSwap Liquidity & Swap Functions ////////////////////////////////////////////////
func (*StableSwapFront) CalcWithdrawCoins ¶
func (f *StableSwapFront) CalcWithdrawCoins(cc types.ContractLoader, _amount *amount.Amount) ([]*amount.Amount, error)
func (*StableSwapFront) CalcWithdrawOneCoin ¶
func (*StableSwapFront) CommitNewFee ¶
func (f *StableSwapFront) CommitNewFee(cc *types.ContractContext, new_fee, new_admin_fee, new_winner_fee, deadline uint64) error
func (*StableSwapFront) CommitNewWhiteList ¶
func (f *StableSwapFront) CommitNewWhiteList(cc *types.ContractContext, new_whiteList common.Address, new_groupId hash.Hash256, deadline uint64) error
func (*StableSwapFront) CommitTransferOwnerWinner ¶
func (f *StableSwapFront) CommitTransferOwnerWinner(cc *types.ContractContext, new_owner, new_winner common.Address, deadline uint64) error
func (*StableSwapFront) Decimals ¶
func (f *StableSwapFront) Decimals(cc types.ContractLoader) *big.Int
func (*StableSwapFront) DecreaseAllowance ¶
func (f *StableSwapFront) DecreaseAllowance(cc *types.ContractContext, spender common.Address, subtractAmount *amount.Amount) error
func (*StableSwapFront) DonateAdminFees ¶
func (f *StableSwapFront) DonateAdminFees(cc *types.ContractContext) error
func (*StableSwapFront) ExType ¶
func (f *StableSwapFront) ExType(cc types.ContractLoader) uint8
func (*StableSwapFront) Factory ¶
func (f *StableSwapFront) Factory(cc types.ContractLoader) common.Address
func (*StableSwapFront) Fee ¶
func (f *StableSwapFront) Fee(cc *types.ContractContext) uint64
func (*StableSwapFront) FeeAddress ¶
func (f *StableSwapFront) FeeAddress(cc *types.ContractContext, from common.Address) (uint64, error)
func (*StableSwapFront) FeeWhiteList ¶
func (f *StableSwapFront) FeeWhiteList(cc *types.ContractContext, from common.Address) ([]byte, error)
func (*StableSwapFront) FutureA ¶
func (f *StableSwapFront) FutureA(cc types.ContractLoader) *big.Int
func (*StableSwapFront) FutureATime ¶
func (f *StableSwapFront) FutureATime(cc types.ContractLoader) uint64
func (*StableSwapFront) FutureAdminFee ¶
func (f *StableSwapFront) FutureAdminFee(cc types.ContractLoader) uint64
func (*StableSwapFront) FutureFee ¶
func (f *StableSwapFront) FutureFee(cc types.ContractLoader) uint64
func (*StableSwapFront) FutureGroupId ¶
func (f *StableSwapFront) FutureGroupId(cc types.ContractLoader) hash.Hash256
func (*StableSwapFront) FutureOwner ¶
func (f *StableSwapFront) FutureOwner(cc types.ContractLoader) common.Address
func (*StableSwapFront) FutureWhiteList ¶
func (f *StableSwapFront) FutureWhiteList(cc types.ContractLoader) common.Address
func (*StableSwapFront) FutureWinner ¶
func (f *StableSwapFront) FutureWinner(cc types.ContractLoader) common.Address
func (*StableSwapFront) FutureWinnerFee ¶
func (f *StableSwapFront) FutureWinnerFee(cc types.ContractLoader) uint64
func (*StableSwapFront) GetVirtualPrice ¶
func (f *StableSwapFront) GetVirtualPrice(cc types.ContractLoader) (*amount.Amount, error)
func (*StableSwapFront) GroupId ¶
func (f *StableSwapFront) GroupId(cc types.ContractLoader) hash.Hash256
func (*StableSwapFront) IncreaseAllowance ¶
func (f *StableSwapFront) IncreaseAllowance(cc *types.ContractContext, spender common.Address, addAmount *amount.Amount) error
func (*StableSwapFront) InitialA ¶
func (f *StableSwapFront) InitialA(cc types.ContractLoader) *big.Int
//////////////////////////////////////////////// StableSwap Parameter Functions ////////////////////////////////////////////////
func (*StableSwapFront) InitialATime ¶
func (f *StableSwapFront) InitialATime(cc types.ContractLoader) uint64
func (*StableSwapFront) IsKilled ¶
func (f *StableSwapFront) IsKilled(cc types.ContractLoader) bool
func (*StableSwapFront) KillMe ¶
func (f *StableSwapFront) KillMe(cc *types.ContractContext) error
func (*StableSwapFront) NTokens ¶
func (f *StableSwapFront) NTokens(cc *types.ContractContext) uint8
func (*StableSwapFront) Name ¶
func (f *StableSwapFront) Name(cc types.ContractLoader) string
//////////////////////////////////////////////// Token ////////////////////////////////////////////////
func (*StableSwapFront) Owner ¶
func (f *StableSwapFront) Owner(cc types.ContractLoader) common.Address
func (*StableSwapFront) PayToken ¶
func (f *StableSwapFront) PayToken(cc types.ContractLoader) common.Address
func (*StableSwapFront) PayTokenIndex ¶
func (f *StableSwapFront) PayTokenIndex(cc types.ContractLoader) (uint8, error)
func (*StableSwapFront) PrecisionMul ¶
func (f *StableSwapFront) PrecisionMul(cc types.ContractLoader) []uint64
func (*StableSwapFront) RampA ¶
func (f *StableSwapFront) RampA(cc *types.ContractContext, _future_A *big.Int, _future_time uint64) error
func (*StableSwapFront) Rates ¶
func (f *StableSwapFront) Rates(cc types.ContractLoader) []*big.Int
func (*StableSwapFront) RemoveLiquidity ¶
func (f *StableSwapFront) RemoveLiquidity(cc *types.ContractContext, _amount *amount.Amount, _min_amounts []*amount.Amount) ([]*amount.Amount, error)
func (*StableSwapFront) RemoveLiquidityImbalance ¶
func (f *StableSwapFront) RemoveLiquidityImbalance(cc *types.ContractContext, _amounts []*amount.Amount, _max_burn_amount *amount.Amount) (*amount.Amount, error)
func (*StableSwapFront) RemoveLiquidityOneCoin ¶
func (*StableSwapFront) Reserves ¶
func (f *StableSwapFront) Reserves(cc types.ContractLoader) ([]*amount.Amount, uint64)
func (*StableSwapFront) RevertNewFee ¶
func (f *StableSwapFront) RevertNewFee(cc *types.ContractContext) error
func (*StableSwapFront) RevertNewWhiteList ¶
func (f *StableSwapFront) RevertNewWhiteList(cc *types.ContractContext) error
func (*StableSwapFront) RevertTransferOwnerWinner ¶
func (f *StableSwapFront) RevertTransferOwnerWinner(cc *types.ContractContext) error
func (*StableSwapFront) SetName ¶
func (f *StableSwapFront) SetName(cc *types.ContractContext, name string) error
func (*StableSwapFront) SetPayToken ¶
func (f *StableSwapFront) SetPayToken(cc *types.ContractContext, _token common.Address) error
////////////////////////////////////////////////// // Exchange : public writer Functions //////////////////////////////////////////////////
func (*StableSwapFront) SetSymbol ¶
func (f *StableSwapFront) SetSymbol(cc *types.ContractContext, symbol string) error
func (*StableSwapFront) StopRampA ¶
func (f *StableSwapFront) StopRampA(cc *types.ContractContext) error
func (*StableSwapFront) Symbol ¶
func (f *StableSwapFront) Symbol(cc types.ContractLoader) string
func (*StableSwapFront) TokenIndex ¶
func (f *StableSwapFront) TokenIndex(cc types.ContractLoader, _token common.Address) (uint8, error)
//////////////////////////////////////////////// StableSwap : public reader functions ////////////////////////////////////////////////
func (*StableSwapFront) TokenTransfer ¶
func (f *StableSwapFront) TokenTransfer(cc *types.ContractContext, token, to common.Address, amt *amount.Amount) error
func (*StableSwapFront) Tokens ¶
func (f *StableSwapFront) Tokens(cc types.ContractLoader) []common.Address
func (*StableSwapFront) TotalSupply ¶
func (f *StableSwapFront) TotalSupply(cc types.ContractLoader) *amount.Amount
func (*StableSwapFront) Transfer ¶
func (f *StableSwapFront) Transfer(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
func (*StableSwapFront) TransferFrom ¶
func (f *StableSwapFront) TransferFrom(cc *types.ContractContext, From common.Address, To common.Address, Amount *amount.Amount) error
func (*StableSwapFront) TransferOwnerWinnerDeadline ¶
func (f *StableSwapFront) TransferOwnerWinnerDeadline(cc types.ContractLoader) uint64
func (*StableSwapFront) UnkillMe ¶
func (f *StableSwapFront) UnkillMe(cc *types.ContractContext) error
func (*StableSwapFront) WhiteList ¶
func (f *StableSwapFront) WhiteList(cc types.ContractLoader) common.Address
func (*StableSwapFront) WhiteListDeadline ¶
func (f *StableSwapFront) WhiteListDeadline(cc types.ContractLoader) uint64
func (*StableSwapFront) Winner ¶
func (f *StableSwapFront) Winner(cc types.ContractLoader) common.Address
func (*StableSwapFront) WinnerFee ¶
func (f *StableSwapFront) WinnerFee(cc types.ContractLoader) uint64
func (*StableSwapFront) WithdrawAdminFees ¶
func (f *StableSwapFront) WithdrawAdminFees(cc *types.ContractContext) ([]*amount.Amount, []*amount.Amount, error)
type UniSwapConstruction ¶
type UniSwapConstruction struct { Name string Symbol string Factory common.Address Token0 common.Address Token1 common.Address PayToken common.Address Owner common.Address Winner common.Address Fee uint64 AdminFee uint64 WinnerFee uint64 WhiteList common.Address GroupId hash.Hash256 }
type UniSwapFront ¶
type UniSwapFront struct {
// contains filtered or unexported fields
}
func (*UniSwapFront) AdminActionsDeadline ¶
func (f *UniSwapFront) AdminActionsDeadline(cc types.ContractLoader) uint64
func (*UniSwapFront) AdminBalance ¶
func (f *UniSwapFront) AdminBalance(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) AdminFee ¶
func (f *UniSwapFront) AdminFee(cc types.ContractLoader) uint64
func (*UniSwapFront) Allowance ¶
func (f *UniSwapFront) Allowance(cc types.ContractLoader, owner, spender common.Address) *amount.Amount
func (*UniSwapFront) ApplyNewFee ¶
func (f *UniSwapFront) ApplyNewFee(cc *types.ContractContext) error
func (*UniSwapFront) ApplyNewWhiteList ¶
func (f *UniSwapFront) ApplyNewWhiteList(cc *types.ContractContext) error
func (*UniSwapFront) ApplyTransferOwnerWinner ¶
func (f *UniSwapFront) ApplyTransferOwnerWinner(cc *types.ContractContext) error
func (*UniSwapFront) Approve ¶
func (f *UniSwapFront) Approve(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
func (*UniSwapFront) BalanceOf ¶
func (f *UniSwapFront) BalanceOf(cc types.ContractLoader, from common.Address) *amount.Amount
func (*UniSwapFront) BlockTimestampLast ¶
func (f *UniSwapFront) BlockTimestampLast(cc types.ContractLoader) uint64
func (*UniSwapFront) Burn ¶
func (f *UniSwapFront) Burn(cc *types.ContractContext, to common.Address) (*amount.Amount, *amount.Amount, error)
func (*UniSwapFront) CommitNewFee ¶
func (f *UniSwapFront) CommitNewFee(cc *types.ContractContext, new_fee, new_admin_fee, new_winner_fee, deadline uint64) error
func (*UniSwapFront) CommitNewWhiteList ¶
func (f *UniSwapFront) CommitNewWhiteList(cc *types.ContractContext, new_whiteList common.Address, new_groupId hash.Hash256, deadline uint64) error
func (*UniSwapFront) CommitTransferOwnerWinner ¶
func (f *UniSwapFront) CommitTransferOwnerWinner(cc *types.ContractContext, new_owner, new_winner common.Address, deadline uint64) error
func (*UniSwapFront) Decimals ¶
func (f *UniSwapFront) Decimals(cc types.ContractLoader) *big.Int
func (*UniSwapFront) DecreaseAllowance ¶
func (f *UniSwapFront) DecreaseAllowance(cc *types.ContractContext, spender common.Address, subtractAmount *amount.Amount) error
func (*UniSwapFront) ExType ¶
func (f *UniSwapFront) ExType(cc types.ContractLoader) uint8
//////////////////////////////////////////////// Exchange : public reader functions ////////////////////////////////////////////////
func (*UniSwapFront) Factory ¶
func (f *UniSwapFront) Factory(cc types.ContractLoader) common.Address
func (*UniSwapFront) Fee ¶
func (f *UniSwapFront) Fee(cc *types.ContractContext) uint64
func (*UniSwapFront) FeeAddress ¶
func (f *UniSwapFront) FeeAddress(cc *types.ContractContext, from common.Address) (uint64, error)
func (*UniSwapFront) FeeWhiteList ¶
func (f *UniSwapFront) FeeWhiteList(cc *types.ContractContext, from common.Address) ([]byte, error)
func (*UniSwapFront) FutureAdminFee ¶
func (f *UniSwapFront) FutureAdminFee(cc types.ContractLoader) uint64
func (*UniSwapFront) FutureFee ¶
func (f *UniSwapFront) FutureFee(cc types.ContractLoader) uint64
func (*UniSwapFront) FutureGroupId ¶
func (f *UniSwapFront) FutureGroupId(cc types.ContractLoader) hash.Hash256
func (*UniSwapFront) FutureOwner ¶
func (f *UniSwapFront) FutureOwner(cc types.ContractLoader) common.Address
func (*UniSwapFront) FutureWhiteList ¶
func (f *UniSwapFront) FutureWhiteList(cc types.ContractLoader) common.Address
func (*UniSwapFront) FutureWinner ¶
func (f *UniSwapFront) FutureWinner(cc types.ContractLoader) common.Address
func (*UniSwapFront) FutureWinnerFee ¶
func (f *UniSwapFront) FutureWinnerFee(cc types.ContractLoader) uint64
func (*UniSwapFront) GetMintAdminFee ¶
func (f *UniSwapFront) GetMintAdminFee(cc types.ContractLoader, _reserve0, _reserve1 *amount.Amount) *amount.Amount
func (*UniSwapFront) GroupId ¶
func (f *UniSwapFront) GroupId(cc types.ContractLoader) hash.Hash256
func (*UniSwapFront) IncreaseAllowance ¶
func (f *UniSwapFront) IncreaseAllowance(cc *types.ContractContext, spender common.Address, addAmount *amount.Amount) error
func (*UniSwapFront) IsKilled ¶
func (f *UniSwapFront) IsKilled(cc types.ContractLoader) bool
func (*UniSwapFront) KLast ¶
func (f *UniSwapFront) KLast(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) KillMe ¶
func (f *UniSwapFront) KillMe(cc *types.ContractContext) error
func (*UniSwapFront) Mint ¶
func (f *UniSwapFront) Mint(cc *types.ContractContext, to common.Address) (*amount.Amount, error)
//////////////////////////////////////////////// Uniswap : public writer functions ////////////////////////////////////////////////
func (*UniSwapFront) MintedAdminBalance ¶
func (f *UniSwapFront) MintedAdminBalance(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) NTokens ¶
func (f *UniSwapFront) NTokens(cc types.ContractLoader) uint8
func (*UniSwapFront) Name ¶
func (f *UniSwapFront) Name(cc types.ContractLoader) string
//////////////////////////////////////////////// Token ////////////////////////////////////////////////
func (*UniSwapFront) Owner ¶
func (f *UniSwapFront) Owner(cc types.ContractLoader) common.Address
func (*UniSwapFront) PayToken ¶
func (f *UniSwapFront) PayToken(cc types.ContractLoader) common.Address
func (*UniSwapFront) PayTokenIndex ¶
func (f *UniSwapFront) PayTokenIndex(cc types.ContractLoader) (uint8, error)
func (*UniSwapFront) Price0CumulativeLast ¶
func (f *UniSwapFront) Price0CumulativeLast(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) Price1CumulativeLast ¶
func (f *UniSwapFront) Price1CumulativeLast(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) Reserve0 ¶
func (f *UniSwapFront) Reserve0(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) Reserve1 ¶
func (f *UniSwapFront) Reserve1(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) Reserves ¶
func (f *UniSwapFront) Reserves(cc types.ContractLoader) ([]*amount.Amount, uint64)
func (*UniSwapFront) RevertNewFee ¶
func (f *UniSwapFront) RevertNewFee(cc *types.ContractContext) error
func (*UniSwapFront) RevertNewWhiteList ¶
func (f *UniSwapFront) RevertNewWhiteList(cc *types.ContractContext) error
func (*UniSwapFront) RevertTransferOwnerWinner ¶
func (f *UniSwapFront) RevertTransferOwnerWinner(cc *types.ContractContext) error
func (*UniSwapFront) SetName ¶
func (f *UniSwapFront) SetName(cc *types.ContractContext, name string) error
func (*UniSwapFront) SetPayToken ¶
func (f *UniSwapFront) SetPayToken(cc *types.ContractContext, _token common.Address) error
////////////////////////////////////////////////// // Exchange : public writer Functions //////////////////////////////////////////////////
func (*UniSwapFront) SetSymbol ¶
func (f *UniSwapFront) SetSymbol(cc *types.ContractContext, symbol string) error
func (*UniSwapFront) Skim ¶
func (f *UniSwapFront) Skim(cc *types.ContractContext, to common.Address) error
func (*UniSwapFront) Symbol ¶
func (f *UniSwapFront) Symbol(cc types.ContractLoader) string
func (*UniSwapFront) Sync ¶
func (f *UniSwapFront) Sync(cc *types.ContractContext) error
func (*UniSwapFront) Token0 ¶
func (f *UniSwapFront) Token0(cc types.ContractLoader) common.Address
//////////////////////////////////////////////// Uniswap : public reader functions ////////////////////////////////////////////////
func (*UniSwapFront) Token1 ¶
func (f *UniSwapFront) Token1(cc types.ContractLoader) common.Address
func (*UniSwapFront) TokenTransfer ¶
func (f *UniSwapFront) TokenTransfer(cc *types.ContractContext, token, to common.Address, amt *amount.Amount) error
func (*UniSwapFront) Tokens ¶
func (f *UniSwapFront) Tokens(cc types.ContractLoader) []common.Address
func (*UniSwapFront) TotalSupply ¶
func (f *UniSwapFront) TotalSupply(cc types.ContractLoader) *amount.Amount
func (*UniSwapFront) Transfer ¶
func (f *UniSwapFront) Transfer(cc *types.ContractContext, To common.Address, Amount *amount.Amount) error
func (*UniSwapFront) TransferFrom ¶
func (f *UniSwapFront) TransferFrom(cc *types.ContractContext, From common.Address, To common.Address, Amount *amount.Amount) error
func (*UniSwapFront) TransferOwnerWinnerDeadline ¶
func (f *UniSwapFront) TransferOwnerWinnerDeadline(cc types.ContractLoader) uint64
func (*UniSwapFront) UnkillMe ¶
func (f *UniSwapFront) UnkillMe(cc *types.ContractContext) error
func (*UniSwapFront) WhiteList ¶
func (f *UniSwapFront) WhiteList(cc types.ContractLoader) common.Address
func (*UniSwapFront) WhiteListDeadline ¶
func (f *UniSwapFront) WhiteListDeadline(cc types.ContractLoader) uint64
func (*UniSwapFront) Winner ¶
func (f *UniSwapFront) Winner(cc types.ContractLoader) common.Address
func (*UniSwapFront) WinnerFee ¶
func (f *UniSwapFront) WinnerFee(cc types.ContractLoader) uint64