Documentation
¶
Overview ¶
package erc20reward implements a meta extension that manages all rewards on a Kwil network. It is used to create other extensions with which users can distribute erc20 tokens to users. It works by exposing an action to the DB owner which allows creation of new extensions for specific erc20s. When the action is called, it starts event listeners which sync information about the escrow contract, erc20, and multisig from the EVM chain. When an extension is in this state, we consider it "pending". Once synced, the extension is no longer "pending", but instead ready. At this point, users can access the extension's namespace to distribute rewards. Internally, the node will start another event listener which is responsible for tracking the erc20's Transfer event. When a transfer event is detected, the node will update the reward balance of the recipient.
Index ¶
Constants ¶
const (
RewardMetaExtensionName = "kwil_erc20_meta"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Epoch ¶
type Epoch struct { PendingEpoch EndHeight *int64 // nil if not finalized Root []byte // merkle root of all rewards, nil if not finalized Total *types.Decimal BlockHash []byte // hash of the block that finalized the epoch, nil if not finalized Confirmed bool EpochVoteInfo }
Epoch is a period in which rewards are distributed.
type EpochReward ¶
EpochReward is a reward given to a user within an epoch