smc

package
v0.0.0-...-24d451d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HASH_LEN = 32

Size of Hash is 32 bytes

View Source
const Max_Gas_Price = 1000000000

Define the maximum of gas price as one BCB (1,000,000,000 cong), GasBasePrice either.

View Source
const Max_Name_Len = 40

Size of

View Source
const PUBKEY_LEN = 32

Size of Hash is 32 bytes

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address = string

Address uses for Account, Contract,

type Chromo

type Chromo = string

type Error

type Error = bcerrors.BCError

type Hash

type Hash = common.HexBytes

Hash uses for public key and others, SHA3-256

func CalcReceiptHash

func CalcReceiptHash(name string, addr Address, receiptByte []byte) Hash

type PubKey

type PubKey = common.HexBytes

pubkey uses for public key and others, PubKeyEd25519

type Receipt

type Receipt struct {
	Name            string  `json:"name"`            //收据名称:标准名称(trnsfer,...) 非标准名称(...)
	ContractAddress Address `json:"contractAddress"` //事件发起方的合约地址
	ReceiptBytes    []byte  `json:"receiptBytes"`
	ReceiptHash     Hash    `json:"receiptHash"`
}

type ReceiptBytes

type ReceiptBytes []byte

Receipt for tx

func (ReceiptBytes) String

func (r ReceiptBytes) String() string

type ReceiptOfAddSupply

type ReceiptOfAddSupply struct {
	Token       Address `json:"token"`       // 代币地址
	Value       big.Int `json:"value"`       // 增发的供应量(单位:cong)
	TotalSupply big.Int `json:"totalSupply"` // 新的总供应量(单位:cong)
}

Name of receipt: AddSupply

type ReceiptOfBurn

type ReceiptOfBurn struct {
	Token       Address `json:"token"`       // 代币地址
	Value       big.Int `json:"value"`       // 燃烧的供应量(单位:cong)
	TotalSupply big.Int `json:"totalSupply"` // 新的总供应量(单位:cong)
}

Name of receipt: Burn

type ReceiptOfFee

type ReceiptOfFee struct {
	Token Address `json:"token"` // 代币地址
	From  Address `json:"from"`  // 支付手续费的账户地址
	Value uint64  `json:"value"` // 手续费(单位:cong)
}

Name of receipt: Fee

type ReceiptOfNewToken

type ReceiptOfNewToken struct {
	TokenAddress     Address `json:"tokenAddress"`     //代币的智能合约账户地址
	ContractAddress  Address `json:"contractAddress"`  //合约地址
	AccountAddress   Address `json:"accountAddress"`   //合约账户地址
	Owner            Address `json:"owner"`            //合约所有者的外部账户地址
	Version          string  `json:"version"`          //合约的版本
	Name             string  `json:"name,omitempty"`   //代币的名称
	Symbol           string  `json:"symbol"`           //代币的符号
	TotalSupply      big.Int `json:"totalSupply"`      //代币的总供应量
	AddSupplyEnabled bool    `json:"addSupplyEnabled"` //代币是否支持增发
	BurnEnabled      bool    `json:"burnEnabled"`      //代币是否支持燃烧
	GasPrice         uint64  `json:"gasprice"`         //代币燃料价格
}

type ReceiptOfSetGasPrice

type ReceiptOfSetGasPrice struct {
	Token    Address `json:"token"`    // 代币地址
	GasPrice uint64  `json:"gasPrice"` // 燃料价格(单位:cong)
}

Name of receipt: SetGasPrice

type ReceiptOfSetOwner

type ReceiptOfSetOwner struct {
	ContractAddr Address `json:"contractAddr"` // 智能合约地址
	NewOwner     Address `json:"newOwner"`     // 合约新的拥有者的外部账户地址
}

Name of receipt: SetOwner

type ReceiptOfTransfer

type ReceiptOfTransfer struct {
	Token Address `json:"token"` // Token Address
	From  Address `json:"from"`  // External account address of Sender
	To    Address `json:"to"`    // External account address of Receiver
	Value big.Int `json:"value"` // Transfer value
}

Receipt for transfer

Jump to

Keyboard shortcuts

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