erc20

package
v0.0.0-...-141c82c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnableToFindDeposit                 = errors.New("unable to find erc20 deposit event")
	ErrUnableToFindWithdrawal              = errors.New("unable to find erc20 withdrawal event")
	ErrUnableToFindERC20AssetList          = errors.New("unable to find erc20 asset list event")
	ErrUnableToFindERC20AssetLimitsUpdated = errors.New("unable to find ERC20 asset limits updated event")
	ErrMissingConfirmations                = errors.New("missing confirmation from ethereum")
	ErrNotAnErc20Asset                     = errors.New("not an erc20 asset")
)

Functions

This section is empty.

Types

type ERC20

type ERC20 struct {
	// contains filtered or unexported fields
}

func New

func New(
	id string,
	asset *types.AssetDetails,
	w *ethnw.Wallet,
	ethClient ETHClient,
) (*ERC20, error)

func (*ERC20) Address

func (e *ERC20) Address() string

func (*ERC20) GetAssetClass

func (e *ERC20) GetAssetClass() common.AssetClass

func (*ERC20) IsValid

func (e *ERC20) IsValid() bool

func (*ERC20) ProtoAsset

func (e *ERC20) ProtoAsset() *typespb.Asset

func (*ERC20) SetEnabled

func (e *ERC20) SetEnabled()

func (*ERC20) SetPendingListing

func (e *ERC20) SetPendingListing()

func (*ERC20) SetRejected

func (e *ERC20) SetRejected()

func (*ERC20) SetValid

func (e *ERC20) SetValid()

func (*ERC20) SignListAsset

func (e *ERC20) SignListAsset() (msg []byte, sig []byte, err error)

SignListAsset create and sign the message to be sent to the bridge to whitelist the asset return the generated message and the signature for this message.

func (*ERC20) SignSetAssetLimits

func (e *ERC20) SignSetAssetLimits(nonce *num.Uint, lifetimeLimit *num.Uint, withdrawThreshold *num.Uint) (msg []byte, sig []byte, err error)

func (*ERC20) SignWithdrawal

func (e *ERC20) SignWithdrawal(
	amount *num.Uint,
	ethPartyAddress string,
	withdrawRef *big.Int,
	now time.Time,
) (msg []byte, sig []byte, err error)

func (*ERC20) String

func (e *ERC20) String() string

func (ERC20) Type

func (e ERC20) Type() *types.Asset

func (*ERC20) Update

func (e *ERC20) Update(updatedAsset *types.Asset)

type ETHClient

type ETHClient interface {
	bind.ContractBackend
	HeaderByNumber(context.Context, *big.Int) (*ethtypes.Header, error)
	CollateralBridgeAddress() ethcommon.Address
	CurrentHeight(context.Context) (uint64, error)
	ConfirmationsRequired() uint64
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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