Skip to content

Instantly share code, notes, and snippets.

View dmoka's full-sized avatar

Daniel Moka dmoka

View GitHub Profile
//! Custom AccountProvider implementation that uses separate storage for EVM nonces.
//!
//! If an account has no entry in EvmNonces (or it is zero), we treat this as "not migrated yet"
//! and fall back to the frame system nonce. On increment, we initialize EvmNonces from the
//! frame system nonce + 1, ensuring compatibility without performing an on-chain migration.
use frame_support::traits::IsType;
use hydradx_traits::evm::InspectEvmAccounts;
use pallet_evm::{AccountProvider, FrameSystemAccountProvider};
use pallet_evm_accounts::EvmNonces;