fluidity

package
v0.0.0-...-07d62d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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 GetRewardPool(client *ethclient.Client, fluidityAddress ethCommon.Address) (*big.Rat, error)

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

func TryDecodeStakingEventData

func TryDecodeStakingEventData(l ethLogs.Log, wethPriceUsd *big.Rat) (ethereum.StakingEvent, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL