⌘K

Icon SunFilledIcon MoonStars

Icon LinkPolicy

// index using powers of 2 for efficient bitmasking
enum PolicyType : uint32 {
    GasPrice = 1,
    WitnessLimit = 2,
    Maturity = 4,
    MaxFee = 8,
}
nametypedescription
dataOne of GasPrice , WitnessLimit , or Maturity Policy data.

Icon LinkGasPrice

nametypedescription
gasPriceuint64Gas price for transaction

Icon LinkWitnessLimit

nametypedescription
witnessLimituint64The maximum amount of witness data allowed for the transaction

Given helper len() that returns the number of bytes of a field.

Transaction is invalid if:

  • len(tx.witnesses) > witnessLimit

Icon LinkMaturity

nametypedescription
maturityuint32Block until which the transaction cannot be included.

Transaction is invalid if:

  • blockheight() < maturity

Icon LinkMaxFee

nametypedescription
max_feeuint64The maximum fee payable by this transaction using BASE_ASSET.

Transaction is invalid if:

  • max_fee > sum_inputs(tx, BASE_ASSET_ID) - sum_outputs(tx, BASE_ASSET_ID)
  • max_fee < reserved_fee_balance(tx, BASE_ASSET_ID)