portaltokens

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Global instant to use

Functions

func ConvertIncPBNBAmountToExternalBNBAmount

func ConvertIncPBNBAmountToExternalBNBAmount(incPBNBAmount int64) int64

ConvertIncPBNBAmountToExternalBNBAmount converts amount in inc chain (decimal 9) to amount in bnb chain (decimal 8)

Types

type PortalBNBTokenProcessor

type PortalBNBTokenProcessor struct {
	*PortalTokenV3
}

func (PortalBNBTokenProcessor) GetChainID

func (p PortalBNBTokenProcessor) GetChainID() string

func (PortalBNBTokenProcessor) GetExpectedMemoForPorting

func (p PortalBNBTokenProcessor) GetExpectedMemoForPorting(portingID string) string

func (PortalBNBTokenProcessor) GetExpectedMemoForRedeem

func (p PortalBNBTokenProcessor) GetExpectedMemoForRedeem(redeemID string, custodianAddress string) string

func (PortalBNBTokenProcessor) GetMinTokenAmount

func (p PortalBNBTokenProcessor) GetMinTokenAmount() uint64

func (PortalBNBTokenProcessor) IsValidRemoteAddress

func (p PortalBNBTokenProcessor) IsValidRemoteAddress(address string, bcr metadata.ChainRetriever) (bool, error)

func (PortalBNBTokenProcessor) ParseAndVerifyProof

func (p PortalBNBTokenProcessor) ParseAndVerifyProof(
	proof string,
	bc metadata.ChainRetriever,
	expectedMemo string,
	expectedPaymentInfos map[string]uint64) (bool, error)

type PortalBTCTokenProcessor

type PortalBTCTokenProcessor struct {
	*PortalTokenV3
}

func (PortalBTCTokenProcessor) GetChainID

func (p PortalBTCTokenProcessor) GetChainID() string

func (PortalBTCTokenProcessor) GetExpectedMemoForPorting

func (p PortalBTCTokenProcessor) GetExpectedMemoForPorting(portingID string) string

func (PortalBTCTokenProcessor) GetExpectedMemoForRedeem

func (p PortalBTCTokenProcessor) GetExpectedMemoForRedeem(redeemID string, custodianIncAddress string) string

func (PortalBTCTokenProcessor) GetMinTokenAmount

func (p PortalBTCTokenProcessor) GetMinTokenAmount() uint64

func (PortalBTCTokenProcessor) IsValidRemoteAddress

func (p PortalBTCTokenProcessor) IsValidRemoteAddress(address string, bcr metadata.ChainRetriever) (bool, error)

func (PortalBTCTokenProcessor) ParseAndVerifyProof

func (p PortalBTCTokenProcessor) ParseAndVerifyProof(
	proof string, bc metadata.ChainRetriever, expectedMemo string, expectedPaymentInfos map[string]uint64) (bool, error)

type PortalTokenLoggerV3

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

func (*PortalTokenLoggerV3) Init

func (portalTokenLogger *PortalTokenLoggerV3) Init(inst common.Logger)

type PortalTokenProcessorV3

type PortalTokenProcessorV3 interface {
	IsValidRemoteAddress(address string, bcr metadata.ChainRetriever) (bool, error)
	GetChainID() string
	GetMinTokenAmount() uint64

	GetExpectedMemoForPorting(portingID string) string
	GetExpectedMemoForRedeem(redeemID string, custodianIncAddress string) string
	ParseAndVerifyProof(
		proof string, bc metadata.ChainRetriever, expectedMemo string, expectedPaymentInfos map[string]uint64) (bool, error)
}

type PortalTokenV3

type PortalTokenV3 struct {
	ChainID        string
	MinTokenAmount uint64 // minimum amount for porting/redeem
}

set MinTokenAmount to avoid attacking with amount is less than smallest unit of cryptocurrency such as satoshi in BTC

func (PortalTokenV3) GetExpectedMemoForPorting

func (p PortalTokenV3) GetExpectedMemoForPorting(portingID string) string

func (PortalTokenV3) GetExpectedMemoForRedeem

func (p PortalTokenV3) GetExpectedMemoForRedeem(redeemID string, custodianAddress string) string

Jump to

Keyboard shortcuts

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