utils

package
v0.0.0-...-e30b66f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGasLimit = 6721975
View Source
const DefaultMaxGasPrice = 20000000000

Variables

View Source
var ExpectedBlockTime = time.Second
View Source
var Max, _ = new(big.Int).SetString("100000000000000000000000000000", 10)

Functions

func DeployMintableSrc20

func DeployMintableSrc20(client *Client, src20Handler common.Address, cy string) (common.Address, error)

DeployMintAndApprove deploys a new erc20 contract, mints to the deployer, and approves the erc20 handler to transfer those token.

func GenTransactor

func GenTransactor(kp *secp256k1.Keypair) *bind.TransactOpts

func GetDepositNonce

func GetDepositNonce(client *Client, bridge seroCommon.Address, chain types.ChainId) (uint64, error)

func IsActive

func IsActive(status uint8) bool

func IsExecuted

func IsExecuted(status uint8) bool

func IsPassed

func IsPassed(status uint8) bool

func RegisterResource

func RegisterResource(client *Client, bridge, handler seroCommon.Address, rId types.ResourceId, cy string, min *big.Int) error

func SetResoruceTokenAddress

func SetResoruceTokenAddress(client *Client, bridge, handler seroCommon.Address, rId types.ResourceId, addr seroCommon.Address) error

func WaitForTx

func WaitForTx(client *Client, tx *serotypes.Transaction) error

WaitForTx will query the chain at ExpectedBlockTime intervals, until a receipt is returned. Returns an error if the tx failed.

Types

type Client

type Client struct {
	Client   *sero.WrappedClient
	Opts     *bind.TransactOpts
	CallOpts *bind.CallOpts
	// contains filtered or unexported fields
}

func NewClient

func NewClient(geroEndpoint string, accountEndpoint string, kp *secp256k1.Keypair) (*Client, error)

type DeployedContracts

type DeployedContracts struct {
	BridgeAddress            seroCommon.Address
	SRC20HandlerAddress      seroCommon.Address
	SignatureColletorContact seroCommon.Address
}

func DeployContracts

func DeployContracts(client *Client, chainID uint8, initialRelayerThreshold *big.Int) (*DeployedContracts, error)

DeployContracts deploys Bridge, Relayer, ERC20Handler, ERC721Handler and CentrifugeAssetHandler and returns the addresses

type EventSig

type EventSig string
const (
	Deposit           EventSig = "Deposit(uint8,bytes32,uint64)"
	ProposalEvent     EventSig = "ProposalEvent(uint8,uint64,uint8,bytes32,bytes32)"
	SignProposalEvent EventSig = "SignProposalEvent(uint8,uint8,uint64,uint8,uint8)"
)

func (EventSig) GetTopic

func (es EventSig) GetTopic() (ret common.Hash)

type ProposalStatus

type ProposalStatus int
const (
	Inactive ProposalStatus = iota
	Active
	Passed
	Executed
	Cancelled
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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