Documentation ¶
Index ¶
Constants ¶
View Source
const ( GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations. MinGasLimit uint64 = 200000 // Minimum the gas limit may ever be. GenesisGasLimit uint64 = 105000000 // Gas limit of the Genesis block. CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero. CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior. OrdinaryTxGas uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions. VoteTxGas uint64 = 35000 // 投票交易固定gas消耗 RegisterTxGas uint64 = 92000 // 注册候选节点固定gas消耗 CreateAssetTxGas uint64 = 67000 // 创建资产固定gas消耗 IssueAssetTxGas uint64 = 55000 // 发行资产固定gas消耗 ReplenishAssetTxGas uint64 = 25000 // 增发资产固定gas消耗 ModifyAssetTxGas uint64 = 35000 // 修改资产info固定gas消耗 TransferAssetTxGas uint64 = 30000 // 交易资产固定gas消耗 ModifySigsTxGas uint64 = 67000 // 设置多重签名账户交易固定gas消耗 BoxTxGas uint64 = 40000 // 设置箱子交易固定gas消耗 TxMessageGas uint64 = 68 // 交易中的message字段消耗gas TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation. SstoreSetGas uint64 = 20000 // Once per SLOAD operation. EventDataGas uint64 = 8 // Per byte in a LOG* operation's data. CallStipend uint64 = 2300 // Free gas given at beginning of call. Sha3Gas uint64 = 30 // Once per SHA3 operation. Sha3WordGas uint64 = 6 // Once per word of the SHA3 operation's data. SstoreResetGas uint64 = 5000 // Once per SSTORE operation if the zeroness changes from zero. JumpdestGas uint64 = 1 // Refunded gas, once per SSTORE operation if the zeroness changes to zero. CreateDataGas uint64 = 200 // CallCreateDepth uint64 = 1024 // Maximum depth of call/create stack. EventGas uint64 = 375 // Per LOG* operation. CopyGas uint64 = 3 // StackLimit uint64 = 1024 // Maximum size of VM stack allowed. EventTopicGas uint64 = 375 // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas. CreateGas uint64 = 32000 // Once per CREATE operation & contract-creation transaction. MemoryGas uint64 = 3 // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL. TxDataNonZeroGas uint64 = 68 // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. MaxCodeSize = 24576 // Maximum bytecode to permit for a contract EcrecoverGas uint64 = 3000 // Elliptic curve sender recovery gas price Sha256BaseGas uint64 = 60 // Base price for a SHA256 operation Sha256PerWordGas uint64 = 12 // Per-word price for a SHA256 operation Ripemd160BaseGas uint64 = 600 // Base price for a RIPEMD160 operation Ripemd160PerWordGas uint64 = 120 // Per-word price for a RIPEMD160 operation IdentityBaseGas uint64 = 15 // Base price for a data copy operation IdentityPerWordGas uint64 = 3 // Per-work price for a data copy operation ModExpQuadCoeffDiv uint64 = 20 // Divisor for the quadratic particle of the big int modular exponentiation Bn256AddGas uint64 = 500 // Gas needed for an elliptic curve addition Bn256ScalarMulGas uint64 = 40000 // Gas needed for an elliptic curve scalar multiplication Bn256PairingBaseGas uint64 = 100000 // Base price for an elliptic curve pairing check Bn256PairingPerPointGas uint64 = 80000 // Per-point price for an elliptic curve pairing check )
View Source
const ( OrdinaryTx uint16 = 0 // 普通交易,包括转账交易和调用智能合约交易 CreateContractTx uint16 = 1 // 创建智能合约交易 VoteTx uint16 = 2 // 用户发送投票交易 RegisterTx uint16 = 3 // 申请参加竞选节点投票交易 CreateAssetTx uint16 = 4 // 创建资产 IssueAssetTx uint16 = 5 // 发行资产 ReplenishAssetTx uint16 = 6 // 增发资产交易 ModifyAssetTx uint16 = 7 // 修改资产交易 TransferAssetTx uint16 = 8 // 交易资产 ModifySignersTx uint16 = 9 // 设置多重签名账户的签名者交易 BoxTx uint16 = 10 // 箱子交易 )
tx type
View Source
const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release VersionPatch = 0 // Patch version component of the current release )
View Source
const (
// Max bytes length of extra data in block header
MaxExtraDataLen = 256
)
Variables ¶
View Source
var ( TermDuration uint32 = 1000000 // 每届间隔 InterimDuration uint32 = 1000 // 过渡期 ReleaseEvilNodeDuration uint32 = 1000 // 释放作恶节点的过度期高度 // RegisterCandidateNodeFees = new(big.Int).Mul(big.NewInt(1000), oneLEMO) // Register Candidate node fees = 1000LEMO RegisterCandidateNodeFees = common.Lemo2Mo("1000") FeeReceiveAddress, _ = common.StringToAddress("0x1001") // 设置接收注册费用1000LEMO的地址 IsCandidateNode = "true" NotCandidateNode = "false" MaxPackageLength uint32 = 100 * 1024 * 1024 // 100M TermRewardPoolTotal = common.Lemo2Mo("900000000") // 奖励池总量 TermRewardContract = common.HexToAddress("0x09") // 换届奖励的预编译合约地址 MinRewardPrecision = common.Lemo2Mo("1") // 1 LEMO )
View Source
var (
DefaultGasTable = GasTable{
ExtcodeSize: 700,
ExtcodeCopy: 700,
Balance: 400,
SLoad: 200,
Calls: 700,
Suicide: 5000,
ExpByte: 50,
CreateBySuicide: 25000,
}
)
View Source
var (
TargetGasLimit uint64 = GenesisGasLimit // The artificial target
)
View Source
var TransactionExpiration = 30 * 60 // 交易过期最大时间
View Source
var Version = func() string { return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) }()
View Source
var VersionUint = func() uint32 { return VersionMajor*1000000 + VersionMinor*1000 + VersionPatch }
Functions ¶
This section is empty.
Types ¶
type GasTable ¶
type GasTable struct { ExtcodeSize uint64 ExtcodeCopy uint64 Balance uint64 SLoad uint64 Calls uint64 Suicide uint64 ExpByte uint64 // CreateBySuicide occurs when the // refunded account is one that does // not exist. This logic is similar // to call. May be left nil. Nil means // not charged. CreateBySuicide uint64 }
type Reward ¶ added in v1.1.1
type Reward struct { Term uint32 `json:"term" gencodec:"required"` Value *big.Int `json:"value" gencodec:"required"` Times uint32 `json:"times" gencodec:"required"` }
func (Reward) MarshalJSON ¶ added in v1.1.1
MarshalJSON marshals as JSON.
func (*Reward) UnmarshalJSON ¶ added in v1.1.1
UnmarshalJSON unmarshals from JSON.
type RewardJson ¶ added in v1.1.1
type RewardJson struct { Term uint32 `json:"term" gencodec:"required"` Value *big.Int `json:"value" gencodec:"required"` }
func (RewardJson) MarshalJSON ¶ added in v1.1.1
func (r RewardJson) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*RewardJson) UnmarshalJSON ¶ added in v1.1.1
func (r *RewardJson) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type RewardJsonMarshaling ¶ added in v1.1.1
type RewardMarshaling ¶ added in v1.1.1
type RewardsMap ¶ added in v1.1.1
The map to store the miner's reward
Click to show internal directories.
Click to hide internal directories.