lock_proxy

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCK_NAME               = "lock"
	UNLOCK_NAME             = "unlock"
	BIND_PROXY_NAME         = "bindProxy"
	BIND_ASSET_NAME         = "bindAsset"
	WITHDRAW_ONG_NAME       = "withdrawONG"
	GET_PROXY_HASH_NAME     = "getProxyHash"
	GET_ASSET_HASH_NAME     = "getAssetHash"
	GET_CROSSED_LIMIT_NAME  = "getCrossedLimit"
	GET_CROSSED_AMOUNT_NAME = "getCrossedAmount"

	TARGET_ASSET_HASH_PEFIX = "TargetAssetHash"
	CROSS_LIMIT_PREFIX      = "AssetCrossLimit"
	CROSS_AMOUNT_PREFIX     = "AssetCrossedAmount"
)

Variables

This section is empty.

Functions

func AddLockNotifications

func AddLockNotifications(native *native.NativeService, contract, sourceAssetAddress common.Address, toChainId uint64, toContract []byte, targetAssetHash []byte, fromAddress common.Address, toAddress []byte, amount uint64)

func AddUnLockNotifications

func AddUnLockNotifications(native *native.NativeService, contract common.Address, fromChainId uint64, fromProxyContract []byte, targetAssetHash common.Address, toAddress common.Address, amount uint64)

func BindAssetHash

func BindAssetHash(native *native.NativeService) ([]byte, error)

func BindProxyHash

func BindProxyHash(native *native.NativeService) ([]byte, error)

func GenBindAssetHashKey

func GenBindAssetHashKey(contract, assetContract common.Address, chainId uint64) []byte

func GenBindProxyKey

func GenBindProxyKey(contract common.Address, chainId uint64) []byte

func GenCrossedAmountKey

func GenCrossedAmountKey(contract, sourceContract common.Address, chainId uint64) []byte

func GenCrossedLimitKey

func GenCrossedLimitKey(contract, assetContract common.Address, chainId uint64) []byte

func GetAssetHash

func GetAssetHash(native *native.NativeService) ([]byte, error)

func GetCrossedAmount

func GetCrossedAmount(native *native.NativeService) ([]byte, error)

func GetCrossedLimit

func GetCrossedLimit(native *native.NativeService) ([]byte, error)

func GetProxyHash

func GetProxyHash(native *native.NativeService) ([]byte, error)

func InitLockProxy

func InitLockProxy()

func Lock

func Lock(native *native.NativeService) ([]byte, error)

func RegisterLockProxyContract

func RegisterLockProxyContract(native *native.NativeService)

func Unlock

func Unlock(native *native.NativeService) ([]byte, error)

func WithdrawONG

func WithdrawONG(native *native.NativeService) ([]byte, error)

Types

type Args

type Args struct {
	TargetAssetHash []byte // to contract asset hash
	ToAddress       []byte
	Value           uint64
}

Args for lock and unlock

func (*Args) Deserialization

func (this *Args) Deserialization(source *common.ZeroCopySource) error

func (*Args) Serialization

func (this *Args) Serialization(sink *common.ZeroCopySink)

type BindAssetParam

type BindAssetParam struct {
	SourceAssetHash    common.Address
	TargetChainId      uint64
	TargetAssetHash    []byte
	Limit              *big.Int
	IsTargetChainAsset bool
}

func (*BindAssetParam) Deserialization

func (this *BindAssetParam) Deserialization(source *common.ZeroCopySource) error

func (*BindAssetParam) Serialization

func (this *BindAssetParam) Serialization(sink *common.ZeroCopySink)

type BindProxyParam

type BindProxyParam struct {
	TargetChainId uint64
	TargetHash    []byte
}

func (*BindProxyParam) Deserialization

func (this *BindProxyParam) Deserialization(source *common.ZeroCopySource) error

func (*BindProxyParam) Serialization

func (this *BindProxyParam) Serialization(sink *common.ZeroCopySink)

type LockParam

type LockParam struct {
	SourceAssetHash common.Address
	FromAddress     common.Address
	ToChainID       uint64
	ToAddress       []byte
	Value           uint64
}

func (*LockParam) Deserialization

func (this *LockParam) Deserialization(source *common.ZeroCopySource) error

func (*LockParam) Serialization

func (this *LockParam) Serialization(sink *common.ZeroCopySink)

type UnlockParam

type UnlockParam struct {
	ArgsBs             []byte
	FromContractHashBs []byte
	FromChainId        uint64
}

func (*UnlockParam) Deserialization

func (this *UnlockParam) Deserialization(source *common.ZeroCopySource) error

func (*UnlockParam) Serialization

func (this *UnlockParam) Serialization(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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