zcnbridge

package
v1.3.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 22 Imported by: 1

README

Implementation

Required

  1. Transaction entity to create transaction
  2. HTTP Client setup to make requests to the chain (miners and sharders)
  3. Wallet setup to be able to register in the chain to sign transaction

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultClientIDEncoder = func(id string) []byte {
		return []byte(id)
	}
)

Functions

func AddPercents

func AddPercents(gasLimitUnits uint64, percents int) *big.Int

func BurnWZCN

func BurnWZCN(ctx context.Context, amountTokens int64) (*types.Transaction, error)

BurnWZCN Burns WZCN tokens on behalf of the 0ZCN client amountTokens - ZCN tokens clientID - 0ZCN client ERC20 signature: "burn(uint256,bytes)"

func BurnZCN

func BurnZCN(ctx context.Context, value int64) (*transaction.Transaction, error)

func ConfirmEthereumTransaction

func ConfirmEthereumTransaction(hash string, times int, duration time.Duration) (int, error)

func GetTransactionStatus

func GetTransactionStatus(hash string) (int, error)

func IncreaseBurnerAllowance

func IncreaseBurnerAllowance(ctx context.Context, amountWei wei) (*types.Transaction, error)

IncreaseBurnerAllowance Increases allowance for bridge contract address to transfer WZCN tokens on behalf of the token owner to the Burn TokenPool During the burn the script transfers amount from token owner to the bridge burn token pool Example: owner wants to burn some amount. The contract will transfer some amount from owner address to the pool. So the owner must call IncreaseAllowance of the WZCN token with 2 parameters: spender address which is the bridge contract and amount to be burned (transferred) ERC20 signature: "increaseAllowance(address,uint256)"

func InitBridge

func InitBridge()

InitBridge Sets up the wallet and node Wallet setup reads keys from keyfile and registers in the 0chain

func MintWZCN

func MintWZCN(ctx context.Context, amountTokens wei, payload *ethereum.MintPayload) (*types.Transaction, error)

MintWZCN Mint ZCN tokens on behalf of the 0ZCN client amountTokens: ZCN tokens payload: received from authorizers

func MintZCN

func MintZCN(ctx context.Context, payload *zcnsc.MintPayload) (*transaction.Transaction, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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