Documentation
¶
Overview ¶
Package signersvc implements the SignerSvc of the Kwil reward system. It simply fetches the new Epoch from Kwil network and verify&sign it, then upload the signature back to the Kwil network. Each bridgeSigner targets one registered erc20 Reward instance.
Index ¶
- Constants
- Variables
- func Aggregate3(ctx context.Context, chainID uint64, calls []abigen.Multicall3Call3, ...) ([]*abigen.Multicall3Result, error)
- func IsMulticall3Deployed(chainID uint64, blockNumber *big.Int) bool
- func NewSignerClient(chainID string, db DB, call engineCall, bcast txBcast, nodeApp nodeApp) *signerClient
- func StateFilePath(dir string) string
- func ToSlicePtr[T any](collection []T) []*T
- type DB
- type Epoch
- type EpochReward
- type RewardInstanceInfo
- type Safe
- type ServiceMgr
- type State
Constants ¶
View Source
const ( EthNetworkMainnet = 1 EthNetworkSepolia = 11155111 )
Variables ¶
View Source
var (
AddressMulticall3 = common.HexToAddress("0xcA11bde05977b3631167028862bE2a173976CA11")
)
Functions ¶
func Aggregate3 ¶
func Aggregate3(ctx context.Context, chainID uint64, calls []abigen.Multicall3Call3, blockNumber *big.Int, contractBackend bind.ContractCaller) ([]*abigen.Multicall3Result, error)
Aggregate3 aggregates multicall result. based on https://github.com/RSS3-Network/Node/blob/947b387f11857144c48250dd95804b5069731153/provider/ethereum/contract/multicall3/contract.go
func NewSignerClient ¶
func ToSlicePtr ¶
func ToSlicePtr[T any](collection []T) []*T
Types ¶
type DB ¶
type DB interface { sql.ReadTxMaker sql.DelayedReadTxMaker }
type EpochReward ¶
type RewardInstanceInfo ¶
type ServiceMgr ¶
type ServiceMgr struct {
// contains filtered or unexported fields
}
ServiceMgr manages multiple bridgeSigner instances running in parallel.
func NewServiceMgr ¶
func NewServiceMgr( chainID string, db DB, call engineCall, bcast txBcast, nodeApp nodeApp, cfg config.ERC20BridgeConfig, state *State, logger log.Logger) *ServiceMgr
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is a naive kv impl used by bridgeSigner.
func LoadStateFromFile ¶
LoadStateFromFile load the state from a file.
func NewMemState ¶
func NewMemState() *State
func NewTmpState ¶
func NewTmpState() *State
func (*State) UpdateLastVote ¶
UpdateLastVote updates the latest vote record, and syncs the changes to disk.
Click to show internal directories.
Click to hide internal directories.