Versions in this module Expand all Collapse all v0 v0.8.3 Aug 2, 2025 v0.8.2 Jul 30, 2025 v0.8.1 Jul 26, 2025 v0.8.0 Jul 25, 2025 Changes in this version + const CodecVersion + const X2CRateUint64 + var Codec codec.Manager + var EVMInputGas uint64 = (common.AddressLength+wrappers.LongLen+hashing.HashLen+wrappers.LongLen)*TxBytesGas + secp256k1fx.CostPerSignature + var EVMOutputGas uint64 = (common.AddressLength + wrappers.LongLen + hashing.HashLen) * TxBytesGas + var ErrAssetIDMismatch = errors.New("asset IDs in the input don't match the utxo") + var ErrConflictingAtomicInputs = errors.New("invalid block due to conflicting atomic inputs") + var ErrConflictingAtomicTx = errors.New("conflicting atomic tx present") + var ErrExportNonLUXInputBanff = errors.New("export input cannot contain non-LUX in Banff") + var ErrExportNonLUXOutputBanff = errors.New("export output cannot contain non-LUX in Banff") + var ErrImportNonLUXInputBanff = errors.New("import input cannot contain non-LUX in Banff") + var ErrImportNonLUXOutputBanff = errors.New("import output cannot contain non-LUX in Banff") + var ErrInputsNotSortedUnique = errors.New("inputs not sorted and unique") + var ErrInsufficientAtomicTxFee = errors.New("atomic tx fee too low for atomic mempool") + var ErrNilTx = errors.New("tx is nil") + var ErrNoEVMOutputs = errors.New("tx has no EVM outputs") + var ErrNoExportOutputs = errors.New("tx has no export outputs") + var ErrNoImportInputs = errors.New("tx has no imported inputs") + var ErrNoValueInput = errors.New("input has no value") + var ErrOutputsNotSorted = errors.New("tx outputs not sorted") + var ErrOutputsNotSortedUnique = errors.New("outputs not sorted and unique") + var ErrTooManyAtomicTx = errors.New("too many atomic tx") + var ErrWrongChainID = errors.New("tx has wrong chain ID") + var ErrWrongNetworkID = errors.New("tx was issued with a different network ID") + var TestBlockchainID = ids.GenerateTestID() + var TestTxCodec codec.Manager + var TxBytesGas uint64 = 1 + var X2CRate = uint256.NewInt(X2CRateUint64) + func CalculateDynamicFee(cost uint64, baseFee *big.Int) (uint64, error) + func SortEVMInputsAndSigners(inputs []EVMInput, signers [][]*secp256k1.PrivateKey) + type AtomicBlockContext interface + AtomicTxs func() []*Tx + type Backend struct + BlockFetcher BlockFetcher + Bootstrapped bool + Ctx *consensus.Context + Fx fx.Fx + Rules params.Rules + SecpCache *secp256k1.RecoverCache + type BlockFetcher interface + GetBlockInternal func(context.Context, ids.ID) (linear.Block, error) + LastAcceptedBlockInternal func() linear.Block + type EVMInput struct + Address common.Address + Amount uint64 + AssetID ids.ID + Nonce uint64 + func GetSpendableFunds(ctx *consensus.Context, state StateDB, keys []*secp256k1.PrivateKey, ...) ([]EVMInput, [][]*secp256k1.PrivateKey, error) + func GetSpendableLUXWithFee(ctx *consensus.Context, state StateDB, keys []*secp256k1.PrivateKey, ...) ([]EVMInput, [][]*secp256k1.PrivateKey, error) + func (i EVMInput) Compare(other EVMInput) int + func (in *EVMInput) Verify() error + type EVMOutput struct + Address common.Address + Amount uint64 + AssetID ids.ID + func (o EVMOutput) Compare(other EVMOutput) int + func (out *EVMOutput) Verify() error + type GossipAtomicTx struct + Tx *Tx + func (tx *GossipAtomicTx) GossipID() ids.ID + type GossipAtomicTxMarshaller struct + func (g GossipAtomicTxMarshaller) MarshalGossip(tx *GossipAtomicTx) ([]byte, error) + func (g GossipAtomicTxMarshaller) UnmarshalGossip(bytes []byte) (*GossipAtomicTx, error) + type Mempool struct + Pending chan struct{} + func NewMempool(ctx *consensus.Context, registerer prometheus.Registerer, maxSize int, ...) (*Mempool, error) + func (m *Mempool) Add(tx *GossipAtomicTx) error + func (m *Mempool) AddLocalTx(tx *Tx) error + func (m *Mempool) AddRemoteTx(tx *Tx) error + func (m *Mempool) CancelCurrentTx(txID ids.ID) + func (m *Mempool) CancelCurrentTxs() + func (m *Mempool) DiscardCurrentTx(txID ids.ID) + func (m *Mempool) DiscardCurrentTxs() + func (m *Mempool) ForceAddTx(tx *Tx) error + func (m *Mempool) GetFilter() ([]byte, []byte) + func (m *Mempool) GetPendingTx(txID ids.ID) (*Tx, bool) + func (m *Mempool) GetTx(txID ids.ID) (*Tx, bool, bool) + func (m *Mempool) Has(txID ids.ID) bool + func (m *Mempool) IssueCurrentTxs() + func (m *Mempool) Iterate(f func(tx *GossipAtomicTx) bool) + func (m *Mempool) Len() int + func (m *Mempool) NextTx() (*Tx, bool) + func (m *Mempool) RemoveTx(tx *Tx) + type Metadata struct + func (md *Metadata) Bytes() []byte + func (md *Metadata) ID() ids.ID + func (md *Metadata) Initialize(unsignedBytes, bytes []byte) + func (md *Metadata) SignedBytes() []byte + type StateDB interface + AddBalance func(common.Address, *uint256.Int) + AddBalanceMultiCoin func(common.Address, common.Hash, *big.Int) + GetBalance func(common.Address) *uint256.Int + GetBalanceMultiCoin func(common.Address, common.Hash) *big.Int + GetNonce func(common.Address) uint64 + SetNonce func(common.Address, uint64) + SubBalance func(common.Address, *uint256.Int) + SubBalanceMultiCoin func(common.Address, common.Hash, *big.Int) + type Status uint32 + const Accepted + const Dropped + const Processing + const Unknown + func (s *Status) UnmarshalJSON(b []byte) error + func (s Status) MarshalJSON() ([]byte, error) + func (s Status) String() string + func (s Status) Valid() error + type TestUnsignedTx struct + AcceptRequestsBlockchainIDV ids.ID + AcceptRequestsV *luxatomic.Requests + BurnedV uint64 + EVMStateTransferV error + GasUsedV uint64 + IDV ids.ID + InputUTXOsV set.Set[ids.ID] + SemanticVerifyV error + SignedBytesV []byte + UnsignedBytesV []byte + VerifyV error + func (t *TestUnsignedTx) AtomicOps() (ids.ID, *luxatomic.Requests, error) + func (t *TestUnsignedTx) Burned(assetID ids.ID) (uint64, error) + func (t *TestUnsignedTx) Bytes() []byte + func (t *TestUnsignedTx) EVMStateTransfer(ctx *consensus.Context, state StateDB) error + func (t *TestUnsignedTx) GasUsed(fixedFee bool) (uint64, error) + func (t *TestUnsignedTx) ID() ids.ID + func (t *TestUnsignedTx) Initialize(unsignedBytes, signedBytes []byte) + func (t *TestUnsignedTx) InputUTXOs() set.Set[ids.ID] + func (t *TestUnsignedTx) SemanticVerify(backend *Backend, stx *Tx, parent AtomicBlockContext, baseFee *big.Int) error + func (t *TestUnsignedTx) SignedBytes() []byte + func (t *TestUnsignedTx) Verify(ctx *consensus.Context, rules params.Rules) error + type Tx struct + Creds []verify.Verifiable + func ExtractAtomicTx(atomicTxBytes []byte, codec codec.Manager) (*Tx, error) + func ExtractAtomicTxs(atomicTxBytes []byte, batch bool, codec codec.Manager) ([]*Tx, error) + func ExtractAtomicTxsBatch(atomicTxBytes []byte, codec codec.Manager) ([]*Tx, error) + func GenerateTestExportTx() *Tx + func GenerateTestImportTx() *Tx + func GenerateTestImportTxWithGas(gasUsed uint64, burned uint64) *Tx + func NewExportTx(ctx *consensus.Context, rules params.Rules, state StateDB, assetID ids.ID, ...) (*Tx, error) + func NewImportTx(ctx *consensus.Context, rules params.Rules, time uint64, chainID ids.ID, ...) (*Tx, error) + func NewTestTx() *Tx + func NewTestTxs(numTxs int) []*Tx + func (tx *Tx) BlockFeeContribution(fixedFee bool, luxAssetID ids.ID, baseFee *big.Int) (*big.Int, *big.Int, error) + func (tx *Tx) Compare(other *Tx) int + func (tx *Tx) Sign(c codec.Manager, signers [][]*secp256k1.PrivateKey) error + type UnsignedAtomicTx interface + AtomicOps func() (ids.ID, *atomic.Requests, error) + EVMStateTransfer func(ctx *consensus.Context, state StateDB) error + InputUTXOs func() set.Set[ids.ID] + SemanticVerify func(backend *Backend, stx *Tx, parent AtomicBlockContext, baseFee *big.Int) error + Verify func(ctx *consensus.Context, rules params.Rules) error + type UnsignedExportTx struct + BlockchainID ids.ID + DestinationChain ids.ID + ExportedOutputs []*lux.TransferableOutput + Ins []EVMInput + NetworkID uint32 + func (utx *UnsignedExportTx) AtomicOps() (ids.ID, *atomic.Requests, error) + func (utx *UnsignedExportTx) Burned(assetID ids.ID) (uint64, error) + func (utx *UnsignedExportTx) EVMStateTransfer(ctx *consensus.Context, state StateDB) error + func (utx *UnsignedExportTx) GasUsed(fixedFee bool) (uint64, error) + func (utx *UnsignedExportTx) InputUTXOs() set.Set[ids.ID] + func (utx *UnsignedExportTx) SemanticVerify(backend *Backend, stx *Tx, parent AtomicBlockContext, baseFee *big.Int) error + func (utx *UnsignedExportTx) Verify(ctx *consensus.Context, rules params.Rules) error + type UnsignedImportTx struct + BlockchainID ids.ID + ImportedInputs []*lux.TransferableInput + NetworkID uint32 + Outs []EVMOutput + SourceChain ids.ID + func (utx *UnsignedImportTx) AtomicOps() (ids.ID, *atomic.Requests, error) + func (utx *UnsignedImportTx) Burned(assetID ids.ID) (uint64, error) + func (utx *UnsignedImportTx) EVMStateTransfer(ctx *consensus.Context, state StateDB) error + func (utx *UnsignedImportTx) GasUsed(fixedFee bool) (uint64, error) + func (utx *UnsignedImportTx) InputUTXOs() set.Set[ids.ID] + func (utx *UnsignedImportTx) SemanticVerify(backend *Backend, stx *Tx, parent AtomicBlockContext, baseFee *big.Int) error + func (utx *UnsignedImportTx) Verify(ctx *consensus.Context, rules params.Rules) error + type UnsignedTx interface + Burned func(assetID ids.ID) (uint64, error) + Bytes func() []byte + GasUsed func(fixedFee bool) (uint64, error) + ID func() ids.ID + Initialize func(unsignedBytes, signedBytes []byte) + SignedBytes func() []byte Other modules containing this package github.com/luxfi/evm/v2