erc20

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var 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.EthereumWallet,
	ethClient ETHClient,
) (*ERC20, error)

func (*ERC20) Address

func (e *ERC20) Address() string

func (ERC20) ChainID added in v0.76.0

func (e ERC20) ChainID() 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) SetChainID added in v0.76.0

func (e *ERC20) SetChainID(chainID string)

SetChainID sets the chain-id on the ERC20. This should only be used during the migration from 0.75.

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
	ChainID(ctx context.Context) (*big.Int, error)
	IsEthereum() bool
}

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