bridges

package
v0.72.12 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAnERC20Asset                     = errors.New("not an erc20 asset")
	ErrUnableToFindERC20AssetList          = errors.New("unable to find erc20 asset list event")
	ErrUnableToFindERC20BridgeStopped      = errors.New("unable to find erc20 bridge stopped event")
	ErrUnableToFindERC20BridgeResumed      = errors.New("unable to find erc20 bridge resumed event")
	ErrUnableToFindERC20Deposit            = errors.New("unable to find erc20 asset deposit")
	ErrUnableToFindERC20Withdrawal         = errors.New("unabled to find erc20 asset withdrawal")
	ErrUnableToFindERC20AssetLimitsUpdated = errors.New("unable to find erc20 asset limits update event")
)

Functions

This section is empty.

Types

type Bytes

type Bytes []byte

func (Bytes) Bytes

func (b Bytes) Bytes() []byte

func (Bytes) Hex

func (b Bytes) Hex() string

type ERC20AssetPool

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

func NewERC20AssetPool

func NewERC20AssetPool(signer Signer, poolAddr string) *ERC20AssetPool

func (ERC20AssetPool) SetBridgeAddress

func (e ERC20AssetPool) SetBridgeAddress(
	newAddress string,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20AssetPool) SetMultiSigControl

func (e ERC20AssetPool) SetMultiSigControl(
	newAddress string,
	nonce *num.Uint,
) (*SignaturePayload, error)

type ERC20Logic

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

ERC20Logic yea that's a weird name but it just matches the name of the contract.

func NewERC20Logic

func NewERC20Logic(signer Signer, bridgeAddr string) *ERC20Logic

func (ERC20Logic) GlobalResume

func (e ERC20Logic) GlobalResume(
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) GlobalStop

func (e ERC20Logic) GlobalStop(
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) ListAsset

func (e ERC20Logic) ListAsset(
	tokenAddress string,
	vegaAssetID string,
	lifetimeLimit *num.Uint,
	withdrawThreshold *num.Uint,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) RemoveAsset

func (e ERC20Logic) RemoveAsset(
	tokenAddress string,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) SetAssetLimits

func (e ERC20Logic) SetAssetLimits(
	tokenAddress string,
	lifetimeLimit *num.Uint,
	withdrawThreshold *num.Uint,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) SetWithdrawDelay

func (e ERC20Logic) SetWithdrawDelay(
	delay time.Duration,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (ERC20Logic) VerifyGlobalResume added in v0.72.0

func (e ERC20Logic) VerifyGlobalResume(
	nonce *num.Uint,
	signatures string,
) ([]string, error)

func (ERC20Logic) VerifyListAsset added in v0.72.0

func (e ERC20Logic) VerifyListAsset(
	tokenAddress string,
	vegaAssetID string,
	lifetimeLimit *num.Uint,
	withdrawThreshold *num.Uint,
	nonce *num.Uint,
	signatures string,
) ([]string, error)

func (ERC20Logic) VerifySetAssetLimits added in v0.72.0

func (e ERC20Logic) VerifySetAssetLimits(
	tokenAddress string,
	lifetimeLimit *num.Uint,
	withdrawThreshold *num.Uint,
	nonce *num.Uint,
	signatures string,
) ([]string, error)

func (ERC20Logic) VerifyWithdrawAsset added in v0.72.0

func (e ERC20Logic) VerifyWithdrawAsset(
	tokenAddress string,
	amount *num.Uint,
	ethPartyAddress string,
	creation time.Time,
	nonce *num.Uint,
	signatures string,
) ([]string, error)

func (ERC20Logic) VerifyWithdrawDelay added in v0.72.0

func (e ERC20Logic) VerifyWithdrawDelay(
	delay time.Duration,
	nonce *num.Uint,
	signatures string,
) ([]string, error)

func (ERC20Logic) WithdrawAsset

func (e ERC20Logic) WithdrawAsset(
	tokenAddress string,
	amount *num.Uint,
	ethPartyAddress string,
	creation time.Time,
	nonce *num.Uint,
) (*SignaturePayload, error)

type ERC20LogicView

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

ERC20Logic yea that's a weird name but it just matches the name of the contract.

func NewERC20LogicView

func NewERC20LogicView(
	clt ETHClient,
	ethConfs EthConfirmations,
) *ERC20LogicView

func (*ERC20LogicView) FindAsset

func (e *ERC20LogicView) FindAsset(
	asset *types.AssetDetails,
) error

FindAsset will try to find an asset and validate it's details on ethereum.

func (*ERC20LogicView) FindAssetLimitsUpdated

func (e *ERC20LogicView) FindAssetLimitsUpdated(
	update *types.ERC20AssetLimitsUpdated,
	blockNumber uint64, logIndex uint64,
	ethAssetAddress string,
	txHash string,
) error

func (*ERC20LogicView) FindAssetList

func (e *ERC20LogicView) FindAssetList(
	al *types.ERC20AssetList,
	blockNumber,
	logIndex uint64,
	txHash string,
) error

FindAssetList will look at the ethereum logs and try to find the given transaction.

func (*ERC20LogicView) FindBridgeResumed

func (e *ERC20LogicView) FindBridgeResumed(
	al *types.ERC20EventBridgeResumed,
	blockNumber,
	logIndex uint64,
	txHash string,
) error

FindBridgeResumed will look at the ethereum logs and try to find the given transaction.

func (*ERC20LogicView) FindBridgeStopped

func (e *ERC20LogicView) FindBridgeStopped(
	al *types.ERC20EventBridgeStopped,
	blockNumber,
	logIndex uint64,
	txHash string,
) error

FindBridgeStopped will look at the ethereum logs and try to find the given transaction.

func (*ERC20LogicView) FindDeposit

func (e *ERC20LogicView) FindDeposit(
	d *types.ERC20Deposit,
	blockNumber, logIndex uint64,
	ethAssetAddress string,
	txHash string,
) error

func (*ERC20LogicView) FindWithdrawal

func (e *ERC20LogicView) FindWithdrawal(
	w *types.ERC20Withdrawal,
	blockNumber, logIndex uint64,
	ethAssetAddress string,
	txHash string,
) (*big.Int, string, uint, error)

type ERC20MultiSigControl

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

func NewERC20MultiSigControl

func NewERC20MultiSigControl(signer Signer) *ERC20MultiSigControl

func (*ERC20MultiSigControl) AddSigner

func (e *ERC20MultiSigControl) AddSigner(
	newSigner, submitter string,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (*ERC20MultiSigControl) BurnNonce

func (e *ERC20MultiSigControl) BurnNonce(
	submitter string,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (*ERC20MultiSigControl) RemoveSigner

func (e *ERC20MultiSigControl) RemoveSigner(
	oldSigner, submitter string,
	nonce *num.Uint,
) (*SignaturePayload, error)

func (*ERC20MultiSigControl) SetThreshold

func (e *ERC20MultiSigControl) SetThreshold(
	newThreshold uint16,
	submitter string,
	nonce *num.Uint,
) (*SignaturePayload, error)

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
}

type EthConfirmations

type EthConfirmations interface {
	Check(uint64) error
}

type SignaturePayload

type SignaturePayload struct {
	Message   Bytes
	Signature Bytes
}

type Signer

type Signer interface {
	Sign([]byte) ([]byte, error)
	Algo() string
}

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