contracts

package
v0.0.0-...-efdc0b2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DiscoveryNode = common.Utf8ToHex("discovery-node")
	ContentNode   = common.Utf8ToHex("content-node")
)

valid service types

View Source
var (
	RegistryKey               = common.Utf8ToHex("Registry")
	GovernanceKey             = common.Utf8ToHex("Governance")
	StakingKey                = common.Utf8ToHex("StakingProxy")
	ServiceProviderFactoryKey = common.Utf8ToHex("ServiceProviderFactory")
	ClaimsManagerKey          = common.Utf8ToHex("ClaimsManagerProxy")
	DelegateManagerKey        = common.Utf8ToHex("DelegateManager")
	AudiusTokenKey            = common.Utf8ToHex("Token")
	RewardsManagerKey         = common.Utf8ToHex("EthRewardsManagerProxy")
)

contract keys

Functions

func ServiceType

func ServiceType(nt config.NodeType) ([32]byte, error)

Types

type AudiusContracts

type AudiusContracts struct {
	Rpc *ethclient.Client

	/** contract addresses */
	RegistryAddress               *geth.Address
	GovernanceAddress             *geth.Address
	StakingAddress                *geth.Address
	ServiceProviderFactoryAddress *geth.Address
	ClaimsManagerAddress          *geth.Address
	DelegateManagerAddress        *geth.Address
	AudioTokenAddress             *geth.Address
	RewardsManagerAddress         *geth.Address
	ServiceTypeManagerAddress     *geth.Address

	/** contract instances */
	Registry               *gen.Registry
	Governance             *gen.Governance
	Staking                *gen.Staking
	ServiceProviderFactory *gen.ServiceProviderFactory
	ClaimsManager          *gen.ClaimsManager
	DelegateManager        *gen.DelegateManager
	AudioToken             *gen.AudiusToken
	RewardsManager         *gen.EthRewardsManager
	ServiceTypeManager     *gen.ServiceTypeManager
}

manager struct so contracts get loaded lazily upon usage and don't spam rpcs for contracts a developer may not need

func NewAudiusContracts

func NewAudiusContracts(rpc *ethclient.Client, registryAddress string) (*AudiusContracts, error)

instantiates audius contract manager so that contracts can be initialized lazily

func NewAudiusContractsInit

func NewAudiusContractsInit(rpc *ethclient.Client, registryAddress string) (*AudiusContracts, error)

instantiates audius contract manager and eagerly gathers contract instances as well

func (*AudiusContracts) GetAudioTokenContract

func (ac *AudiusContracts) GetAudioTokenContract() (*gen.AudiusToken, error)

func (*AudiusContracts) GetClaimsManagerContract

func (ac *AudiusContracts) GetClaimsManagerContract() (*gen.ClaimsManager, error)

func (*AudiusContracts) GetDelegateManagerContract

func (ac *AudiusContracts) GetDelegateManagerContract() (*gen.DelegateManager, error)

func (*AudiusContracts) GetGovernanceContract

func (ac *AudiusContracts) GetGovernanceContract() (*gen.Governance, error)

func (*AudiusContracts) GetRewardsManagerContract

func (ac *AudiusContracts) GetRewardsManagerContract() (*gen.EthRewardsManager, error)

func (*AudiusContracts) GetServiceProviderFactoryContract

func (ac *AudiusContracts) GetServiceProviderFactoryContract() (*gen.ServiceProviderFactory, error)

func (*AudiusContracts) GetServiceTypeManagerContract

func (ac *AudiusContracts) GetServiceTypeManagerContract() (*gen.ServiceTypeManager, error)

func (*AudiusContracts) GetStakingContract

func (ac *AudiusContracts) GetStakingContract() (*gen.Staking, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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