Documentation ¶
Index ¶
- Constants
- Variables
- type BurnCode
- type BurnCodeRecord
- type BurnFunction
- type BurnLog
- type BurnRecord
- type BurnTable
- type GasFeePolicy
- func (p *GasFeePolicy) AffordableGasBudgetFromAvailableTokens(availableTokens uint64) uint64
- func (p *GasFeePolicy) Bytes() []byte
- func (p *GasFeePolicy) FeeFromGas(gasUnits, availableTokens uint64) (sendToOwner, sendToValidator uint64)
- func (p *GasFeePolicy) IsEnoughForMinimumFee(availableTokens uint64) bool
- func (p *GasFeePolicy) MinFee() uint64
Constants ¶
View Source
const ( MaxGasPerBlock = uint64(1_000_000_000) MinGasPerRequest = 10000 MaxGasPerRequest = MaxGasPerBlock / 20 // one request cannot use more than 5% of maximum block gas MaxGasExternalViewCall = MaxGasPerRequest )
View Source
const ( BurnCodeStorage1P = BurnCode(iota) BurnCodeReadFromState1P BurnCodeCallTargetNotFound BurnCodeGetContext BurnCodeGetCallerData BurnCodeGetAllowance BurnCodeGetStateAnchorInfo BurnCodeGetBalance BurnCodeGetNFTData BurnCodeCallContract BurnCodeDeployContract BurnCodeEmitEventFixed BurnCodeTransferAllowance BurnCodeEstimateStorageDepositCost BurnCodeSendL1Request BurnCodeUtilsHashingBlake2b BurnCodeUtilsHashingSha3 BurnCodeUtilsHashingHname BurnCodeUtilsBase58Encode BurnCodeUtilsBase58Decode BurnCodeUtilsED25519ValidSig BurnCodeUtilsED25519AddrFromPubKey BurnCodeUtilsBLSValidSignature BurnCodeUtilsBLSAddrFromPubKey BurnCodeUtilsBLSAggregateBLS1P BurnCodeWasm1P BurnCodeMinimumGasPerRequest1P BurnCodeEVM1P )
View Source
const ( Coef1Send = 200 CoefBLSAggregate = 400 )
Variables ¶
View Source
var ErrUnknownBurnCode = xerrors.New("unknown gas burn code")
Functions ¶
This section is empty.
Types ¶
type BurnCodeRecord ¶
type BurnCodeRecord struct { Name string BurnFunction }
type BurnFunction ¶
type BurnLog ¶
type BurnLog struct {
// contains filtered or unexported fields
}
func NewGasBurnLog ¶
func NewGasBurnLog() *BurnLog
type BurnRecord ¶
type BurnTable ¶
type BurnTable map[BurnCode]BurnCodeRecord
type GasFeePolicy ¶
type GasFeePolicy struct { // GasFeeTokenID contains iotago.NativeTokenID used to pay for gas, or nil if base token are used for gas fee GasFeeTokenID *iotago.NativeTokenID // GasFeeTokenDecimals the number of decimals in the native token used to pay for gas fees. Only considered if GasFeeTokenID != nil GasFeeTokenDecimals uint32 // GasPerToken specifies how many gas units are paid for each token ( 100 means 1 tokens pays for 100 gas) GasPerToken uint64 // 0 mean all goes to Governor // >=100 all goes to Validator ValidatorFeeShare uint8 }
func DefaultGasFeePolicy ¶
func DefaultGasFeePolicy() *GasFeePolicy
func FeePolicyFromBytes ¶
func FeePolicyFromBytes(data []byte) (*GasFeePolicy, error)
func MustGasFeePolicyFromBytes ¶
func MustGasFeePolicyFromBytes(data []byte) *GasFeePolicy
func (*GasFeePolicy) AffordableGasBudgetFromAvailableTokens ¶
func (p *GasFeePolicy) AffordableGasBudgetFromAvailableTokens(availableTokens uint64) uint64
func (*GasFeePolicy) Bytes ¶
func (p *GasFeePolicy) Bytes() []byte
func (*GasFeePolicy) FeeFromGas ¶
func (p *GasFeePolicy) FeeFromGas(gasUnits, availableTokens uint64) (sendToOwner, sendToValidator uint64)
FeeFromGas return ownerFee and validatorFee
func (*GasFeePolicy) IsEnoughForMinimumFee ¶
func (p *GasFeePolicy) IsEnoughForMinimumFee(availableTokens uint64) bool
func (*GasFeePolicy) MinFee ¶
func (p *GasFeePolicy) MinFee() uint64
Click to show internal directories.
Click to hide internal directories.