Documentation ¶
Index ¶
- Constants
- Variables
- func GetRewardPool(client *ethclient.Client, fluidityAddress ethCommon.Address) (*big.Rat, error)
- func GetUtilityVars(client *ethclient.Client, registryAddress, tokenAddress ethCommon.Address, ...) ([]worker.UtilityVars, error)
- func TransactBatchReward(client *ethclient.Client, executorAddress, tokenAddress ethCommon.Address, ...) (*ethTypes.Transaction, error)
- func TransactLpRewards(tokens map[applications.UtilityName]ethCommon.Address, ...) (*ethTypes.Transaction, error)
- func TransactTransfer(client *ethclient.Client, ...) (*ethTypes.Transaction, error)
- func TryDecodeStakingEventData(l ethLogs.Log, wethPriceUsd *big.Rat) (ethereum.StakingEvent, error)
- type RewardData
- type TestnetOwnerPair
- type UnblockedRewardData
Constants ¶
View Source
const ( UsdcDecimals = 6 FusdcDecimals = 6 WethDecimals = 18 )
View Source
const ( WinningClasses = 5 DeltaWeightNum = int64(31536000) DeltaWeightDenom = int64(1) PayoutFreqNum = int64(1) PayoutFreqDenom = int64(4) )
Variables ¶
View Source
var ( FluidityContractAbi ethAbi.ABI ExecutorAbi ethAbi.ABI RegistryAbi ethAbi.ABI RewardPoolAbi ethAbi.ABI StakingAbi ethAbi.ABI )
View Source
var ErrWrongEvent = fmt.Errorf("event signature doesn't match")
View Source
var ManualRewardArguments = ethAbi.Arguments{
ethAbiMustArgument("contract", "address"),
ethAbiMustArgument("chainid", "uint256"),
ethAbiMustArgument("winner", "address"),
ethAbiMustArgument("win_amount", "uint256"),
ethAbiMustArgument("first_block", "uint256"),
ethAbiMustArgument("last_block", "uint256"),
}
Functions ¶
func GetRewardPool ¶
func GetUtilityVars ¶
func GetUtilityVars(client *ethclient.Client, registryAddress, tokenAddress ethCommon.Address, fluidityClients []applications.UtilityName) ([]worker.UtilityVars, error)
GetUtilityVars from a list of utilities, returning if any failed
func TransactBatchReward ¶
func TransactBatchReward(client *ethclient.Client, executorAddress, tokenAddress ethCommon.Address, transactionOptions *ethAbiBind.TransactOpts, announcement typesWorker.EthereumSpooledRewards) (*ethTypes.Transaction, error)
func TransactLpRewards ¶
func TransactLpRewards(tokens map[applications.UtilityName]ethCommon.Address, client *ethclient.Client, executorAddress, tokenAddress ethCommon.Address, transactionOptions *ethAbiBind.TransactOpts, announcement typesWorker.EthereumSpooledLpRewards) (*ethTypes.Transaction, error)
func TransactTransfer ¶
func TransactTransfer(client *ethclient.Client, fluidityContractAddress, recipientAddress ethCommon.Address, amount *big.Int, transactionOptions *ethAbiBind.TransactOpts) (*ethTypes.Transaction, error)
TransactTransfer using the transfer function in the contract, send to the address with the amount given
Types ¶
type RewardData ¶
type RewardData struct { Blocked bool TokenDetails token_details.TokenDetails Winner ethCommon.Address Amount *misc.BigInt StartBlock *misc.BigInt EndBlock *misc.BigInt }
func TryDecodeRewardData ¶
func TryDecodeRewardData(log typesEth.Log, token token_details.TokenDetails) (RewardData, error)
type TestnetOwnerPair ¶
type TestnetOwnerPair struct { // Owner for the address that owns TestnetAddress Owner ethereum.Address // TestnetAddress for the testnet address used on Ropsten TestnetAddress ethereum.Address }
func TryDecodeAddressConfirmed ¶
func TryDecodeAddressConfirmed(log ethLogs.Log) (TestnetOwnerPair, error)
TryDecodeAddressConfirmed to decode ownership confirmation of a testnet address
type UnblockedRewardData ¶
type UnblockedRewardData struct { RewardData RewardData OriginalRewardHash ethCommon.Hash }
func TryDecodeUnblockedRewardData ¶
func TryDecodeUnblockedRewardData(log typesEth.Log, token token_details.TokenDetails) (UnblockedRewardData, error)
Click to show internal directories.
Click to hide internal directories.