bcrp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BCRP bytom contract register protocol
	BCRP = "bcrp"
	// Version bcrp version
	Version = 1
)

Variables

This section is empty.

Functions

func IsBCRPScript

func IsBCRPScript(prog []byte) bool

IsBCRPScript checks if a control program is bytom contract register protocol BCRP script format: OP_FAIL + OP_DATA_4 + "bcrp" + OP_DATA_1 + "1" + {{dynamic_op}} + contract 0 < len(contract) <= 75 dynamic_op -> OP_DATA_N 75 <len(contract) < 256 dynamic_op -> OP_PUSHDATA1 256 <= len(contract) < 65536 dynamic_op -> OP_PUSHDATA2 len(contract) >= 65536 dynamic_op -> OP_PUSHDATA4

func IsCallContractScript

func IsCallContractScript(prog []byte) bool

IsCallContractScript checks if a program is script call contract registered by BCRP call contract script format: OP_DATA_4 + "bcrp"+ OP_DATA_32 + SHA3-256(contract)

func ParseContract

func ParseContract(prog []byte) ([]byte, error)

ParseContract parse contract from BCRP script BCRP script format: OP_FAIL + OP_DATA_4 + "bcrp" + OP_DATA_1 + "1" + {{dynamic_op}} + contract

func ParseContractHash

func ParseContractHash(prog []byte) ([32]byte, error)

ParseContractHash parse contract hash from call BCRP script call contract script format: OP_DATA_4 + "bcrp"+ OP_DATA_32 + SHA3-256(contract)

Types

This section is empty.

Jump to

Keyboard shortcuts

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