Versions in this module Expand all Collapse all v1 v1.0.2 May 6, 2019 v1.0.1 Apr 26, 2019 v1.0.0 Apr 25, 2019 Changes in this version + const FineTypeFailStop + const FineTypeFailStopDKG + const FineTypeForkBlock + const FineTypeForkVote + const FineTypeInvalidDKG + const GasContractByte + const GasExtStep + const GasFastStep + const GasFastestStep + const GasMidStep + const GasQuickStep + const GasReturn + const GasSlowStep + const GasStop + const GovernanceABIJSON + const GovernanceActionGasCost + var ErrCodeStoreOutOfGas = errors.New("contract creation code storage out of gas") + var ErrContractAddressCollision = errors.New("contract address collision") + var ErrDepth = errors.New("max call depth exceeded") + var ErrInsufficientBalance = errors.New("insufficient balance for transfer") + var ErrNoCompatibleInterpreter = errors.New("no compatible interpreter") + var ErrOutOfGas = errors.New("out of gas") + var ErrTraceLimitReached = errors.New("the number of logs reached the specified limit") + var GovernanceContractAddress = common.HexToAddress("63751838d6485578b23e8b051d40861ecc416794") + var OracleContracts = map[common.Address]func() OracleContract + var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract + var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract + func IdToAddress(id coreTypes.NodeID) common.Address + func PackAddDKGComplaint(complaint *dkgTypes.Complaint) ([]byte, error) + func PackAddDKGFinalize(final *dkgTypes.Finalize) ([]byte, error) + func PackAddDKGMPKReady(ready *dkgTypes.MPKReady) ([]byte, error) + func PackAddDKGMasterPublicKey(mpk *dkgTypes.MasterPublicKey) ([]byte, error) + func PackAddDKGSuccess(final *dkgTypes.Success) ([]byte, error) + func PackProposeCRS(round uint64, signedCRS []byte) ([]byte, error) + func PackReportForkBlock(block1, block2 *coreTypes.Block) ([]byte, error) + func PackReportForkVote(vote1, vote2 *coreTypes.Vote) ([]byte, error) + func PackResetDKG(newSignedCRS []byte) ([]byte, error) + func RunOracleContract(oracle OracleContract, evm *EVM, input []byte, contract *Contract) (ret []byte, err error) + func RunPrecompiledContract(p PrecompiledContract, input []byte, contract *Contract) (ret []byte, err error) + func WriteLogs(writer io.Writer, logs []*types.Log) + func WriteTrace(writer io.Writer, logs []StructLog) + type AccountRef common.Address + func (ar AccountRef) Address() common.Address + type Bytes32 [32]byte + type CallContext interface + Call func(env *EVM, me ContractRef, addr common.Address, data []byte, ...) ([]byte, error) + CallCode func(env *EVM, me ContractRef, addr common.Address, data []byte, ...) ([]byte, error) + Create func(env *EVM, me ContractRef, data []byte, gas, value *big.Int) ([]byte, common.Address, error) + DelegateCall func(env *EVM, me ContractRef, addr common.Address, data []byte, gas *big.Int) ([]byte, error) + type CanTransferFunc func(StateDB, common.Address, *big.Int) bool + type Config struct + Debug bool + EVMInterpreter string + EWASMInterpreter string + EnablePreimageRecording bool + IsBlockProposer bool + JumpTable [256]operation + NoRecursion bool + Tracer Tracer + type Context struct + BlockNumber *big.Int + CanTransfer CanTransferFunc + Coinbase common.Address + Difficulty *big.Int + GasLimit uint64 + GasPrice *big.Int + GetHash GetHashFunc + GetRoundHeight GetRoundHeightFunc + Origin common.Address + RandCallIndex uint64 + Randomness []byte + Round *big.Int + StateAtNumber StateAtNumberFunc + Time *big.Int + Transfer TransferFunc + type Contract struct + CallerAddress common.Address + Code []byte + CodeAddr *common.Address + CodeHash common.Hash + Gas uint64 + Input []byte + func NewContract(caller ContractRef, object ContractRef, value *big.Int, gas uint64) *Contract + func (c *Contract) Address() common.Address + func (c *Contract) AsDelegate() *Contract + func (c *Contract) Caller() common.Address + func (c *Contract) GetByte(n uint64) byte + func (c *Contract) GetOp(n uint64) OpCode + func (c *Contract) SetCallCode(addr *common.Address, hash common.Hash, code []byte) + func (c *Contract) SetCodeOptionalHash(addr *common.Address, codeAndHash *codeAndHash) + func (c *Contract) UseGas(gas uint64) (ok bool) + func (c *Contract) Value() *big.Int + type ContractRef interface + Address func() common.Address + type EVM struct + StateDB StateDB + func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmConfig Config) *EVM + func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, ...) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte, gas uint64, ...) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) Cancel() + func (evm *EVM) ChainConfig() *params.ChainConfig + func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) + func (evm *EVM) Create2(caller ContractRef, code []byte, gas uint64, endowment *big.Int, salt *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) + func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) Interpreter() Interpreter + func (evm *EVM) IsBlockProposer() bool + func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error) + type EVMInterpreter struct + func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter + func (in *EVMInterpreter) CanRun(code []byte) bool + func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) + type FineType uint64 + type GetHashFunc func(uint64) common.Hash + type GetRoundHeightFunc func(uint64) (uint64, bool) + type GovernanceContract struct + func (g *GovernanceContract) Address() common.Address + func (g *GovernanceContract) Run(evm *EVM, input []byte, contract *Contract) (ret []byte, err error) + type GovernanceState struct + StateDB StateDB + func (s *GovernanceState) BlockGasLimit() *big.Int + func (s *GovernanceState) CRS() common.Hash + func (s *GovernanceState) CRSRound() *big.Int + func (s *GovernanceState) CalNotarySetSize() + func (s *GovernanceState) ClearDKGComplaintProposed() + func (s *GovernanceState) ClearDKGComplaints() + func (s *GovernanceState) ClearDKGFinalizeds(dkgSet map[coreTypes.NodeID]struct{}) + func (s *GovernanceState) ClearDKGMPKReadys(notarySet map[coreTypes.NodeID]struct{}) + func (s *GovernanceState) ClearDKGMasterPublicKeyOffset() + func (s *GovernanceState) ClearDKGMasterPublicKeys() + func (s *GovernanceState) ClearDKGSuccesses(dkgSet map[coreTypes.NodeID]struct{}) + func (s *GovernanceState) Configuration() *params.DexconConfig + func (s *GovernanceState) DKGComplaint(offset *big.Int) []byte + func (s *GovernanceState) DKGComplaintItems() []*dkgTypes.Complaint + func (s *GovernanceState) DKGComplaintProposed(id Bytes32) bool + func (s *GovernanceState) DKGComplaints() [][]byte + func (s *GovernanceState) DKGFinalized(addr common.Address) bool + func (s *GovernanceState) DKGFinalizedsCount() *big.Int + func (s *GovernanceState) DKGMPKReady(addr common.Address) bool + func (s *GovernanceState) DKGMPKReadysCount() *big.Int + func (s *GovernanceState) DKGMasterPublicKey(offset *big.Int) []byte + func (s *GovernanceState) DKGMasterPublicKeyItem(offset *big.Int) *dkgTypes.MasterPublicKey + func (s *GovernanceState) DKGMasterPublicKeyItems() []*dkgTypes.MasterPublicKey + func (s *GovernanceState) DKGMasterPublicKeyOffset(id Bytes32) *big.Int + func (s *GovernanceState) DKGMasterPublicKeys() [][]byte + func (s *GovernanceState) DKGResetCount(round *big.Int) *big.Int + func (s *GovernanceState) DKGRound() *big.Int + func (s *GovernanceState) DKGSuccess(addr common.Address) bool + func (s *GovernanceState) DKGSuccessesCount() *big.Int + func (s *GovernanceState) DecTotalStaked(amount *big.Int) + func (s *GovernanceState) DecTotalSupply(amount *big.Int) + func (s *GovernanceState) DeleteNodeOffsets(n *nodeInfo) + func (s *GovernanceState) DeleteNodesOffsetByAddress(addr common.Address) + func (s *GovernanceState) DeleteNodesOffsetByNodeKeyAddress(addr common.Address) + func (s *GovernanceState) Disqualify(n *nodeInfo) error + func (s *GovernanceState) FineRecords(recordHash Bytes32) bool + func (s *GovernanceState) FineValue(index *big.Int) *big.Int + func (s *GovernanceState) FineValues() []*big.Int + func (s *GovernanceState) GetNodeByID(id coreTypes.NodeID) (*nodeInfo, error) + func (s *GovernanceState) HalfLastHalvedAmount() + func (s *GovernanceState) HalfMiningVelocity() + func (s *GovernanceState) IncDKGFinalizedsCount() + func (s *GovernanceState) IncDKGMPKReadysCount() + func (s *GovernanceState) IncDKGResetCount(round *big.Int) + func (s *GovernanceState) IncDKGSuccessesCount() + func (s *GovernanceState) IncNextHalvingSupply(amount *big.Int) + func (s *GovernanceState) IncTotalStaked(amount *big.Int) + func (s *GovernanceState) IncTotalSupply(amount *big.Int) + func (s *GovernanceState) Initialize(config *params.DexconConfig, totalSupply *big.Int) + func (s *GovernanceState) LambdaBA() *big.Int + func (s *GovernanceState) LambdaDKG() *big.Int + func (s *GovernanceState) LastHalvedAmount() *big.Int + func (s *GovernanceState) LastProposedHeight(addr common.Address) *big.Int + func (s *GovernanceState) LenDKGComplaints() *big.Int + func (s *GovernanceState) LenDKGMasterPublicKeys() *big.Int + func (s *GovernanceState) LenNodes() *big.Int + func (s *GovernanceState) LockupPeriod() *big.Int + func (s *GovernanceState) MinBlockInterval() *big.Int + func (s *GovernanceState) MinGasPrice() *big.Int + func (s *GovernanceState) MinStake() *big.Int + func (s *GovernanceState) MiningHalved() + func (s *GovernanceState) MiningVelocity() *big.Int + func (s *GovernanceState) NextHalvingSupply() *big.Int + func (s *GovernanceState) Node(index *big.Int) *nodeInfo + func (s *GovernanceState) Nodes() []*nodeInfo + func (s *GovernanceState) NodesOffsetByAddress(addr common.Address) *big.Int + func (s *GovernanceState) NodesOffsetByNodeKeyAddress(addr common.Address) *big.Int + func (s *GovernanceState) NotaryParamAlpha() *big.Int + func (s *GovernanceState) NotaryParamBeta() *big.Int + func (s *GovernanceState) NotarySetSize() *big.Int + func (s *GovernanceState) Owner() common.Address + func (s *GovernanceState) PopLastNode() + func (s *GovernanceState) PushDKGComplaint(complaint []byte) + func (s *GovernanceState) PushDKGMasterPublicKey(mpk []byte) + func (s *GovernanceState) PushNode(n *nodeInfo) + func (s *GovernanceState) PushRoundHeight(height *big.Int) + func (s *GovernanceState) PutDKGComplaintProposed(id Bytes32, status bool) + func (s *GovernanceState) PutDKGFinalized(addr common.Address, finalized bool) + func (s *GovernanceState) PutDKGMPKReady(addr common.Address, ready bool) + func (s *GovernanceState) PutDKGMasterPublicKeyOffset(id Bytes32, offset *big.Int) + func (s *GovernanceState) PutDKGSuccess(addr common.Address, success bool) + func (s *GovernanceState) PutLastProposedHeight(addr common.Address, height *big.Int) + func (s *GovernanceState) PutNodeOffsets(n *nodeInfo, offset *big.Int) + func (s *GovernanceState) PutNodesOffsetByAddress(addr common.Address, offset *big.Int) + func (s *GovernanceState) PutNodesOffsetByNodeKeyAddress(addr common.Address, offset *big.Int) + func (s *GovernanceState) QualifiedNodes() []*nodeInfo + func (s *GovernanceState) Register(addr common.Address, publicKey []byte, name, email, location, url string, ...) + func (s *GovernanceState) ResetDKGFinalizedsCount() + func (s *GovernanceState) ResetDKGMPKReadysCount() + func (s *GovernanceState) ResetDKGSuccessesCount() + func (s *GovernanceState) RoundHeight(round *big.Int) *big.Int + func (s *GovernanceState) RoundLength() *big.Int + func (s *GovernanceState) SetBlockGasLimit(reward *big.Int) + func (s *GovernanceState) SetCRS(crs common.Hash) + func (s *GovernanceState) SetCRSRound(round *big.Int) + func (s *GovernanceState) SetDKGRound(round *big.Int) + func (s *GovernanceState) SetFineRecords(recordHash Bytes32, status bool) + func (s *GovernanceState) SetFineValues(values []*big.Int) + func (s *GovernanceState) SetOwner(newOwner common.Address) + func (s *GovernanceState) TotalStaked() *big.Int + func (s *GovernanceState) TotalSupply() *big.Int + func (s *GovernanceState) UpdateConfiguration(cfg *params.DexconConfig) + func (s *GovernanceState) UpdateConfigurationRaw(cfg *rawConfigStruct) + func (s *GovernanceState) UpdateNode(index *big.Int, n *nodeInfo) + type Interpreter interface + CanRun func([]byte) bool + Run func(contract *Contract, input []byte, static bool) ([]byte, error) + type JSONLogger struct + func NewJSONLogger(cfg *LogConfig, writer io.Writer) *JSONLogger + func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error + func (l *JSONLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *JSONLogger) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, ...) error + func (l *JSONLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + type LogConfig struct + Debug bool + DisableMemory bool + DisableStack bool + DisableStorage bool + Limit int + type Memory struct + func NewMemory() *Memory + func (m *Memory) Data() []byte + func (m *Memory) Get(offset, size int64) (cpy []byte) + func (m *Memory) GetPtr(offset, size int64) []byte + func (m *Memory) Len() int + func (m *Memory) Print() + func (m *Memory) Resize(size uint64) + func (m *Memory) Set(offset, size uint64, value []byte) + func (m *Memory) Set32(offset uint64, val *big.Int) + type OpCode byte + const ADD + const ADDMOD + const ADDRESS + const AND + const BALANCE + const BLOCKHASH + const BYTE + const CALL + const CALLCODE + const CALLDATACOPY + const CALLDATALOAD + const CALLDATASIZE + const CALLER + const CALLVALUE + const CODECOPY + const CODESIZE + const COINBASE + const CREATE + const CREATE2 + const DELEGATECALL + const DIFFICULTY + const DIV + const DUP + const DUP1 + const DUP10 + const DUP11 + const DUP12 + const DUP13 + const DUP14 + const DUP15 + const DUP16 + const DUP2 + const DUP3 + const DUP4 + const DUP5 + const DUP6 + const DUP7 + const DUP8 + const DUP9 + const EQ + const EXP + const EXTCODECOPY + const EXTCODEHASH + const EXTCODESIZE + const GAS + const GASLIMIT + const GASPRICE + const GT + const ISZERO + const JUMP + const JUMPDEST + const JUMPI + const LOG0 + const LOG1 + const LOG2 + const LOG3 + const LOG4 + const LT + const MLOAD + const MOD + const MSIZE + const MSTORE + const MSTORE8 + const MUL + const MULMOD + const NOT + const NUMBER + const OR + const ORIGIN + const PC + const POP + const PUSH + const PUSH1 + const PUSH10 + const PUSH11 + const PUSH12 + const PUSH13 + const PUSH14 + const PUSH15 + const PUSH16 + const PUSH17 + const PUSH18 + const PUSH19 + const PUSH2 + const PUSH20 + const PUSH21 + const PUSH22 + const PUSH23 + const PUSH24 + const PUSH25 + const PUSH26 + const PUSH27 + const PUSH28 + const PUSH29 + const PUSH3 + const PUSH30 + const PUSH31 + const PUSH32 + const PUSH4 + const PUSH5 + const PUSH6 + const PUSH7 + const PUSH8 + const PUSH9 + const RAND + const RETURN + const RETURNDATACOPY + const RETURNDATASIZE + const REVERT + const SAR + const SDIV + const SELFDESTRUCT + const SGT + const SHA3 + const SHL + const SHR + const SIGNEXTEND + const SLOAD + const SLT + const SMOD + const SSTORE + const STATICCALL + const STOP + const SUB + const SWAP + const SWAP1 + const SWAP10 + const SWAP11 + const SWAP12 + const SWAP13 + const SWAP14 + const SWAP15 + const SWAP16 + const SWAP2 + const SWAP3 + const SWAP4 + const SWAP5 + const SWAP6 + const SWAP7 + const SWAP8 + const SWAP9 + const TIMESTAMP + const XOR + func StringToOp(str string) OpCode + func (op OpCode) IsPush() bool + func (op OpCode) IsStaticJump() bool + func (op OpCode) String() string + type OracleContract interface + Run func(evm *EVM, input []byte, contract *Contract) (ret []byte, err error) + type OracleContractABI struct + ABI abi.ABI + Events map[string]abi.Event + Name2Method map[string]abi.Method + Sig2Method map[string]abi.Method + var GovernanceABI *OracleContractABI + func NewOracleContractABI(abiDefinition string) *OracleContractABI + type PrecompiledContract interface + RequiredGas func(input []byte) uint64 + Run func(input []byte) ([]byte, error) + type Stack struct + func (st *Stack) Back(n int) *big.Int + func (st *Stack) Data() []*big.Int + func (st *Stack) Print() + type StateAtNumberFunc func(uint64) (*state.StateDB, error) + type StateDB interface + AddBalance func(common.Address, *big.Int) + AddLog func(*types.Log) + AddPreimage func(common.Hash, []byte) + AddRefund func(uint64) + CreateAccount func(common.Address) + Empty func(common.Address) bool + Exist func(common.Address) bool + ForEachStorage func(common.Address, func(common.Hash, common.Hash) bool) + GetBalance func(common.Address) *big.Int + GetCode func(common.Address) []byte + GetCodeHash func(common.Address) common.Hash + GetCodeSize func(common.Address) int + GetCommittedState func(common.Address, common.Hash) common.Hash + GetNonce func(common.Address) uint64 + GetRefund func() uint64 + GetState func(common.Address, common.Hash) common.Hash + HasSuicided func(common.Address) bool + RevertToSnapshot func(int) + SetCode func(common.Address, []byte) + SetNonce func(common.Address, uint64) + SetState func(common.Address, common.Hash, common.Hash) + Snapshot func() int + SubBalance func(common.Address, *big.Int) + SubRefund func(uint64) + Suicide func(common.Address) bool + type Storage map[common.Hash]common.Hash + func (s Storage) Copy() Storage + type StructLog struct + Depth int + Err error + Gas uint64 + GasCost uint64 + Memory []byte + MemorySize int + Op OpCode + Pc uint64 + RefundCounter uint64 + Stack []*big.Int + Storage map[common.Hash]common.Hash + func (s *StructLog) ErrorString() string + func (s *StructLog) OpName() string + func (s *StructLog) UnmarshalJSON(input []byte) error + func (s StructLog) MarshalJSON() ([]byte, error) + type StructLogger struct + func NewStructLogger(cfg *LogConfig) *StructLogger + func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error + func (l *StructLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *StructLogger) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, ...) error + func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *StructLogger) Error() error + func (l *StructLogger) Output() []byte + func (l *StructLogger) StructLogs() []StructLog + type Tracer interface + CaptureEnd func(output []byte, gasUsed uint64, t time.Duration, err error) error + CaptureFault func(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + CaptureStart func(from common.Address, to common.Address, call bool, input []byte, gas uint64, ...) error + CaptureState func(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + type TransferFunc func(StateDB, common.Address, common.Address, *big.Int)