contracts

package
v0.0.0-...-1df7544 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWhiteInfo

func GetWhiteInfo() (wList, wFunc []common.Hash)

GetWhiteInfo return White Functions

func GetWhiteListCommonHash

func GetWhiteListCommonHash(callerAddress common.Address) common.Hash

GetWhiteListCommonHash returns white list contract code hash

func IsInWhiteList

func IsInWhiteList(evm *vm.EVM, callerAddress common.Address) bool

func IsSystemCaller

func IsSystemCaller(caller vm.ContractRef) (ret bool)

func IsWhiteListCall

func IsWhiteListCall(addr common.Address, data []byte) bool

func PrintWhiteList

func PrintWhiteList(evm *vm.EVM, callerAddress common.Address)

PrintWhiteList prints WhiteList

Types

type PrecompiledContract

type PrecompiledContract interface {
	RequiredGas(input []byte) uint64                                                    // RequiredPrice calculates the contract gas use
	Run(evm *vm.EVM, snapshot int, contract *vm.Contract, input []byte) ([]byte, error) // Run runs the precompiled contract
}

PrecompiledContract is the basic interface for native Go contracts. The implementation requires a deterministic gas count based on the input size of the Run method of the contract.

type PrecompiledContracts

type PrecompiledContracts struct {
}

func GetInstance

func GetInstance() *PrecompiledContracts

Singleton

func (*PrecompiledContracts) IsSystemCaller

func (pc *PrecompiledContracts) IsSystemCaller(caller vm.ContractRef) (ret bool)

func (*PrecompiledContracts) PrecompiledContractsByBlock

func (pc *PrecompiledContracts) PrecompiledContractsByBlock(blockNumber *big.Int, chainConfig *params.ChainConfig) map[common.Address]vm.PrecompiledContract

func (*PrecompiledContracts) PrecompiledContractsByzantium

func (pc *PrecompiledContracts) PrecompiledContractsByzantium() map[common.Address]vm.PrecompiledContract

func (*PrecompiledContracts) PrecompiledContractsFuxi

func (pc *PrecompiledContracts) PrecompiledContractsFuxi() map[common.Address]vm.PrecompiledContract

func (*PrecompiledContracts) PrecompiledContractsPangu

func (pc *PrecompiledContracts) PrecompiledContractsPangu() map[common.Address]vm.PrecompiledContract

func (*PrecompiledContracts) RunPrecompiledContract

func (pc *PrecompiledContracts) RunPrecompiledContract(evm *vm.EVM, snapshot int, p vm.PrecompiledContract, input []byte, contract *vm.Contract, hash *common.Hash) (ret []byte, err error)

RunPrecompiledContract runs and evaluates the output of a precompiled contract.

func (*PrecompiledContracts) SystemCntEntry

func (pc *PrecompiledContracts) SystemCntEntry() int

func (*PrecompiledContracts) SystemContractCallAddr

func (pc *PrecompiledContracts) SystemContractCallAddr() common.Address

func (*PrecompiledContracts) SystemContractEntryAddr

func (pc *PrecompiledContracts) SystemContractEntryAddr(num *big.Int) common.Address

func (*PrecompiledContracts) WhiteListCallAddr

func (pc *PrecompiledContracts) WhiteListCallAddr() common.Address

Jump to

Keyboard shortcuts

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