From 1faa072b2791e9ae881f9d2a380c68fd1d805282 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 12:29:35 +0100 Subject: [PATCH 001/162] chore: update to stable2506 --- Cargo.toml | 234 ++++++++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a5038dcb..b9b684af8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,137 +80,137 @@ pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # de # Substrate # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } frame-metadata = { version = "20.0.0", default-features = false } -frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-nft-fractionalization = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-nfts-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-nfts-sdk = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", package = "pallet-nfts", default-features = false } -pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-revive = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false, package = "substrate-prometheus-endpoint" } -sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-network = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-service = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-session = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -sp-version = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-nft-fractionalization = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-nfts-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-nfts-sdk = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "pallet-nfts", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-revive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false, package = "substrate-prometheus-endpoint" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } # Polkadot # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", package = "staging-xcm", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", package = "staging-xcm-builder", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", package = "staging-xcm-executor", default-features = false } -xcm-runtime-apis = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm-builder", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm-executor", default-features = false } +xcm-runtime-apis = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } # Cumulus # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -asset-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-pallet-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } -parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", package = "staging-parachain-info", default-features = false } -parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } +asset-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-pallet-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-parachain-info", default-features = false } +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } # Runtimes # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } -asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } +asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } paseo-runtime = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } paseo-runtime-constants = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } -westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4" } -westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503-4", default-features = false } +westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -ismp-parachain = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -ismp-parachain-inherent = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -ismp-parachain-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -pallet-ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -pallet-ismp-rpc = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } -pallet-ismp-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2503-4", default-features = false } +ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +ismp-parachain = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +ismp-parachain-inherent = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +ismp-parachain-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +pallet-ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +pallet-ismp-rpc = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } +pallet-ismp-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } From 3723ed501256381b5caf5ff463a8f3a597ff4cdd Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:17:47 +0100 Subject: [PATCH 002/162] refactor(pallets): remove deprecated runtimeevent config item --- pallets/api/src/fungibles/mod.rs | 2 -- pallets/api/src/messaging/mod.rs | 3 --- pallets/api/src/nonfungibles/mod.rs | 2 -- pallets/motion/src/benchmarking.rs | 2 +- pallets/motion/src/lib.rs | 2 -- pallets/nfts/src/benchmarking.rs | 2 +- pallets/nfts/src/lib.rs | 4 ---- 7 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pallets/api/src/fungibles/mod.rs b/pallets/api/src/fungibles/mod.rs index 7dd06a926..9ce08e2be 100644 --- a/pallets/api/src/fungibles/mod.rs +++ b/pallets/api/src/fungibles/mod.rs @@ -44,8 +44,6 @@ pub mod pallet { /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] pub trait Config: frame_system::Config + pallet_assets::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The instance of pallet-assets. type AssetsInstance; /// Weight information for dispatchables in this pallet. diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index afaa696cb..7a902f6aa 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -51,9 +51,6 @@ pub mod pallet { /// Configuration of the pallet by specifying the parameters and types on which it depends. #[pallet::config] pub trait Config: frame_system::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type OriginConverter: TryConvert; #[pallet::constant] diff --git a/pallets/api/src/nonfungibles/mod.rs b/pallets/api/src/nonfungibles/mod.rs index e5e8b2e47..8efe80a08 100644 --- a/pallets/api/src/nonfungibles/mod.rs +++ b/pallets/api/src/nonfungibles/mod.rs @@ -63,8 +63,6 @@ pub mod pallet { /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] pub trait Config: frame_system::Config + pallet_nfts::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The instance of pallet-nfts. type NftsInstance; /// Weight information for dispatchables in this pallet. diff --git a/pallets/motion/src/benchmarking.rs b/pallets/motion/src/benchmarking.rs index 2bc78cbf0..3f790eebc 100644 --- a/pallets/motion/src/benchmarking.rs +++ b/pallets/motion/src/benchmarking.rs @@ -7,7 +7,7 @@ use super::*; #[allow(unused)] use crate::Pallet as Motion; -fn assert_last_event(generic_event: ::RuntimeEvent) { +fn assert_last_event(generic_event: T::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/pallets/motion/src/lib.rs b/pallets/motion/src/lib.rs index 813763fab..8387f2134 100644 --- a/pallets/motion/src/lib.rs +++ b/pallets/motion/src/lib.rs @@ -38,8 +38,6 @@ pub mod pallet { type RuntimeCall: Parameter + UnfilteredDispatchable + GetDispatchInfo; - /// The runtime event type. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Origin that can act as `Root` origin if a collective has achieved a simple majority /// consensus. type SimpleMajorityOrigin: EnsureOrigin; diff --git a/pallets/nfts/src/benchmarking.rs b/pallets/nfts/src/benchmarking.rs index affacdce5..8f7128048 100644 --- a/pallets/nfts/src/benchmarking.rs +++ b/pallets/nfts/src/benchmarking.rs @@ -187,7 +187,7 @@ fn add_collection_attribute, I: 'static>( (key, caller, caller_lookup) } -fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { +fn assert_last_event, I: 'static>(generic_event: T::RuntimeEvent) { let events = frame_system::Pallet::::events(); let system_event: ::RuntimeEvent = generic_event.into(); // compare to the last event record diff --git a/pallets/nfts/src/lib.rs b/pallets/nfts/src/lib.rs index 438876d7b..0922f8b89 100644 --- a/pallets/nfts/src/lib.rs +++ b/pallets/nfts/src/lib.rs @@ -138,10 +138,6 @@ pub mod pallet { #[pallet::config] /// The module configuration trait. pub trait Config: frame_system::Config { - /// The overarching event type. - type RuntimeEvent: From> - + IsType<::RuntimeEvent>; - /// Identifier for the collection of item. /// /// SAFETY: The functions in the `Incrementable` trait are fallible. If the functions From a1c4546ececc8896985468c56b4d2fadb64ed17b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 12:31:58 +0100 Subject: [PATCH 003/162] refactor(runtime/common): add missing weights after sdk uplift --- .../src/weights/cumulus_pallet_xcmp_queue.rs | 75 +++++++++++++++++-- runtime/common/src/weights/pallet_assets.rs | 31 ++++++++ runtime/common/src/weights/pallet_revive.rs | 21 ++++++ 3 files changed, 121 insertions(+), 6 deletions(-) diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index 30bc13290..256bf8114 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -65,6 +65,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } + // NOTE: copied from polkadot-sdk until benchmarks can be re-run /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) @@ -75,15 +76,77 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) /// Storage: `MessageQueue::Pages` (r:0 w:1) /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn enqueue_2_empty_xcmp_messages() -> Weight { + /// The range of component `n` is `[0, 1000]`. + fn enqueue_n_empty_xcmp_messages(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `151` // Estimated: `5487` - // Minimum execution time: 22_251_000 picoseconds. - Weight::from_parts(22_846_000, 0) - .saturating_add(Weight::from_parts(0, 5487)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_987_577, 5487) + // Standard Error: 313 + .saturating_add(Weight::from_parts(94_980, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) + /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 105457]`. + fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `334 + n * (1 ±0)` + // Estimated: `108986` + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(11_015_940, 108986) + // Standard Error: 32 + .saturating_add(Weight::from_parts(911, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) + /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:0 w:100) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 100]`. + fn enqueue_n_full_pages(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `186` + // Estimated: `5487` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(7_000_000, 5487) + // Standard Error: 20_150 + .saturating_add(Weight::from_parts(20_690_483, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + } + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) + /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) + fn enqueue_1000_small_xcmp_messages() -> Weight { + // Proof Size summary in bytes: + // Measured: `53067` + // Estimated: `108986` + // Minimum execution time: 139_000_000 picoseconds. + Weight::from_parts(148_000_000, 108986) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) diff --git a/runtime/common/src/weights/pallet_assets.rs b/runtime/common/src/weights/pallet_assets.rs index 1be48c443..0d38324d7 100644 --- a/runtime/common/src/weights/pallet_assets.rs +++ b/runtime/common/src/weights/pallet_assets.rs @@ -492,4 +492,35 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } + // NOTE: copied from polkadot-sdk until benchmarks can be re-run + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn total_issuance() -> Weight { + // Proof Size summary in bytes: + // Measured: `418` + // Estimated: `3675` + // Minimum execution time: 8_792_000 picoseconds. + Weight::from_parts(9_095_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Account` (r:1 w:0) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn balance() -> Weight { + // Proof Size summary in bytes: + // Measured: `255` + // Estimated: `3599` + // Minimum execution time: 8_924_000 picoseconds. + Weight::from_parts(9_407_000, 3599) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Approvals` (r:1 w:0) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + fn allowance() -> Weight { + // Proof Size summary in bytes: + // Measured: `350` + // Estimated: `3613` + // Minimum execution time: 11_348_000 picoseconds. + Weight::from_parts(11_882_000, 3613) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } } diff --git a/runtime/common/src/weights/pallet_revive.rs b/runtime/common/src/weights/pallet_revive.rs index f031145bd..3c5b28302 100644 --- a/runtime/common/src/weights/pallet_revive.rs +++ b/runtime/common/src/weights/pallet_revive.rs @@ -994,4 +994,25 @@ impl pallet_revive::WeightInfo for WeightInfo { // Standard Error: 10 .saturating_add(Weight::from_parts(77_239, 0).saturating_mul(r.into())) } + // NOTE: copied from polkadot-sdk until benchmarks can be re-run + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// The range of component `d` is `[0, 1]`. + /// The range of component `i` is `[0, 262144]`. + fn seal_call_precompile(d: u32, i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + d * (453 ±0)` + // Estimated: `1959 + d * (1959 ±0)` + // Minimum execution time: 19_412_000 picoseconds. + Weight::from_parts(3_906_222, 1959) + // Standard Error: 378_943 + .saturating_add(Weight::from_parts(16_405_804, 0).saturating_mul(d.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_205, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 1959).saturating_mul(d.into())) + } } From 5e205af271bcae7fe099cdb9d2042f04ead4155d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:18:27 +0100 Subject: [PATCH 004/162] refactor(runtime/common): remove unused import --- runtime/common/src/genesis.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/runtime/common/src/genesis.rs b/runtime/common/src/genesis.rs index dd3d327fa..ae2115888 100644 --- a/runtime/common/src/genesis.rs +++ b/runtime/common/src/genesis.rs @@ -1,5 +1,3 @@ -#[cfg(not(feature = "std"))] -use alloc::format; use alloc::vec::Vec; use parachains_common::AccountId; From 2a3e70cce9d050bad37da8eb9eb36914e7767b54 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 12:33:28 +0100 Subject: [PATCH 005/162] refactor(devnet): update revive api implementation --- runtime/devnet/src/lib.rs | 74 ++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index dee597b64..1c86e976a 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -1038,25 +1038,29 @@ impl_runtime_apis! { fn eth_transact(tx: pallet_revive::evm::GenericTransaction) -> Result, pallet_revive::EthTransactError> { - let blockweights: BlockWeights = ::BlockWeights::get(); + use pallet_revive::{ + codec::Encode, evm::runtime::EthExtra, + sp_runtime::traits::{TransactionExtension, Block as BlockT} + }; + + let tx_fee = |pallet_call, mut dispatch_info: pallet_revive::DispatchInfo| { + let call = + ::RuntimeCall::from(pallet_call); + dispatch_info.extension_weight = + EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let tx_fee = |pallet_call, mut dispatch_info: DispatchInfo| { - let call = RuntimeCall::Revive(pallet_call); - dispatch_info.extension_weight = EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let uxt: UncheckedExtrinsic = generic::UncheckedExtrinsic::new_bare(call).into(); + let uxt: ::Extrinsic = + pallet_revive::sp_runtime::generic::UncheckedExtrinsic::new_bare(call).into(); - pallet_transaction_payment::Pallet::::compute_fee( + TransactionPayment::compute_fee( uxt.encoded_size() as u32, &dispatch_info, 0u32.into(), ) }; - Revive::bare_eth_transact( - tx, - blockweights.max_block, - tx_fee, - ) + let blockweights = ::BlockWeights::get(); + Revive::dry_run_eth_transact(tx, blockweights.max_block, tx_fee) } fn call( @@ -1067,6 +1071,7 @@ impl_runtime_apis! { storage_deposit_limit: Option, input_data: Vec, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_call( RuntimeOrigin::signed(origin), dest, @@ -1087,6 +1092,7 @@ impl_runtime_apis! { salt: Option<[u8; 32]>, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_instantiate( RuntimeOrigin::signed(origin), value, @@ -1111,6 +1117,13 @@ impl_runtime_apis! { ) } + fn get_storage_var_key( + address: pallet_revive::H160, + key: Vec + ) -> pallet_revive::GetStorageResult { + Revive::get_storage_var_key(address, key) + } + fn get_storage( address: H160, key: [u8; 32], @@ -1123,20 +1136,21 @@ impl_runtime_apis! { fn trace_block( block: Block, - config: pallet_revive::evm::TracerConfig - ) -> Vec<(u32, pallet_revive::evm::CallTrace)> { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Vec<(u32, pallet_revive::evm::Trace)> { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let mut traces = vec![]; let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); - if let Some(tx_trace) = tracer.collect_traces().pop() { + if let Some(tx_trace) = tracer.collect_trace() { traces.push((index as u32, tx_trace)); } } @@ -1147,16 +1161,17 @@ impl_runtime_apis! { fn trace_tx( block: Block, tx_index: u32, - config: pallet_revive::evm::TracerConfig - ) -> Option { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Option { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { if index as u32 == tx_index { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); break; @@ -1165,24 +1180,25 @@ impl_runtime_apis! { } } - tracer.collect_traces().pop() + tracer.collect_trace() } fn trace_call( tx: pallet_revive::evm::GenericTransaction, - config: pallet_revive::evm::TracerConfig) - -> Result + tracer_type: pallet_revive::evm::TracerType + ) -> Result { use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); - let result = trace(&mut tracer, || Self::eth_transact(tx)); + let mut tracer = Revive::evm_tracer(tracer_type); + let t = tracer.as_tracing(); + let result = trace(t, || Self::eth_transact(tx)); - if let Some(trace) = tracer.collect_traces().pop() { + if let Some(trace) = tracer.collect_trace() { Ok(trace) } else if let Err(err) = result { Err(err) } else { - Ok(Default::default()) + Ok(tracer.empty_trace()) } } } From d24851424f010dbd03cef1ed2beade19808f5f94 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 12:34:06 +0100 Subject: [PATCH 006/162] refactor(devnet): add relayparentoffset config item --- runtime/devnet/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 1c86e976a..b928f4448 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -421,6 +421,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type DmpQueue = frame_support::traits::EnqueueWithOrigin; type OnSystemEvent = (); type OutboundXcmpMessageSource = XcmpQueue; + type RelayParentOffset = ConstU32<0>; type ReservedDmpWeight = ReservedDmpWeight; type ReservedXcmpWeight = ReservedXcmpWeight; type RuntimeEvent = RuntimeEvent; From de81d3c65806fe23ba5d281f1f723aad35a1217b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:21:59 +0100 Subject: [PATCH 007/162] refactor(devnet): update assets config --- runtime/devnet/src/config/assets.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/devnet/src/config/assets.rs b/runtime/devnet/src/config/assets.rs index 487f0fe7c..6da67f82c 100644 --- a/runtime/devnet/src/config/assets.rs +++ b/runtime/devnet/src/config/assets.rs @@ -90,7 +90,6 @@ impl pallet_nfts::Config for Runtime { type MetadataDepositBase = NftsMetadataDepositBase; type OffchainPublic = ::Signer; type OffchainSignature = Signature; - type RuntimeEvent = RuntimeEvent; type StringLimit = ConstU32<256>; type ValueLimit = ConstU32<256>; type WeightInfo = pallet_nfts::weights::SubstrateWeight; From 86a9b8cc02e7eb130b86f097268b7381d6756c60 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:22:25 +0100 Subject: [PATCH 008/162] refactor(devnet): update revive config --- runtime/devnet/src/config/contracts.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 576d78051..23dbc8503 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -9,8 +9,8 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - deposit, Balance, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeHoldReason, Timestamp, TransactionPayment, + deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + Timestamp, TransactionPayment, }; fn schedule() -> pallet_contracts::Schedule { @@ -90,9 +90,6 @@ impl pallet_contracts::Config for Runtime { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; - // No runtime dispatchables are callable from contracts. - type CallFilter = Nothing; - type ChainExtension = (); type ChainId = ChainId; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Currency = Balances; @@ -105,6 +102,7 @@ impl pallet_revive::Config for Runtime { type NativeToEthRatio = NativeToEthRatio; // 512 MB. Used in an integrity test that verifies the runtime has enough memory. type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type Precompiles = (); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -116,7 +114,6 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = pallet_revive::weights::SubstrateWeight; type WeightPrice = TransactionPayment; - type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { From 284e037af36a15542075a2f8e4a7cb1f1449076a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:22:46 +0100 Subject: [PATCH 009/162] refactor(devnet): update api config --- runtime/devnet/src/config/api/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index e49a4c7d9..a5b2eafa1 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -12,7 +12,7 @@ use versioning::*; use crate::{ config::assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, - fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, + fungibles, nonfungibles, Runtime, RuntimeCall, }; mod versioning; @@ -83,13 +83,11 @@ impl RuntimeResult { impl fungibles::Config for Runtime { type AssetsInstance = TrustBackedAssetsInstance; - type RuntimeEvent = RuntimeEvent; type WeightInfo = fungibles::weights::SubstrateWeight; } impl nonfungibles::Config for Runtime { type NftsInstance = TrustBackedNftsInstance; - type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } From f2d770b1b583758ed2d9b91ddfae2f82cdc0eda5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:23:05 +0100 Subject: [PATCH 010/162] refactor(devnet): remove unused imports --- runtime/devnet/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index b928f4448..ccb6f27ac 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -22,7 +22,6 @@ use ::ismp::{ host::StateMachine, router::{Request, Response}, }; -use codec::Encode; use config::xcm::{RelayLocation, XcmOriginToTransactDispatchOrigin}; use cumulus_pallet_parachain_system::{RelayChainState, RelayNumberMonotonicallyIncreases}; use cumulus_pallet_weight_reclaim::StorageWeightReclaim; @@ -30,7 +29,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use frame_metadata_hash_extension::CheckMetadataHash; use frame_support::{ derive_impl, - dispatch::{DispatchClass, DispatchInfo}, + dispatch::DispatchClass, genesis_builder_helper::{build_state, get_preset}, parameter_types, traits::{ @@ -75,7 +74,7 @@ use sp_core::{crypto::KeyTypeId, Get, OpaqueMetadata, H256, U256}; pub use sp_runtime::BuildStorage; use sp_runtime::{ generic, impl_opaque_keys, - traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, TransactionExtension, Verify}, + traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; From 45505bc50d882e07607d46a45c2e1add22eeef24 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:23:49 +0100 Subject: [PATCH 011/162] refactor(testnet): add relayparentoffset config item --- runtime/testnet/src/config/system.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/testnet/src/config/system.rs b/runtime/testnet/src/config/system.rs index de3d1eb8e..19492a061 100644 --- a/runtime/testnet/src/config/system.rs +++ b/runtime/testnet/src/config/system.rs @@ -12,8 +12,6 @@ use sp_runtime::{ Perbill, }; -#[cfg(not(feature = "runtime-benchmarks"))] -use crate::Revive; use crate::{ weights::RocksDbWeight, AccountId, AggregateMessageOrigin, Aura, BalancesCall, Block, BlockExecutionWeight, BlockLength, BlockWeights, DispatchClass, ExtrinsicBaseWeight, @@ -149,6 +147,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type DmpQueue = frame_support::traits::EnqueueWithOrigin; type OnSystemEvent = (); type OutboundXcmpMessageSource = XcmpQueue; + type RelayParentOffset = ConstU32<0>; type ReservedDmpWeight = ReservedDmpWeight; type ReservedXcmpWeight = ReservedXcmpWeight; type RuntimeEvent = RuntimeEvent; From 84f95d6b858b520630a5f5a91722209639e39fab Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:24:21 +0100 Subject: [PATCH 012/162] refactor(testnet): update api config --- runtime/testnet/src/config/api/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index 8bf971e02..591494042 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -21,7 +21,7 @@ use crate::{ assets::TrustBackedAssetsInstance, monetary::TransactionByteFee, xcm::LocalOriginToLocation, }, fungibles, AccountId, Balances, BlockNumber, Contracts, Ismp, PolkadotXcm, Runtime, - RuntimeCall, RuntimeEvent, RuntimeHoldReason, + RuntimeCall, RuntimeHoldReason, }; mod versioning; @@ -106,7 +106,6 @@ impl messaging::Config for Runtime { // TODO: ensure within the contract buffer bounds type MaxResponseLen = ConstU32<1024>; type OriginConverter = LocalOriginToLocation; - type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; @@ -191,7 +190,6 @@ impl NotifyQueryHandler for QueryHandler { impl fungibles::Config for Runtime { type AssetsInstance = TrustBackedAssetsInstance; - type RuntimeEvent = RuntimeEvent; type WeightInfo = fungibles::weights::SubstrateWeight; } From b3daf81dc42be68ff1eb0c9ac3d748a592e108fd Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:24:36 +0100 Subject: [PATCH 013/162] refactor(testnet): update revive config --- runtime/testnet/src/config/contracts.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/testnet/src/config/contracts.rs b/runtime/testnet/src/config/contracts.rs index 85811da27..e5bb2b307 100644 --- a/runtime/testnet/src/config/contracts.rs +++ b/runtime/testnet/src/config/contracts.rs @@ -9,8 +9,8 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - deposit, Balance, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeHoldReason, Timestamp, TransactionPayment, + deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + Timestamp, TransactionPayment, }; fn schedule() -> pallet_contracts::Schedule { @@ -88,9 +88,6 @@ impl pallet_contracts::Config for Runtime { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; - // No runtime dispatchables are callable from contracts. - type CallFilter = Nothing; - type ChainExtension = (); // EVM chain id. 3,395 is a unique ID still. type ChainId = ConstU64<3_395>; // 30 percent of storage deposit held for using a code hash. @@ -105,6 +102,7 @@ impl pallet_revive::Config for Runtime { type NativeToEthRatio = NativeToEthRatio; // 512 MB. Used in an integrity test that verifies the runtime has enough memory. type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type Precompiles = (); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -116,7 +114,6 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = pallet_revive::weights::SubstrateWeight; type WeightPrice = TransactionPayment; - type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { From 66f544612b8b45516bb102b4c1234ac61c356f7c Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:24:51 +0100 Subject: [PATCH 014/162] refactor(testnet): update governance config --- runtime/testnet/src/config/governance.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/testnet/src/config/governance.rs b/runtime/testnet/src/config/governance.rs index 0ef617e8c..2d481a98d 100644 --- a/runtime/testnet/src/config/governance.rs +++ b/runtime/testnet/src/config/governance.rs @@ -51,7 +51,6 @@ impl pallet_collective::Config for Runtime { impl pallet_motion::Config for Runtime { type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; // Simple majority is disabled. type SimpleMajorityOrigin = NeverEnsureOrigin<()>; // At least 3/4 of the council vote is needed. From 7c1459e06e6ca923ea0083f6f28d8e2723ed0988 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:25:29 +0100 Subject: [PATCH 015/162] refactor(testnet): update revive api implementation --- runtime/testnet/src/lib.rs | 86 ++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index a75865641..7f1b15e64 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -23,13 +23,12 @@ use ::ismp::{ host::StateMachine, router::{Request, Response}, }; -use codec::Encode; use config::system::ConsensusHook; use cumulus_pallet_parachain_system::RelayChainState; use cumulus_primitives_core::AggregateMessageOrigin; use frame_metadata_hash_extension::CheckMetadataHash; use frame_support::{ - dispatch::{DispatchClass, DispatchInfo}, + dispatch::DispatchClass, genesis_builder_helper::{build_state, get_preset}, parameter_types, traits::{ @@ -51,10 +50,7 @@ use pallet_api::{fungibles, messaging}; use pallet_balances::Call as BalancesCall; use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_nfts_sdk as pallet_nfts; -use pallet_revive::{ - evm::{runtime::EthExtra, H160}, - AddressMapper, -}; +use pallet_revive::{evm::H160, AddressMapper}; use pallet_transaction_payment::ChargeTransactionPayment; // Polkadot imports use polkadot_runtime_common::SlowAdjustingFeeUpdate; @@ -71,7 +67,7 @@ use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256}; pub use sp_runtime::BuildStorage; use sp_runtime::{ generic, impl_opaque_keys, - traits::{BlakeTwo256, Block as BlockT, Get, IdentifyAccount, TransactionExtension, Verify}, + traits::{BlakeTwo256, Block as BlockT, Get, IdentifyAccount, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -83,7 +79,7 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight}; // XCM Imports use xcm::{latest::prelude::BodyId, VersionedAsset, VersionedLocation}; -use crate::config::{assets::TrustBackedAssetsInstance, system::RuntimeBlockWeights}; +use crate::config::system::RuntimeBlockWeights; /// Some way of identifying an account on the chain. We intentionally make it equivalent /// to the public key of our transaction signing scheme. @@ -714,25 +710,29 @@ impl_runtime_apis! { fn eth_transact(tx: pallet_revive::evm::GenericTransaction) -> Result, pallet_revive::EthTransactError> { - let blockweights: BlockWeights = ::BlockWeights::get(); + use pallet_revive::{ + codec::Encode, evm::runtime::EthExtra, + sp_runtime::traits::{TransactionExtension, Block as BlockT} + }; + + let tx_fee = |pallet_call, mut dispatch_info: pallet_revive::DispatchInfo| { + let call = + ::RuntimeCall::from(pallet_call); + dispatch_info.extension_weight = + EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let tx_fee = |pallet_call, mut dispatch_info: DispatchInfo| { - let call = RuntimeCall::Revive(pallet_call); - dispatch_info.extension_weight = EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let uxt: UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic::new_bare(call).into(); + let uxt: ::Extrinsic = + pallet_revive::sp_runtime::generic::UncheckedExtrinsic::new_bare(call).into(); - pallet_transaction_payment::Pallet::::compute_fee( + TransactionPayment::compute_fee( uxt.encoded_size() as u32, &dispatch_info, 0u32.into(), ) }; - Revive::bare_eth_transact( - tx, - blockweights.max_block, - tx_fee, - ) + let blockweights = ::BlockWeights::get(); + Revive::dry_run_eth_transact(tx, blockweights.max_block, tx_fee) } fn call( @@ -743,6 +743,7 @@ impl_runtime_apis! { storage_deposit_limit: Option, input_data: Vec, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_call( RuntimeOrigin::signed(origin), dest, @@ -763,6 +764,7 @@ impl_runtime_apis! { salt: Option<[u8; 32]>, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_instantiate( RuntimeOrigin::signed(origin), value, @@ -787,6 +789,13 @@ impl_runtime_apis! { ) } + fn get_storage_var_key( + address: pallet_revive::H160, + key: Vec + ) -> pallet_revive::GetStorageResult { + Revive::get_storage_var_key(address, key) + } + fn get_storage( address: H160, key: [u8; 32], @@ -799,20 +808,21 @@ impl_runtime_apis! { fn trace_block( block: Block, - config: pallet_revive::evm::TracerConfig - ) -> Vec<(u32, pallet_revive::evm::CallTrace)> { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Vec<(u32, pallet_revive::evm::Trace)> { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let mut traces = vec![]; let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); - if let Some(tx_trace) = tracer.collect_traces().pop() { + if let Some(tx_trace) = tracer.collect_trace() { traces.push((index as u32, tx_trace)); } } @@ -823,16 +833,17 @@ impl_runtime_apis! { fn trace_tx( block: Block, tx_index: u32, - config: pallet_revive::evm::TracerConfig - ) -> Option { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Option { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { if index as u32 == tx_index { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); break; @@ -841,24 +852,25 @@ impl_runtime_apis! { } } - tracer.collect_traces().pop() + tracer.collect_trace() } fn trace_call( tx: pallet_revive::evm::GenericTransaction, - config: pallet_revive::evm::TracerConfig) - -> Result + tracer_type: pallet_revive::evm::TracerType + ) -> Result { use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); - let result = trace(&mut tracer, || Self::eth_transact(tx)); + let mut tracer = Revive::evm_tracer(tracer_type); + let t = tracer.as_tracing(); + let result = trace(t, || Self::eth_transact(tx)); - if let Some(trace) = tracer.collect_traces().pop() { + if let Some(trace) = tracer.collect_trace() { Ok(trace) } else if let Err(err) = result { Err(err) } else { - Ok(Default::default()) + Ok(tracer.empty_trace()) } } } From c3b5173a55e08614b9cd4e1ae7e306a5cd9e2564 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:26:03 +0100 Subject: [PATCH 016/162] refactor(mainnet): update revive api implementation --- runtime/mainnet/src/apis.rs | 88 +++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/runtime/mainnet/src/apis.rs b/runtime/mainnet/src/apis.rs index ab1529337..09f9e0d2f 100644 --- a/runtime/mainnet/src/apis.rs +++ b/runtime/mainnet/src/apis.rs @@ -1,18 +1,16 @@ use alloc::{vec, vec::Vec}; -use codec::Encode; use frame_support::{ - dispatch::DispatchInfo, genesis_builder_helper::{build_state, get_preset}, traits::nonfungibles_v2::Inspect, weights::{Weight, WeightToFee as _}, }; -use pallet_revive::{evm::runtime::EthExtra, AddressMapper}; +use pallet_revive::AddressMapper; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160, U256}; use sp_runtime::{ - traits::{Block as BlockT, TransactionExtension}, + traits::Block as BlockT, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -30,10 +28,10 @@ use xcm_runtime_apis::{ // Local module imports use super::{ config::{monetary::fee::WeightToFee, system::RuntimeBlockWeights, xcm as xcm_config}, - AccountId, Balance, Block, BlockNumber, BlockWeights, EthExtraImpl, Executive, - ExtrinsicInclusionMode, InherentDataExt, Nfts, Nonce, OriginCaller, ParachainSystem, - PolkadotXcm, Revive, Runtime, RuntimeCall, RuntimeEvent, RuntimeGenesisConfig, RuntimeOrigin, - SessionKeys, System, TransactionPayment, UncheckedExtrinsic, VERSION, + AccountId, Balance, Block, BlockNumber, EthExtraImpl, Executive, ExtrinsicInclusionMode, + InherentDataExt, Nfts, Nonce, OriginCaller, ParachainSystem, PolkadotXcm, Revive, Runtime, + RuntimeCall, RuntimeEvent, RuntimeGenesisConfig, RuntimeOrigin, SessionKeys, System, + TransactionPayment, VERSION, }; impl_runtime_apis! { @@ -438,25 +436,29 @@ impl_runtime_apis! { fn eth_transact(tx: pallet_revive::evm::GenericTransaction) -> Result, pallet_revive::EthTransactError> { - let blockweights: BlockWeights = ::BlockWeights::get(); + use pallet_revive::{ + codec::Encode, evm::runtime::EthExtra, + sp_runtime::traits::{TransactionExtension, Block as BlockT} + }; + + let tx_fee = |pallet_call, mut dispatch_info: pallet_revive::DispatchInfo| { + let call = + ::RuntimeCall::from(pallet_call); + dispatch_info.extension_weight = + EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let tx_fee = |pallet_call, mut dispatch_info: DispatchInfo| { - let call = RuntimeCall::Revive(pallet_call); - dispatch_info.extension_weight = EthExtraImpl::get_eth_extension(0, 0u32.into()).weight(&call); - let uxt: UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic::new_bare(call).into(); + let uxt: ::Extrinsic = + pallet_revive::sp_runtime::generic::UncheckedExtrinsic::new_bare(call).into(); - pallet_transaction_payment::Pallet::::compute_fee( + TransactionPayment::compute_fee( uxt.encoded_size() as u32, &dispatch_info, 0u32.into(), ) }; - Revive::bare_eth_transact( - tx, - blockweights.max_block, - tx_fee, - ) + let blockweights = ::BlockWeights::get(); + Revive::dry_run_eth_transact(tx, blockweights.max_block, tx_fee) } fn call( @@ -467,6 +469,7 @@ impl_runtime_apis! { storage_deposit_limit: Option, input_data: Vec, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_call( RuntimeOrigin::signed(origin), dest, @@ -487,6 +490,7 @@ impl_runtime_apis! { salt: Option<[u8; 32]>, ) -> pallet_revive::ContractResult { + Revive::prepare_dry_run(&origin); Revive::bare_instantiate( RuntimeOrigin::signed(origin), value, @@ -511,6 +515,13 @@ impl_runtime_apis! { ) } + fn get_storage_var_key( + address: pallet_revive::H160, + key: Vec + ) -> pallet_revive::GetStorageResult { + Revive::get_storage_var_key(address, key) + } + fn get_storage( address: H160, key: [u8; 32], @@ -523,20 +534,21 @@ impl_runtime_apis! { fn trace_block( block: Block, - config: pallet_revive::evm::TracerConfig - ) -> Vec<(u32, pallet_revive::evm::CallTrace)> { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Vec<(u32, pallet_revive::evm::Trace)> { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let mut traces = vec![]; let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); - if let Some(tx_trace) = tracer.collect_traces().pop() { + if let Some(tx_trace) = tracer.collect_trace() { traces.push((index as u32, tx_trace)); } } @@ -547,16 +559,17 @@ impl_runtime_apis! { fn trace_tx( block: Block, tx_index: u32, - config: pallet_revive::evm::TracerConfig - ) -> Option { - use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); + tracer_type: pallet_revive::evm::TracerType + ) -> Option { + use pallet_revive::{sp_runtime::traits::Block, tracing::trace}; + let mut tracer = Revive::evm_tracer(tracer_type); let (header, extrinsics) = block.deconstruct(); Executive::initialize_block(&header); for (index, ext) in extrinsics.into_iter().enumerate() { if index as u32 == tx_index { - trace(&mut tracer, || { + let t = tracer.as_tracing(); + trace(t, || { let _ = Executive::apply_extrinsic(ext); }); break; @@ -565,24 +578,25 @@ impl_runtime_apis! { } } - tracer.collect_traces().pop() + tracer.collect_trace() } fn trace_call( tx: pallet_revive::evm::GenericTransaction, - config: pallet_revive::evm::TracerConfig) - -> Result + tracer_type: pallet_revive::evm::TracerType + ) -> Result { use pallet_revive::tracing::trace; - let mut tracer = config.build(Revive::evm_gas_from_weight); - let result = trace(&mut tracer, || Self::eth_transact(tx)); + let mut tracer = Revive::evm_tracer(tracer_type); + let t = tracer.as_tracing(); + let result = trace(t, || Self::eth_transact(tx)); - if let Some(trace) = tracer.collect_traces().pop() { + if let Some(trace) = tracer.collect_trace() { Ok(trace) } else if let Err(err) = result { Err(err) } else { - Ok(Default::default()) + Ok(tracer.empty_trace()) } } } From a395e6eeab189ee6f7495dfb1831f5d3ada138e5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:26:36 +0100 Subject: [PATCH 017/162] refactor(mainnet): update governance config --- runtime/mainnet/src/config/governance.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/mainnet/src/config/governance.rs b/runtime/mainnet/src/config/governance.rs index c9ff16553..03ba8cd20 100644 --- a/runtime/mainnet/src/config/governance.rs +++ b/runtime/mainnet/src/config/governance.rs @@ -1,8 +1,6 @@ -use frame_support::{ - parameter_types, - traits::{EitherOfDiverse, NeverEnsureOrigin}, - weights::Weight, -}; +#[cfg(not(feature = "runtime-benchmarks"))] +use frame_support::traits::NeverEnsureOrigin; +use frame_support::{parameter_types, traits::EitherOfDiverse, weights::Weight}; use frame_system::EnsureRoot; use pallet_collective::EnsureProportionAtLeast; use parachains_common::BlockNumber; @@ -60,7 +58,6 @@ impl pallet_collective::Config for Runtime { impl pallet_motion::Config for Runtime { type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] // Simple majority is disabled. type SimpleMajorityOrigin = NeverEnsureOrigin<()>; From 8b131612c609097dcfa9e7b80a7826115a16dfca Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:26:54 +0100 Subject: [PATCH 018/162] refactor(mainnet): update revive config --- runtime/mainnet/src/config/revive.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/runtime/mainnet/src/config/revive.rs b/runtime/mainnet/src/config/revive.rs index 204de546e..0883c927f 100644 --- a/runtime/mainnet/src/config/revive.rs +++ b/runtime/mainnet/src/config/revive.rs @@ -1,13 +1,13 @@ use frame_support::{ parameter_types, - traits::{ConstBool, ConstU32, ConstU64, Nothing}, + traits::{ConstBool, ConstU32, ConstU64}, }; use frame_system::EnsureSigned; use crate::{ config::monetary::{DepositPerByte, DepositPerItem}, - weights, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, - Timestamp, TransactionPayment, UNIT, + weights, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, + TransactionPayment, UNIT, }; // 18 decimals @@ -20,9 +20,6 @@ parameter_types! { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; - // No runtime dispatchables are callable from contracts. - type CallFilter = Nothing; - type ChainExtension = (); // EVM chain id. 3,395 is a unique ID still. type ChainId = ConstU64<3_395>; // 30 percent of storage deposit held for using a code hash. @@ -37,6 +34,7 @@ impl pallet_revive::Config for Runtime { type NativeToEthRatio = NativeToEthRatio; // 512 MB. Used in an integrity test that verifies the runtime has enough memory. type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type Precompiles = (); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -48,7 +46,6 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = weights::pallet_revive::WeightInfo; type WeightPrice = TransactionPayment; - type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { From 2ebd03ac75eebae64a15ee0b099273030652cff2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:27:13 +0100 Subject: [PATCH 019/162] refactor(mainnet): add relayparentoffset config item --- runtime/mainnet/src/config/system.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/mainnet/src/config/system.rs b/runtime/mainnet/src/config/system.rs index 24aecb5b1..d8a08328d 100644 --- a/runtime/mainnet/src/config/system.rs +++ b/runtime/mainnet/src/config/system.rs @@ -154,6 +154,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type DmpQueue = EnqueueWithOrigin; type OnSystemEvent = (); type OutboundXcmpMessageSource = XcmpQueue; + type RelayParentOffset = ConstU32<0>; type ReservedDmpWeight = ReservedDmpWeight; type ReservedXcmpWeight = ReservedXcmpWeight; type RuntimeEvent = RuntimeEvent; From 89ce03d3ad16bf4bebb47005d33558611eeab292 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:27:59 +0100 Subject: [PATCH 020/162] refactor(mainnet): replace fee_asset with worst_case_for_trader --- runtime/mainnet/src/benchmarks.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/mainnet/src/benchmarks.rs b/runtime/mainnet/src/benchmarks.rs index ef1e23adb..f2032556b 100644 --- a/runtime/mainnet/src/benchmarks.rs +++ b/runtime/mainnet/src/benchmarks.rs @@ -6,6 +6,7 @@ use frame_support::parameter_types; pub use pallet_xcm::benchmarking::Pallet as PalletXcmBenchmark; use xcm::prelude::{ Asset, AssetId, Fungible, Here, InteriorLocation, Junction, Location, NetworkId, Response, + WeightLimit, }; use xcm_executor::traits::ConvertLocation; @@ -208,8 +209,11 @@ impl pallet_xcm_benchmarks::generic::Config for Runtime { Ok((origin, ticket, assets)) } - fn fee_asset() -> Result { - Ok(Asset { id: AssetId(RelayLocation::get()), fun: Fungible(1_000_000 * UNIT) }) + fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> { + Ok(( + Asset { id: AssetId(RelayLocation::get()), fun: Fungible(1_000_000 * UNIT) }, + WeightLimit::Limited(Weight::from_parts(5000, 5000)), + )) } fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { From 56b0d857b5fb45610cc1089b3f022bda02f50328 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:29:13 +0100 Subject: [PATCH 021/162] refactor(node): add shared trie cache parameter to storage benchmarking command --- node/src/command.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/src/command.rs b/node/src/command.rs index b1be951dd..3da2619b7 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -319,7 +319,9 @@ pub fn run() -> Result<()> { construct_benchmark_partials!(config, |partials| { let db = partials.backend.expose_db(); let storage = partials.backend.expose_storage(); - cmd.run(config, partials.client.clone(), db, storage) + let shared_cache = partials.backend.expose_shared_trie_cache(); + + cmd.run(config, partials.client.clone(), db, storage, shared_cache) }) }), BenchmarkCmd::Machine(cmd) => From 10d6d1155f077aba68de219fdd791f6b3b0ff493 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:29:45 +0100 Subject: [PATCH 022/162] refactor(node): silence clippy warning --- node/src/rpc.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/node/src/rpc.rs b/node/src/rpc.rs index c44e8d6de..c04aecc96 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -28,6 +28,7 @@ pub struct FullDeps { /// Transaction pool instance. pub pool: Arc

, /// Backend used by the node. + #[allow(dead_code)] pub backend: Arc, } From 7d33e20e0e5074a5224628960c50a8755179c450 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:30:23 +0100 Subject: [PATCH 023/162] refactor(node): address service breaking changes --- node/src/service.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/node/src/service.rs b/node/src/service.rs index 02e55e787..854cc1b9b 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -198,16 +198,17 @@ where let backend = params.backend.clone(); let mut task_manager = params.task_manager; - let (relay_chain_interface, collator_key) = build_relay_chain_interface( - polkadot_config, - ¶chain_config, - telemetry_worker_handle, - &mut task_manager, - collator_options.clone(), - hwbench.clone(), - ) - .await - .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; + let (relay_chain_interface, collator_key, _relay_chain_network, _paranode_rx) = + build_relay_chain_interface( + polkadot_config, + ¶chain_config, + telemetry_worker_handle, + &mut task_manager, + collator_options.clone(), + hwbench.clone(), + ) + .await + .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; let validator = parachain_config.role.is_authority(); let transaction_pool = params.transaction_pool.clone(); @@ -328,6 +329,7 @@ where relay_chain_slot_duration, recovery_handle: Box::new(overseer_handle.clone()), sync_service: sync_service.clone(), + prometheus_registry: prometheus_registry.as_ref(), })?; if validator { From 85980e689a98ea0cb8a990ce2ef7ee7e4cae1250 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:30:35 +0100 Subject: [PATCH 024/162] chore: update cargo.lock --- Cargo.lock | 8168 +++++++++++++++++++++++++++------------------------- 1 file changed, 4315 insertions(+), 3853 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 132c44913..271054326 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,9 +112,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-core" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8bcce99ad10fe02640cfaec1c6bc809b837c783c1d52906aa5af66e2a196f6" +checksum = "5968f48d7a62587cd874bd84034831da4f7f577ce5de984828e376766efc0f32" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -125,15 +125,14 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" +checksum = "f9135eb501feccf7f4cb8a183afd406a65483fdad7bbd7332d0470e5d725c92f" dependencies = [ "alloy-json-abi", "alloy-primitives", "alloy-sol-type-parser", "alloy-sol-types", - "const-hex", "itoa", "serde", "serde_json", @@ -142,9 +141,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" +checksum = "8b26fdd571915bafe857fccba4ee1a4f352965800e46a53e4a5f50187b7776fa" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -154,9 +153,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +checksum = "a326d47106039f38b811057215a92139f46eef7983a4b77b10930a0ea5685b1e" dependencies = [ "alloy-rlp", "bytes", @@ -171,7 +170,7 @@ dependencies = [ "keccak-asm", "paste", "proptest", - "rand 0.8.5", + "rand 0.9.1", "ruint", "rustc-hash 2.1.1", "serde", @@ -191,9 +190,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" +checksum = "d4be1ce1274ddd7fdfac86e5ece1b225e9bba1f2327e20fbb30ee6b9cc1423fe" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -205,9 +204,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" +checksum = "01e92f3708ea4e0d9139001c86c051c538af0146944a2a9c7181753bd944bf57" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -223,9 +222,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" +checksum = "9afe1bd348a41f8c9b4b54dfb314886786d6201235b0b3f47198b9d910c86bb2" dependencies = [ "const-hex", "dunce", @@ -239,9 +238,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d162f8524adfdfb0e4bd0505c734c985f3e2474eb022af32eef0d52a4f3935c" +checksum = "d6195df2acd42df92a380a8db6205a5c7b41282d0ce3f4c665ecf7911ac292f1" dependencies = [ "serde", "winnow", @@ -249,14 +248,13 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" +checksum = "6185e98a79cf19010722f48a74b5a65d153631d2f038cabd250f4b9e9813b8ad" dependencies = [ "alloy-json-abi", "alloy-primitives", "alloy-sol-macro", - "const-hex", "serde", ] @@ -912,7 +910,7 @@ dependencies = [ "sp-storage 21.0.0", "sp-transaction-pool 34.0.0", "sp-version 37.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-parachain-info 0.17.0", "staging-xcm 14.2.2", "staging-xcm-builder 17.0.5", @@ -924,125 +922,151 @@ dependencies = [ [[package]] name = "asset-hub-westend-runtime" -version = "0.29.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.15.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "assets-common 0.21.0", + "assets-common 0.7.0", "bp-asset-hub-rococo", "bp-asset-hub-westend", "bp-bridge-hub-rococo", "bp-bridge-hub-westend", - "cumulus-pallet-aura-ext 0.20.0", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-aura-ext 0.7.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm 0.19.1", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-utility 0.20.0", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "cumulus-pallet-xcm 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-utility 0.7.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex-literal", "log", - "pallet-asset-conversion 22.0.0", + "pallet-asset-conversion 10.0.0", "pallet-asset-conversion-ops", - "pallet-asset-conversion-tx-payment 22.0.0", + "pallet-asset-conversion-tx-payment 10.0.0", "pallet-asset-rewards", - "pallet-assets 42.0.0", + "pallet-assets 29.1.0", "pallet-assets-freezer", - "pallet-aura 39.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", - "pallet-message-queue 43.1.0", + "pallet-aura 27.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", + "pallet-message-queue 31.0.0", "pallet-migrations", - "pallet-multisig 40.1.0", + "pallet-multisig 28.0.0", "pallet-nft-fractionalization", - "pallet-nfts 34.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "pallet-nfts-runtime-api 26.0.0", - "pallet-proxy 40.1.0", + "pallet-nfts 22.0.0", + "pallet-nfts-runtime-api 14.0.0", + "pallet-proxy 28.0.0", "pallet-revive", - "pallet-session 40.0.0", - "pallet-state-trie-migration 44.1.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-uniques 40.1.0", - "pallet-utility 40.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-benchmarks 20.0.0", - "pallet-xcm-bridge-hub-router 0.18.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-runtime-common 19.1.0", + "pallet-session 28.0.0", + "pallet-state-trie-migration 29.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-uniques 28.0.0", + "pallet-utility 28.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-benchmarks 7.0.0", + "pallet-xcm-bridge-hub-router 0.5.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-runtime-common 7.0.0", "primitive-types 0.13.1", "scale-info", "serde_json", - "snowbridge-inbound-queue-primitives", "snowbridge-outbound-queue-primitives", "snowbridge-pallet-system-frontend", "snowbridge-runtime-common", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-storage 19.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 17.0.0", "testnet-parachains-constants", "westend-runtime-constants", - "xcm-runtime-apis 0.7.0", + "xcm-runtime-apis 0.1.1", ] [[package]] name = "asset-test-utils" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-asset-conversion 22.0.0", - "pallet-assets 42.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", - "pallet-session 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-bridge-hub-router 0.18.0", - "parachains-common 21.0.0", +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-asset-conversion 10.0.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", + "pallet-session 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-bridge-hub-router 0.5.0", + "parachains-common 7.0.0", "parachains-runtimes-test-utils", "parity-scale-codec", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "xcm-runtime-apis 0.7.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "xcm-runtime-apis 0.1.1", +] + +[[package]] +name = "assets-common" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-primitives-core 0.7.0", + "ethereum-standards", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "pallet-asset-conversion 10.0.0", + "pallet-assets 29.1.0", + "pallet-revive", + "pallet-revive-uapi", + "pallet-xcm 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "scale-info", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "tracing", ] [[package]] @@ -1069,28 +1093,6 @@ dependencies = [ "substrate-wasm-builder 24.0.2", ] -[[package]] -name = "assets-common" -version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "impl-trait-for-tuples", - "pallet-asset-conversion 22.0.0", - "pallet-assets 42.0.0", - "pallet-xcm 19.1.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "tracing", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -1428,29 +1430,29 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "binary-merkle-tree" -version = "15.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336bf780dd7526a9a4bc1521720b25c1994dc132cccd59553431923fa4d1a693" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hash-db", "log", + "parity-scale-codec", ] [[package]] name = "binary-merkle-tree" -version = "16.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "181f5380e435b8ba6d901f8b16fc8908c6f0f8bea8973113d1c8718d89bb1809" +checksum = "336bf780dd7526a9a4bc1521720b25c1994dc132cccd59553431923fa4d1a693" dependencies = [ "hash-db", "log", - "parity-scale-codec", ] [[package]] name = "binary-merkle-tree" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181f5380e435b8ba6d901f8b16fc8908c6f0f8bea8973113d1c8718d89bb1809" dependencies = [ "hash-db", "log", @@ -1765,38 +1767,56 @@ dependencies = [ [[package]] name = "bp-asset-hub-rococo" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-bridge-hub-cumulus 0.21.0", - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "bp-xcm-bridge-hub-router 0.17.0", - "frame-support 40.1.0", + "bp-bridge-hub-cumulus 0.7.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "bp-xcm-bridge-hub-router 0.6.0", + "frame-support 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-api 26.0.0", + "sp-core 28.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants", ] [[package]] name = "bp-asset-hub-westend" -version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-bridge-hub-cumulus 0.21.0", - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "bp-xcm-bridge-hub-router 0.17.0", - "frame-support 40.1.0", + "bp-bridge-hub-cumulus 0.7.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "bp-xcm-bridge-hub-router 0.6.0", + "frame-support 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-api 26.0.0", + "sp-core 28.0.0", + "staging-xcm 7.0.1", "testnet-parachains-constants", ] +[[package]] +name = "bp-bridge-hub-cumulus" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bp-messages 0.7.0", + "bp-polkadot-core 0.7.0", + "bp-runtime 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "parachains-common 7.0.0", + "polkadot-primitives 7.0.0", + "sp-api 26.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", +] + [[package]] name = "bp-bridge-hub-cumulus" version = "0.18.0" @@ -1813,21 +1833,6 @@ dependencies = [ "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "bp-bridge-hub-cumulus" -version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "bp-messages 0.20.1", - "bp-polkadot-core 0.20.1", - "bp-runtime 0.20.1", - "frame-support 40.1.0", - "frame-system 40.1.0", - "polkadot-primitives 18.1.0", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "bp-bridge-hub-kusama" version = "1.0.0" @@ -1891,34 +1896,51 @@ dependencies = [ [[package]] name = "bp-bridge-hub-rococo" -version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-bridge-hub-cumulus 0.21.0", - "bp-messages 0.20.1", - "bp-runtime 0.20.1", + "bp-bridge-hub-cumulus 0.7.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", "bp-xcm-bridge-hub", - "frame-support 40.1.0", + "frame-support 28.0.0", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] name = "bp-bridge-hub-westend" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-bridge-hub-cumulus 0.21.0", - "bp-messages 0.20.1", - "bp-runtime 0.20.1", + "bp-bridge-hub-cumulus 0.7.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", "bp-xcm-bridge-hub", - "frame-support 40.1.0", + "frame-support 28.0.0", + "parity-scale-codec", + "sp-api 26.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", +] + +[[package]] +name = "bp-header-chain" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bp-runtime 0.7.0", + "finality-grandpa", + "frame-support 28.0.0", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "scale-info", + "serde", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] @@ -1940,20 +1962,19 @@ dependencies = [ ] [[package]] -name = "bp-header-chain" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-messages" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-runtime 0.20.1", - "finality-grandpa", - "frame-support 40.1.0", + "bp-header-chain 0.7.0", + "bp-runtime 0.7.0", + "frame-support 28.0.0", "parity-scale-codec", "scale-info", "serde", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] @@ -1974,36 +1995,37 @@ dependencies = [ ] [[package]] -name = "bp-messages" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-parachains" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-header-chain 0.20.1", - "bp-runtime 0.20.1", - "frame-support 40.1.0", + "bp-header-chain 0.7.0", + "bp-polkadot-core 0.7.0", + "bp-runtime 0.7.0", + "frame-support 28.0.0", + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] -name = "bp-parachains" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-polkadot-core" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-header-chain 0.20.1", - "bp-polkadot-core 0.20.1", - "bp-runtime 0.20.1", - "frame-support 40.1.0", - "impl-trait-for-tuples", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] @@ -2026,38 +2048,44 @@ dependencies = [ ] [[package]] -name = "bp-polkadot-core" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-relayers" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "frame-support 40.1.0", - "frame-system 40.1.0", + "bp-header-chain 0.7.0", + "bp-messages 0.7.0", + "bp-parachains", + "bp-runtime 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-utility 28.0.0", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] -name = "bp-relayers" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-runtime" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-header-chain 0.20.1", - "bp-messages 0.20.1", - "bp-parachains", - "bp-runtime 0.20.1", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-utility 40.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "hash-db", + "impl-trait-for-tuples", + "log", + "num-traits", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-trie 29.0.0", + "trie-db 0.30.0", ] [[package]] @@ -2085,43 +2113,32 @@ dependencies = [ ] [[package]] -name = "bp-runtime" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-xcm-bridge-hub" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "hash-db", - "impl-trait-for-tuples", - "log", - "num-traits", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "frame-support 28.0.0", "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "trie-db 0.30.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", ] [[package]] -name = "bp-xcm-bridge-hub" -version = "0.6.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "bp-xcm-bridge-hub-router" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "frame-support 40.1.0", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", ] [[package]] @@ -2137,18 +2154,6 @@ dependencies = [ "staging-xcm 14.2.2", ] -[[package]] -name = "bp-xcm-bridge-hub-router" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", -] - [[package]] name = "bs58" version = "0.5.1" @@ -2906,6 +2911,21 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -3038,10 +3058,36 @@ dependencies = [ "cipher 0.4.4", ] +[[package]] +name = "cumulus-client-bootnodes" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "cumulus-client-network", + "cumulus-primitives-core 0.7.0", + "cumulus-relay-chain-interface", + "futures", + "hex", + "ip_network", + "log", + "num-traits", + "parachains-common 7.0.0", + "parity-scale-codec", + "prost 0.12.6", + "prost-build", + "sc-network", + "sc-service", + "sp-consensus-babe 0.32.0", + "sp-runtime 31.0.1", + "tokio", +] + [[package]] name = "cumulus-client-cli" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "clap", "parity-scale-codec", @@ -3050,46 +3096,46 @@ dependencies = [ "sc-client-api", "sc-service", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "url", ] [[package]] name = "cumulus-client-collator" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "futures", "parity-scale-codec", "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-client-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "tracing", ] [[package]] name = "cumulus-client-consensus-aura" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "cumulus-client-collator", "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-parachain-inherent", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", "futures", "parity-scale-codec", @@ -3098,7 +3144,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-client-api", "sc-consensus", "sc-consensus-aura", @@ -3107,19 +3153,19 @@ dependencies = [ "sc-telemetry", "sc-utils", "schnellru", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-timestamp 26.0.0", + "sp-trie 29.0.0", "substrate-prometheus-endpoint", "tokio", "tracing", @@ -3127,53 +3173,55 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "cumulus-client-pov-recovery", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", + "cumulus-relay-chain-streams", "dyn-clone", "futures", "log", "parity-scale-codec", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-client-api", "sc-consensus", "sc-consensus-babe", + "sc-network", "schnellru", "sp-blockchain", "sp-consensus", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-timestamp 26.0.0", + "sp-trie 29.0.0", + "sp-version 29.0.0", "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "cumulus-client-consensus-proposer" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "anyhow", "async-trait", - "cumulus-primitives-parachain-inherent 0.18.1", + "cumulus-primitives-parachain-inherent 0.7.0", "sp-consensus", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", "thiserror 1.0.69", ] [[package]] name = "cumulus-client-network" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -3183,82 +3231,89 @@ dependencies = [ "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "sc-client-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-network", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-version 29.0.0", "tracing", ] [[package]] name = "cumulus-client-parachain-inherent" -version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-parachain-inherent 0.18.1", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-relay-chain-interface", "cumulus-test-relay-sproof-builder", "parity-scale-codec", "sc-client-api", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-consensus-babe", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-storage 19.0.0", "tracing", ] [[package]] name = "cumulus-client-pov-recovery" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", + "cumulus-relay-chain-streams", "futures", "futures-timer", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-network", + "sp-api 26.0.0", "sp-consensus", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-runtime 31.0.1", + "sp-version 29.0.0", "tracing", ] [[package]] name = "cumulus-client-service" -version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "async-channel 1.9.0", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-client-pov-recovery", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-proof-size-hostfunction 0.12.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-proof-size-hostfunction 0.2.0", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", + "cumulus-relay-chain-streams", "futures", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", + "prometheus", "sc-client-api", "sc-consensus", "sc-network", @@ -3270,13 +3325,30 @@ dependencies = [ "sc-telemetry", "sc-transaction-pool", "sc-utils", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-transaction-pool 26.0.0", +] + +[[package]] +name = "cumulus-pallet-aura-ext" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-pallet-parachain-system 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-aura 27.0.0", + "pallet-timestamp 27.0.0", + "parity-scale-codec", + "scale-info", + "sp-application-crypto 30.0.0", + "sp-consensus-aura 0.32.0", + "sp-runtime 31.0.1", ] [[package]] @@ -3298,20 +3370,40 @@ dependencies = [ ] [[package]] -name = "cumulus-pallet-aura-ext" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-pallet-parachain-system" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-pallet-parachain-system 0.20.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-aura 39.0.0", - "pallet-timestamp 39.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-aura 0.42.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "bytes", + "cumulus-pallet-parachain-system-proc-macro 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-parachain-inherent 0.7.0", + "cumulus-primitives-proof-size-hostfunction 0.2.0", + "environmental", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "hashbrown 0.15.3", + "impl-trait-for-tuples", + "log", + "pallet-message-queue 31.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-runtime-parachains 7.0.0", + "scale-info", + "sp-consensus-babe 0.32.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-trie 29.0.0", + "sp-version 29.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "trie-db 0.30.0", ] [[package]] @@ -3351,41 +3443,6 @@ dependencies = [ "trie-db 0.29.1", ] -[[package]] -name = "cumulus-pallet-parachain-system" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "bytes", - "cumulus-pallet-parachain-system-proc-macro 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-parachain-inherent 0.18.1", - "cumulus-primitives-proof-size-hostfunction 0.12.0", - "environmental", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", - "log", - "pallet-message-queue 43.1.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-runtime-parachains 19.1.0", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "trie-db 0.30.0", -] - [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" @@ -3401,7 +3458,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3409,6 +3466,19 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "cumulus-pallet-session-benchmarking" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-session 28.0.0", + "parity-scale-codec", + "sp-runtime 31.0.1", +] + [[package]] name = "cumulus-pallet-session-benchmarking" version = "19.0.0" @@ -3423,36 +3493,38 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "cumulus-pallet-session-benchmarking" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-session 40.0.0", - "parity-scale-codec", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "cumulus-pallet-weight-reclaim" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "cumulus-primitives-storage-weight-reclaim", "derive-where", "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", +] + +[[package]] +name = "cumulus-pallet-xcm" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "parity-scale-codec", + "scale-info", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", ] [[package]] @@ -3472,18 +3544,29 @@ dependencies = [ ] [[package]] -name = "cumulus-pallet-xcm" -version = "0.19.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-pallet-xcmp-queue" +version = "0.7.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "frame-system 40.1.0", + "approx", + "bounded-collections", + "bp-xcm-bridge-hub-router 0.6.0", + "cumulus-primitives-core 0.7.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "pallet-message-queue 31.0.0", "parity-scale-codec", + "polkadot-runtime-common 7.0.0", + "polkadot-runtime-parachains 7.0.0", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -3513,28 +3596,12 @@ dependencies = [ ] [[package]] -name = "cumulus-pallet-xcmp-queue" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-aura" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bounded-collections", - "bp-xcm-bridge-hub-router 0.17.0", - "cumulus-primitives-core 0.18.1", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-message-queue 43.1.0", - "parity-scale-codec", - "polkadot-runtime-common 19.1.0", - "polkadot-runtime-parachains 19.1.0", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-api 26.0.0", + "sp-consensus-aura 0.32.0", ] [[package]] @@ -3552,12 +3619,20 @@ dependencies = [ ] [[package]] -name = "cumulus-primitives-aura" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-core" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-aura 0.42.0", + "parity-scale-codec", + "polkadot-core-primitives 7.0.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "scale-info", + "sp-api 26.0.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", + "staging-xcm 7.0.1", + "tracing", ] [[package]] @@ -3578,19 +3653,17 @@ dependencies = [ ] [[package]] -name = "cumulus-primitives-core" -version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-parachain-inherent" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "async-trait", + "cumulus-primitives-core 0.7.0", "parity-scale-codec", - "polkadot-core-primitives 17.1.0", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-trie 29.0.0", ] [[package]] @@ -3609,17 +3682,13 @@ dependencies = [ ] [[package]] -name = "cumulus-primitives-parachain-inherent" -version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-proof-size-hostfunction" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "async-trait", - "cumulus-primitives-core 0.18.1", - "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-externalities 0.25.0", + "sp-runtime-interface 24.0.0", + "sp-trie 29.0.0", ] [[package]] @@ -3634,30 +3703,37 @@ dependencies = [ ] [[package]] -name = "cumulus-primitives-proof-size-hostfunction" -version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-storage-weight-reclaim" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-proof-size-hostfunction 0.2.0", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime 31.0.1", ] [[package]] -name = "cumulus-primitives-storage-weight-reclaim" -version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "cumulus-primitives-utility" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-proof-size-hostfunction 0.12.0", - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", "log", + "pallet-asset-conversion 10.0.0", "parity-scale-codec", - "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-runtime-common 7.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -3678,83 +3754,73 @@ dependencies = [ "staging-xcm-executor 17.0.2", ] -[[package]] -name = "cumulus-primitives-utility" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "log", - "pallet-asset-conversion 22.0.0", - "parity-scale-codec", - "polkadot-runtime-common 19.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", -] - [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "async-channel 1.9.0", "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-client-bootnodes", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", "futures", "futures-timer", "polkadot-cli", + "polkadot-primitives 7.0.0", "polkadot-service", "sc-cli", "sc-client-api", + "sc-network", "sc-sysinfo", "sc-telemetry", "sc-tracing", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", ] [[package]] name = "cumulus-relay-chain-interface" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "futures", "jsonrpsee-core", "parity-scale-codec", "polkadot-overseer", "sc-client-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-network", + "sp-api 26.0.0", "sp-blockchain", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-state-machine 0.35.0", + "sp-version 29.0.0", "thiserror 1.0.69", ] [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", + "async-channel 1.9.0", "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-client-bootnodes", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures", - "polkadot-core-primitives 17.1.0", + "polkadot-core-primitives 7.0.0", "polkadot-network-bridge", "polkadot-node-network-protocol", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "polkadot-service", "sc-authority-discovery", "sc-client-api", @@ -3763,22 +3829,22 @@ dependencies = [ "sc-service", "sc-tracing", "sc-utils", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.42.1", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-babe 0.32.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", "either", "futures", @@ -3790,6 +3856,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-rpc-api", "sc-service", "schnellru", @@ -3797,13 +3864,13 @@ dependencies = [ "serde_json", "smoldot 0.11.0", "smoldot-light 0.9.0", - "sp-authority-discovery 36.0.0", - "sp-consensus-babe 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-authority-discovery 26.0.0", + "sp-consensus-babe 0.32.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-storage 19.0.0", + "sp-version 29.0.0", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -3812,17 +3879,31 @@ dependencies = [ "url", ] +[[package]] +name = "cumulus-relay-chain-streams" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-relay-chain-interface", + "futures", + "polkadot-node-subsystem", + "polkadot-primitives 7.0.0", + "sp-api 26.0.0", + "sp-consensus", + "tracing", +] + [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "parity-scale-codec", - "polkadot-primitives 18.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-primitives 7.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", ] [[package]] @@ -4457,38 +4538,42 @@ dependencies = [ [[package]] name = "emulated-integration-tests-common" -version = "20.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "asset-test-utils", - "bp-messages 0.20.1", + "bp-messages 0.7.0", "bp-xcm-bridge-hub", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", "hex-literal", - "pallet-assets 42.0.0", - "pallet-balances 41.1.0", + "pallet-asset-conversion 10.0.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", "pallet-bridge-messages", - "pallet-message-queue 43.1.0", - "pallet-xcm 19.1.0", + "pallet-message-queue 31.0.0", + "pallet-xcm 7.0.0", "pallet-xcm-bridge-hub", - "parachains-common 21.0.0", + "parachains-common 7.0.0", "parity-scale-codec", "paste", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-parachains 19.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-parachains 7.0.0", "sc-consensus-grandpa", - "sp-authority-discovery 36.0.0", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-authority-discovery 26.0.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-core 28.0.0", + "sp-keyring 31.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", "xcm-emulator", + "xcm-runtime-apis 0.1.1", + "xcm-simulator", ] [[package]] @@ -4694,6 +4779,14 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "ethereum-standards" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "alloy-core", +] + [[package]] name = "ethereum-types" version = "0.14.1" @@ -4973,8 +5066,8 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "12.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", ] @@ -5015,6 +5108,30 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" +[[package]] +name = "frame-benchmarking" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-support 28.0.0", + "frame-support-procedural 23.0.0", + "frame-system 28.0.0", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-runtime-interface 24.0.0", + "sp-storage 19.0.0", + "static_assertions", +] + [[package]] name = "frame-benchmarking" version = "38.0.0" @@ -5040,34 +5157,10 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "frame-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "frame-support 40.1.0", - "frame-support-procedural 33.0.0", - "frame-system 40.1.0", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "static_assertions", -] - [[package]] name = "frame-benchmarking-cli" -version = "47.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "32.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "array-bytes", @@ -5075,18 +5168,19 @@ dependencies = [ "clap", "comfy-table", "cumulus-client-parachain-inherent", - "cumulus-primitives-proof-size-hostfunction 0.12.0", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "cumulus-primitives-proof-size-hostfunction 0.2.0", + "frame-benchmarking 28.0.0", + "frame-storage-access-test-runtime", + "frame-support 28.0.0", + "frame-system 28.0.0", "gethostname", "handlebars", "itertools 0.11.0", "linked-hash-map", "log", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "rand_pcg", "sc-block-builder", @@ -5094,30 +5188,32 @@ dependencies = [ "sc-cli", "sc-client-api", "sc-client-db", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", + "sc-executor-common 0.29.0", + "sc-executor-wasmtime 0.29.0", "sc-runtime-utilities", "sc-service", "sc-sysinfo", "serde", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-database", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", - "sp-transaction-pool 36.0.0", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-externalities 0.25.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-storage 19.0.0", + "sp-timestamp 26.0.0", + "sp-transaction-pool 26.0.0", + "sp-trie 29.0.0", + "sp-version 29.0.0", + "sp-wasm-interface 20.0.0", "subxt", "subxt-signer", "thiserror 1.0.69", @@ -5126,13 +5222,13 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.5.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6027a409bac4fe95b4d107f965fcdbc252fc89d884a360d076b3070b6128c094" +checksum = "a7cb8796f93fa038f979a014234d632e9688a120e745f936e2635123c77537f7" dependencies = [ - "frame-metadata 17.0.0", + "frame-metadata 20.0.0", "parity-scale-codec", - "scale-decode 0.14.0", + "scale-decode 0.16.0", "scale-info", "scale-type-resolver 0.2.0", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5140,9 +5236,8 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" -version = "14.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -5152,8 +5247,9 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" -version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "14.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -5161,6 +5257,23 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "frame-election-provider-support" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-election-provider-solution-type 13.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "parity-scale-codec", + "scale-info", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-npos-elections 26.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", +] + [[package]] name = "frame-election-provider-support" version = "38.0.0" @@ -5172,26 +5285,28 @@ dependencies = [ "frame-system 38.0.0", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-npos-elections 34.0.0", "sp-runtime 39.0.5", ] [[package]] -name = "frame-election-provider-support" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "frame-executive" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-election-provider-solution-type 16.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "aquamarine", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-try-runtime 0.34.0", + "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-npos-elections 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", ] [[package]] @@ -5210,25 +5325,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "frame-executive" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "aquamarine", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-try-runtime 0.46.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-tracing 17.1.0", ] [[package]] @@ -5245,9 +5342,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "17.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701bac17e9b55e0f95067c428ebcb46496587f08e8cf4ccc0fe5903bea10dbb8" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" dependencies = [ "cfg-if", "parity-scale-codec", @@ -5257,9 +5354,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "20.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" dependencies = [ "cfg-if", "parity-scale-codec", @@ -5267,6 +5364,22 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata-hash-extension" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "array-bytes", + "const-hex", + "docify", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime 31.0.1", +] + [[package]] name = "frame-metadata-hash-extension" version = "0.6.0" @@ -5284,19 +5397,58 @@ dependencies = [ ] [[package]] -name = "frame-metadata-hash-extension" -version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "frame-storage-access-test-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-pallet-parachain-system 0.7.0", + "parity-scale-codec", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", + "substrate-wasm-builder 17.0.0", +] + +[[package]] +name = "frame-support" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "aquamarine", "array-bytes", - "const-hex", + "binary-merkle-tree 13.0.0", + "bitflags 1.3.2", "docify", - "frame-support 40.1.0", - "frame-system 40.1.0", + "environmental", + "frame-metadata 23.0.0", + "frame-support-procedural 23.0.0", + "impl-trait-for-tuples", + "k256", "log", + "macro_magic", "parity-scale-codec", + "paste", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "serde_json", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", + "sp-state-machine 0.35.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-tracing 16.0.0", + "sp-trie 29.0.0", + "sp-weights 27.0.0", + "tt-call", ] [[package]] @@ -5323,7 +5475,7 @@ dependencies = [ "serde_json", "smallvec", "sp-api 34.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5335,101 +5487,59 @@ dependencies = [ "sp-staking 36.0.0", "sp-state-machine 0.43.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", + "sp-weights 31.1.0", "static_assertions", "tt-call", ] -[[package]] -name = "frame-support" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "aquamarine", - "array-bytes", - "binary-merkle-tree 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "bitflags 1.3.2", - "docify", - "environmental", - "frame-metadata 20.0.0", - "frame-support-procedural 33.0.0", - "impl-trait-for-tuples", - "k256", - "log", - "macro_magic", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-metadata-ir 0.10.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "tt-call", -] - [[package]] name = "frame-support-procedural" -version = "30.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da784d943f2a945be923ab081a7c0837355b38045c50945d7ec1a138e2f3c52" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "docify", "expander", - "frame-support-procedural-tools 13.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-support-procedural-tools 10.0.0", "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "syn 2.0.101", ] [[package]] name = "frame-support-procedural" -version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "30.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da784d943f2a945be923ab081a7c0837355b38045c50945d7ec1a138e2f3c52" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "docify", "expander", - "frame-support-procedural-tools 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "frame-support-procedural-tools 13.0.1", "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "syn 2.0.101", ] [[package]] name = "frame-support-procedural-tools" -version = "13.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support-procedural-tools-derive 12.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-support-procedural-tools-derive 11.0.0", "proc-macro-crate 3.3.0", "proc-macro2", "quote", @@ -5439,9 +5549,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" dependencies = [ - "frame-support-procedural-tools-derive 12.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "frame-support-procedural-tools-derive 12.0.0", "proc-macro-crate 3.3.0", "proc-macro2", "quote", @@ -5450,9 +5561,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", @@ -5462,13 +5572,33 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", "syn 2.0.101", ] +[[package]] +name = "frame-system" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cfg-if", + "docify", + "frame-support 28.0.0", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-version 29.0.0", + "sp-weights 27.0.0", +] + [[package]] name = "frame-system" version = "38.0.0" @@ -5487,26 +5617,21 @@ dependencies = [ "sp-runtime 39.0.5", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-version 37.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", ] [[package]] -name = "frame-system" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "frame-system-benchmarking" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cfg-if", - "docify", - "frame-support 40.1.0", - "log", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -5525,17 +5650,13 @@ dependencies = [ ] [[package]] -name = "frame-system-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "frame-system-rpc-runtime-api" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "docify", "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", ] [[package]] @@ -5550,13 +5671,14 @@ dependencies = [ ] [[package]] -name = "frame-system-rpc-runtime-api" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "frame-try-runtime" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", + "frame-support 28.0.0", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -5571,17 +5693,6 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "frame-try-runtime" -version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "frame-support 40.1.0", - "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -5772,16 +5883,30 @@ dependencies = [ ] [[package]] -name = "generic-array" -version = "0.12.4" +name = "generator" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +checksum = "d18470a76cb7f8ff746cf1f7470914f900252ec36bbc40b569d74b1258446827" dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.61.1", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" @@ -6118,6 +6243,31 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.9.1", + "ring 0.17.14", + "thiserror 2.0.12", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-resolver" version = "0.24.4" @@ -6126,7 +6276,7 @@ checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.24.4", "ipconfig", "lru-cache", "once_cell", @@ -6139,6 +6289,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "hickory-resolver" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.25.2", + "ipconfig", + "moka", + "once_cell", + "parking_lot 0.12.3", + "rand 0.9.1", + "resolv-conf", + "smallvec", + "thiserror 2.0.12", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -6252,6 +6423,16 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "hyper" version = "0.14.32" @@ -6533,7 +6714,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.53.0", ] [[package]] @@ -6925,31 +7106,31 @@ dependencies = [ "asset-hub-paseo-runtime", "asset-hub-westend-runtime", "asset-test-utils", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "emulated-integration-tests-common", - "frame-support 40.1.0", - "pallet-assets 42.0.0", - "pallet-balances 41.1.0", - "pallet-message-queue 43.1.0", - "pallet-xcm 19.1.0", + "frame-support 28.0.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", + "pallet-message-queue 31.0.0", + "pallet-xcm 7.0.0", "parity-scale-codec", "paseo-runtime", "paseo-runtime-constants", - "polkadot-primitives 18.1.0", - "polkadot-runtime-parachains 19.1.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-parachains 7.0.0", "pop-runtime-common", "pop-runtime-devnet", "pop-runtime-mainnet", "pop-runtime-testnet", - "sp-authority-discovery 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "sp-authority-discovery 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", "tracing-subscriber", "westend-runtime", "westend-runtime-constants", @@ -7019,7 +7200,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "ismp" version = "0.2.2" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "anyhow", "derive_more 1.0.0", @@ -7036,12 +7217,12 @@ dependencies = [ [[package]] name = "ismp-parachain" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "frame-system 40.1.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "hex-literal", "ismp", "log", @@ -7050,22 +7231,22 @@ dependencies = [ "primitive-types 0.13.1", "scale-info", "serde", - "sp-consensus-aura 0.42.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-aura 0.32.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", "substrate-state-machine", ] [[package]] name = "ismp-parachain-inherent" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "anyhow", "async-trait", - "cumulus-primitives-core 0.18.1", + "cumulus-primitives-core 0.7.0", "cumulus-relay-chain-interface", "ismp", "ismp-parachain", @@ -7073,19 +7254,19 @@ dependencies = [ "log", "pallet-ismp-runtime-api", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "ismp-parachain-runtime-api" version = "1.15.1" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ - "cumulus-pallet-parachain-system 0.20.0", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "cumulus-pallet-parachain-system 0.7.0", + "sp-api 26.0.0", ] [[package]] @@ -7399,7 +7580,7 @@ dependencies = [ "sp-core 34.0.0", "sp-runtime 39.0.5", "sp-trie 37.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm-builder 17.0.5", ] @@ -7585,7 +7766,7 @@ checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", - "hickory-resolver", + "hickory-resolver 0.24.4", "libp2p-core", "libp2p-identity", "parking_lot 0.12.3", @@ -7671,7 +7852,7 @@ checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", - "hickory-proto", + "hickory-proto 0.24.4", "if-watch", "libp2p-core", "libp2p-identity", @@ -8096,9 +8277,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "litep2p" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71056c23c896bb0e18113b2d2f1989be95135e6bdeedb0b757422ee21a073eb" +checksum = "14fb10e63363204b89d91e1292df83322fd9de5d7fa76c3d5c78ddc2f8f3efa9" dependencies = [ "async-trait", "bs58", @@ -8107,7 +8288,7 @@ dependencies = [ "ed25519-dalek", "futures", "futures-timer", - "hickory-resolver", + "hickory-resolver 0.25.2", "indexmap 2.9.0", "libc", "mockall", @@ -8157,6 +8338,19 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" version = "0.8.1" @@ -8353,6 +8547,16 @@ dependencies = [ "hash-db", ] +[[package]] +name = "memory-db" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6da20dba965bd218a14c3b335b90d3e07c09ede190c7c19b50deb23d418a322" +dependencies = [ + "hash-db", + "hashbrown 0.15.3", +] + [[package]] name = "merkleized-metadata" version = "0.4.0" @@ -8433,36 +8637,36 @@ dependencies = [ [[package]] name = "mmr-gadget" -version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "log", "parity-scale-codec", "sc-client-api", "sc-offchain", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-beefy 24.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-beefy 13.0.0", + "sp-core 28.0.0", + "sp-mmr-primitives 26.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "mmr-rpc" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "jsonrpsee", "parity-scale-codec", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-mmr-primitives 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -8491,6 +8695,25 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "moka" +version = "0.12.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "loom", + "parking_lot 0.12.3", + "portable-atomic", + "rustc_version 0.4.1", + "smallvec", + "tagptr", + "thiserror 1.0.69", + "uuid", +] + [[package]] name = "multi-stash" version = "0.2.0" @@ -8782,6 +9005,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -8931,6 +9163,10 @@ name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "opaque-debug" @@ -9010,22 +9246,40 @@ name = "pallet-api" version = "0.1.0" dependencies = [ "anyhow", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "ismp", "log", - "pallet-assets 42.0.0", - "pallet-balances 41.1.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", "pallet-ismp", "pallet-nfts 34.1.0", "parity-scale-codec", "pop-chain-extension", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", +] + +[[package]] +name = "pallet-asset-conversion" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9041,46 +9295,43 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api 34.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", ] [[package]] -name = "pallet-asset-conversion" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-asset-conversion-ops" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-asset-conversion 10.0.0", "parity-scale-codec", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-asset-conversion-ops" -version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-asset-conversion-tx-payment" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-asset-conversion 22.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-asset-conversion 10.0.0", + "pallet-transaction-payment 28.0.0", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] @@ -9099,18 +9350,17 @@ dependencies = [ ] [[package]] -name = "pallet-asset-conversion-tx-payment" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-asset-rate" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-asset-conversion 22.0.0", - "pallet-transaction-payment 40.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9129,35 +9379,37 @@ dependencies = [ ] [[package]] -name = "pallet-asset-rate" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-asset-rewards" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] -name = "pallet-asset-rewards" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-asset-tx-payment" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-transaction-payment 28.0.0", "parity-scale-codec", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9179,20 +9431,21 @@ dependencies = [ ] [[package]] -name = "pallet-asset-tx-payment" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-assets" +version = "29.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-transaction-payment 40.0.0", + "ethereum-standards", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "log", + "pallet-revive", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9213,31 +9466,31 @@ dependencies = [ ] [[package]] -name = "pallet-assets" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-assets-freezer" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", "log", + "pallet-assets 29.1.0", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", ] [[package]] -name = "pallet-assets-freezer" -version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-aura" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-assets 42.0.0", + "pallet-timestamp 27.0.0", "parity-scale-codec", - "polkadot-sdk-frame", "scale-info", + "sp-application-crypto 30.0.0", + "sp-consensus-aura 0.32.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9258,19 +9511,18 @@ dependencies = [ ] [[package]] -name = "pallet-aura" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-authority-discovery" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-timestamp 39.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-session 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-aura 0.42.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-authority-discovery 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9290,18 +9542,16 @@ dependencies = [ ] [[package]] -name = "pallet-authority-discovery" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-authorship" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-session 40.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] @@ -9319,16 +9569,26 @@ dependencies = [ ] [[package]] -name = "pallet-authorship" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-babe" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "pallet-authorship 28.0.0", + "pallet-session 28.0.0", + "pallet-timestamp 27.0.0", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-consensus-babe 0.32.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", ] [[package]] @@ -9356,26 +9616,24 @@ dependencies = [ ] [[package]] -name = "pallet-babe" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-bags-list" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "aquamarine", + "docify", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-authorship 40.0.0", - "pallet-session 40.0.0", - "pallet-timestamp 39.0.0", + "pallet-balances 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-babe 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", ] [[package]] @@ -9397,28 +9655,23 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", ] [[package]] -name = "pallet-bags-list" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-balances" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "aquamarine", "docify", - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-balances 41.1.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9438,19 +9691,22 @@ dependencies = [ ] [[package]] -name = "pallet-balances" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-beefy" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-authorship 28.0.0", + "pallet-session 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-consensus-beefy 13.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", ] [[package]] @@ -9474,22 +9730,28 @@ dependencies = [ ] [[package]] -name = "pallet-beefy" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-beefy-mmr" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", + "array-bytes", + "binary-merkle-tree 13.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-authorship 40.0.0", - "pallet-session 40.0.0", + "pallet-beefy 28.0.0", + "pallet-mmr 27.0.0", + "pallet-session 28.0.0", "parity-scale-codec", "scale-info", "serde", - "sp-consensus-beefy 24.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", + "sp-api 26.0.0", + "sp-consensus-beefy 13.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", ] [[package]] @@ -9519,28 +9781,20 @@ dependencies = [ ] [[package]] -name = "pallet-beefy-mmr" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-bounties" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "array-bytes", - "binary-merkle-tree 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-beefy 41.1.0", - "pallet-mmr 40.0.0", - "pallet-session 40.0.0", + "pallet-treasury 27.0.0", "parity-scale-codec", "scale-info", - "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-beefy 24.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9562,39 +9816,40 @@ dependencies = [ ] [[package]] -name = "pallet-bounties" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-bridge-messages" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "bp-header-chain 0.7.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-treasury 39.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-trie 29.0.0", ] [[package]] -name = "pallet-bridge-messages" -version = "0.20.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-broker" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-header-chain 0.20.1", - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "bitvec", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9611,27 +9866,27 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api 34.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-runtime 39.0.5", ] [[package]] -name = "pallet-broker" -version = "0.19.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-child-bounties" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bitvec", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-bounties 27.0.0", + "pallet-treasury 27.0.0", "parity-scale-codec", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9654,21 +9909,22 @@ dependencies = [ ] [[package]] -name = "pallet-child-bounties" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-collator-selection" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-bounties 39.0.0", - "pallet-treasury 39.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-session 28.0.0", "parity-scale-codec", + "rand 0.8.5", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -9691,56 +9947,37 @@ dependencies = [ "sp-staking 36.0.0", ] -[[package]] -name = "pallet-collator-selection" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-session 40.0.0", - "parity-scale-codec", - "rand 0.8.5", - "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", -] - [[package]] name = "pallet-collective" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "pallet-contracts" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "environmental", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "impl-trait-for-tuples", "log", - "pallet-balances 41.1.0", + "pallet-balances 28.0.0", "pallet-contracts-proc-macro", - "pallet-contracts-uapi 14.0.0", + "pallet-contracts-uapi 5.0.0", "parity-scale-codec", "paste", "rand 0.8.5", @@ -9748,26 +9985,37 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", "wasm-instrument", "wasmi 0.32.3", ] [[package]] name = "pallet-contracts-proc-macro" -version = "23.0.3" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "18.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", "syn 2.0.101", ] +[[package]] +name = "pallet-contracts-uapi" +version = "5.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bitflags 1.3.2", + "parity-scale-codec", + "paste", + "scale-info", +] + [[package]] name = "pallet-contracts-uapi" version = "9.0.0" @@ -9780,14 +10028,19 @@ dependencies = [ ] [[package]] -name = "pallet-contracts-uapi" -version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-conviction-voting" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bitflags 1.3.2", + "assert_matches", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", - "paste", "scale-info", + "serde", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9808,19 +10061,18 @@ dependencies = [ ] [[package]] -name = "pallet-conviction-voting" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-delegated-staking" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "assert_matches", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", "scale-info", - "serde", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -9840,35 +10092,41 @@ dependencies = [ ] [[package]] -name = "pallet-delegated-staking" -version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-democracy" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-democracy" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-election-provider-multi-phase" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", + "rand 0.8.5", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-npos-elections 26.0.0", + "sp-runtime 31.0.1", + "strum 0.26.3", ] [[package]] @@ -9886,7 +10144,7 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-io 38.0.2", "sp-npos-elections 34.0.0", @@ -9895,25 +10153,16 @@ dependencies = [ ] [[package]] -name = "pallet-election-provider-multi-phase" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-election-provider-support-benchmarking" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-election-provider-support-benchmarking 39.0.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", - "rand 0.8.5", - "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-npos-elections 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "strum 0.26.3", + "sp-npos-elections 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -9931,34 +10180,39 @@ dependencies = [ ] [[package]] -name = "pallet-election-provider-support-benchmarking" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-elections-phragmen" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", - "sp-npos-elections 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "scale-info", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-npos-elections 26.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] -name = "pallet-elections-phragmen" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-fast-unstake" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "docify", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-npos-elections 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -9981,21 +10235,25 @@ dependencies = [ ] [[package]] -name = "pallet-fast-unstake" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-grandpa" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-authorship 28.0.0", + "pallet-session 28.0.0", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-application-crypto 30.0.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", ] [[package]] @@ -10022,25 +10280,19 @@ dependencies = [ ] [[package]] -name = "pallet-grandpa" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-identity" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "enumflags2", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-authorship 40.0.0", - "pallet-session 40.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -10061,19 +10313,22 @@ dependencies = [ ] [[package]] -name = "pallet-identity" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-im-online" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "enumflags2", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-authorship 28.0.0", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -10097,22 +10352,18 @@ dependencies = [ ] [[package]] -name = "pallet-im-online" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-indices" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-authorship 40.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -10132,51 +10383,36 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "pallet-indices" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "pallet-ismp" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "anyhow", "fortuples", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "ismp", "log", "parity-scale-codec", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-mmr-primitives 26.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] name = "pallet-ismp-rpc" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "anyhow", - "frame-system 40.1.0", + "frame-system 28.0.0", "hash-db", "hex", "hex-literal", @@ -10189,13 +10425,13 @@ dependencies = [ "sc-rpc", "serde", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-mmr-primitives 26.0.0", + "sp-runtime 31.0.1", + "sp-storage 19.0.0", + "sp-trie 29.0.0", "tower", "trie-db 0.30.0", ] @@ -10203,31 +10439,34 @@ dependencies = [ [[package]] name = "pallet-ismp-runtime-api" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "ismp", "pallet-ismp", "parity-scale-codec", "primitive-types 0.13.1", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", + "sp-api 26.0.0", + "sp-mmr-primitives 26.0.0", ] [[package]] -name = "pallet-membership" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-message-queue" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "environmental", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", ] [[package]] @@ -10243,67 +10482,60 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", ] [[package]] -name = "pallet-message-queue" -version = "43.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-meta-tx" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "environmental", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] -name = "pallet-meta-tx" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-migrations" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-migrations" -version = "10.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-mmr" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", "log", "parity-scale-codec", "polkadot-sdk-frame", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-mmr-primitives 26.0.0", ] [[package]] @@ -10325,32 +10557,31 @@ dependencies = [ ] [[package]] -name = "pallet-mmr" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-motion" +version = "4.0.0-dev" dependencies = [ + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-balances 28.0.0", + "pallet-collective", "parity-scale-codec", - "polkadot-sdk-frame", "scale-info", - "sp-mmr-primitives 36.1.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-motion" -version = "4.0.0-dev" +name = "pallet-multisig" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", "log", - "pallet-balances 41.1.0", - "pallet-collective", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", ] [[package]] @@ -10370,30 +10601,33 @@ dependencies = [ ] [[package]] -name = "pallet-multisig" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nft-fractionalization" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", + "pallet-assets 29.1.0", + "pallet-nfts 22.0.0", "parity-scale-codec", "polkadot-sdk-frame", "scale-info", ] [[package]] -name = "pallet-nft-fractionalization" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nfts" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "enumflags2", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-assets 42.0.0", - "pallet-nfts 34.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -10419,34 +10653,26 @@ name = "pallet-nfts" version = "34.1.0" dependencies = [ "enumflags2", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-balances 41.1.0", + "pallet-balances 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-nfts" -version = "34.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nfts-runtime-api" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "enumflags2", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", ] [[package]] @@ -10461,22 +10687,31 @@ dependencies = [ ] [[package]] -name = "pallet-nfts-runtime-api" -version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nis" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-sdk-frame", + "scale-info", ] [[package]] -name = "pallet-nis" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nomination-pools" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "pallet-balances 28.0.0", "parity-scale-codec", - "polkadot-sdk-frame", "scale-info", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", + "sp-tracing 16.0.0", ] [[package]] @@ -10495,25 +10730,27 @@ dependencies = [ "sp-io 38.0.2", "sp-runtime 39.0.5", "sp-staking 36.0.0", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", ] [[package]] -name = "pallet-nomination-pools" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nomination-pools-benchmarking" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-balances 41.1.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-bags-list 27.0.0", + "pallet-delegated-staking 1.0.0", + "pallet-nomination-pools 25.0.0", + "pallet-staking 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-runtime-interface 24.0.0", + "sp-staking 26.0.0", ] [[package]] @@ -10538,23 +10775,13 @@ dependencies = [ ] [[package]] -name = "pallet-nomination-pools-benchmarking" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-nomination-pools-runtime-api" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-bags-list 39.1.0", - "pallet-delegated-staking 7.0.0", - "pallet-nomination-pools 38.1.0", - "pallet-staking 40.1.0", + "pallet-nomination-pools 25.0.0", "parity-scale-codec", - "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-api 26.0.0", ] [[package]] @@ -10569,13 +10796,18 @@ dependencies = [ ] [[package]] -name = "pallet-nomination-pools-runtime-api" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-offences" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "pallet-nomination-pools 38.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "scale-info", + "serde", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -10596,18 +10828,26 @@ dependencies = [ ] [[package]] -name = "pallet-offences" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-offences-benchmarking" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-babe 28.0.0", + "pallet-balances 28.0.0", + "pallet-grandpa 28.0.0", + "pallet-im-online 27.0.0", + "pallet-offences 27.0.0", + "pallet-session 28.0.0", + "pallet-staking 28.0.0", "parity-scale-codec", "scale-info", - "serde", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -10635,26 +10875,20 @@ dependencies = [ ] [[package]] -name = "pallet-offences-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-parameters" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-babe 40.0.0", - "pallet-balances 41.1.0", - "pallet-grandpa 40.0.0", - "pallet-im-online 39.1.0", - "pallet-offences 39.0.0", - "pallet-session 40.0.0", - "pallet-staking 40.1.0", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", + "paste", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "serde", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -10676,20 +10910,19 @@ dependencies = [ ] [[package]] -name = "pallet-parameters" -version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-preimage" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", - "paste", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -10710,19 +10943,13 @@ dependencies = [ ] [[package]] -name = "pallet-preimage" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-proxy" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", ] [[package]] @@ -10740,83 +10967,69 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "pallet-proxy" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "parity-scale-codec", - "polkadot-sdk-frame", - "scale-info", -] - [[package]] name = "pallet-ranked-collective" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "pallet-recovery" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", ] [[package]] name = "pallet-referenda" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3008c20531d1730c9b457ae77ecf0e3c9b07aaf8c4f5d798d61ef6f0b9e2d4b" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "assert_matches", - "frame-benchmarking 38.0.0", - "frame-support 38.2.0", - "frame-system 38.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 38.0.2", - "sp-runtime 39.0.5", + "sp-arithmetic 23.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "pallet-referenda" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3008c20531d1730c9b457ae77ecf0e3c9b07aaf8c4f5d798d61ef6f0b9e2d4b" dependencies = [ "assert_matches", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 38.0.0", + "frame-support 38.2.0", + "frame-system 38.0.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 26.1.0", + "sp-io 38.0.2", + "sp-runtime 39.0.5", ] [[package]] @@ -10839,18 +11052,19 @@ dependencies = [ [[package]] name = "pallet-revive" -version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "alloy-core", "derive_more 0.99.20", "environmental", - "ethabi-decode 2.0.0", + "ethereum-standards", "ethereum-types 0.15.1", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "hex-literal", + "humantime-serde", "impl-trait-for-tuples", "log", "num-bigint", @@ -10859,7 +11073,7 @@ dependencies = [ "pallet-revive-fixtures", "pallet-revive-proc-macro", "pallet-revive-uapi", - "pallet-transaction-payment 40.0.0", + "pallet-transaction-payment 28.0.0", "parity-scale-codec", "paste", "polkavm 0.21.0", @@ -10870,38 +11084,36 @@ dependencies = [ "rlp 0.6.1", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-aura 0.42.0", - "sp-consensus-babe 0.42.1", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-consensus-aura 0.32.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", "substrate-bn", "subxt-signer", ] [[package]] name = "pallet-revive-fixtures" -version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "anyhow", "cargo_metadata 0.15.4", "pallet-revive-uapi", "polkavm-linker 0.21.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", "toml 0.8.22", ] [[package]] name = "pallet-revive-proc-macro" -version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", @@ -10910,8 +11122,8 @@ dependencies = [ [[package]] name = "pallet-revive-uapi" -version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitflags 1.3.2", "pallet-revive-proc-macro", @@ -10922,16 +11134,32 @@ dependencies = [ [[package]] name = "pallet-root-testing" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "4.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-support 28.0.0", + "frame-system 28.0.0", + "parity-scale-codec", + "scale-info", + "sp-io 30.0.0", + "sp-runtime 31.0.1", +] + +[[package]] +name = "pallet-scheduler" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", ] [[package]] @@ -10949,24 +11177,28 @@ dependencies = [ "scale-info", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", ] [[package]] -name = "pallet-scheduler" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-session" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", "log", + "pallet-timestamp 27.0.0", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", ] [[package]] @@ -10992,24 +11224,19 @@ dependencies = [ ] [[package]] -name = "pallet-session" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-session-benchmarking" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", - "log", - "pallet-timestamp 39.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-session 28.0.0", + "pallet-staking 28.0.0", "parity-scale-codec", - "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "rand 0.8.5", + "sp-runtime 31.0.1", + "sp-session 27.0.0", ] [[package]] @@ -11030,36 +11257,42 @@ dependencies = [ ] [[package]] -name = "pallet-session-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-society" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-session 40.0.0", - "pallet-staking 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", - "rand 0.8.5", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", + "rand_chacha 0.3.1", + "scale-info", + "sp-arithmetic 23.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-society" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-staking" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-authorship 28.0.0", + "pallet-session 28.0.0", "parity-scale-codec", "rand_chacha 0.3.1", "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-application-crypto 30.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", ] [[package]] @@ -11086,25 +11319,39 @@ dependencies = [ ] [[package]] -name = "pallet-staking" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-staking-async-ah-client" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-authorship 40.0.0", - "pallet-session 40.0.0", + "pallet-authorship 28.0.0", + "pallet-session 28.0.0", + "pallet-staking-async-rc-client", "parity-scale-codec", - "rand_chacha 0.3.1", "scale-info", "serde", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", +] + +[[package]] +name = "pallet-staking-async-rc-client" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", + "staging-xcm 7.0.1", ] [[package]] @@ -11121,42 +11368,58 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "22.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b982dbfe9fbc548dc7f9a3078214989ed58cabf521a8313ae1767d6b4b53b9b" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 23.0.0", ] [[package]] name = "pallet-staking-reward-fn" version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b982dbfe9fbc548dc7f9a3078214989ed58cabf521a8313ae1767d6b4b53b9b" dependencies = [ "log", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 26.1.0", ] [[package]] name = "pallet-staking-runtime-api" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7298559ef3a6b2f5dfbe9a3b8f3d22f2ff9b073c97f4c4853d2b316d973e72d" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", - "sp-api 34.0.0", - "sp-staking 36.0.0", + "sp-api 26.0.0", + "sp-staking 26.0.0", ] [[package]] name = "pallet-staking-runtime-api" -version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7298559ef3a6b2f5dfbe9a3b8f3d22f2ff9b073c97f4c4853d2b316d973e72d" +dependencies = [ + "parity-scale-codec", + "sp-api 34.0.0", + "sp-staking 36.0.0", +] + +[[package]] +name = "pallet-state-trie-migration" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "scale-info", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -11177,19 +11440,18 @@ dependencies = [ ] [[package]] -name = "pallet-state-trie-migration" -version = "44.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-sudo" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -11209,18 +11471,21 @@ dependencies = [ ] [[package]] -name = "pallet-sudo" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-timestamp" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-storage 19.0.0", + "sp-timestamp 26.0.0", ] [[package]] @@ -11244,40 +11509,36 @@ dependencies = [ ] [[package]] -name = "pallet-timestamp" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-tips" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-treasury 27.0.0", "parity-scale-codec", "scale-info", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] -name = "pallet-tips" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-transaction-payment" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-treasury 39.0.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -11297,35 +11558,31 @@ dependencies = [ ] [[package]] -name = "pallet-transaction-payment" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-transaction-payment-rpc" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", "parity-scale-codec", - "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-blockchain", + "sp-core 28.0.0", + "sp-rpc", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", ] [[package]] -name = "pallet-transaction-payment-rpc" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-transaction-payment-rpc-runtime-api" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "jsonrpsee", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", + "pallet-transaction-payment 28.0.0", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-rpc", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", ] [[package]] @@ -11338,19 +11595,26 @@ dependencies = [ "parity-scale-codec", "sp-api 34.0.0", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", ] [[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-treasury" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "pallet-transaction-payment 40.0.0", + "docify", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "log", + "pallet-balances 28.0.0", "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "scale-info", + "serde", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -11373,22 +11637,17 @@ dependencies = [ ] [[package]] -name = "pallet-treasury" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-uniques" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-balances 41.1.0", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] @@ -11407,17 +11666,18 @@ dependencies = [ ] [[package]] -name = "pallet-uniques" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-utility" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -11437,34 +11697,32 @@ dependencies = [ ] [[package]] -name = "pallet-utility" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-verify-signature" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", ] [[package]] -name = "pallet-verify-signature" -version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-vesting" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] @@ -11483,17 +11741,13 @@ dependencies = [ ] [[package]] -name = "pallet-vesting" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-whitelist" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", ] [[package]] @@ -11512,13 +11766,26 @@ dependencies = [ ] [[package]] -name = "pallet-whitelist" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-xcm" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "bounded-collections", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-balances 28.0.0", "parity-scale-codec", - "polkadot-sdk-frame", "scale-info", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "tracing", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -11547,26 +11814,20 @@ dependencies = [ ] [[package]] -name = "pallet-xcm" -version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-xcm-benchmarks" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bounded-collections", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-balances 41.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "tracing", - "xcm-runtime-apis 0.7.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -11588,42 +11849,45 @@ dependencies = [ ] [[package]] -name = "pallet-xcm-benchmarks" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-xcm-bridge-hub" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "bp-messages 0.7.0", + "bp-runtime 0.7.0", + "bp-xcm-bridge-hub", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "pallet-bridge-messages", "parity-scale-codec", "scale-info", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] -name = "pallet-xcm-bridge-hub" -version = "0.16.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "pallet-xcm-bridge-hub-router" +version = "0.5.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-messages 0.20.1", - "bp-runtime 0.20.1", - "bp-xcm-bridge-hub", - "frame-support 40.1.0", - "frame-system 40.1.0", + "bp-xcm-bridge-hub-router 0.6.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-bridge-messages", "parity-scale-codec", + "polkadot-runtime-parachains 7.0.0", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", ] [[package]] @@ -11647,22 +11911,32 @@ dependencies = [ ] [[package]] -name = "pallet-xcm-bridge-hub-router" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "parachains-common" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-xcm-bridge-hub-router 0.17.0", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-utility 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", + "pallet-asset-tx-payment 28.0.0", + "pallet-assets 29.1.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", + "pallet-message-queue 31.0.0", + "pallet-xcm 7.0.0", "parity-scale-codec", + "polkadot-primitives 7.0.0", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -11696,64 +11970,35 @@ dependencies = [ "substrate-wasm-builder 24.0.2", ] -[[package]] -name = "parachains-common" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-utility 0.20.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "log", - "pallet-asset-tx-payment 40.0.0", - "pallet-assets 42.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", - "pallet-message-queue 43.1.0", - "pallet-xcm 19.1.0", - "parity-scale-codec", - "polkadot-primitives 18.1.0", - "scale-info", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", -] - [[package]] name = "parachains-runtimes-test-utils" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-parachain-inherent 0.18.1", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-test-relay-sproof-builder", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", - "pallet-session 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-xcm 19.1.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", - "xcm-runtime-apis 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", + "pallet-session 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-xcm 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -11972,7 +12217,7 @@ dependencies = [ "pallet-session-benchmarking 38.0.0", "pallet-staking 38.0.1", "pallet-staking-reward-curve", - "pallet-staking-reward-fn 22.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pallet-staking-reward-fn 22.0.1", "pallet-staking-runtime-api 24.0.0", "pallet-state-trie-migration 40.0.0", "pallet-sudo 38.0.0", @@ -11996,7 +12241,7 @@ dependencies = [ "serde_json", "sp-api 34.0.0", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-authority-discovery 34.0.0", "sp-block-builder 34.0.0", "sp-consensus-babe 0.40.0", @@ -12037,7 +12282,7 @@ dependencies = [ "sp-core 34.0.0", "sp-runtime 39.0.5", "sp-trie 37.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm-builder 17.0.5", ] @@ -12217,8 +12462,8 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-approval-distribution" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "futures-timer", @@ -12228,30 +12473,30 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-bitfield-distribution" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-distribution" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fatality", "futures", @@ -12261,20 +12506,20 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "sc-network", "schnellru", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-availability-recovery" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "fatality", @@ -12285,7 +12530,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "sc-network", "schnellru", @@ -12316,8 +12561,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "clap", "frame-benchmarking-cli", @@ -12331,17 +12576,17 @@ dependencies = [ "sc-storage-monitor", "sc-sysinfo", "sc-tracing", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "substrate-build-script-utils 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keyring 31.0.0", + "sp-runtime 31.0.1", + "substrate-build-script-utils 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "thiserror 1.0.69", ] [[package]] name = "polkadot-collator-protocol" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitvec", "fatality", @@ -12351,11 +12596,11 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "schnellru", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", "tokio-util", "tracing-gum", @@ -12363,31 +12608,31 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2900d3b857e34c480101618a950c3a4fbcddc8c0d50573d48553376185908b8" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 34.0.0", - "sp-runtime 39.0.5", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "polkadot-core-primitives" -version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2900d3b857e34c480101618a950c3a4fbcddc8c0d50573d48553376185908b8" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 34.0.0", + "sp-runtime 39.0.5", ] [[package]] name = "polkadot-dispute-distribution" -version = "22.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fatality", "futures", @@ -12398,53 +12643,53 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-network", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-erasure-coding" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "reed-solomon-novelpoly", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-trie 29.0.0", "thiserror 1.0.69", ] [[package]] name = "polkadot-gossip-support" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-keystore 0.34.0", "tracing-gum", ] [[package]] name = "polkadot-network-bridge" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "always-assert", "async-trait", @@ -12457,7 +12702,7 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-network", "sp-consensus", "thiserror 1.0.69", @@ -12466,8 +12711,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "parity-scale-codec", @@ -12475,17 +12720,17 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "schnellru", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-approval-voting" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "bitvec", @@ -12499,25 +12744,25 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sc-keystore", "schnellru", "schnorrkel 0.11.4", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", "sp-consensus", - "sp-consensus-slots 0.42.1", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-slots 0.32.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-approval-voting-parallel" -version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -12530,7 +12775,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "rand_core 0.6.4", "sc-keystore", @@ -12540,8 +12785,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitvec", "futures", @@ -12551,7 +12796,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sp-consensus", "thiserror 1.0.69", "tracing-gum", @@ -12559,8 +12804,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitvec", "fatality", @@ -12569,25 +12814,25 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "polkadot-statement-table", "schnellru", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-bitfield-signing" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-primitives 7.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", "wasm-timer", @@ -12595,8 +12840,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -12608,17 +12853,17 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "sp-application-crypto 30.0.0", + "sp-keystore 0.34.0", "tracing-gum", ] [[package]] name = "polkadot-node-core-chain-api" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "polkadot-node-metrics", @@ -12631,8 +12876,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "futures-timer", @@ -12640,15 +12885,15 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fatality", "futures", @@ -12656,7 +12901,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-keystore", "schnellru", "thiserror 1.0.69", @@ -12665,39 +12910,39 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", "futures-timer", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sp-blockchain", - "sp-inherents 36.0.0", + "sp-inherents 26.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-prospective-parachains" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fatality", "futures", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-provisioner" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitvec", "fatality", @@ -12706,15 +12951,15 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "always-assert", "array-bytes", @@ -12726,12 +12971,12 @@ dependencies = [ "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "sc-tracing", "slotmap", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "strum 0.26.3", "tempfile", "thiserror 1.0.69", @@ -12741,21 +12986,21 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-primitives 7.0.0", + "sp-keystore 0.34.0", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf-common" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "cpu-time", "futures", @@ -12763,46 +13008,46 @@ dependencies = [ "libc", "nix 0.29.0", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-common 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-wasmtime 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "sc-executor 0.32.0", + "sc-executor-common 0.29.0", + "sc-executor-wasmtime 0.29.0", "seccompiler", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-io 30.0.0", + "sp-tracing 16.0.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-runtime-api" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-node-subsystem-types", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "schnellru", - "sp-consensus-babe 0.42.1", + "sp-consensus-babe 0.32.0", "tracing-gum", ] [[package]] name = "polkadot-node-metrics" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bs58", "futures", "futures-timer", "parity-scale-codec", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "prioritized-metered-channel", "sc-cli", "sc-service", @@ -12812,8 +13057,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -12824,12 +13069,12 @@ dependencies = [ "hex", "parity-scale-codec", "polkadot-node-primitives", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "rand 0.8.5", "sc-authority-discovery", "sc-network", "sc-network-types", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", "strum 0.26.3", "thiserror 1.0.69", "tracing-gum", @@ -12837,32 +13082,32 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitvec", "bounded-vec", "futures", "futures-timer", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "sc-keystore", "schnorrkel 0.11.4", "serde", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-babe 0.42.1", - "sp-consensus-slots 0.42.1", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-slots 0.32.0", + "sp-keystore 0.34.0", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "thiserror 1.0.69", "zstd 0.12.4", ] [[package]] name = "polkadot-node-subsystem" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", @@ -12870,8 +13115,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "derive_more 0.99.20", @@ -12880,26 +13125,26 @@ dependencies = [ "orchestra", "polkadot-node-network-protocol", "polkadot-node-primitives", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "polkadot-statement-table", "sc-client-api", "sc-network", "sc-network-types", "sc-transaction-pool-api", "smallvec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", + "sp-api 26.0.0", + "sp-authority-discovery 26.0.0", "sp-blockchain", - "sp-consensus-babe 0.42.1", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-babe 0.32.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "polkadot-node-subsystem-util" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fatality", "futures", @@ -12915,22 +13160,21 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-types", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "prioritized-metered-channel", "rand 0.8.5", - "sc-client-api", "schnellru", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-overseer" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -12940,13 +13184,29 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-types", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-client-api", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "tikv-jemalloc-ctl", "tracing-gum", ] +[[package]] +name = "polkadot-parachain-primitives" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bounded-collections", + "derive_more 0.99.20", + "parity-scale-codec", + "polkadot-core-primitives 7.0.0", + "scale-info", + "serde", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", +] + [[package]] name = "polkadot-parachain-primitives" version = "14.0.0" @@ -12961,23 +13221,36 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", ] [[package]] -name = "polkadot-parachain-primitives" -version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "polkadot-primitives" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "bitvec", "bounded-collections", - "derive_more 0.99.20", + "hex-literal", + "log", "parity-scale-codec", - "polkadot-core-primitives 17.1.0", + "polkadot-core-primitives 7.0.0", + "polkadot-parachain-primitives 6.0.0", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", + "sp-authority-discovery 26.0.0", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "thiserror 1.0.69", ] [[package]] @@ -12996,7 +13269,7 @@ dependencies = [ "serde", "sp-api 34.0.0", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-authority-discovery 34.0.0", "sp-consensus-slots 0.40.1", "sp-core 34.0.0", @@ -13023,7 +13296,7 @@ dependencies = [ "serde", "sp-api 34.0.0", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-authority-discovery 34.0.0", "sp-consensus-slots 0.40.1", "sp-core 34.0.0", @@ -13034,43 +13307,15 @@ dependencies = [ "sp-staking 36.0.0", ] -[[package]] -name = "polkadot-primitives" -version = "18.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "bitvec", - "hex-literal", - "log", - "parity-scale-codec", - "polkadot-core-primitives 17.1.0", - "polkadot-parachain-primitives 16.1.0", - "scale-info", - "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "thiserror 1.0.69", -] - [[package]] name = "polkadot-rpc" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "jsonrpsee", "mmr-rpc", "pallet-transaction-payment-rpc", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "sc-chain-spec", "sc-client-api", "sc-consensus-babe", @@ -13082,19 +13327,69 @@ dependencies = [ "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-frame-rpc-system", "substrate-state-trie-migration-rpc", ] +[[package]] +name = "polkadot-runtime-common" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bitvec", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate 7.0.0", + "pallet-authorship 28.0.0", + "pallet-babe 28.0.0", + "pallet-balances 28.0.0", + "pallet-broker 0.6.0", + "pallet-election-provider-multi-phase 27.0.0", + "pallet-fast-unstake 27.0.0", + "pallet-identity 29.0.0", + "pallet-session 28.0.0", + "pallet-staking 28.0.0", + "pallet-staking-reward-fn 19.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-treasury 27.0.0", + "pallet-vesting 28.0.0", + "parity-scale-codec", + "polkadot-primitives 7.0.0", + "polkadot-runtime-parachains 7.0.0", + "rustc-hex", + "scale-info", + "serde", + "slot-range-helper 7.0.0", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-npos-elections 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "static_assertions", +] + [[package]] name = "polkadot-runtime-common" version = "17.0.1" @@ -13119,7 +13414,7 @@ dependencies = [ "pallet-identity 38.0.0", "pallet-session 38.0.0", "pallet-staking 38.0.1", - "pallet-staking-reward-fn 22.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pallet-staking-reward-fn 22.0.1", "pallet-timestamp 37.0.0", "pallet-transaction-payment 38.0.2", "pallet-treasury 37.0.0", @@ -13147,59 +13442,9 @@ dependencies = [ ] [[package]] -name = "polkadot-runtime-common" -version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "bitvec", - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", - "libsecp256k1", - "log", - "pallet-asset-rate 19.0.0", - "pallet-authorship 40.0.0", - "pallet-babe 40.0.0", - "pallet-balances 41.1.0", - "pallet-broker 0.19.1", - "pallet-election-provider-multi-phase 39.1.0", - "pallet-fast-unstake 39.0.0", - "pallet-identity 40.1.0", - "pallet-session 40.0.0", - "pallet-staking 40.1.0", - "pallet-staking-reward-fn 22.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-treasury 39.0.0", - "pallet-vesting 40.1.0", - "parity-scale-codec", - "polkadot-primitives 18.1.0", - "polkadot-runtime-parachains 19.1.0", - "rustc-hex", - "scale-info", - "serde", - "slot-range-helper 17.0.0", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-npos-elections 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "static_assertions", -] - -[[package]] -name = "polkadot-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.4.3#f6cd32d205d82a84c7120b26a3f4ec46f52aabdc" +name = "polkadot-runtime-constants" +version = "1.0.0" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.4.3#f6cd32d205d82a84c7120b26a3f4ec46f52aabdc" dependencies = [ "frame-support 38.2.0", "pallet-remote-proxy", @@ -13211,10 +13456,22 @@ dependencies = [ "sp-core 34.0.0", "sp-runtime 39.0.5", "sp-trie 37.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm-builder 17.0.5", ] +[[package]] +name = "polkadot-runtime-metrics" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "bs58", + "frame-benchmarking 28.0.0", + "parity-scale-codec", + "polkadot-primitives 7.0.0", + "sp-tracing 16.0.0", +] + [[package]] name = "polkadot-runtime-metrics" version = "17.0.0" @@ -13225,19 +13482,55 @@ dependencies = [ "frame-benchmarking 38.0.0", "parity-scale-codec", "polkadot-primitives 16.0.0", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", ] [[package]] -name = "polkadot-runtime-metrics" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "polkadot-runtime-parachains" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bs58", - "frame-benchmarking 40.0.0", - "parity-scale-codec", - "polkadot-primitives 18.1.0", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "bitflags 1.3.2", + "bitvec", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "impl-trait-for-tuples", + "log", + "pallet-authority-discovery 28.0.0", + "pallet-authorship 28.0.0", + "pallet-babe 28.0.0", + "pallet-balances 28.0.0", + "pallet-broker 0.6.0", + "pallet-message-queue 31.0.0", + "pallet-mmr 27.0.0", + "pallet-session 28.0.0", + "pallet-staking 28.0.0", + "pallet-timestamp 27.0.0", + "parity-scale-codec", + "polkadot-core-primitives 7.0.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-metrics 7.0.0", + "rand 0.8.5", + "rand_chacha 0.3.1", + "scale-info", + "serde", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", + "static_assertions", ] [[package]] @@ -13276,7 +13569,7 @@ dependencies = [ "serde", "sp-api 34.0.0", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-inherents 34.0.0", "sp-io 38.0.2", @@ -13290,115 +13583,59 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "polkadot-runtime-parachains" -version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "bitflags 1.3.2", - "bitvec", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "impl-trait-for-tuples", - "log", - "pallet-authority-discovery 40.0.0", - "pallet-authorship 40.0.0", - "pallet-babe 40.0.0", - "pallet-balances 41.1.0", - "pallet-broker 0.19.1", - "pallet-message-queue 43.1.0", - "pallet-mmr 40.0.0", - "pallet-session 40.0.0", - "pallet-staking 40.1.0", - "pallet-timestamp 39.0.0", - "parity-scale-codec", - "polkadot-core-primitives 17.1.0", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-metrics 20.0.0", - "rand 0.8.5", - "rand_chacha 0.3.1", - "scale-info", - "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", - "static_assertions", -] - -[[package]] -name = "polkadot-sdk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb819108697967452fa6d8d96ab4c0d48cbaa423b3156499dcb24f1cf95d6775" -dependencies = [ - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-sdk-frame" -version = "0.9.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-storage 19.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", ] [[package]] name = "polkadot-service" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", - "frame-benchmarking 40.0.0", + "frame-benchmarking 28.0.0", "frame-benchmarking-cli", - "frame-system 40.1.0", - "frame-system-rpc-runtime-api 36.0.0", + "frame-system 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", "futures", "is_executable", "kvdb", "kvdb-rocksdb", "log", "mmr-gadget", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", "parity-db", "parity-scale-codec", "parking_lot 0.12.3", @@ -13407,7 +13644,7 @@ dependencies = [ "polkadot-availability-distribution", "polkadot-availability-recovery", "polkadot-collator-protocol", - "polkadot-core-primitives 17.1.0", + "polkadot-core-primitives 7.0.0", "polkadot-dispute-distribution", "polkadot-gossip-support", "polkadot-network-bridge", @@ -13433,9 +13670,9 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "polkadot-rpc", - "polkadot-runtime-parachains 19.1.0", + "polkadot-runtime-parachains 7.0.0", "polkadot-statement-distribution", "rococo-runtime", "sc-authority-discovery", @@ -13447,7 +13684,7 @@ dependencies = [ "sc-consensus-beefy", "sc-consensus-grandpa", "sc-consensus-slots", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", "sc-keystore", "sc-network", "sc-network-sync", @@ -13460,65 +13697,62 @@ dependencies = [ "sc-transaction-pool-api", "serde", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-authority-discovery 26.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-mmr-primitives 36.1.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-timestamp 36.0.0", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-mmr-primitives 26.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-timestamp 26.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing-gum", "westend-runtime", - "xcm-runtime-apis 0.7.0", + "xcm-runtime-apis 0.1.1", ] [[package]] name = "polkadot-statement-distribution" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "arrayvec 0.7.6", "bitvec", "fatality", "futures", "futures-timer", - "indexmap 2.9.0", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 18.1.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "polkadot-primitives 7.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-statement-table" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "tracing-gum", ] @@ -13548,6 +13782,19 @@ dependencies = [ "polkavm-linux-raw 0.21.0", ] +[[package]] +name = "polkavm" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2a01db119bb3a86572c0641ba6e7c9786fbd2ac89c25b43b688c4e353787526" +dependencies = [ + "libc", + "log", + "polkavm-assembler 0.24.0", + "polkavm-common 0.24.0", + "polkavm-linux-raw 0.24.0", +] + [[package]] name = "polkavm-assembler" version = "0.18.0" @@ -13566,6 +13813,15 @@ dependencies = [ "log", ] +[[package]] +name = "polkavm-assembler" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea6105f3f344abe0bf0151d67b3de6f5d24353f2393355ecf3f5f6e06d7fd0b" +dependencies = [ + "log", +] + [[package]] name = "polkavm-common" version = "0.9.0" @@ -13593,6 +13849,16 @@ dependencies = [ "polkavm-assembler 0.21.0", ] +[[package]] +name = "polkavm-common" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed9e5af472f729fcf3b3c1cf17508ddbb3505259dd6e2ee0fb5a29e105d22" +dependencies = [ + "log", + "polkavm-assembler 0.24.0", +] + [[package]] name = "polkavm-derive" version = "0.9.1" @@ -13620,6 +13886,15 @@ dependencies = [ "polkavm-derive-impl-macro 0.21.0", ] +[[package]] +name = "polkavm-derive" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176144f8661117ea95fa7cf868c9a62d6b143e8a2ebcb7582464c3faade8669a" +dependencies = [ + "polkavm-derive-impl-macro 0.24.0", +] + [[package]] name = "polkavm-derive-impl" version = "0.9.0" @@ -13656,6 +13931,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5a21844afdfcc10c92b9ef288ccb926211af27478d1730fcd55e4aec710179d" +dependencies = [ + "polkavm-common 0.24.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.9.0" @@ -13686,6 +13973,16 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0ef0f17ad81413ea1ca5b1b67553aedf5650c88269b673d3ba015c83bc2651" +dependencies = [ + "polkavm-derive-impl 0.24.0", + "syn 2.0.101", +] + [[package]] name = "polkavm-linker" version = "0.9.2" @@ -13733,6 +14030,22 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "polkavm-linker" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c95a521a1331024ebe5823ffdfba9ea6df40b934b0804049d5171887579806" +dependencies = [ + "dirs", + "gimli 0.31.1", + "hashbrown 0.14.5", + "log", + "object 0.36.7", + "polkavm-common 0.24.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + [[package]] name = "polkavm-linux-raw" version = "0.18.0" @@ -13745,6 +14058,12 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be6cd1d48c5e7814d287a3e12a339386a5dfa2f3ac72f932335f4cf56467f1b3" +[[package]] +name = "polkavm-linux-raw" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec0b13e26ec7234dba213ca17118c70c562809bdce0eefe84f92613d5c8da26" + [[package]] name = "polling" version = "2.8.0" @@ -13807,7 +14126,7 @@ dependencies = [ "enumflags2", "ink", "pop-primitives", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 40.0.1", ] [[package]] @@ -13816,26 +14135,26 @@ version = "0.1.0" dependencies = [ "contract-build", "env_logger 0.11.8", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "ismp", "log", "pallet-api", - "pallet-assets 42.0.0", - "pallet-balances 41.1.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", "pallet-contracts", "pallet-ismp", "pallet-nfts 34.1.0", - "pallet-xcm 19.1.0", + "pallet-xcm 7.0.0", "parity-scale-codec", "pop-api", "pop-primitives", "pop-runtime-devnet", "pop-runtime-testnet", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -13844,19 +14163,19 @@ version = "0.1.0" dependencies = [ "contract-build", "env_logger 0.11.8", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "impl-trait-for-tuples", "log", - "pallet-balances 41.1.0", + "pallet-balances 28.0.0", "pallet-contracts", - "pallet-timestamp 39.0.0", + "pallet-timestamp 27.0.0", "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -13871,12 +14190,12 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-service", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-parachain-inherent 0.18.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-relay-chain-interface", "docify", - "frame-benchmarking 40.0.0", + "frame-benchmarking 28.0.0", "frame-benchmarking-cli", "futures", "ismp-parachain", @@ -13886,11 +14205,11 @@ dependencies = [ "log", "pallet-ismp-rpc", "pallet-ismp-runtime-api", - "pallet-multisig 40.1.0", + "pallet-multisig 28.0.0", "pallet-transaction-payment-rpc", "parity-scale-codec", "polkadot-cli", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "pop-runtime-common", "pop-runtime-devnet", "pop-runtime-mainnet", @@ -13900,7 +14219,7 @@ dependencies = [ "sc-cli", "sc-client-api", "sc-consensus", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", "sc-network", "sc-network-sync", "sc-offchain", @@ -13913,21 +14232,21 @@ dependencies = [ "sc-transaction-pool-api", "serde", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-timestamp 36.0.0", - "sp-transaction-pool 36.0.0", - "staging-xcm 16.1.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-keystore 0.34.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-timestamp 26.0.0", + "sp-transaction-pool 26.0.0", + "staging-xcm 7.0.1", "substrate-build-script-utils 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -13946,47 +14265,47 @@ dependencies = [ name = "pop-runtime-common" version = "0.0.0" dependencies = [ - "cumulus-pallet-aura-ext 0.20.0", - "cumulus-pallet-parachain-system 0.20.0", + "cumulus-pallet-aura-ext 0.7.0", + "cumulus-pallet-parachain-system 0.7.0", "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcmp-queue 0.20.0", + "cumulus-pallet-xcmp-queue 0.7.1", "docify", - "frame-support 40.1.0", - "frame-system 40.1.0", - "pallet-assets 42.0.0", - "pallet-aura 39.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-assets 29.1.0", + "pallet-aura 27.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", "pallet-collective", - "pallet-message-queue 43.1.0", + "pallet-message-queue 31.0.0", "pallet-migrations", "pallet-motion", - "pallet-multisig 40.1.0", - "pallet-nfts 34.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-multisig 28.0.0", + "pallet-nfts 22.0.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-revive", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-treasury 39.0.0", - "pallet-utility 40.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-benchmarks 20.0.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-treasury 27.0.0", + "pallet-utility 28.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-benchmarks 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", "scale-info", "serde_json", - "sp-keyring 41.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-keyring 31.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -13994,26 +14313,26 @@ name = "pop-runtime-devnet" version = "0.1.0" dependencies = [ "anyhow", - "cumulus-pallet-aura-ext 0.20.0", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-aura-ext 0.7.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm 0.19.1", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-utility 0.20.0", + "cumulus-pallet-xcm 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-utility 0.7.0", "docify", "enumflags2", "env_logger 0.11.8", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex", "hex-literal", "ismp", @@ -14021,138 +14340,138 @@ dependencies = [ "ismp-parachain-runtime-api", "log", "pallet-api", - "pallet-assets 42.0.0", - "pallet-aura 39.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", + "pallet-assets 29.1.0", + "pallet-aura 27.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", "pallet-contracts", "pallet-ismp", "pallet-ismp-runtime-api", - "pallet-message-queue 43.1.0", - "pallet-multisig 40.1.0", + "pallet-message-queue 31.0.0", + "pallet-multisig 28.0.0", "pallet-nft-fractionalization", "pallet-nfts 34.1.0", - "pallet-nfts-runtime-api 26.0.0", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-nfts-runtime-api 14.0.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-revive", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-utility 40.0.0", - "pallet-xcm 19.1.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-runtime-common 19.1.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-utility 28.0.0", + "pallet-xcm 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-runtime-common 7.0.0", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm-runtime-apis 0.7.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-mmr-primitives 26.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 26.0.1", + "xcm-runtime-apis 0.1.1", ] [[package]] name = "pop-runtime-mainnet" version = "0.1.0" dependencies = [ - "cumulus-pallet-aura-ext 0.20.0", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-aura-ext 0.7.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm 0.19.1", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-utility 0.20.0", + "cumulus-pallet-xcm 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-utility 0.7.0", "docify", "enumflags2", "env_logger 0.11.8", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", "frame-metadata 20.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex", "log", - "pallet-assets 42.0.0", - "pallet-aura 39.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", + "pallet-assets 29.1.0", + "pallet-aura 27.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", "pallet-collective", - "pallet-message-queue 43.1.0", + "pallet-message-queue 31.0.0", "pallet-motion", - "pallet-multisig 40.1.0", - "pallet-nfts 34.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "pallet-nfts-runtime-api 26.0.0", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-multisig 28.0.0", + "pallet-nfts 22.0.0", + "pallet-nfts-runtime-api 14.0.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-revive", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-treasury 39.0.0", - "pallet-utility 40.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-benchmarks 20.0.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-runtime-common 19.1.0", - "polkadot-runtime-parachains 19.1.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-treasury 27.0.0", + "pallet-utility 28.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-benchmarks 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-runtime-common 7.0.0", + "polkadot-runtime-parachains 7.0.0", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm-runtime-apis 0.7.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 26.0.1", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -14160,27 +14479,27 @@ name = "pop-runtime-testnet" version = "0.5.4" dependencies = [ "anyhow", - "cumulus-pallet-aura-ext 0.20.0", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-aura-ext 0.7.0", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-pallet-session-benchmarking 9.0.0", "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm 0.19.1", - "cumulus-pallet-xcmp-queue 0.20.0", - "cumulus-primitives-aura 0.17.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-utility 0.20.0", + "cumulus-pallet-xcm 0.7.0", + "cumulus-pallet-xcmp-queue 0.7.1", + "cumulus-primitives-aura 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-utility 0.7.0", "docify", "enumflags2", "env_logger 0.11.8", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", "frame-metadata 20.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex", "hex-literal", "ismp", @@ -14188,62 +14507,62 @@ dependencies = [ "ismp-parachain-runtime-api", "log", "pallet-api", - "pallet-assets 42.0.0", - "pallet-aura 39.0.0", - "pallet-authorship 40.0.0", - "pallet-balances 41.1.0", - "pallet-collator-selection 21.0.0", + "pallet-assets 29.1.0", + "pallet-aura 27.0.0", + "pallet-authorship 28.0.0", + "pallet-balances 28.0.0", + "pallet-collator-selection 9.0.0", "pallet-collective", "pallet-contracts", "pallet-ismp", "pallet-ismp-runtime-api", - "pallet-message-queue 43.1.0", + "pallet-message-queue 31.0.0", "pallet-migrations", "pallet-motion", - "pallet-multisig 40.1.0", + "pallet-multisig 28.0.0", "pallet-nft-fractionalization", - "pallet-nfts 34.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "pallet-nfts-runtime-api 26.0.0", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-nfts 22.0.0", + "pallet-nfts-runtime-api 14.0.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-revive", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-treasury 39.0.0", - "pallet-utility 40.0.0", - "pallet-xcm 19.1.0", - "parachains-common 21.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-runtime-common 19.1.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-treasury 27.0.0", + "pallet-utility 28.0.0", + "pallet-xcm 7.0.0", + "parachains-common 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-runtime-common 7.0.0", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", - "sp-consensus-aura 0.42.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-parachain-info 0.20.0", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm-runtime-apis 0.7.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-aura 0.32.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-mmr-primitives 26.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-parachain-info 0.7.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 26.0.1", + "xcm-runtime-apis 0.1.1", ] [[package]] @@ -14722,7 +15041,6 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", - "serde", ] [[package]] @@ -14733,6 +15051,7 @@ checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", + "serde", ] [[package]] @@ -14771,6 +15090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.3", + "serde", ] [[package]] @@ -14983,7 +15303,7 @@ name = "relay-common" version = "1.0.0" source = "git+https://github.com/paseo-network/runtimes?tag=v1.4.3#3de47024fc96ff77392684761f21245db80680c0" dependencies = [ - "pallet-staking-reward-fn 22.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pallet-staking-reward-fn 22.0.1", "parity-scale-codec", "polkadot-primitives 16.0.0", "scale-info", @@ -15083,116 +15403,116 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "22.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "binary-merkle-tree 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "binary-merkle-tree 13.0.0", "bitvec", - "frame-benchmarking 40.0.0", - "frame-executive 40.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-benchmarking 28.0.0", + "frame-executive 28.0.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex-literal", "log", - "pallet-asset-rate 19.0.0", - "pallet-authority-discovery 40.0.0", - "pallet-authorship 40.0.0", - "pallet-babe 40.0.0", - "pallet-balances 41.1.0", - "pallet-beefy 41.1.0", - "pallet-beefy-mmr 41.0.0", - "pallet-bounties 39.0.0", - "pallet-child-bounties 39.0.0", - "pallet-conviction-voting 40.1.0", + "pallet-asset-rate 7.0.0", + "pallet-authority-discovery 28.0.0", + "pallet-authorship 28.0.0", + "pallet-babe 28.0.0", + "pallet-balances 28.0.0", + "pallet-beefy 28.0.0", + "pallet-beefy-mmr 28.0.0", + "pallet-bounties 27.0.0", + "pallet-child-bounties 27.0.0", + "pallet-conviction-voting 28.0.0", "pallet-democracy", "pallet-elections-phragmen", - "pallet-grandpa 40.0.0", - "pallet-identity 40.1.0", - "pallet-indices 40.0.0", - "pallet-message-queue 43.1.0", + "pallet-grandpa 28.0.0", + "pallet-identity 29.0.0", + "pallet-indices 28.0.0", + "pallet-message-queue 31.0.0", "pallet-migrations", - "pallet-mmr 40.0.0", - "pallet-multisig 40.1.0", + "pallet-mmr 27.0.0", + "pallet-multisig 28.0.0", "pallet-nis", - "pallet-offences 39.0.0", - "pallet-parameters 0.11.0", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-offences 27.0.0", + "pallet-parameters 0.1.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-ranked-collective", "pallet-recovery", - "pallet-referenda 40.1.0", + "pallet-referenda 28.0.0", "pallet-root-testing", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", "pallet-society", - "pallet-staking 40.1.0", - "pallet-state-trie-migration 44.1.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", + "pallet-staking 28.0.0", + "pallet-state-trie-migration 29.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", "pallet-tips", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-treasury 39.0.0", - "pallet-utility 40.0.0", - "pallet-vesting 40.1.0", - "pallet-whitelist 39.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-benchmarks 20.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-common 19.1.0", - "polkadot-runtime-parachains 19.1.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-treasury 27.0.0", + "pallet-utility 28.0.0", + "pallet-vesting 28.0.0", + "pallet-whitelist 27.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-benchmarks 7.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-common 7.0.0", + "polkadot-runtime-parachains 7.0.0", "rococo-runtime-constants", "scale-info", "serde", "serde_derive", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", - "sp-block-builder 36.0.0", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-mmr-primitives 36.1.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "xcm-runtime-apis 0.7.0", + "sp-api 26.0.0", + "sp-arithmetic 23.0.0", + "sp-authority-discovery 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-mmr-primitives 26.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", + "sp-storage 19.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 17.0.0", + "xcm-runtime-apis 0.1.1", ] [[package]] name = "rococo-runtime-constants" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-common 19.1.0", + "frame-support 28.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-common 7.0.0", "smallvec", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", ] [[package]] @@ -15548,31 +15868,31 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c10a9966875fcbde028c73697c6d5faad5f5d24e94b3c949fb1d063c727381d" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 28.0.0", + "sp-wasm-interface 20.0.0", "thiserror 1.0.69", ] [[package]] name = "sc-allocator" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c10a9966875fcbde028c73697c6d5faad5f5d24e94b3c949fb1d063c727381d" dependencies = [ "log", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-wasm-interface 21.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-authority-discovery" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -15587,20 +15907,20 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-types", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", + "sp-api 26.0.0", + "sp-authority-discovery 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "sc-basic-authorship" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "log", @@ -15609,34 +15929,34 @@ dependencies = [ "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", ] [[package]] name = "sc-block-builder" -version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", ] [[package]] name = "sc-chain-spec" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "docify", @@ -15644,25 +15964,25 @@ dependencies = [ "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", "sc-network", "sc-telemetry", "serde", "serde_json", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-genesis-builder 0.8.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-tracing 16.0.0", ] [[package]] name = "sc-chain-spec-derive" -version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -15672,8 +15992,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.51.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.36.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "chrono", @@ -15702,46 +16022,46 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-panic-handler 13.0.2 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keyring 31.0.0", + "sp-keystore 0.34.0", + "sp-panic-handler 13.0.0", + "sp-runtime 31.0.1", + "sp-version 29.0.0", "thiserror 1.0.69", "tokio", ] [[package]] name = "sc-client-api" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fnv", "futures", "log", "parity-scale-codec", "parking_lot 0.12.3", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", "sc-transaction-pool-api", "sc-utils", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-database", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-externalities 0.25.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-storage 19.0.0", + "sp-trie 29.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hash-db", "kvdb", @@ -15755,19 +16075,21 @@ dependencies = [ "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-database", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", + "substrate-prometheus-endpoint", + "sysinfo", ] [[package]] name = "sc-consensus" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -15780,17 +16102,17 @@ dependencies = [ "serde", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-aura" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -15801,25 +16123,25 @@ dependencies = [ "sc-consensus", "sc-consensus-slots", "sc-telemetry", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-aura 0.42.0", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-aura 0.32.0", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-babe" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "fork-tree", @@ -15836,26 +16158,26 @@ dependencies = [ "sc-consensus-slots", "sc-telemetry", "sc-transaction-pool-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.42.1", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-babe 0.32.0", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-inherents 26.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-babe-rpc" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "jsonrpsee", @@ -15863,21 +16185,21 @@ dependencies = [ "sc-consensus-epochs", "sc-rpc-api", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-babe 0.32.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-beefy" -version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -15893,15 +16215,15 @@ dependencies = [ "sc-network-sync", "sc-network-types", "sc-utils", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-beefy 24.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-beefy 13.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -15910,8 +16232,8 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" -version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "jsonrpsee", @@ -15921,30 +16243,30 @@ dependencies = [ "sc-consensus-beefy", "sc-rpc", "serde", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-beefy 24.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-consensus-beefy 13.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-epochs" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "fork-tree", "parity-scale-codec", "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] name = "sc-consensus-grandpa" -version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "ahash 0.8.12", "array-bytes", @@ -15971,24 +16293,24 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "finality-grandpa", "futures", @@ -16000,15 +16322,15 @@ dependencies = [ "sc-rpc", "serde", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-consensus-slots" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -16018,73 +16340,72 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", ] [[package]] name = "sc-executor" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55c745bf88acb34bd606346c7de6cc06f334f627c1ff40380252a6e52ad9354" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sc-executor-common 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sc-executor-polkavm 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sc-executor-wasmtime 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sc-executor-common 0.29.0", + "sc-executor-polkavm 0.29.0", + "sc-executor-wasmtime 0.29.0", "schnellru", - "sp-api 36.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-panic-handler 13.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 39.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-io 30.0.0", + "sp-panic-handler 13.0.0", + "sp-runtime-interface 24.0.0", + "sp-trie 29.0.0", + "sp-version 29.0.0", + "sp-wasm-interface 20.0.0", "tracing", ] [[package]] name = "sc-executor" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55c745bf88acb34bd606346c7de6cc06f334f627c1ff40380252a6e52ad9354" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sc-executor-common 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-polkavm 0.35.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-wasmtime 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor-common 0.38.0", + "sc-executor-polkavm 0.35.0", + "sc-executor-wasmtime 0.38.0", "schnellru", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-panic-handler 13.0.2 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 36.0.1", + "sp-core 36.1.0", + "sp-externalities 0.30.0", + "sp-io 40.0.1", + "sp-panic-handler 13.0.2", + "sp-runtime-interface 29.0.1", + "sp-trie 39.1.0", + "sp-version 39.0.0", + "sp-wasm-interface 21.0.1", "tracing", ] [[package]] name = "sc-executor-common" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2f84b9aa7664a9b401afbf423bcd3c1845f5adedf4f6030586808238a222df" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "polkavm 0.18.0", - "sc-allocator 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm 0.24.0", + "sc-allocator 23.0.0", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-wasm-interface 20.0.0", "thiserror 1.0.69", "wasm-instrument", ] @@ -16092,76 +16413,77 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2f84b9aa7664a9b401afbf423bcd3c1845f5adedf4f6030586808238a222df" dependencies = [ "polkavm 0.18.0", - "sc-allocator 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-allocator 31.0.0", + "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 21.0.1", "thiserror 1.0.69", "wasm-instrument", ] [[package]] name = "sc-executor-polkavm" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb4929b3457077f9b30ad397a724116f43f252a889ec334ec369f6cdad8f76c" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", - "polkavm 0.18.0", - "sc-executor-common 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm 0.24.0", + "sc-executor-common 0.29.0", + "sp-wasm-interface 20.0.0", ] [[package]] name = "sc-executor-polkavm" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb4929b3457077f9b30ad397a724116f43f252a889ec334ec369f6cdad8f76c" dependencies = [ "log", "polkavm 0.18.0", - "sc-executor-common 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor-common 0.38.0", + "sp-wasm-interface 21.0.1", ] [[package]] name = "sc-executor-wasmtime" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5ad79b030a1f91ef0f667e58ac35e1c9fa33a6b8a0ec1ae7fe4890322535ac" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "anyhow", "log", "parking_lot 0.12.3", "rustix 0.36.17", - "sc-allocator 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sc-executor-common 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sc-allocator 23.0.0", + "sc-executor-common 0.29.0", + "sp-runtime-interface 24.0.0", + "sp-wasm-interface 20.0.0", "wasmtime", ] [[package]] name = "sc-executor-wasmtime" version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5ad79b030a1f91ef0f667e58ac35e1c9fa33a6b8a0ec1ae7fe4890322535ac" dependencies = [ "anyhow", "log", "parking_lot 0.12.3", "rustix 0.36.17", - "sc-allocator 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-common 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-allocator 31.0.0", + "sc-executor-common 0.38.0", + "sp-runtime-interface 29.0.1", + "sp-wasm-interface 21.0.1", "wasmtime", ] [[package]] name = "sc-informant" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "console", "futures", @@ -16171,27 +16493,27 @@ dependencies = [ "sc-network", "sc-network-sync", "sp-blockchain", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] name = "sc-keystore" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "parking_lot 0.12.3", "serde_json", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", "thiserror 1.0.69", ] [[package]] name = "sc-mixnet" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -16207,19 +16529,19 @@ dependencies = [ "sc-network", "sc-network-types", "sc-transaction-pool-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-keystore 0.34.0", "sp-mixnet", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-network" -version = "0.49.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16252,10 +16574,10 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -16268,18 +16590,18 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", ] [[package]] name = "sc-network-gossip" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "ahash 0.8.12", "futures", @@ -16290,15 +16612,15 @@ dependencies = [ "sc-network-sync", "sc-network-types", "schnellru", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "sc-network-light" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16311,15 +16633,15 @@ dependencies = [ "sc-network", "sc-network-types", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-network-sync" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16339,12 +16661,12 @@ dependencies = [ "sc-utils", "schnellru", "smallvec", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", "sp-blockchain", "sp-consensus", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -16353,8 +16675,8 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "futures", @@ -16366,14 +16688,14 @@ dependencies = [ "sc-network-types", "sc-utils", "sp-consensus", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", "substrate-prometheus-endpoint", ] [[package]] name = "sc-network-types" -version = "0.15.3" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bs58", "bytes", @@ -16391,8 +16713,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bytes", "fnv", @@ -16413,20 +16735,20 @@ dependencies = [ "sc-network-types", "sc-transaction-pool-api", "sc-utils", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-keystore 0.34.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", "threadpool", "tracing", ] [[package]] name = "sc-proposer-metrics" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -16434,8 +16756,8 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "jsonrpsee", @@ -16451,23 +16773,23 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-offchain 36.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-offchain 26.0.0", "sp-rpc", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", "sp-statement-store", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-version 29.0.0", "tokio", ] [[package]] name = "sc-rpc-api" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16477,17 +16799,17 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-rpc", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-version 29.0.0", "thiserror 1.0.69", ] [[package]] name = "sc-rpc-server" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -16510,8 +16832,8 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.49.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", "futures", @@ -16529,12 +16851,13 @@ dependencies = [ "sc-transaction-pool-api", "schnellru", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-rpc", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-version 29.0.0", + "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", "tokio-stream", @@ -16542,23 +16865,23 @@ dependencies = [ [[package]] name = "sc-runtime-utilities" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sc-executor-common 0.38.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", + "sc-executor-common 0.29.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-state-machine 0.35.0", + "sp-wasm-interface 20.0.0", "thiserror 1.0.69", ] [[package]] name = "sc-service" -version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "directories", @@ -16575,7 +16898,7 @@ dependencies = [ "sc-client-api", "sc-client-db", "sc-consensus", - "sc-executor 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sc-executor 0.32.0", "sc-informant", "sc-keystore", "sc-network", @@ -16596,20 +16919,20 @@ dependencies = [ "schnellru", "serde", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-state-machine 0.35.0", + "sp-storage 19.0.0", + "sp-transaction-pool 26.0.0", "sp-transaction-storage-proof", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-trie 29.0.0", + "sp-version 29.0.0", "static_init", "substrate-prometheus-endpoint", "tempfile", @@ -16621,32 +16944,32 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.30.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", ] [[package]] name = "sc-storage-monitor" -version = "0.24.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "clap", "fs4", "log", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "thiserror 1.0.69", "tokio", ] [[package]] name = "sc-sync-state-rpc" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16658,14 +16981,14 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-sysinfo" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "derive_more 0.99.20", "futures", @@ -16677,15 +17000,15 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-io 30.0.0", ] [[package]] name = "sc-telemetry" -version = "28.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "chrono", "futures", @@ -16703,8 +17026,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "chrono", "console", @@ -16717,12 +17040,12 @@ dependencies = [ "sc-client-api", "sc-tracing-proc-macro", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-rpc", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", "thiserror 1.0.69", "tracing", "tracing-log", @@ -16731,8 +17054,8 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "11.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -16742,8 +17065,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -16751,20 +17074,19 @@ dependencies = [ "indexmap 2.9.0", "itertools 0.11.0", "linked-hash-map", - "log", "parity-scale-codec", "parking_lot 0.12.3", "sc-client-api", "sc-transaction-pool-api", "sc-utils", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", + "sp-transaction-pool 26.0.0", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -16774,8 +17096,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", @@ -16784,15 +17106,15 @@ dependencies = [ "parity-scale-codec", "serde", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", "thiserror 1.0.69", ] [[package]] name = "sc-utils" -version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-channel 1.9.0", "futures", @@ -16800,7 +17122,7 @@ dependencies = [ "log", "parking_lot 0.12.3", "prometheus", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", ] [[package]] @@ -16818,6 +17140,16 @@ name = "scale-bits" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver 0.2.0", +] + +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" dependencies = [ "parity-scale-codec", "scale-info", @@ -16854,17 +17186,17 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" dependencies = [ - "derive_more 1.0.0", "parity-scale-codec", "primitive-types 0.13.1", - "scale-bits 0.6.0", - "scale-decode-derive 0.14.0", + "scale-bits 0.7.0", + "scale-decode-derive 0.16.0", "scale-type-resolver 0.2.0", "smallvec", + "thiserror 2.0.12", ] [[package]] @@ -16881,9 +17213,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed9401effa946b493f9f84dc03714cca98119b230497df6f3df6b84a2b03648" +checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" dependencies = [ "darling 0.20.11", "proc-macro2", @@ -16906,17 +17238,17 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" dependencies = [ - "derive_more 1.0.0", "parity-scale-codec", "primitive-types 0.13.1", - "scale-bits 0.6.0", - "scale-encode-derive 0.8.0", + "scale-bits 0.7.0", + "scale-encode-derive 0.10.0", "scale-type-resolver 0.2.0", "smallvec", + "thiserror 2.0.12", ] [[package]] @@ -16934,9 +17266,9 @@ dependencies = [ [[package]] name = "scale-encode-derive" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102fbc6236de6c53906c0b262f12c7aa69c2bdc604862c12728f5f4d370bc137" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" dependencies = [ "darling 0.20.11", "proc-macro-crate 3.3.0", @@ -16993,34 +17325,33 @@ dependencies = [ [[package]] name = "scale-typegen" -version = "0.9.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc4c70c7fea2eef1740f0081d3fe385d8bee1eef11e9272d3bec7dc8e5438e0" +checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" dependencies = [ "proc-macro2", "quote", "scale-info", "syn 2.0.101", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] name = "scale-value" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e0ef2a0ee1e02a69ada37feb87ea1616ce9808aca072befe2d3131bf28576e" +checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" dependencies = [ "base58", "blake2 0.10.6", - "derive_more 1.0.0", "either", "parity-scale-codec", - "scale-bits 0.6.0", - "scale-decode 0.14.0", - "scale-encode 0.8.0", - "scale-info", + "scale-bits 0.7.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", "scale-type-resolver 0.2.0", "serde", + "thiserror 2.0.12", "yap", ] @@ -17103,6 +17434,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -17311,7 +17648,7 @@ dependencies = [ [[package]] name = "serde-hex-utils" version = "0.1.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ "anyhow", "hex", @@ -17610,25 +17947,25 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e34f1146a457a5c554dedeae6c7273aa54c3b031f3e9eb0abd037b5511e2ce9" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 39.0.5", + "sp-runtime 31.0.1", ] [[package]] name = "slot-range-helper" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e34f1146a457a5c554dedeae6c7273aa54c3b031f3e9eb0abd037b5511e2ce9" dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 39.0.5", ] [[package]] @@ -17893,6 +18230,28 @@ dependencies = [ "scale-info", ] +[[package]] +name = "snowbridge-beacon-primitives" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "byte-slice-cast", + "frame-support 28.0.0", + "hex", + "parity-scale-codec", + "rlp 0.6.1", + "scale-info", + "serde", + "snowbridge-ethereum 0.3.0", + "snowbridge-milagro-bls", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "ssz_rs", + "ssz_rs_derive", +] + [[package]] name = "snowbridge-beacon-primitives" version = "0.10.1" @@ -17917,25 +18276,27 @@ dependencies = [ ] [[package]] -name = "snowbridge-beacon-primitives" -version = "0.13.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "snowbridge-core" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "byte-slice-cast", - "frame-support 40.1.0", - "hex", + "bp-relayers", + "frame-support 28.0.0", + "frame-system 28.0.0", + "hex-literal", + "log", "parity-scale-codec", - "rlp 0.6.1", + "polkadot-parachain-primitives 6.0.0", "scale-info", "serde", - "snowbridge-ethereum 0.12.0", - "snowbridge-milagro-bls", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "ssz_rs", - "ssz_rs_derive", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -17953,7 +18314,7 @@ dependencies = [ "scale-info", "serde", "snowbridge-beacon-primitives 0.10.1", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", @@ -17963,28 +18324,23 @@ dependencies = [ ] [[package]] -name = "snowbridge-core" -version = "0.13.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "snowbridge-ethereum" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bp-relayers", "ethabi-decode 2.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "ethbloom 0.14.1", + "ethereum-types 0.15.1", "hex-literal", - "log", + "parity-bytes", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", + "rlp 0.6.1", "scale-info", "serde", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "serde-big-array", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] @@ -18008,50 +18364,6 @@ dependencies = [ "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "snowbridge-ethereum" -version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "ethabi-decode 2.0.0", - "ethbloom 0.14.1", - "ethereum-types 0.15.1", - "hex-literal", - "parity-bytes", - "parity-scale-codec", - "rlp 0.6.1", - "scale-info", - "serde", - "serde-big-array", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - -[[package]] -name = "snowbridge-inbound-queue-primitives" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "alloy-core", - "frame-support 40.1.0", - "frame-system 40.1.0", - "hex-literal", - "log", - "parity-scale-codec", - "scale-info", - "snowbridge-beacon-primitives 0.13.1", - "snowbridge-core 0.13.1", - "snowbridge-verification-primitives", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", -] - [[package]] name = "snowbridge-milagro-bls" version = "1.5.4" @@ -18069,49 +18381,49 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-primitives" -version = "0.2.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "alloy-core", "ethabi-decode 2.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "hex-literal", "log", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", + "polkadot-parachain-primitives 6.0.0", "scale-info", - "snowbridge-core 0.13.1", + "snowbridge-core 0.2.0", "snowbridge-verification-primitives", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] name = "snowbridge-pallet-system-frontend" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-xcm 19.1.0", + "pallet-asset-conversion 10.0.0", "parity-scale-codec", "scale-info", - "snowbridge-core 0.13.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "snowbridge-core 0.2.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", "tracing", ] @@ -18137,34 +18449,34 @@ dependencies = [ [[package]] name = "snowbridge-runtime-common" -version = "0.13.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "log", - "pallet-xcm 19.1.0", + "pallet-xcm 7.0.0", "parity-scale-codec", - "snowbridge-core 0.13.1", + "snowbridge-core 0.2.0", "snowbridge-outbound-queue-primitives", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", + "sp-arithmetic 23.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] name = "snowbridge-verification-primitives" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", + "frame-support 28.0.0", "parity-scale-codec", "scale-info", - "snowbridge-beacon-primitives 0.13.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "snowbridge-beacon-primitives 0.2.0", + "sp-core 28.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] @@ -18218,6 +18530,28 @@ dependencies = [ "sha1", ] +[[package]] +name = "sp-api" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "docify", + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro 15.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 31.0.1", + "sp-runtime-interface 24.0.0", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", + "sp-version 29.0.0", + "thiserror 1.0.69", +] + [[package]] name = "sp-api" version = "34.0.0" @@ -18252,45 +18586,22 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-metadata-ir 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 41.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-state-machine 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 39.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.69", -] - -[[package]] -name = "sp-api" -version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "docify", - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-metadata-ir 0.10.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api-proc-macro 22.0.0", + "sp-core 36.1.0", + "sp-externalities 0.30.0", + "sp-metadata-ir 0.10.0", + "sp-runtime 41.1.0", + "sp-runtime-interface 29.0.1", + "sp-state-machine 0.45.0", + "sp-trie 39.1.0", + "sp-version 39.0.0", "thiserror 1.0.69", ] [[package]] name = "sp-api-proc-macro" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "blake2 0.10.6", @@ -18303,9 +18614,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "22.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36334085c348bb507debd40e604f71194b1fc669eb6fec81aebef08eb3466f6c" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" dependencies = [ "Inflector", "blake2 0.10.6", @@ -18319,7 +18630,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36334085c348bb507debd40e604f71194b1fc669eb6fec81aebef08eb3466f6c" dependencies = [ "Inflector", "blake2 0.10.6", @@ -18330,6 +18642,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "sp-application-crypto" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 28.0.0", + "sp-io 30.0.0", +] + [[package]] name = "sp-application-crypto" version = "38.0.0" @@ -18352,20 +18676,22 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 36.1.0", + "sp-io 40.0.1", ] [[package]] -name = "sp-application-crypto" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-arithmetic" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "docify", + "integer-sqrt", + "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "static_assertions", ] [[package]] @@ -18384,17 +18710,15 @@ dependencies = [ ] [[package]] -name = "sp-arithmetic" -version = "26.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-authority-discovery" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "docify", - "integer-sqrt", - "num-traits", "parity-scale-codec", "scale-info", - "serde", - "static_assertions", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -18411,15 +18735,13 @@ dependencies = [ ] [[package]] -name = "sp-authority-discovery" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-block-builder" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -18433,49 +18755,55 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "sp-block-builder" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "sp-blockchain" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "futures", "parity-scale-codec", "parking_lot 0.12.3", "schnellru", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", "sp-consensus", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-database", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", "thiserror 1.0.69", "tracing", ] [[package]] name = "sp-consensus" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "futures", "log", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", "thiserror 1.0.69", ] +[[package]] +name = "sp-consensus-aura" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-consensus-slots 0.32.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-timestamp 26.0.0", +] + [[package]] name = "sp-consensus-aura" version = "0.40.0" @@ -18494,19 +18822,21 @@ dependencies = [ ] [[package]] -name = "sp-consensus-aura" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-consensus-babe" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-slots 0.42.1", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", + "serde", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-consensus-slots 0.32.0", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-timestamp 26.0.0", ] [[package]] @@ -18529,21 +18859,23 @@ dependencies = [ ] [[package]] -name = "sp-consensus-babe" -version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-consensus-beefy" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "async-trait", "parity-scale-codec", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-consensus-slots 0.42.1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-timestamp 36.0.0", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-io 30.0.0", + "sp-keystore 0.34.0", + "sp-mmr-primitives 26.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "strum 0.26.3", ] [[package]] @@ -18564,28 +18896,25 @@ dependencies = [ "sp-keystore 0.40.0", "sp-mmr-primitives 34.1.0", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "strum 0.26.3", ] [[package]] -name = "sp-consensus-beefy" -version = "24.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-consensus-grandpa" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "finality-grandpa", + "log", "parity-scale-codec", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-mmr-primitives 36.1.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "strum 0.26.3", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", ] [[package]] @@ -18607,20 +18936,14 @@ dependencies = [ ] [[package]] -name = "sp-consensus-grandpa" -version = "23.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-consensus-slots" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "finality-grandpa", - "log", "parity-scale-codec", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-timestamp 26.0.0", ] [[package]] @@ -18635,34 +18958,23 @@ dependencies = [ "sp-timestamp 34.0.0", ] -[[package]] -name = "sp-consensus-slots" -version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-timestamp 36.0.0", -] - [[package]] name = "sp-core" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "ark-vrf", "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", "bs58", - "dyn-clonable", + "dyn-clone", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.4.0", + "impl-serde 0.5.0", "itertools 0.11.0", "k256", "libsecp256k1", @@ -18672,21 +18984,22 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "primitive-types 0.12.2", + "primitive-types 0.13.1", "rand 0.8.5", "scale-info", "schnorrkel 0.11.4", "secp256k1 0.28.2", "secrecy 0.8.0", "serde", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.29.0", - "sp-runtime-interface 28.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", + "sha2 0.10.9", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-runtime-interface 24.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-storage 19.0.0", "ss58-registry", - "substrate-bip39 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-bip39 0.4.7", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -18695,11 +19008,10 @@ dependencies = [ [[package]] name = "sp-core" -version = "36.1.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" dependencies = [ - "ark-vrf", "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", @@ -18710,7 +19022,7 @@ dependencies = [ "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.5.0", + "impl-serde 0.4.0", "itertools 0.11.0", "k256", "libsecp256k1", @@ -18720,7 +19032,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "primitive-types 0.13.1", + "primitive-types 0.12.2", "rand 0.8.5", "scale-info", "schnorrkel 0.11.4", @@ -18729,12 +19041,12 @@ dependencies = [ "serde", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.29.0", + "sp-runtime-interface 28.0.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-bip39 0.6.0", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -18744,7 +19056,8 @@ dependencies = [ [[package]] name = "sp-core" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" dependencies = [ "ark-vrf", "array-bytes", @@ -18774,14 +19087,14 @@ dependencies = [ "secp256k1 0.28.2", "secrecy 0.8.0", "serde", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.30.0", + "sp-runtime-interface 29.0.1", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 22.0.0", "ss58-registry", - "substrate-bip39 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "substrate-bip39 0.6.0", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -18805,7 +19118,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "blake2b_simd", "byteorder", @@ -18829,17 +19142,17 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "syn 2.0.101", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -18859,7 +19172,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", @@ -18868,34 +19181,46 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 21.0.0", + "sp-storage 19.0.0", ] [[package]] name = "sp-externalities" -version = "0.30.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 21.0.0", ] [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-storage 22.0.0", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.8.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -18912,15 +19237,16 @@ dependencies = [ ] [[package]] -name = "sp-genesis-builder" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-inherents" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "async-trait", + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime 31.0.1", + "thiserror 1.0.69", ] [[package]] @@ -18938,16 +19264,29 @@ dependencies = [ ] [[package]] -name = "sp-inherents" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-io" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "async-trait", - "impl-trait-for-tuples", + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", "parity-scale-codec", - "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "thiserror 1.0.69", + "polkavm-derive 0.24.0", + "rustversion", + "secp256k1 0.28.2", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-keystore 0.34.0", + "sp-runtime-interface 24.0.0", + "sp-state-machine 0.35.0", + "sp-tracing 16.0.0", + "sp-trie 29.0.0", + "tracing", + "tracing-core", ] [[package]] @@ -18971,7 +19310,7 @@ dependencies = [ "sp-keystore 0.40.0", "sp-runtime-interface 28.0.0", "sp-state-machine 0.43.0", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", "sp-trie 37.0.0", "tracing", "tracing-core", @@ -18992,42 +19331,26 @@ dependencies = [ "polkavm-derive 0.18.0", "rustversion", "secp256k1 0.28.2", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 36.1.0", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-keystore 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-state-machine 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.30.0", + "sp-keystore 0.42.0", + "sp-runtime-interface 29.0.1", + "sp-state-machine 0.45.0", + "sp-tracing 17.1.0", + "sp-trie 39.1.0", "tracing", "tracing-core", ] [[package]] -name = "sp-io" -version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-keyring" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "bytes", - "docify", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive 0.18.0", - "rustversion", - "secp256k1 0.28.2", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "tracing", - "tracing-core", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "strum 0.26.3", ] [[package]] @@ -19042,13 +19365,14 @@ dependencies = [ ] [[package]] -name = "sp-keyring" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-keystore" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "strum 0.26.3", + "parity-scale-codec", + "parking_lot 0.12.3", + "sp-core 28.0.0", + "sp-externalities 0.25.0", ] [[package]] @@ -19071,19 +19395,8 @@ checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sp-keystore" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", ] [[package]] @@ -19099,12 +19412,22 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", ] +[[package]] +name = "sp-metadata-ir" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-metadata 23.0.0", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp-metadata-ir" version = "0.7.0" @@ -19128,24 +19451,31 @@ dependencies = [ ] [[package]] -name = "sp-metadata-ir" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-mixnet" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-metadata 20.0.0", "parity-scale-codec", "scale-info", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", ] [[package]] -name = "sp-mixnet" -version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-mmr-primitives" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "log", "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range 0.8.1", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-runtime 31.0.1", + "thiserror 1.0.69", ] [[package]] @@ -19167,20 +19497,16 @@ dependencies = [ ] [[package]] -name = "sp-mmr-primitives" -version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-npos-elections" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "log", "parity-scale-codec", - "polkadot-ckb-merkle-mountain-range 0.8.1", "scale-info", "serde", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "thiserror 1.0.69", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -19192,22 +19518,19 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-runtime 39.0.5", ] [[package]] -name = "sp-npos-elections" -version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-offchain" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -19221,21 +19544,10 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "sp-offchain" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "sp-panic-handler" -version = "13.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "backtrace", "regex", @@ -19244,7 +19556,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" dependencies = [ "backtrace", "regex", @@ -19252,20 +19565,20 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "rustc-hash 1.1.0", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", ] [[package]] name = "sp-runtime" -version = "39.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e00503b83cf48fffe48746b91b9b832d6785d4e2eeb0941558371eac6baac6" +version = "31.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "binary-merkle-tree 13.0.0", "docify", "either", "hash256-std-hasher", @@ -19278,22 +19591,23 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 38.0.0", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 38.0.2", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-trie 29.0.0", + "sp-weights 27.0.0", "tracing", + "tuplex", ] [[package]] name = "sp-runtime" -version = "41.1.0" +version = "39.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" +checksum = "b1e00503b83cf48fffe48746b91b9b832d6785d4e2eeb0941558371eac6baac6" dependencies = [ - "binary-merkle-tree 16.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "docify", "either", "hash256-std-hasher", @@ -19306,23 +19620,22 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 40.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-application-crypto 38.0.0", + "sp-arithmetic 26.1.0", + "sp-core 34.0.0", + "sp-io 38.0.2", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "tracing", - "tuplex", ] [[package]] name = "sp-runtime" version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" dependencies = [ - "binary-merkle-tree 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "binary-merkle-tree 16.0.0", "docify", "either", "hash256-std-hasher", @@ -19335,81 +19648,80 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-application-crypto 40.1.0", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 39.1.0", + "sp-weights 31.1.0", "tracing", "tuplex", ] [[package]] name = "sp-runtime-interface" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.9.1", - "primitive-types 0.12.2", - "sp-externalities 0.29.0", - "sp-runtime-interface-proc-macro 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm-derive 0.24.0", + "primitive-types 0.13.1", + "sp-externalities 0.25.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-storage 19.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface" -version = "29.0.1" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.18.0", - "primitive-types 0.13.1", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface-proc-macro 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm-derive 0.9.1", + "primitive-types 0.12.2", + "sp-externalities 0.29.0", + "sp-runtime-interface-proc-macro 18.0.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 21.0.0", + "sp-tracing 17.1.0", + "sp-wasm-interface 21.0.1", "static_assertions", ] [[package]] name = "sp-runtime-interface" version = "29.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.18.0", "primitive-types 0.13.1", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface-proc-macro 18.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-externalities 0.30.0", + "sp-runtime-interface-proc-macro 18.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 22.0.0", + "sp-tracing 17.1.0", + "sp-wasm-interface 21.0.1", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "expander", @@ -19422,7 +19734,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", @@ -19432,6 +19745,20 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "sp-session" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api 26.0.0", + "sp-core 28.0.0", + "sp-keystore 0.34.0", + "sp-runtime 31.0.1", + "sp-staking 26.0.0", +] + [[package]] name = "sp-session" version = "36.0.0" @@ -19448,17 +19775,16 @@ dependencies = [ ] [[package]] -name = "sp-session" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-staking" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-staking 38.0.0", + "serde", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -19489,24 +19815,10 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "sp-staking" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "sp-state-machine" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930104d6ae882626e8880d9b1578da9300655d337a3ffb45e130c608b6c89660" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hash-db", "log", @@ -19514,20 +19826,20 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-panic-handler 13.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 37.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-panic-handler 13.0.0", + "sp-trie 29.0.0", "thiserror 1.0.69", "tracing", - "trie-db 0.29.1", + "trie-db 0.30.0", ] [[package]] name = "sp-state-machine" -version = "0.45.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" +checksum = "930104d6ae882626e8880d9b1578da9300655d337a3ffb45e130c608b6c89660" dependencies = [ "hash-db", "log", @@ -19535,19 +19847,20 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-panic-handler 13.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-panic-handler 13.0.2", + "sp-trie 37.0.0", "thiserror 1.0.69", "tracing", - "trie-db 0.30.0", + "trie-db 0.29.1", ] [[package]] name = "sp-state-machine" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" dependencies = [ "hash-db", "log", @@ -19555,10 +19868,10 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-panic-handler 13.0.2 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", + "sp-panic-handler 13.0.2", + "sp-trie 39.1.0", "thiserror 1.0.69", "tracing", "trie-db 0.30.0", @@ -19566,8 +19879,8 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "20.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -19577,13 +19890,13 @@ dependencies = [ "rand 0.8.5", "scale-info", "sha2 0.10.9", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-runtime 31.0.1", + "sp-runtime-interface 24.0.0", "thiserror 1.0.69", "x25519-dalek", ] @@ -19597,7 +19910,19 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" + +[[package]] +name = "sp-storage" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "impl-serde 0.5.0", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", +] [[package]] name = "sp-storage" @@ -19626,15 +19951,15 @@ dependencies = [ ] [[package]] -name = "sp-storage" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-timestamp" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "impl-serde 0.5.0", + "async-trait", "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "thiserror 1.0.69", ] [[package]] @@ -19651,15 +19976,14 @@ dependencies = [ ] [[package]] -name = "sp-timestamp" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-tracing" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "async-trait", "parity-scale-codec", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "thiserror 1.0.69", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] @@ -19675,14 +19999,12 @@ dependencies = [ ] [[package]] -name = "sp-tracing" -version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "sp-transaction-pool" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "parity-scale-codec", - "tracing", - "tracing-core", - "tracing-subscriber", + "sp-api 26.0.0", + "sp-runtime 31.0.1", ] [[package]] @@ -19695,92 +20017,84 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "sp-transaction-pool" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", -] - [[package]] name = "sp-transaction-storage-proof" -version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-inherents 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-inherents 26.0.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", ] [[package]] name = "sp-trie" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "ahash 0.8.12", "hash-db", - "lazy_static", - "memory-db", + "memory-db 0.33.0", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 34.0.0", - "sp-externalities 0.29.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing", - "trie-db 0.29.1", + "trie-db 0.30.0", "trie-root", ] [[package]] name = "sp-trie" -version = "39.1.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" +checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" dependencies = [ "ahash 0.8.12", "hash-db", - "memory-db", + "lazy_static", + "memory-db 0.32.0", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 34.0.0", + "sp-externalities 0.29.0", "thiserror 1.0.69", "tracing", - "trie-db 0.30.0", + "trie-db 0.29.1", "trie-root", ] [[package]] name = "sp-trie" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" dependencies = [ "ahash 0.8.12", "hash-db", - "memory-db", + "memory-db 0.32.0", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", "thiserror 1.0.69", "tracing", "trie-db 0.30.0", @@ -19789,64 +20103,64 @@ dependencies = [ [[package]] name = "sp-version" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d521a405707b5be561367cd3d442ff67588993de24062ce3adefcf8437ee9fe1" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "impl-serde 0.4.0", + "impl-serde 0.5.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 39.0.5", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version-proc-macro 14.0.0", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-runtime 31.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-version-proc-macro 13.0.0", "thiserror 1.0.69", ] [[package]] name = "sp-version" -version = "39.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" +checksum = "d521a405707b5be561367cd3d442ff67588993de24062ce3adefcf8437ee9fe1" dependencies = [ - "impl-serde 0.5.0", + "impl-serde 0.4.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 41.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 39.0.5", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version-proc-macro 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-version-proc-macro 14.0.0", "thiserror 1.0.69", ] [[package]] name = "sp-version" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-version-proc-macro 15.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 41.1.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-version-proc-macro 15.0.0", "thiserror 1.0.69", ] [[package]] name = "sp-version-proc-macro" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", + "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.101", @@ -19854,12 +20168,11 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "15.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" dependencies = [ "parity-scale-codec", - "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.101", @@ -19868,7 +20181,8 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -19879,9 +20193,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "21.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -19893,7 +20206,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -19904,31 +20218,31 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 23.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] name = "sp-weights" version = "31.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" dependencies = [ "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 26.1.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -20006,6 +20320,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "staging-parachain-info" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "parity-scale-codec", + "scale-info", + "sp-runtime 31.0.1", +] + [[package]] name = "staging-parachain-info" version = "0.17.0" @@ -20021,16 +20348,24 @@ dependencies = [ ] [[package]] -name = "staging-parachain-info" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "staging-xcm" +version = "7.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "frame-system 40.1.0", + "array-bytes", + "bounded-collections", + "derive-where", + "environmental", + "frame-support 28.0.0", + "hex-literal", + "impl-trait-for-tuples", + "log", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "serde", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "xcm-procedural 7.0.0", ] [[package]] @@ -20048,7 +20383,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "xcm-procedural 8.0.0", ] @@ -20068,29 +20403,32 @@ dependencies = [ "scale-info", "serde", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "xcm-procedural 10.1.0", ] [[package]] -name = "staging-xcm" -version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "staging-xcm-builder" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "array-bytes", - "bounded-collections", - "derive-where", "environmental", - "frame-support 40.1.0", - "hex-literal", + "frame-support 28.0.0", + "frame-system 28.0.0", "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "xcm-procedural 11.0.2", + "pallet-asset-conversion 10.0.0", + "pallet-transaction-payment 28.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 6.0.0", + "scale-info", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", + "tracing", ] [[package]] @@ -20108,35 +20446,31 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain-primitives 14.0.0", "scale-info", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm 14.2.2", "staging-xcm-executor 17.0.2", ] [[package]] -name = "staging-xcm-builder" -version = "20.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "staging-xcm-executor" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "environmental", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-benchmarking 28.0.0", + "frame-support 28.0.0", "impl-trait-for-tuples", - "pallet-asset-conversion 22.0.0", - "pallet-transaction-payment 40.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "parity-scale-codec", + "scale-info", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", "tracing", ] @@ -20152,35 +20486,15 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", "sp-core 34.0.0", "sp-io 38.0.2", "sp-runtime 39.0.5", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm 14.2.2", "tracing", ] -[[package]] -name = "staging-xcm-executor" -version = "19.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" -dependencies = [ - "environmental", - "frame-benchmarking 40.0.0", - "frame-support 40.1.0", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "tracing", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -20281,9 +20595,8 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +version = "0.4.7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -20295,7 +20608,8 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -20326,32 +20640,32 @@ checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" [[package]] name = "substrate-frame-rpc-system" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", - "frame-system-rpc-runtime-api 36.0.0", + "frame-system-rpc-runtime-api 26.0.0", "futures", "jsonrpsee", "log", "parity-scale-codec", "sc-rpc-api", "sc-transaction-pool-api", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-block-builder 36.0.0", + "sp-api 26.0.0", + "sp-block-builder 26.0.0", "sp-blockchain", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", ] [[package]] name = "substrate-prometheus-endpoint" -version = "0.17.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -20365,9 +20679,9 @@ dependencies = [ [[package]] name = "substrate-state-machine" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2503-4#97e0ba9e2cb7f7c27a43c66ee9decbbfa5f617f4" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" dependencies = [ - "frame-support 40.1.0", + "frame-support 28.0.0", "hash-db", "ismp", "pallet-ismp", @@ -20375,34 +20689,33 @@ dependencies = [ "primitive-types 0.13.1", "scale-info", "serde", - "sp-consensus-aura 0.42.0", - "sp-consensus-babe 0.42.1", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-consensus-aura 0.32.0", + "sp-consensus-babe 0.32.0", + "sp-runtime 31.0.1", + "sp-trie 29.0.0", ] [[package]] name = "substrate-state-trie-migration-rpc" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "jsonrpsee", "parity-scale-codec", "sc-client-api", "sc-rpc-api", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", "trie-db 0.30.0", ] [[package]] name = "substrate-wasm-builder" -version = "24.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eccd97d503bdd5d14be243fefccc4b712f8740aab2baba3dfd0140e2d08f765" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "build-helper", "cargo_metadata 0.15.4", @@ -20410,8 +20723,9 @@ dependencies = [ "filetime", "jobserver", "parity-wasm", - "polkavm-linker 0.9.2", - "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm-linker 0.24.0", + "shlex", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "strum 0.26.3", "tempfile", "toml 0.8.22", @@ -20421,28 +20735,18 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "26.0.1" +version = "24.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adc17ecd661e16b25708f36f6e6961f809a3ab16c89132a4acd7936c0f31e46" +checksum = "8eccd97d503bdd5d14be243fefccc4b712f8740aab2baba3dfd0140e2d08f765" dependencies = [ - "array-bytes", "build-helper", "cargo_metadata 0.15.4", "console", "filetime", - "frame-metadata 20.0.0", "jobserver", - "merkleized-metadata", - "parity-scale-codec", "parity-wasm", - "polkavm-linker 0.18.0", - "sc-executor 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", - "shlex", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "polkavm-linker 0.9.2", "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 39.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "strum 0.26.3", "tempfile", "toml 0.8.22", @@ -20453,17 +20757,27 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "26.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adc17ecd661e16b25708f36f6e6961f809a3ab16c89132a4acd7936c0f31e46" dependencies = [ + "array-bytes", "build-helper", "cargo_metadata 0.15.4", "console", "filetime", + "frame-metadata 20.0.0", "jobserver", + "merkleized-metadata", + "parity-scale-codec", "parity-wasm", "polkavm-linker 0.18.0", + "sc-executor 0.42.0", "shlex", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", + "sp-version 39.0.0", "strum 0.26.3", "tempfile", "toml 0.8.22", @@ -20491,33 +20805,32 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c17d7ec2359d33133b63c97e28c8b7cd3f0a5bc6ce567ae3aef9d9e85be3433" +checksum = "03459d84546def5e1d0d22b162754609f18e031522b0319b53306f5829de9c09" dependencies = [ "async-trait", "derive-where", "either", - "frame-metadata 17.0.0", + "frame-metadata 20.0.0", "futures", "hex", - "impl-serde 0.5.0", - "jsonrpsee", "parity-scale-codec", - "polkadot-sdk", "primitive-types 0.13.1", - "scale-bits 0.6.0", - "scale-decode 0.14.0", - "scale-encode 0.8.0", + "scale-bits 0.7.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", "scale-info", "scale-value", "serde", "serde_json", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", - "thiserror 1.0.69", + "subxt-rpcs", + "thiserror 2.0.12", "tokio", "tokio-util", "tracing", @@ -20527,9 +20840,9 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6550ef451c77db6e3bc7c56fb6fe1dca9398a2c8fc774b127f6a396a769b9c5b" +checksum = "324c52c09919fec8c22a4b572a466878322e99fe14a9e3d50d6c3700a226ec25" dependencies = [ "heck 0.5.0", "parity-scale-codec", @@ -20539,50 +20852,51 @@ dependencies = [ "scale-typegen", "subxt-metadata", "syn 2.0.101", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] name = "subxt-core" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7a1bc6c9c1724971636a66e3225a7253cdb35bb6efb81524a6c71c04f08c59" +checksum = "66ef00be9d64885ec94e478a58e4e39d222024b20013ae7df4fc6ece545391aa" dependencies = [ "base58", "blake2 0.10.6", "derive-where", "frame-decode", - "frame-metadata 17.0.0", + "frame-metadata 20.0.0", "hashbrown 0.14.5", "hex", "impl-serde 0.5.0", "keccak-hash", "parity-scale-codec", - "polkadot-sdk", "primitive-types 0.13.1", - "scale-bits 0.6.0", - "scale-decode 0.14.0", - "scale-encode 0.8.0", + "scale-bits 0.7.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", "scale-info", "scale-value", "serde", "serde_json", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-metadata", + "thiserror 2.0.12", "tracing", ] [[package]] name = "subxt-lightclient" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ebc9131da4d0ba1f7814495b8cc79698798ccd52cacd7bcefe451e415bd945" +checksum = "ce07c2515b2e63b85ec3043fe4461b287af0615d4832c2fe6e81ba780b906bc0" dependencies = [ "futures", "futures-util", "serde", "serde_json", "smoldot-light 0.16.2", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -20590,9 +20904,9 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7819c5e09aae0319981ee853869f2fcd1fac4db8babd0d004c17161297aadc05" +checksum = "7c2c8da275a620dd676381d72395dfea91f0a6cd849665b4f1d0919371850701" dependencies = [ "darling 0.20.11", "parity-scale-codec", @@ -20606,23 +20920,47 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aacd4e7484fef58deaa2dcb32d94753a864b208a668c0dd0c28be1d8abeeadb2" +checksum = "fff4591673600c4388e21305788282414d26c791b4dee21b7cb0b19c10076f98" dependencies = [ "frame-decode", - "frame-metadata 17.0.0", + "frame-metadata 20.0.0", "hashbrown 0.14.5", "parity-scale-codec", - "polkadot-sdk", "scale-info", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.12", +] + +[[package]] +name = "subxt-rpcs" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba7494d250d65dc3439365ac5e8e0fbb9c3992e6e84b7aa01d69e082249b8b8" +dependencies = [ + "derive-where", + "frame-metadata 20.0.0", + "futures", + "hex", + "impl-serde 0.5.0", + "jsonrpsee", + "parity-scale-codec", + "primitive-types 0.13.1", + "serde", + "serde_json", + "subxt-core", + "subxt-lightclient", + "thiserror 2.0.12", + "tracing", + "url", ] [[package]] name = "subxt-signer" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d680352d04665b1e4eb6f9d2a54b800c4d8e1b20478e69be1b7d975b08d9fc34" +checksum = "4a2370298a210ed1df26152db7209a85e0ed8cfbce035309c3b37f7b61755377" dependencies = [ "base64 0.22.1", "bip32", @@ -20634,7 +20972,6 @@ dependencies = [ "keccak-hash", "parity-scale-codec", "pbkdf2", - "polkadot-sdk", "regex", "schnorrkel 0.11.4", "scrypt", @@ -20643,19 +20980,21 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.9", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-core", + "thiserror 2.0.12", "zeroize", ] [[package]] name = "subxt-utils-fetchmetadata" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c53bc3eeaacc143a2f29ace4082edd2edaccab37b69ad20befba9fb00fdb3d" +checksum = "fc868b55fe2303788dc7703457af390111940c3da4714b510983284501780ed5" dependencies = [ "hex", "parity-scale-codec", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] @@ -20682,9 +21021,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.25" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4560533fbd6914b94a8fb5cc803ed6801c3455668db3b810702c57612bac9412" +checksum = "14c8c8f496c33dc6343dac05b4be8d9e0bca180a4caa81d7b8416b10cc2273cd" dependencies = [ "paste", "proc-macro2", @@ -20715,6 +21054,21 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "sysinfo" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "windows 0.52.0", +] + [[package]] name = "system-configuration" version = "0.6.1" @@ -20771,6 +21125,12 @@ dependencies = [ "staging-xcm 14.2.2", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -20833,16 +21193,16 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "testnet-parachains-constants" -version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "cumulus-primitives-core 0.18.1", - "frame-support 40.1.0", - "polkadot-core-primitives 17.1.0", + "cumulus-primitives-core 0.7.0", + "frame-support 28.0.0", + "polkadot-core-primitives 7.0.0", "rococo-runtime-constants", "smallvec", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", "westend-runtime-constants", ] @@ -21236,11 +21596,11 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "coarsetime", - "polkadot-primitives 18.1.0", + "polkadot-primitives 7.0.0", "tracing", "tracing-gum-proc-macro", ] @@ -21248,7 +21608,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -21520,6 +21880,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "uzers" version = "0.12.1" @@ -22170,127 +22541,125 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "westend-runtime" -version = "22.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "binary-merkle-tree 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "binary-merkle-tree 13.0.0", "bitvec", - "frame-benchmarking 40.0.0", - "frame-election-provider-support 40.1.0", - "frame-executive 40.0.0", - "frame-metadata-hash-extension 0.8.0", - "frame-support 40.1.0", - "frame-system 40.1.0", - "frame-system-benchmarking 40.0.0", - "frame-system-rpc-runtime-api 36.0.0", - "frame-try-runtime 0.46.0", + "frame-benchmarking 28.0.0", + "frame-election-provider-support 28.0.0", + "frame-executive 28.0.0", + "frame-metadata-hash-extension 0.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", + "frame-system-benchmarking 28.0.0", + "frame-system-rpc-runtime-api 26.0.0", + "frame-try-runtime 0.34.0", "hex-literal", "log", - "pallet-asset-rate 19.0.0", - "pallet-authority-discovery 40.0.0", - "pallet-authorship 40.0.0", - "pallet-babe 40.0.0", - "pallet-bags-list 39.1.0", - "pallet-balances 41.1.0", - "pallet-beefy 41.1.0", - "pallet-beefy-mmr 41.0.0", - "pallet-conviction-voting 40.1.0", - "pallet-delegated-staking 7.0.0", - "pallet-election-provider-multi-phase 39.1.0", - "pallet-election-provider-support-benchmarking 39.0.0", - "pallet-elections-phragmen", - "pallet-fast-unstake 39.0.0", - "pallet-grandpa 40.0.0", - "pallet-identity 40.1.0", - "pallet-indices 40.0.0", - "pallet-membership", - "pallet-message-queue 43.1.0", + "pallet-asset-rate 7.0.0", + "pallet-authority-discovery 28.0.0", + "pallet-authorship 28.0.0", + "pallet-babe 28.0.0", + "pallet-bags-list 27.0.0", + "pallet-balances 28.0.0", + "pallet-beefy 28.0.0", + "pallet-beefy-mmr 28.0.0", + "pallet-conviction-voting 28.0.0", + "pallet-delegated-staking 1.0.0", + "pallet-election-provider-multi-phase 27.0.0", + "pallet-election-provider-support-benchmarking 27.0.0", + "pallet-fast-unstake 27.0.0", + "pallet-grandpa 28.0.0", + "pallet-identity 29.0.0", + "pallet-indices 28.0.0", + "pallet-message-queue 31.0.0", "pallet-meta-tx", "pallet-migrations", - "pallet-mmr 40.0.0", - "pallet-multisig 40.1.0", - "pallet-nomination-pools 38.1.0", - "pallet-nomination-pools-benchmarking 38.0.0", - "pallet-nomination-pools-runtime-api 36.0.0", - "pallet-offences 39.0.0", - "pallet-offences-benchmarking 40.0.0", - "pallet-parameters 0.11.0", - "pallet-preimage 40.0.0", - "pallet-proxy 40.1.0", + "pallet-mmr 27.0.0", + "pallet-multisig 28.0.0", + "pallet-nomination-pools 25.0.0", + "pallet-nomination-pools-benchmarking 26.0.0", + "pallet-nomination-pools-runtime-api 23.0.0", + "pallet-offences 27.0.0", + "pallet-offences-benchmarking 28.0.0", + "pallet-parameters 0.1.0", + "pallet-preimage 28.0.0", + "pallet-proxy 28.0.0", "pallet-recovery", - "pallet-referenda 40.1.0", + "pallet-referenda 28.0.0", "pallet-root-testing", - "pallet-scheduler 41.0.0", - "pallet-session 40.0.0", - "pallet-session-benchmarking 40.0.0", - "pallet-society", - "pallet-staking 40.1.0", - "pallet-staking-runtime-api 26.0.0", - "pallet-state-trie-migration 44.1.0", - "pallet-sudo 40.0.0", - "pallet-timestamp 39.0.0", - "pallet-transaction-payment 40.0.0", - "pallet-transaction-payment-rpc-runtime-api 40.0.0", - "pallet-treasury 39.0.0", - "pallet-utility 40.0.0", + "pallet-scheduler 29.0.0", + "pallet-session 28.0.0", + "pallet-session-benchmarking 28.0.0", + "pallet-staking 28.0.0", + "pallet-staking-async-ah-client", + "pallet-staking-async-rc-client", + "pallet-staking-runtime-api 14.0.0", + "pallet-sudo 28.0.0", + "pallet-timestamp 27.0.0", + "pallet-transaction-payment 28.0.0", + "pallet-transaction-payment-rpc-runtime-api 28.0.0", + "pallet-treasury 27.0.0", + "pallet-utility 28.0.0", "pallet-verify-signature", - "pallet-vesting 40.1.0", - "pallet-whitelist 39.0.0", - "pallet-xcm 19.1.0", - "pallet-xcm-benchmarks 20.0.0", + "pallet-vesting 28.0.0", + "pallet-whitelist 27.0.0", + "pallet-xcm 7.0.0", + "pallet-xcm-benchmarks 7.0.0", "parity-scale-codec", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-common 19.1.0", - "polkadot-runtime-parachains 19.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-common 7.0.0", + "polkadot-runtime-parachains 7.0.0", "scale-info", "serde", "serde_derive", "serde_json", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-application-crypto 40.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-authority-discovery 36.0.0", - "sp-block-builder 36.0.0", - "sp-consensus-babe 0.42.1", - "sp-consensus-beefy 24.1.0", - "sp-consensus-grandpa 23.1.0", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-genesis-builder 0.17.0", - "sp-inherents 36.0.0", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keyring 41.0.0", - "sp-mmr-primitives 36.1.0", - "sp-npos-elections 36.1.0", - "sp-offchain 36.0.0", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-session 38.1.0", - "sp-staking 38.0.0", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-transaction-pool 36.0.0", - "sp-version 39.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", - "staging-xcm-executor 19.1.0", - "substrate-wasm-builder 26.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-api 26.0.0", + "sp-application-crypto 30.0.0", + "sp-arithmetic 23.0.0", + "sp-authority-discovery 26.0.0", + "sp-block-builder 26.0.0", + "sp-consensus-babe 0.32.0", + "sp-consensus-beefy 13.0.0", + "sp-consensus-grandpa 13.0.0", + "sp-core 28.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 26.0.0", + "sp-io 30.0.0", + "sp-keyring 31.0.0", + "sp-mmr-primitives 26.0.0", + "sp-npos-elections 26.0.0", + "sp-offchain 26.0.0", + "sp-runtime 31.0.1", + "sp-session 27.0.0", + "sp-staking 26.0.0", + "sp-storage 19.0.0", + "sp-transaction-pool 26.0.0", + "sp-version 29.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", + "substrate-wasm-builder 17.0.0", "westend-runtime-constants", - "xcm-runtime-apis 0.7.0", + "xcm-runtime-apis 0.1.1", ] [[package]] name = "westend-runtime-constants" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-common 19.1.0", + "frame-support 28.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-common 7.0.0", "smallvec", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-builder 20.1.0", + "sp-core 28.0.0", + "sp-runtime 31.0.1", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", ] [[package]] @@ -22352,6 +22721,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.53.0" @@ -22362,6 +22741,37 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.53.0" @@ -22385,6 +22795,17 @@ dependencies = [ "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.0" @@ -22413,6 +22834,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link", +] + [[package]] name = "windows-result" version = "0.1.2" @@ -22538,6 +22969,15 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -22815,42 +23255,42 @@ dependencies = [ [[package]] name = "xcm-emulator" -version = "0.19.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.5.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "array-bytes", - "cumulus-pallet-parachain-system 0.20.0", - "cumulus-primitives-core 0.18.1", - "cumulus-primitives-parachain-inherent 0.18.1", + "cumulus-pallet-parachain-system 0.7.0", + "cumulus-primitives-core 0.7.0", + "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-test-relay-sproof-builder", - "frame-support 40.1.0", - "frame-system 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "impl-trait-for-tuples", "log", - "pallet-balances 41.1.0", - "pallet-message-queue 43.1.0", - "pallet-timestamp 39.0.0", - "parachains-common 21.0.0", + "pallet-balances 28.0.0", + "pallet-message-queue 31.0.0", + "pallet-timestamp 27.0.0", + "parachains-common 7.0.0", "parity-scale-codec", "paste", - "polkadot-parachain-primitives 16.1.0", - "polkadot-primitives 18.1.0", - "polkadot-runtime-parachains 19.1.0", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime 41.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-parachains 7.0.0", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "sp-tracing 16.0.0", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", + "xcm-simulator", ] [[package]] name = "xcm-procedural" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "proc-macro2", @@ -22860,9 +23300,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "10.1.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" +checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" dependencies = [ "Inflector", "proc-macro2", @@ -22872,8 +23312,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "11.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", @@ -22881,6 +23322,20 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "xcm-runtime-apis" +version = "0.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "frame-support 28.0.0", + "parity-scale-codec", + "scale-info", + "sp-api 26.0.0", + "sp-weights 27.0.0", + "staging-xcm 7.0.1", + "staging-xcm-executor 7.0.0", +] + [[package]] name = "xcm-runtime-apis" version = "0.4.3" @@ -22891,23 +23346,30 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api 34.0.0", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "staging-xcm 14.2.2", "staging-xcm-executor 17.0.2", ] [[package]] -name = "xcm-runtime-apis" -version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +name = "xcm-simulator" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ - "frame-support 40.1.0", + "frame-support 28.0.0", + "frame-system 28.0.0", "parity-scale-codec", + "paste", + "polkadot-core-primitives 7.0.0", + "polkadot-parachain-primitives 6.0.0", + "polkadot-primitives 7.0.0", + "polkadot-runtime-parachains 7.0.0", "scale-info", - "sp-api 36.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "staging-xcm 16.1.0", - "staging-xcm-executor 19.1.0", + "sp-io 30.0.0", + "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", + "staging-xcm-executor 7.0.0", ] [[package]] @@ -22964,9 +23426,9 @@ dependencies = [ [[package]] name = "yap" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" +checksum = "bfe269e7b803a5e8e20cbd97860e136529cd83bf2c9c6d37b142467e7e1f051f" [[package]] name = "yasna" From 01c58c7ada0f653699741f1c2262dbfa2b411150 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 13:44:40 +0100 Subject: [PATCH 025/162] chore(api): update cargo.lock --- pop-api/Cargo.lock | 668 +++++++++++++++++++++++++++++++-------------- 1 file changed, 459 insertions(+), 209 deletions(-) diff --git a/pop-api/Cargo.lock b/pop-api/Cargo.lock index b00e272fd..74cf208df 100644 --- a/pop-api/Cargo.lock +++ b/pop-api/Cargo.lock @@ -428,6 +428,12 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -469,8 +475,8 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "binary-merkle-tree" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hash-db", "log", @@ -1163,10 +1169,16 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "frame-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "frame-support", "frame-support-procedural", @@ -1179,19 +1191,19 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", "sp-runtime", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime-interface 24.0.0", + "sp-storage 19.0.0", "static_assertions", ] [[package]] name = "frame-metadata" -version = "20.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" dependencies = [ "cfg-if", "parity-scale-codec", @@ -1201,8 +1213,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "aquamarine", "array-bytes", @@ -1222,28 +1234,28 @@ dependencies = [ "serde", "serde_json", "sp-api", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "sp-genesis-builder", "sp-inherents", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-io 30.0.0", "sp-metadata-ir", "sp-runtime", "sp-staking", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-state-machine 0.35.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-tracing 16.0.0", + "sp-trie 29.0.0", + "sp-weights 27.0.0", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "cfg-expr", @@ -1256,14 +1268,14 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "syn 2.0.101", ] [[package]] name = "frame-support-procedural-tools" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -1274,8 +1286,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", @@ -1284,8 +1296,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "cfg-if", "docify", @@ -1294,11 +1306,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", "sp-runtime", "sp-version", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-weights 27.0.0", ] [[package]] @@ -1467,6 +1479,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hash-db" version = "0.16.0" @@ -1508,6 +1539,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" dependencies = [ "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -1564,6 +1597,87 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2111,6 +2225,16 @@ dependencies = [ "hash-db", ] +[[package]] +name = "memory-db" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6da20dba965bd218a14c3b335b90d3e07c09ede190c7c19b50deb23d418a322" +dependencies = [ + "hash-db", + "hashbrown 0.15.3", +] + [[package]] name = "merlin" version = "3.0.0" @@ -2132,6 +2256,17 @@ dependencies = [ "adler2", ] +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + [[package]] name = "nalgebra" version = "0.33.2" @@ -2286,8 +2421,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", "sp-runtime", ] @@ -2423,6 +2558,12 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" +[[package]] +name = "polkavm-common" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed9e5af472f729fcf3b3c1cf17508ddbb3505259dd6e2ee0fb5a29e105d22" + [[package]] name = "polkavm-derive" version = "0.9.1" @@ -2441,6 +2582,15 @@ dependencies = [ "polkavm-derive-impl-macro 0.18.0", ] +[[package]] +name = "polkavm-derive" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176144f8661117ea95fa7cf868c9a62d6b143e8a2ebcb7582464c3faade8669a" +dependencies = [ + "polkavm-derive-impl-macro 0.24.0", +] + [[package]] name = "polkavm-derive-impl" version = "0.9.0" @@ -2465,6 +2615,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5a21844afdfcc10c92b9ef288ccb926211af27478d1730fcd55e4aec710179d" +dependencies = [ + "polkavm-common 0.24.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.9.0" @@ -2485,6 +2647,16 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0ef0f17ad81413ea1ca5b1b67553aedf5650c88269b673d3ba015c83bc2651" +dependencies = [ + "polkavm-derive-impl 0.24.0", + "syn 2.0.101", +] + [[package]] name = "pop-api" version = "0.0.0" @@ -2495,7 +2667,7 @@ dependencies = [ "pallet-nfts", "parity-scale-codec", "pop-primitives", - "sp-io 40.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 40.0.1", ] [[package]] @@ -2608,6 +2780,20 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "thiserror", +] + [[package]] name = "quote" version = "1.0.40" @@ -3175,10 +3361,20 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "sp-api" -version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", "hash-db", @@ -3186,21 +3382,21 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-externalities 0.25.0", "sp-metadata-ir", "sp-runtime", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-runtime-interface 24.0.0", + "sp-state-machine 0.35.0", + "sp-trie 29.0.0", "sp-version", "thiserror", ] [[package]] name = "sp-api-proc-macro" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "blake2", @@ -3213,21 +3409,20 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", + "sp-io 30.0.0", ] [[package]] name = "sp-arithmetic" -version = "26.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "docify", "integer-sqrt", @@ -3241,7 +3436,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" dependencies = [ "docify", "integer-sqrt", @@ -3254,9 +3450,8 @@ dependencies = [ [[package]] name = "sp-core" -version = "36.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "ark-vrf", "array-bytes", @@ -3264,7 +3459,7 @@ dependencies = [ "blake2", "bounded-collections", "bs58", - "dyn-clonable", + "dyn-clone", "ed25519-zebra", "futures", "hash-db", @@ -3286,14 +3481,15 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.10.9", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-runtime-interface 24.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-storage 19.0.0", "ss58-registry", - "substrate-bip39 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-bip39 0.4.7", "thiserror", "tracing", "w3f-bls", @@ -3303,7 +3499,8 @@ dependencies = [ [[package]] name = "sp-core" version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" dependencies = [ "ark-vrf", "array-bytes", @@ -3333,14 +3530,14 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.30.0", + "sp-runtime-interface 29.0.1", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 22.0.0", "ss58-registry", - "substrate-bip39 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "substrate-bip39 0.6.0", "thiserror", "tracing", "w3f-bls", @@ -3364,7 +3561,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "blake2b_simd", "byteorder", @@ -3377,10 +3574,10 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "syn 2.0.101", ] @@ -3398,7 +3595,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "proc-macro2", "quote", @@ -3407,29 +3604,29 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 19.0.0", ] [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-storage 22.0.0", ] [[package]] name = "sp-genesis-builder" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.8.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "scale-info", @@ -3440,8 +3637,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -3453,9 +3650,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "40.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bytes", "docify", @@ -3463,17 +3659,17 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive 0.18.0", + "polkavm-derive 0.24.0", "rustversion", "secp256k1", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-keystore 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 29.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-state-machine 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 28.0.0", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-externalities 0.25.0", + "sp-keystore 0.34.0", + "sp-runtime-interface 24.0.0", + "sp-state-machine 0.35.0", + "sp-tracing 16.0.0", + "sp-trie 29.0.0", "tracing", "tracing-core", ] @@ -3481,7 +3677,8 @@ dependencies = [ [[package]] name = "sp-io" version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" dependencies = [ "bytes", "docify", @@ -3492,45 +3689,45 @@ dependencies = [ "polkavm-derive 0.18.0", "rustversion", "secp256k1", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-keystore 0.42.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface 29.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-state-machine 0.45.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.30.0", + "sp-keystore 0.42.0", + "sp-runtime-interface 29.0.1", + "sp-state-machine 0.45.0", + "sp-tracing 17.1.0", + "sp-trie 39.1.0", "tracing", "tracing-core", ] [[package]] name = "sp-keystore" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 28.0.0", + "sp-externalities 0.25.0", ] [[package]] name = "sp-keystore" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", ] [[package]] name = "sp-metadata-ir" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -3539,9 +3736,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "13.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "backtrace", "regex", @@ -3550,7 +3746,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" dependencies = [ "backtrace", "regex", @@ -3558,8 +3755,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "31.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "binary-merkle-tree", "docify", @@ -3575,60 +3772,59 @@ dependencies = [ "serde", "simple-mermaid", "sp-application-crypto", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-io 40.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-weights 31.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 23.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-trie 29.0.0", + "sp-weights 27.0.0", "tracing", "tuplex", ] [[package]] name = "sp-runtime-interface" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.18.0", + "polkavm-derive 0.24.0", "primitive-types", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface-proc-macro 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.25.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-storage 19.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface" version = "29.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.18.0", "primitive-types", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-runtime-interface-proc-macro 18.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-storage 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-tracing 17.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-externalities 0.30.0", + "sp-runtime-interface-proc-macro 18.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 22.0.0", + "sp-tracing 17.1.0", + "sp-wasm-interface 21.0.1", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "Inflector", "expander", @@ -3641,7 +3837,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", @@ -3653,22 +3850,21 @@ dependencies = [ [[package]] name = "sp-staking" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 28.0.0", "sp-runtime", ] [[package]] name = "sp-state-machine" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hash-db", "log", @@ -3676,10 +3872,10 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-panic-handler 13.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 39.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-panic-handler 13.0.0", + "sp-trie 29.0.0", "thiserror", "tracing", "trie-db", @@ -3688,7 +3884,8 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" dependencies = [ "hash-db", "log", @@ -3696,10 +3893,10 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-panic-handler 13.0.2 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-trie 39.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", + "sp-panic-handler 13.0.2", + "sp-trie 39.1.0", "thiserror", "tracing", "trie-db", @@ -3714,38 +3911,37 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" [[package]] name = "sp-storage" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sp-tracing" -version = "17.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6147a5b8c98b9ed4bf99dc033fab97a468b4645515460974c8784daeb7c35433" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "tracing", @@ -3756,7 +3952,8 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6147a5b8c98b9ed4bf99dc033fab97a468b4645515460974c8784daeb7c35433" dependencies = [ "parity-scale-codec", "tracing", @@ -3766,21 +3963,21 @@ dependencies = [ [[package]] name = "sp-trie" -version = "39.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "ahash", "hash-db", - "memory-db", + "memory-db 0.33.0", "nohash-hasher", "parity-scale-codec", "parking_lot", "rand", "scale-info", "schnellru", - "sp-core 36.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "substrate-prometheus-endpoint", "thiserror", "tracing", "trie-db", @@ -3790,19 +3987,20 @@ dependencies = [ [[package]] name = "sp-trie" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" dependencies = [ "ahash", "hash-db", - "memory-db", + "memory-db 0.32.0", "nohash-hasher", "parity-scale-codec", "parking_lot", "rand", "scale-info", "schnellru", - "sp-core 36.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-externalities 0.30.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-core 36.1.0", + "sp-externalities 0.30.0", "thiserror", "tracing", "trie-db", @@ -3811,8 +4009,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -3821,15 +4019,15 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -3840,9 +4038,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "21.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -3853,7 +4050,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -3863,31 +4061,31 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 23.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", ] [[package]] name = "sp-weights" version = "31.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" dependencies = [ "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.1.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4)", + "sp-arithmetic 26.1.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3930,7 +4128,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 31.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "xcm-procedural", ] @@ -3948,9 +4146,8 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "substrate-bip39" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +version = "0.4.7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -3962,7 +4159,8 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503-4#0548e837980715584bfdea1fb907c9a6b3186bc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -3971,6 +4169,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +dependencies = [ + "http-body-util", + "hyper", + "hyper-util", + "log", + "prometheus", + "thiserror", + "tokio", +] + [[package]] name = "subtle" version = "2.6.1" @@ -4110,6 +4322,35 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.8.22" @@ -4446,7 +4687,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -4455,6 +4696,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" From 500ca5661157133c4b0f63f2f10e4e5730d48bb0 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 14:23:00 +0100 Subject: [PATCH 026/162] refactor(pallets): remove deprecated runtimeevent config item --- pallets/api/src/mock.rs | 3 --- pallets/motion/src/mock.rs | 1 - pallets/nfts/src/mock.rs | 1 - 3 files changed, 5 deletions(-) diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 48caa6caa..24104d754 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -113,7 +113,6 @@ impl pallet_assets::Config for Test { impl crate::fungibles::Config for Test { type AssetsInstance = AssetsInstance; - type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -190,7 +189,6 @@ impl pallet_nfts::Config for Test { type MetadataDepositBase = ConstU128<1>; type OffchainPublic = Noop; type OffchainSignature = Noop; - type RuntimeEvent = RuntimeEvent; type StringLimit = ConstU32<50>; type ValueLimit = ConstU32<50>; type WeightInfo = (); @@ -198,7 +196,6 @@ impl pallet_nfts::Config for Test { impl crate::nonfungibles::Config for Test { type NftsInstance = NftsInstance; - type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } diff --git a/pallets/motion/src/mock.rs b/pallets/motion/src/mock.rs index c562c5d49..4da403b4e 100644 --- a/pallets/motion/src/mock.rs +++ b/pallets/motion/src/mock.rs @@ -74,7 +74,6 @@ impl pallet_collective::Config for Test { impl pallet_motion::Config for Test { type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; type SimpleMajorityOrigin = pallet_collective::EnsureProportionAtLeast; type SuperMajorityOrigin = diff --git a/pallets/nfts/src/mock.rs b/pallets/nfts/src/mock.rs index 1f75fcaf3..20c7159b6 100644 --- a/pallets/nfts/src/mock.rs +++ b/pallets/nfts/src/mock.rs @@ -91,7 +91,6 @@ impl Config for Test { /// Off-chain = signature On-chain - therefore no conversion needed. /// It needs to be From for benchmarking. type OffchainSignature = Signature; - type RuntimeEvent = RuntimeEvent; type StringLimit = ConstU32<50>; type ValueLimit = ConstU32<50>; type WeightInfo = (); From 942bdcfd6a1f818db1a7be388973d58429e11376 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 14:24:05 +0100 Subject: [PATCH 027/162] test(fungibles): disambiguate allowance --- pallets/api/src/fungibles/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/api/src/fungibles/tests.rs b/pallets/api/src/fungibles/tests.rs index 43881ac0a..b66f256a3 100644 --- a/pallets/api/src/fungibles/tests.rs +++ b/pallets/api/src/fungibles/tests.rs @@ -713,7 +713,7 @@ mod read_weights { assert_eq!(total_supply, WeightInfo::total_supply()); assert_eq!(balance_of, WeightInfo::balance_of()); - assert_eq!(allowance, WeightInfo::allowance()); + assert_eq!(allowance, ::allowance()); assert_eq!(token_name, WeightInfo::token_name()); assert_eq!(token_symbol, WeightInfo::token_symbol()); assert_eq!(token_decimals, WeightInfo::token_decimals()); From ac0790a681faadb3cf745061fd3621aa003659fd Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 14:32:07 +0100 Subject: [PATCH 028/162] test(mainnet): update revive integrity tests --- runtime/mainnet/src/config/revive.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/runtime/mainnet/src/config/revive.rs b/runtime/mainnet/src/config/revive.rs index 0883c927f..88a99511c 100644 --- a/runtime/mainnet/src/config/revive.rs +++ b/runtime/mainnet/src/config/revive.rs @@ -81,13 +81,8 @@ mod tests { } #[test] - fn call_filter_is_nothing() { - assert_eq!(TypeId::of::<::CallFilter>(), TypeId::of::(),); - } - - #[test] - fn chain_extension_is_unset() { - assert_eq!(TypeId::of::<::ChainExtension>(), TypeId::of::<()>(),); + fn precompiles_is_unset() { + assert_eq!(TypeId::of::<::Precompiles>(), TypeId::of::<()>(),); } #[test] @@ -201,12 +196,4 @@ mod tests { TypeId::of::>(), ); } - - #[test] - fn xcm_is_pallet_xcm() { - assert_eq!( - TypeId::of::<::Xcm>(), - TypeId::of::>(), - ); - } } From 9168f9ba811588824a32f5eb37fb1f87095e3a7f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 14:32:49 +0100 Subject: [PATCH 029/162] build(deps): bump frame-metadata to resolve dependency clash --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 271054326..8b068d06e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14412,7 +14412,7 @@ dependencies = [ "env_logger 0.11.8", "frame-benchmarking 28.0.0", "frame-executive 28.0.0", - "frame-metadata 20.0.0", + "frame-metadata 23.0.0", "frame-metadata-hash-extension 0.1.0", "frame-support 28.0.0", "frame-system 28.0.0", @@ -14493,7 +14493,7 @@ dependencies = [ "env_logger 0.11.8", "frame-benchmarking 28.0.0", "frame-executive 28.0.0", - "frame-metadata 20.0.0", + "frame-metadata 23.0.0", "frame-metadata-hash-extension 0.1.0", "frame-support 28.0.0", "frame-system 28.0.0", diff --git a/Cargo.toml b/Cargo.toml index b9b684af8..1615fe11d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,7 @@ pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # de frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-metadata = { version = "20.0.0", default-features = false } +frame-metadata = { version = "23.0.0", default-features = false } frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } From 4ff7f3cd2765e7315c0f7634a1b7b9eeace2ad63 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 14:33:45 +0100 Subject: [PATCH 030/162] ci: restore runtime-benchmarks checks --- .github/workflows/ci.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b238bd4e3..cf54f692d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,9 +53,8 @@ jobs: - uses: "./.github/actions/init" - name: Check Build - # TODO: restore runtime-benchmarks once revive benchmarks resolved run: | - cargo check --release --locked --workspace --exclude integration-tests --features=try-runtime + cargo check --release --locked --workspace --exclude integration-tests --features=runtime-benchmarks,try-runtime check-ismp: needs: lint @@ -64,9 +63,8 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/init" - name: Check Build with ISMP - # TODO: restore runtime-benchmarks once revive benchmarks resolved run: | - cargo check --release --locked --workspace --exclude integration-tests --features=ismp,try-runtime + cargo check --release --locked --workspace --exclude integration-tests --features=ismp,runtime-benchmarks,try-runtime clippy: needs: lint @@ -85,8 +83,7 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - # TODO: restore runtime-benchmarks once revive benchmarks resolved - args: --release --locked --workspace --exclude integration-tests + args: --release --locked --workspace --exclude integration-tests --features=runtime-benchmarks clippy-ismp: needs: lint @@ -105,8 +102,7 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - # TODO: restore runtime-benchmarks once revive benchmarks resolved - args: --release --locked --workspace --exclude integration-tests --features=ismp + args: --release --locked --workspace --exclude integration-tests --features=runtime-benchmarks,ismp test: needs: lint @@ -117,8 +113,7 @@ jobs: - uses: "./.github/actions/init" - name: Run tests - # TODO: restore runtime-benchmarks once revive benchmarks resolved - run: cargo test --release --locked --workspace --exclude integration-tests --exclude pop-api-integration-tests + run: cargo test --release --locked --workspace --exclude integration-tests --exclude pop-api-integration-tests --features=runtime-benchmarks integration-tests: needs: lint @@ -199,8 +194,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage - # TODO: restore runtime-benchmarks once revive benchmarks resolved - run: cargo llvm-cov --features=try-runtime,ismp --workspace --exclude integration-tests --exclude pop-api-integration-tests --lib --bins --codecov --output-path codecov.json + run: cargo llvm-cov --features=runtime-benchmarks,try-runtime,ismp --workspace --exclude integration-tests --exclude pop-api-integration-tests --lib --bins --codecov --output-path codecov.json - name: Upload to codecov.io uses: codecov/codecov-action@v4 From 0eda3538632dde829b72fd5ad0c174e508c9d1b9 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 15:23:27 +0100 Subject: [PATCH 031/162] test(mainnet): update metadata integrity test after v16 stabilisation --- runtime/mainnet/src/apis.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/runtime/mainnet/src/apis.rs b/runtime/mainnet/src/apis.rs index 09f9e0d2f..c2903d5f7 100644 --- a/runtime/mainnet/src/apis.rs +++ b/runtime/mainnet/src/apis.rs @@ -608,7 +608,6 @@ fn metadata_api_implemented() { use codec::Decode; use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed}; - const V16_UNSTABLE: u32 = u32::MAX; fn assert>() { let opaque_meta: OpaqueMetadata = T::metadata(); @@ -620,7 +619,7 @@ fn metadata_api_implemented() { panic!("Expected metadata V14"); }; - assert_eq!(T::metadata_versions(), vec![14, 15, V16_UNSTABLE]); + assert_eq!(T::metadata_versions(), vec![14, 15, 16]); let version = 15; let opaque_meta = T::metadata_at_version(version).expect("V15 should exist"); @@ -634,8 +633,17 @@ fn metadata_api_implemented() { assert!(!metadata.apis.is_empty()); assert!(!metadata.pallets.is_empty()); - // Ensure metadata v16 is not provided. - assert!(T::metadata_at_version(16).is_none()); + let version = 16; + let opaque_meta = T::metadata_at_version(version).expect("V16 should exist"); + let prefixed_meta_bytes = opaque_meta.deref(); + assert_eq!(prefixed_meta_bytes, Runtime::metadata_at_version(version).unwrap().deref()); + let prefixed_meta = RuntimeMetadataPrefixed::decode(&mut &prefixed_meta_bytes[..]).unwrap(); + // Ensure that we have the V16 variant. + let RuntimeMetadata::V16(metadata) = prefixed_meta.1 else { + panic!("Expected metadata V16"); + }; + assert!(!metadata.apis.is_empty()); + assert!(!metadata.pallets.is_empty()); } sp_io::TestExternalities::new_empty().execute_with(|| assert::()); } From 9dba349308965daf603163fa1816f6387ece7827 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 15:33:02 +0100 Subject: [PATCH 032/162] refactor(runtimes): use max_pov_size constant --- runtime/devnet/src/lib.rs | 8 ++++---- runtime/mainnet/src/config/system.rs | 4 ++-- runtime/testnet/src/config/system.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index ccb6f27ac..6178675e9 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -63,9 +63,9 @@ use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; pub use pop_runtime_common::{ deposit, AuraId, Balance, BlockNumber, Hash, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, - BLOCK_PROCESSING_VELOCITY, DAYS, EXISTENTIAL_DEPOSIT, HOURS, MAXIMUM_BLOCK_WEIGHT, MICRO_UNIT, - MILLI_UNIT, MINUTES, NORMAL_DISPATCH_RATIO, RELAY_CHAIN_SLOT_DURATION_MILLIS, SLOT_DURATION, - UNINCLUDED_SEGMENT_CAPACITY, UNIT, + BLOCK_PROCESSING_VELOCITY, DAYS, EXISTENTIAL_DEPOSIT, HOURS, MAXIMUM_BLOCK_WEIGHT, + MAX_POV_SIZE, MICRO_UNIT, MILLI_UNIT, MINUTES, NORMAL_DISPATCH_RATIO, + RELAY_CHAIN_SLOT_DURATION_MILLIS, SLOT_DURATION, UNINCLUDED_SEGMENT_CAPACITY, UNIT, }; use smallvec::smallvec; use sp_api::impl_runtime_apis; @@ -262,7 +262,7 @@ parameter_types! { // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize // the lazy contract deletion. pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + BlockLength::max_with_normal_ratio(MAX_POV_SIZE, NORMAL_DISPATCH_RATIO); pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() .base_block(BlockExecutionWeight::get()) .for_class(DispatchClass::all(), |weights| { diff --git a/runtime/mainnet/src/config/system.rs b/runtime/mainnet/src/config/system.rs index d8a08328d..33fb200f3 100644 --- a/runtime/mainnet/src/config/system.rs +++ b/runtime/mainnet/src/config/system.rs @@ -3,7 +3,7 @@ use frame_support::traits::{ConstU32, ConstU64, Contains, EnqueueWithOrigin, Eve use pallet_balances::Call as BalancesCall; use polkadot_runtime_common::BlockHashCount; use pop_runtime_common::{ - Nonce, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, + Nonce, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, MAX_POV_SIZE, NORMAL_DISPATCH_RATIO, }; use sp_runtime::traits::AccountIdLookup; @@ -30,7 +30,7 @@ parameter_types! { /// Defines the length limit in bytes for a block. // BlockLength is created with max for Operational & Mandatory and normal * max for Normal `DispatchClass`. pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + BlockLength::max_with_normal_ratio(MAX_POV_SIZE, NORMAL_DISPATCH_RATIO); /// Defines the block weight in terms of the different `DispatchClass` limits. pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() diff --git a/runtime/testnet/src/config/system.rs b/runtime/testnet/src/config/system.rs index 19492a061..32a6c70e2 100644 --- a/runtime/testnet/src/config/system.rs +++ b/runtime/testnet/src/config/system.rs @@ -29,7 +29,7 @@ parameter_types! { // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize // the lazy contract deletion. pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + BlockLength::max_with_normal_ratio(pop_runtime_common::MAX_POV_SIZE, NORMAL_DISPATCH_RATIO); pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() .base_block(BlockExecutionWeight::get()) .for_class(DispatchClass::all(), |weights| { From e1ed80846bbb961657ece895f441b04eaa926d6f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 15:51:29 +0100 Subject: [PATCH 033/162] test(integration-tests): updated expected ref_time for xcm attempted event --- integration-tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index a6e3fd4d6..1496cbe20 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -73,7 +73,7 @@ fn relay_to_para_sender_assertions(t: RelayToParaTest) { fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { type RuntimeEvent = ::RuntimeEvent; AssetHubPara::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 578_673_000, + 243_713_000, 6_208, ))); assert_expected_events!( From 488bdd5911215861dff929d6baee5a4dc564565b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 17:47:38 +0100 Subject: [PATCH 034/162] test(testnet): update metadata integrity test after v16 stabilisation --- runtime/testnet/src/lib.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 7f1b15e64..c0f4362ad 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -1063,7 +1063,6 @@ fn metadata_api_implemented() { use codec::Decode; use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed}; - const V16_UNSTABLE: u32 = u32::MAX; fn assert>() { let opaque_meta: OpaqueMetadata = T::metadata(); @@ -1075,7 +1074,7 @@ fn metadata_api_implemented() { panic!("Expected metadata V14"); }; - assert_eq!(T::metadata_versions(), vec![14, 15, V16_UNSTABLE]); + assert_eq!(T::metadata_versions(), vec![14, 15, 16]); let version = 15; let opaque_meta = T::metadata_at_version(version).expect("V15 should exist"); @@ -1089,8 +1088,17 @@ fn metadata_api_implemented() { assert!(!metadata.apis.is_empty()); assert!(!metadata.pallets.is_empty()); - // Ensure metadata v16 is not provided. - assert!(T::metadata_at_version(16).is_none()); + let version = 16; + let opaque_meta = T::metadata_at_version(version).expect("V16 should exist"); + let prefixed_meta_bytes = opaque_meta.deref(); + assert_eq!(prefixed_meta_bytes, Runtime::metadata_at_version(version).unwrap().deref()); + let prefixed_meta = RuntimeMetadataPrefixed::decode(&mut &prefixed_meta_bytes[..]).unwrap(); + // Ensure that we have the V16 variant. + let RuntimeMetadata::V16(metadata) = prefixed_meta.1 else { + panic!("Expected metadata V16"); + }; + assert!(!metadata.apis.is_empty()); + assert!(!metadata.pallets.is_empty()); } sp_io::TestExternalities::new_empty().execute_with(|| assert::()); } From 034d733faa7807ecb4996853cb2ff88d647a3d73 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 23:11:19 +0100 Subject: [PATCH 035/162] build(deps): update stable2506 revision --- Cargo.toml | 220 ++++++++++++++++++++++++++--------------------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1615fe11d..37c768787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,132 +80,132 @@ pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # de # Substrate # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } frame-metadata = { version = "23.0.0", default-features = false } -frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-nft-fractionalization = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-nfts-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-nfts-sdk = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "pallet-nfts", default-features = false } -pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-revive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false, package = "substrate-prometheus-endpoint" } -sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-nft-fractionalization = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-nfts-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-nfts-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", package = "pallet-nfts", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-revive = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false, package = "substrate-prometheus-endpoint" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } # Polkadot # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm-builder", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-xcm-executor", default-features = false } -xcm-runtime-apis = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", package = "staging-xcm", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", package = "staging-xcm-builder", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", package = "staging-xcm-executor", default-features = false } +xcm-runtime-apis = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } # Cumulus # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 -asset-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-pallet-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } -parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", package = "staging-parachain-info", default-features = false } -parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +asset-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-pallet-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +emulated-integration-tests-common = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", package = "staging-parachain-info", default-features = false } +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } # Runtimes # Dependencies changed to point to the tag for stable 2503-4 release as we needed a patch in pallet-session # that wasn't released in crates.io for testnet runtime v0.5.3 asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } -asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } +asset-hub-westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } paseo-runtime = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } paseo-runtime-constants = { git = "https://github.com/paseo-network/runtimes", default-features = false, tag = "v1.4.3" } -westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506" } -westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2506", default-features = false } +westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", rev = "a251f77", default-features = false } ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } ismp-parachain = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2506", default-features = false } From 88d4feedb59864554a7dde07aa2c8c59e63dbff3 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 23:11:33 +0100 Subject: [PATCH 036/162] chore: update cargo.lock --- Cargo.lock | 808 +++++++++++++++++++++++---------------------- pop-api/Cargo.lock | 100 +++--- 2 files changed, 455 insertions(+), 453 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b068d06e..ab8409f2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -923,7 +923,7 @@ dependencies = [ [[package]] name = "asset-hub-westend-runtime" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "assets-common 0.7.0", "bp-asset-hub-rococo", @@ -998,7 +998,7 @@ dependencies = [ "sp-offchain 26.0.0", "sp-runtime 31.0.1", "sp-session 27.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-storage 19.0.0", "sp-transaction-pool 26.0.0", "sp-version 29.0.0", @@ -1015,7 +1015,7 @@ dependencies = [ [[package]] name = "asset-test-utils" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "cumulus-pallet-xcmp-queue 0.7.1", @@ -1045,7 +1045,7 @@ dependencies = [ [[package]] name = "assets-common" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "ethereum-standards", @@ -1431,7 +1431,7 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "binary-merkle-tree" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hash-db", "log", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "bp-asset-hub-rococo" version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-bridge-hub-cumulus 0.7.0", "bp-messages 0.7.0", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "bp-asset-hub-westend" version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-bridge-hub-cumulus 0.7.0", "bp-messages 0.7.0", @@ -1804,7 +1804,7 @@ dependencies = [ [[package]] name = "bp-bridge-hub-cumulus" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-messages 0.7.0", "bp-polkadot-core 0.7.0", @@ -1814,7 +1814,7 @@ dependencies = [ "parachains-common 7.0.0", "polkadot-primitives 7.0.0", "sp-api 26.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -1897,7 +1897,7 @@ dependencies = [ [[package]] name = "bp-bridge-hub-rococo" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-bridge-hub-cumulus 0.7.0", "bp-messages 0.7.0", @@ -1907,13 +1907,13 @@ dependencies = [ "parity-scale-codec", "sp-api 26.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "bp-bridge-hub-westend" version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-bridge-hub-cumulus 0.7.0", "bp-messages 0.7.0", @@ -1923,13 +1923,13 @@ dependencies = [ "parity-scale-codec", "sp-api 26.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "bp-header-chain" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-runtime 0.7.0", "finality-grandpa", @@ -1940,7 +1940,7 @@ dependencies = [ "sp-consensus-grandpa 13.0.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "bp-messages" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-header-chain 0.7.0", "bp-runtime 0.7.0", @@ -1974,7 +1974,7 @@ dependencies = [ "serde", "sp-core 28.0.0", "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -1997,7 +1997,7 @@ dependencies = [ [[package]] name = "bp-parachains" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-header-chain 0.7.0", "bp-polkadot-core 0.7.0", @@ -2008,13 +2008,13 @@ dependencies = [ "scale-info", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "bp-polkadot-core" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-messages 0.7.0", "bp-runtime 0.7.0", @@ -2025,7 +2025,7 @@ dependencies = [ "serde", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "bp-relayers" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-header-chain 0.7.0", "bp-messages 0.7.0", @@ -2062,13 +2062,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "bp-runtime" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -2083,7 +2083,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-trie 29.0.0", "trie-db 0.30.0", ] @@ -2115,7 +2115,7 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-messages 0.7.0", "bp-runtime 0.7.0", @@ -2125,14 +2125,14 @@ dependencies = [ "serde", "sp-core 28.0.0", "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", ] [[package]] name = "bp-xcm-bridge-hub-router" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "cumulus-client-bootnodes" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -3087,7 +3087,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "clap", "parity-scale-codec", @@ -3104,7 +3104,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -3127,7 +3127,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3174,7 +3174,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3206,7 +3206,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "anyhow", "async-trait", @@ -3221,7 +3221,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -3248,7 +3248,7 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-primitives-core 0.7.0", @@ -3258,7 +3258,7 @@ dependencies = [ "parity-scale-codec", "sc-client-api", "sc-consensus-babe", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-inherents 26.0.0", "sp-runtime 31.0.1", "sp-state-machine 0.35.0", @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-primitives-core 0.7.0", @@ -3288,7 +3288,7 @@ dependencies = [ "sc-network", "sp-api 26.0.0", "sp-consensus", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-runtime 31.0.1", "sp-version 29.0.0", "tracing", @@ -3297,7 +3297,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-channel 1.9.0", "cumulus-client-cli", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "frame-support 28.0.0", @@ -3372,10 +3372,10 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", - "cumulus-pallet-parachain-system-proc-macro 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "cumulus-pallet-parachain-system-proc-macro 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "cumulus-primitives-core 0.7.0", "cumulus-primitives-parachain-inherent 0.7.0", "cumulus-primitives-proof-size-hostfunction 0.2.0", @@ -3398,7 +3398,7 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-trie 29.0.0", "sp-version 29.0.0", "staging-xcm 7.0.1", @@ -3458,7 +3458,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -3496,7 +3496,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-weight-reclaim" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-storage-weight-reclaim", "derive-where", @@ -3515,7 +3515,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", @@ -3546,7 +3546,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.7.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "approx", "bounded-collections", @@ -3598,7 +3598,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-api 26.0.0", "sp-consensus-aura 0.32.0", @@ -3621,7 +3621,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-core-primitives 7.0.0", @@ -3655,7 +3655,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-primitives-core 0.7.0", @@ -3684,7 +3684,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-externalities 0.25.0", "sp-runtime-interface 24.0.0", @@ -3705,7 +3705,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-storage-weight-reclaim" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "cumulus-primitives-proof-size-hostfunction 0.2.0", @@ -3722,7 +3722,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", @@ -3757,7 +3757,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -3785,7 +3785,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-primitives-core 0.7.0", @@ -3805,7 +3805,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -3841,7 +3841,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "cumulus-primitives-core 0.7.0", @@ -3882,7 +3882,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-streams" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-relay-chain-interface", "futures", @@ -3896,7 +3896,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "parity-scale-codec", @@ -4539,7 +4539,7 @@ dependencies = [ [[package]] name = "emulated-integration-tests-common" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "asset-test-utils", "bp-messages 0.7.0", @@ -4782,7 +4782,7 @@ dependencies = [ [[package]] name = "ethereum-standards" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "alloy-core", ] @@ -5067,7 +5067,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", ] @@ -5111,7 +5111,7 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-support-procedural 23.0.0", @@ -5160,7 +5160,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "32.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "array-bytes", @@ -5237,7 +5237,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -5260,7 +5260,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-election-provider-solution-type 13.0.0", "frame-support 28.0.0", @@ -5271,7 +5271,7 @@ dependencies = [ "sp-core 28.0.0", "sp-npos-elections 26.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -5294,7 +5294,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "aquamarine", "frame-support 28.0.0", @@ -5367,7 +5367,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "const-hex", @@ -5399,7 +5399,7 @@ dependencies = [ [[package]] name = "frame-storage-access-test-runtime" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "parity-scale-codec", @@ -5413,7 +5413,7 @@ dependencies = [ [[package]] name = "frame-support" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "aquamarine", "array-bytes", @@ -5435,8 +5435,8 @@ dependencies = [ "sp-api 26.0.0", "sp-arithmetic 23.0.0", "sp-core 28.0.0", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-genesis-builder 0.8.0", "sp-inherents 26.0.0", "sp-io 30.0.0", @@ -5444,7 +5444,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-staking 26.0.0", "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-tracing 16.0.0", "sp-trie 29.0.0", "sp-weights 27.0.0", @@ -5496,7 +5496,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "cfg-expr", @@ -5509,7 +5509,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "syn 2.0.101", ] @@ -5537,7 +5537,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support-procedural-tools-derive 11.0.0", "proc-macro-crate 3.3.0", @@ -5562,7 +5562,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -5583,7 +5583,7 @@ dependencies = [ [[package]] name = "frame-system" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cfg-if", "docify", @@ -5623,7 +5623,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -5652,7 +5652,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "parity-scale-codec", @@ -5673,7 +5673,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "parity-scale-codec", @@ -6450,7 +6450,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -7200,7 +7200,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "ismp" version = "0.2.2" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "anyhow", "derive_more 1.0.0", @@ -7217,7 +7217,7 @@ dependencies = [ [[package]] name = "ismp-parachain" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "cumulus-primitives-core 0.7.0", @@ -7242,7 +7242,7 @@ dependencies = [ [[package]] name = "ismp-parachain-inherent" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "anyhow", "async-trait", @@ -7263,7 +7263,7 @@ dependencies = [ [[package]] name = "ismp-parachain-runtime-api" version = "1.15.1" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "sp-api 26.0.0", @@ -8638,7 +8638,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "log", @@ -8657,7 +8657,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9267,7 +9267,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9304,7 +9304,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion-ops" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9322,7 +9322,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion-tx-payment" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9352,7 +9352,7 @@ dependencies = [ [[package]] name = "pallet-asset-rate" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9381,7 +9381,7 @@ dependencies = [ [[package]] name = "pallet-asset-rewards" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9393,13 +9393,13 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "pallet-asset-tx-payment" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9433,7 +9433,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "29.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ethereum-standards", "frame-benchmarking 28.0.0", @@ -9468,7 +9468,7 @@ dependencies = [ [[package]] name = "pallet-assets-freezer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "pallet-assets 29.1.0", @@ -9480,7 +9480,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -9513,7 +9513,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -9544,7 +9544,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -9571,7 +9571,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9618,7 +9618,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "aquamarine", "docify", @@ -9661,7 +9661,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -9693,7 +9693,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -9732,7 +9732,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "binary-merkle-tree 13.0.0", @@ -9783,7 +9783,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9818,7 +9818,7 @@ dependencies = [ [[package]] name = "pallet-bridge-messages" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-header-chain 0.7.0", "bp-messages 0.7.0", @@ -9830,14 +9830,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-trie 29.0.0", ] [[package]] name = "pallet-broker" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "frame-benchmarking 28.0.0", @@ -9874,7 +9874,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9911,7 +9911,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -9950,7 +9950,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -9967,7 +9967,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "frame-benchmarking 28.0.0", @@ -9998,7 +9998,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -10008,7 +10008,7 @@ dependencies = [ [[package]] name = "pallet-contracts-uapi" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -10030,7 +10030,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "assert_matches", "frame-benchmarking 28.0.0", @@ -10063,7 +10063,7 @@ dependencies = [ [[package]] name = "pallet-delegated-staking" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -10094,7 +10094,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10111,7 +10111,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-election-provider-support 28.0.0", @@ -10155,7 +10155,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-election-provider-support 28.0.0", @@ -10182,7 +10182,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10200,7 +10200,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -10237,7 +10237,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10282,7 +10282,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "enumflags2", "frame-benchmarking 28.0.0", @@ -10315,7 +10315,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10354,7 +10354,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10386,7 +10386,7 @@ dependencies = [ [[package]] name = "pallet-ismp" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "anyhow", "fortuples", @@ -10403,13 +10403,13 @@ dependencies = [ "sp-io 30.0.0", "sp-mmr-primitives 26.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "pallet-ismp-rpc" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "anyhow", "frame-system 28.0.0", @@ -10439,7 +10439,7 @@ dependencies = [ [[package]] name = "pallet-ismp-runtime-api" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "ismp", "pallet-ismp", @@ -10453,7 +10453,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "frame-benchmarking 28.0.0", @@ -10492,7 +10492,7 @@ dependencies = [ [[package]] name = "pallet-meta-tx" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -10504,13 +10504,13 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] name = "pallet-migrations" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -10529,7 +10529,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "parity-scale-codec", @@ -10576,7 +10576,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "parity-scale-codec", @@ -10603,7 +10603,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "pallet-assets 29.1.0", @@ -10616,7 +10616,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "enumflags2", "frame-benchmarking 28.0.0", @@ -10669,7 +10669,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "sp-api 26.0.0", @@ -10689,7 +10689,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -10699,7 +10699,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -10736,7 +10736,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-election-provider-support 28.0.0", @@ -10777,7 +10777,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "pallet-nomination-pools 25.0.0", "parity-scale-codec", @@ -10798,7 +10798,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -10830,7 +10830,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-election-provider-support 28.0.0", @@ -10877,7 +10877,7 @@ dependencies = [ [[package]] name = "pallet-parameters" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -10912,7 +10912,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10945,7 +10945,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -10970,7 +10970,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -10988,7 +10988,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -10998,7 +10998,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "assert_matches", "frame-benchmarking 28.0.0", @@ -11053,7 +11053,7 @@ dependencies = [ [[package]] name = "pallet-revive" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "alloy-core", "derive_more 0.99.20", @@ -11092,6 +11092,8 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", + "staging-xcm 7.0.1", + "staging-xcm-builder 7.0.0", "substrate-bn", "subxt-signer", ] @@ -11099,7 +11101,7 @@ dependencies = [ [[package]] name = "pallet-revive-fixtures" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "anyhow", "cargo_metadata 0.15.4", @@ -11113,7 +11115,7 @@ dependencies = [ [[package]] name = "pallet-revive-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -11123,7 +11125,7 @@ dependencies = [ [[package]] name = "pallet-revive-uapi" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitflags 1.3.2", "pallet-revive-proc-macro", @@ -11135,7 +11137,7 @@ dependencies = [ [[package]] name = "pallet-root-testing" version = "4.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -11148,7 +11150,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -11183,7 +11185,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -11226,7 +11228,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11259,7 +11261,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11276,7 +11278,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-election-provider-support 28.0.0", @@ -11321,7 +11323,7 @@ dependencies = [ [[package]] name = "pallet-staking-async-ah-client" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -11340,7 +11342,7 @@ dependencies = [ [[package]] name = "pallet-staking-async-rc-client" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -11369,7 +11371,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "sp-arithmetic 23.0.0", @@ -11388,7 +11390,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "sp-api 26.0.0", @@ -11409,7 +11411,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11442,7 +11444,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -11473,7 +11475,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -11511,7 +11513,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11529,7 +11531,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11560,7 +11562,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api 28.0.0", @@ -11576,7 +11578,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "pallet-transaction-payment 28.0.0", "parity-scale-codec", @@ -11601,7 +11603,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -11639,7 +11641,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11668,7 +11670,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11699,7 +11701,7 @@ dependencies = [ [[package]] name = "pallet-verify-signature" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11714,7 +11716,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11743,7 +11745,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -11768,7 +11770,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bounded-collections", "frame-benchmarking 28.0.0", @@ -11816,7 +11818,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -11851,7 +11853,7 @@ dependencies = [ [[package]] name = "pallet-xcm-bridge-hub" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-messages 0.7.0", "bp-runtime 0.7.0", @@ -11864,7 +11866,7 @@ dependencies = [ "scale-info", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", @@ -11873,7 +11875,7 @@ dependencies = [ [[package]] name = "pallet-xcm-bridge-hub-router" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-xcm-bridge-hub-router 0.6.0", "frame-benchmarking 28.0.0", @@ -11885,7 +11887,7 @@ dependencies = [ "scale-info", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", ] @@ -11913,7 +11915,7 @@ dependencies = [ [[package]] name = "parachains-common" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "cumulus-primitives-utility 0.7.0", @@ -11973,7 +11975,7 @@ dependencies = [ [[package]] name = "parachains-runtimes-test-utils" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-pallet-parachain-system 0.7.0", "cumulus-pallet-xcmp-queue 0.7.1", @@ -12463,7 +12465,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-approval-distribution" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "futures-timer", @@ -12481,7 +12483,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "futures-timer", @@ -12496,7 +12498,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fatality", "futures", @@ -12519,7 +12521,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "fatality", @@ -12562,7 +12564,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "clap", "frame-benchmarking-cli", @@ -12579,14 +12581,14 @@ dependencies = [ "sp-core 28.0.0", "sp-keyring 31.0.0", "sp-runtime 31.0.1", - "substrate-build-script-utils 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "substrate-build-script-utils 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "thiserror 1.0.69", ] [[package]] name = "polkadot-collator-protocol" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "fatality", @@ -12609,7 +12611,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -12632,7 +12634,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fatality", "futures", @@ -12654,7 +12656,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -12668,7 +12670,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "futures-timer", @@ -12681,7 +12683,7 @@ dependencies = [ "sc-network", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-keystore 0.34.0", "tracing-gum", ] @@ -12689,7 +12691,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "always-assert", "async-trait", @@ -12712,7 +12714,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "parity-scale-codec", @@ -12730,7 +12732,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "bitvec", @@ -12762,7 +12764,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting-parallel" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -12786,7 +12788,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "futures", @@ -12805,7 +12807,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "fatality", @@ -12826,7 +12828,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "polkadot-node-subsystem", @@ -12841,7 +12843,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -12863,7 +12865,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "polkadot-node-metrics", @@ -12877,7 +12879,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "futures-timer", @@ -12893,7 +12895,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fatality", "futures", @@ -12911,7 +12913,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -12928,7 +12930,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fatality", "futures", @@ -12942,7 +12944,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "fatality", @@ -12959,7 +12961,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "always-assert", "array-bytes", @@ -12987,7 +12989,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "polkadot-node-subsystem", @@ -13000,7 +13002,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cpu-time", "futures", @@ -13015,7 +13017,7 @@ dependencies = [ "sc-executor-wasmtime 0.29.0", "seccompiler", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-io 30.0.0", "sp-tracing 16.0.0", @@ -13026,7 +13028,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "polkadot-node-metrics", @@ -13041,7 +13043,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bs58", "futures", @@ -13058,7 +13060,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -13083,7 +13085,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "bounded-vec", @@ -13099,7 +13101,7 @@ dependencies = [ "sp-consensus-babe 0.32.0", "sp-consensus-slots 0.32.0", "sp-keystore 0.34.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "thiserror 1.0.69", "zstd 0.12.4", ] @@ -13107,7 +13109,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", @@ -13116,7 +13118,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "derive_more 0.99.20", @@ -13144,7 +13146,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fatality", "futures", @@ -13174,7 +13176,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -13194,7 +13196,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bounded-collections", "derive_more 0.99.20", @@ -13227,7 +13229,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "bounded-collections", @@ -13249,7 +13251,7 @@ dependencies = [ "sp-keystore 0.34.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "thiserror 1.0.69", ] @@ -13310,7 +13312,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -13343,7 +13345,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "frame-benchmarking 28.0.0", @@ -13463,7 +13465,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bs58", "frame-benchmarking 28.0.0", @@ -13488,7 +13490,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -13527,7 +13529,7 @@ dependencies = [ "sp-runtime 31.0.1", "sp-session 27.0.0", "sp-staking 26.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "static_assertions", @@ -13586,7 +13588,7 @@ dependencies = [ [[package]] name = "polkadot-sdk-frame" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-benchmarking 28.0.0", @@ -13621,7 +13623,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "7.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "frame-benchmarking 28.0.0", @@ -13729,7 +13731,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitvec", "fatality", @@ -13749,7 +13751,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "polkadot-primitives 7.0.0", @@ -14854,7 +14856,7 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "itertools 0.14.0", "log", "multimap", @@ -15404,7 +15406,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "binary-merkle-tree 13.0.0", "bitvec", @@ -15502,7 +15504,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "polkadot-primitives 7.0.0", @@ -15869,7 +15871,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "sp-core 28.0.0", @@ -15892,7 +15894,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -15920,7 +15922,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "log", @@ -15941,7 +15943,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "sp-api 26.0.0", @@ -15956,7 +15958,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "docify", @@ -15971,7 +15973,7 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-genesis-builder 0.8.0", "sp-io 30.0.0", "sp-runtime 31.0.1", @@ -15982,7 +15984,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -15993,7 +15995,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "chrono", @@ -16035,7 +16037,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fnv", "futures", @@ -16061,7 +16063,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hash-db", "kvdb", @@ -16089,7 +16091,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -16112,7 +16114,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -16141,7 +16143,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "fork-tree", @@ -16166,7 +16168,7 @@ dependencies = [ "sp-consensus-babe 0.32.0", "sp-consensus-slots 0.32.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-inherents 26.0.0", "sp-keystore 0.34.0", "sp-runtime 31.0.1", @@ -16177,7 +16179,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "jsonrpsee", @@ -16199,7 +16201,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16233,7 +16235,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "jsonrpsee", @@ -16253,7 +16255,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "fork-tree", "parity-scale-codec", @@ -16266,7 +16268,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ahash 0.8.12", "array-bytes", @@ -16300,7 +16302,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa 13.0.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-keystore 0.34.0", "sp-runtime 31.0.1", "substrate-prometheus-endpoint", @@ -16310,7 +16312,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "finality-grandpa", "futures", @@ -16330,7 +16332,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -16353,7 +16355,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -16400,11 +16402,11 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "polkavm 0.24.0", "sc-allocator 23.0.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-wasm-interface 20.0.0", "thiserror 1.0.69", "wasm-instrument", @@ -16427,7 +16429,7 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "polkavm 0.24.0", @@ -16450,7 +16452,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "anyhow", "log", @@ -16483,7 +16485,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "console", "futures", @@ -16499,7 +16501,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -16513,7 +16515,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -16541,7 +16543,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16591,7 +16593,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -16601,7 +16603,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ahash 0.8.12", "futures", @@ -16620,7 +16622,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16641,7 +16643,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -16676,7 +16678,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "futures", @@ -16695,7 +16697,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bs58", "bytes", @@ -16714,7 +16716,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", "fnv", @@ -16748,7 +16750,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -16757,7 +16759,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "jsonrpsee", @@ -16789,7 +16791,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16809,7 +16811,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -16833,7 +16835,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "futures", @@ -16866,13 +16868,13 @@ dependencies = [ [[package]] name = "sc-runtime-utilities" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "sc-executor 0.32.0", "sc-executor-common 0.29.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-state-machine 0.35.0", "sp-wasm-interface 20.0.0", "thiserror 1.0.69", @@ -16881,7 +16883,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "directories", @@ -16945,7 +16947,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "parity-scale-codec", @@ -16956,7 +16958,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "clap", "fs4", @@ -16969,7 +16971,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16988,7 +16990,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "derive_more 0.99.20", "futures", @@ -17001,14 +17003,14 @@ dependencies = [ "serde", "serde_json", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-io 30.0.0", ] [[package]] name = "sc-telemetry" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "chrono", "futures", @@ -17027,7 +17029,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "chrono", "console", @@ -17055,7 +17057,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -17066,7 +17068,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -17083,7 +17085,7 @@ dependencies = [ "sp-api 26.0.0", "sp-blockchain", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-runtime 31.0.1", "sp-tracing 16.0.0", "sp-transaction-pool 26.0.0", @@ -17097,7 +17099,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -17114,7 +17116,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-channel 1.9.0", "futures", @@ -17648,7 +17650,7 @@ dependencies = [ [[package]] name = "serde-hex-utils" version = "0.1.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "anyhow", "hex", @@ -17948,7 +17950,7 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "enumn", "parity-scale-codec", @@ -18233,7 +18235,7 @@ dependencies = [ [[package]] name = "snowbridge-beacon-primitives" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "byte-slice-cast", "frame-support 28.0.0", @@ -18247,7 +18249,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "ssz_rs", "ssz_rs_derive", ] @@ -18278,7 +18280,7 @@ dependencies = [ [[package]] name = "snowbridge-core" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bp-relayers", "frame-support 28.0.0", @@ -18293,7 +18295,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", @@ -18326,7 +18328,7 @@ dependencies = [ [[package]] name = "snowbridge-ethereum" version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ethabi-decode 2.0.0", "ethbloom 0.14.1", @@ -18340,7 +18342,7 @@ dependencies = [ "serde-big-array", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -18382,7 +18384,7 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-primitives" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "alloy-core", "ethabi-decode 2.0.0", @@ -18399,7 +18401,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", @@ -18408,7 +18410,7 @@ dependencies = [ [[package]] name = "snowbridge-pallet-system-frontend" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", @@ -18421,7 +18423,7 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-executor 7.0.0", "tracing", @@ -18450,7 +18452,7 @@ dependencies = [ [[package]] name = "snowbridge-runtime-common" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", @@ -18460,7 +18462,7 @@ dependencies = [ "snowbridge-core 0.2.0", "snowbridge-outbound-queue-primitives", "sp-arithmetic 23.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "staging-xcm-executor 7.0.0", @@ -18469,14 +18471,14 @@ dependencies = [ [[package]] name = "snowbridge-verification-primitives" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "parity-scale-codec", "scale-info", "snowbridge-beacon-primitives 0.2.0", "sp-core 28.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -18533,7 +18535,7 @@ dependencies = [ [[package]] name = "sp-api" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "hash-db", @@ -18601,7 +18603,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "blake2 0.10.6", @@ -18645,7 +18647,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -18683,7 +18685,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "integer-sqrt", @@ -18712,7 +18714,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -18737,7 +18739,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-api 26.0.0", "sp-inherents 26.0.0", @@ -18758,7 +18760,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "futures", "parity-scale-codec", @@ -18777,7 +18779,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "futures", @@ -18791,7 +18793,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "parity-scale-codec", @@ -18824,7 +18826,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "parity-scale-codec", @@ -18861,7 +18863,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -18869,7 +18871,7 @@ dependencies = [ "sp-api 26.0.0", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-io 30.0.0", "sp-keystore 0.34.0", "sp-mmr-primitives 26.0.0", @@ -18903,7 +18905,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "finality-grandpa", "log", @@ -18938,7 +18940,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -18961,7 +18963,7 @@ dependencies = [ [[package]] name = "sp-core" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ark-vrf", "array-bytes", @@ -18992,11 +18994,11 @@ dependencies = [ "secrecy 0.8.0", "serde", "sha2 0.10.9", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-runtime-interface 24.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-storage 19.0.0", "ss58-registry", "substrate-bip39 0.4.7", @@ -19118,7 +19120,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "blake2b_simd", "byteorder", @@ -19142,17 +19144,17 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "syn 2.0.101", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -19172,7 +19174,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -19182,7 +19184,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "parity-scale-codec", @@ -19214,7 +19216,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -19239,7 +19241,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -19266,7 +19268,7 @@ dependencies = [ [[package]] name = "sp-io" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", "docify", @@ -19278,7 +19280,7 @@ dependencies = [ "rustversion", "secp256k1 0.28.2", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-keystore 0.34.0", "sp-runtime-interface 24.0.0", @@ -19346,7 +19348,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-core 28.0.0", "sp-runtime 31.0.1", @@ -19367,7 +19369,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -19412,7 +19414,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -19421,7 +19423,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-metadata 23.0.0", "parity-scale-codec", @@ -19453,7 +19455,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -19464,7 +19466,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "log", "parity-scale-codec", @@ -19473,7 +19475,7 @@ dependencies = [ "serde", "sp-api 26.0.0", "sp-core 28.0.0", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-runtime 31.0.1", "thiserror 1.0.69", ] @@ -19499,7 +19501,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -19526,7 +19528,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-api 26.0.0", "sp-core 28.0.0", @@ -19547,7 +19549,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "backtrace", "regex", @@ -19566,7 +19568,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -19576,7 +19578,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "31.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "binary-merkle-tree 13.0.0", "docify", @@ -19595,7 +19597,7 @@ dependencies = [ "sp-arithmetic 23.0.0", "sp-core 28.0.0", "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-trie 29.0.0", "sp-weights 27.0.0", "tracing", @@ -19662,7 +19664,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -19671,7 +19673,7 @@ dependencies = [ "primitive-types 0.13.1", "sp-externalities 0.25.0", "sp-runtime-interface-proc-macro 17.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-storage 19.0.0", "sp-tracing 16.0.0", "sp-wasm-interface 20.0.0", @@ -19721,7 +19723,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "expander", @@ -19748,7 +19750,7 @@ dependencies = [ [[package]] name = "sp-session" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -19777,7 +19779,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -19818,7 +19820,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hash-db", "log", @@ -19880,7 +19882,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -19893,7 +19895,7 @@ dependencies = [ "sp-api 26.0.0", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-runtime 31.0.1", "sp-runtime-interface 24.0.0", @@ -19910,18 +19912,18 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -19953,7 +19955,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "parity-scale-codec", @@ -19978,7 +19980,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "tracing", @@ -20001,7 +20003,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "sp-api 26.0.0", "sp-runtime 31.0.1", @@ -20020,7 +20022,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "parity-scale-codec", @@ -20034,7 +20036,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ahash 0.8.12", "hash-db", @@ -20104,16 +20106,16 @@ dependencies = [ [[package]] name = "sp-version" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-version-proc-macro 13.0.0", "thiserror 1.0.69", ] @@ -20157,7 +20159,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -20194,7 +20196,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -20219,7 +20221,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -20227,7 +20229,7 @@ dependencies = [ "serde", "smallvec", "sp-arithmetic 23.0.0", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -20323,7 +20325,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", @@ -20350,7 +20352,7 @@ dependencies = [ [[package]] name = "staging-xcm" version = "7.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "bounded-collections", @@ -20410,7 +20412,7 @@ dependencies = [ [[package]] name = "staging-xcm-builder" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "frame-support 28.0.0", @@ -20457,7 +20459,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "frame-benchmarking 28.0.0", @@ -20596,7 +20598,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.4.7" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -20640,12 +20642,12 @@ checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" [[package]] name = "substrate-frame-rpc-system" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "frame-system-rpc-runtime-api 26.0.0", @@ -20665,7 +20667,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -20679,7 +20681,7 @@ dependencies = [ [[package]] name = "substrate-state-machine" version = "1.15.3" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#461ac5a30770039359cfd9884d755a53877c3710" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2506#1e0cb6e317ee7202a286b5e1dad93a4979a9be28" dependencies = [ "frame-support 28.0.0", "hash-db", @@ -20698,7 +20700,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -20715,7 +20717,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "build-helper", "cargo_metadata 0.15.4", @@ -20725,7 +20727,7 @@ dependencies = [ "parity-wasm", "polkavm-linker 0.24.0", "shlex", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "strum 0.26.3", "tempfile", "toml 0.8.22", @@ -21194,7 +21196,7 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "testnet-parachains-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", @@ -21597,7 +21599,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "coarsetime", "polkadot-primitives 7.0.0", @@ -21608,7 +21610,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -22542,7 +22544,7 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "westend-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "binary-merkle-tree 13.0.0", "bitvec", @@ -22649,7 +22651,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "polkadot-primitives 7.0.0", @@ -23256,7 +23258,7 @@ dependencies = [ [[package]] name = "xcm-emulator" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "array-bytes", "cumulus-pallet-parachain-system 0.7.0", @@ -23278,7 +23280,7 @@ dependencies = [ "polkadot-runtime-parachains 7.0.0", "sp-arithmetic 23.0.0", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0", @@ -23290,7 +23292,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "proc-macro2", @@ -23325,7 +23327,7 @@ dependencies = [ [[package]] name = "xcm-runtime-apis" version = "0.1.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "parity-scale-codec", @@ -23354,7 +23356,7 @@ dependencies = [ [[package]] name = "xcm-simulator" version = "7.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", diff --git a/pop-api/Cargo.lock b/pop-api/Cargo.lock index 74cf208df..902b42b6f 100644 --- a/pop-api/Cargo.lock +++ b/pop-api/Cargo.lock @@ -476,7 +476,7 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "binary-merkle-tree" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hash-db", "log", @@ -1178,7 +1178,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "frame-benchmarking" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support", "frame-support-procedural", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "frame-support" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "aquamarine", "array-bytes", @@ -1237,7 +1237,7 @@ dependencies = [ "sp-arithmetic 23.0.0", "sp-core 28.0.0", "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-genesis-builder", "sp-inherents", "sp-io 30.0.0", @@ -1245,7 +1245,7 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-tracing 16.0.0", "sp-trie 29.0.0", "sp-weights 27.0.0", @@ -1255,7 +1255,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "cfg-expr", @@ -1268,14 +1268,14 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "syn 2.0.101", ] [[package]] name = "frame-support-procedural-tools" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -1287,7 +1287,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -1297,7 +1297,7 @@ dependencies = [ [[package]] name = "frame-system" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "cfg-if", "docify", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "sp-api" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "hash-db", @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "blake2", @@ -3410,7 +3410,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -3422,7 +3422,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "docify", "integer-sqrt", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "sp-core" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ark-vrf", "array-bytes", @@ -3482,11 +3482,11 @@ dependencies = [ "secrecy", "serde", "sha2 0.10.9", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-runtime-interface 24.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-storage 19.0.0", "ss58-registry", "substrate-bip39 0.4.7", @@ -3561,7 +3561,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "blake2b_simd", "byteorder", @@ -3574,10 +3574,10 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "syn 2.0.101", ] @@ -3595,7 +3595,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "proc-macro2", "quote", @@ -3605,7 +3605,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "environmental", "parity-scale-codec", @@ -3626,7 +3626,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "scale-info", @@ -3638,7 +3638,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -3651,7 +3651,7 @@ dependencies = [ [[package]] name = "sp-io" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", "docify", @@ -3663,7 +3663,7 @@ dependencies = [ "rustversion", "secp256k1", "sp-core 28.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-externalities 0.25.0", "sp-keystore 0.34.0", "sp-runtime-interface 24.0.0", @@ -3704,7 +3704,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "parking_lot", @@ -3727,7 +3727,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -3737,7 +3737,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "backtrace", "regex", @@ -3756,7 +3756,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "31.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "binary-merkle-tree", "docify", @@ -3775,7 +3775,7 @@ dependencies = [ "sp-arithmetic 23.0.0", "sp-core 28.0.0", "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-trie 29.0.0", "sp-weights 27.0.0", "tracing", @@ -3785,7 +3785,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -3794,7 +3794,7 @@ dependencies = [ "primitive-types", "sp-externalities 0.25.0", "sp-runtime-interface-proc-macro 17.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-storage 19.0.0", "sp-tracing 16.0.0", "sp-wasm-interface 20.0.0", @@ -3824,7 +3824,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "Inflector", "expander", @@ -3851,7 +3851,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -3864,7 +3864,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hash-db", "log", @@ -3911,18 +3911,18 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -3941,7 +3941,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "tracing", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "ahash", "hash-db", @@ -4010,7 +4010,7 @@ dependencies = [ [[package]] name = "sp-version" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -4019,7 +4019,7 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", "sp-version-proc-macro", "thiserror", ] @@ -4027,7 +4027,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -4039,7 +4039,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -4062,7 +4062,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -4070,7 +4070,7 @@ dependencies = [ "serde", "smallvec", "sp-arithmetic 23.0.0", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2506)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=a251f77)", ] [[package]] @@ -4147,7 +4147,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "substrate-bip39" version = "0.4.7" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -4172,7 +4172,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2506#46dae3e7d3b301fb1744192126b015db622d2fac" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "http-body-util", "hyper", From 5f976312127f54fcf8883ba1a066c7752373748c Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 23:12:58 +0100 Subject: [PATCH 037/162] refactor(runtime): update revive config after revision change --- runtime/devnet/src/config/contracts.rs | 7 +++++-- runtime/mainnet/src/config/revive.rs | 9 ++++++--- runtime/testnet/src/config/contracts.rs | 7 +++++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 23dbc8503..8ae093576 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -9,8 +9,8 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, - Timestamp, TransactionPayment, + deposit, Balance, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeHoldReason, Timestamp, TransactionPayment, }; fn schedule() -> pallet_contracts::Schedule { @@ -90,6 +90,8 @@ impl pallet_contracts::Config for Runtime { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; + // No runtime dispatchables are callable from contracts. + type CallFilter = Nothing; type ChainId = ChainId; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Currency = Balances; @@ -114,6 +116,7 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = pallet_revive::weights::SubstrateWeight; type WeightPrice = TransactionPayment; + type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { diff --git a/runtime/mainnet/src/config/revive.rs b/runtime/mainnet/src/config/revive.rs index 88a99511c..b3dbd7631 100644 --- a/runtime/mainnet/src/config/revive.rs +++ b/runtime/mainnet/src/config/revive.rs @@ -1,13 +1,13 @@ use frame_support::{ parameter_types, - traits::{ConstBool, ConstU32, ConstU64}, + traits::{ConstBool, ConstU32, ConstU64, Nothing}, }; use frame_system::EnsureSigned; use crate::{ config::monetary::{DepositPerByte, DepositPerItem}, - weights, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, - TransactionPayment, UNIT, + weights, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + Timestamp, TransactionPayment, UNIT, }; // 18 decimals @@ -20,6 +20,8 @@ parameter_types! { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; + // No runtime dispatchables are callable from contracts. + type CallFilter = Nothing; // EVM chain id. 3,395 is a unique ID still. type ChainId = ConstU64<3_395>; // 30 percent of storage deposit held for using a code hash. @@ -46,6 +48,7 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = weights::pallet_revive::WeightInfo; type WeightPrice = TransactionPayment; + type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { diff --git a/runtime/testnet/src/config/contracts.rs b/runtime/testnet/src/config/contracts.rs index e5bb2b307..4a2e01dbc 100644 --- a/runtime/testnet/src/config/contracts.rs +++ b/runtime/testnet/src/config/contracts.rs @@ -9,8 +9,8 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, - Timestamp, TransactionPayment, + deposit, Balance, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, + RuntimeHoldReason, Timestamp, TransactionPayment, }; fn schedule() -> pallet_contracts::Schedule { @@ -88,6 +88,8 @@ impl pallet_contracts::Config for Runtime { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; + // No runtime dispatchables are callable from contracts. + type CallFilter = Nothing; // EVM chain id. 3,395 is a unique ID still. type ChainId = ConstU64<3_395>; // 30 percent of storage deposit held for using a code hash. @@ -114,6 +116,7 @@ impl pallet_revive::Config for Runtime { type UploadOrigin = EnsureSigned; type WeightInfo = pallet_revive::weights::SubstrateWeight; type WeightPrice = TransactionPayment; + type Xcm = PolkadotXcm; } impl TryFrom for pallet_revive::Call { From 3b8b49b3ff8eff4a0fb54f079e7bddcdf56961c6 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 8 May 2025 08:02:07 +0100 Subject: [PATCH 038/162] build(deps): disable default-features for serde --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 37c768787..58e367d13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ rand = "0.8.5" scale-info = { version = "2.11.6", default-features = false, features = [ "derive", ] } -serde = "1.0.214" +serde = { version = "1.0.214", default-features = false } serde_json = { version = "1.0.132", default-features = false } smallvec = "1.11.2" subxt = "0.38.1" From ad6f707fcc9b8ed8c71d3e8ed726823d6d83a9b7 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 28 May 2025 10:49:22 +0100 Subject: [PATCH 039/162] feat(api-vnext): new 'pallet' to provide fungible api(s) via precompiles --- Cargo.toml | 1 + pallets/api-vnext/Cargo.toml | 40 ++ pallets/api-vnext/src/fungibles/mod.rs | 147 +++++ .../src/fungibles/precompiles/erc20.rs | 401 ++++++++++++ .../precompiles/interfaces/IERC20.sol | 83 +++ .../precompiles/interfaces/IFungibles.sol | 60 ++ .../src/fungibles/precompiles/mod.rs | 569 ++++++++++++++++++ pallets/api-vnext/src/lib.rs | 146 +++++ pallets/api-vnext/src/mock.rs | 141 +++++ 9 files changed, 1588 insertions(+) create mode 100644 pallets/api-vnext/Cargo.toml create mode 100644 pallets/api-vnext/src/fungibles/mod.rs create mode 100644 pallets/api-vnext/src/fungibles/precompiles/erc20.rs create mode 100644 pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol create mode 100644 pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol create mode 100644 pallets/api-vnext/src/fungibles/precompiles/mod.rs create mode 100644 pallets/api-vnext/src/lib.rs create mode 100644 pallets/api-vnext/src/mock.rs diff --git a/Cargo.toml b/Cargo.toml index 58e367d13..a9ad9aad3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,7 @@ substrate-wasm-builder = { version = "26.0.1" } # Local pallet-api = { path = "pallets/api", default-features = false } +pallet-api-vnext = { path = "pallets/api-vnext", default-features = false } pallet-motion = { path = "pallets/motion", default-features = false } pallet-nfts = { path = "pallets/nfts", default-features = false } pop-chain-extension = { path = "./extension", default-features = false } diff --git a/pallets/api-vnext/Cargo.toml b/pallets/api-vnext/Cargo.toml new file mode 100644 index 000000000..bf75b4269 --- /dev/null +++ b/pallets/api-vnext/Cargo.toml @@ -0,0 +1,40 @@ +[package] +authors.workspace = true +description = "API pallet, enabling smart(er) contracts with the power of Polkadot" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-api-vnext" +repository.workspace = true +version = "0.1.0" + +[dependencies] +codec.workspace = true +frame-support.workspace = true +frame-system.workspace = true +pallet-assets = { workspace = true, default-features = false, optional = true } +pallet-revive = { workspace = true, default-features = false } +scale-info.workspace = true + +[dev-dependencies] +pallet-balances.workspace = true +pallet-timestamp.workspace = true +sp-io.workspace = true + +[features] +default = [ "fungibles", "std" ] +fungibles = [ "pallet-assets" ] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", +] +std = [ + "frame-support/std", + "frame-system/std", + "pallet-assets?/std", + "pallet-balances/std", + "pallet-revive/std", + "pallet-timestamp/std", + "sp-io/std", +] diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs new file mode 100644 index 000000000..b918ba3b8 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -0,0 +1,147 @@ +use core::cmp::Ordering::{Equal, Greater, Less}; + +use frame_support::{ + dispatch::{DispatchResult, DispatchResultWithPostInfo, WithPostDispatchInfo}, + pallet_prelude::{DispatchError, Zero}, + sp_runtime::Saturating, + traits::fungibles::{approvals::Inspect as _, Inspect as _}, + weights::Weight, +}; +use frame_system::{ensure_signed, pallet_prelude::OriginFor}; +use pallet_assets::{Config, NextAssetId}; +use AddressMatcher::Fixed; + +use super::*; + +pub mod precompiles; + +type AssetIdOf = >::AssetId; +type BalanceOf = >::Balance; + +fn approve, I>( + origin: OriginFor, + asset: AssetIdOf, + spender: AccountIdOf, + value: BalanceOf, +) -> DispatchResultWithPostInfo { + // TODO: weights + let owner = ensure_signed(origin.clone()).map_err(|e| e.with_weight(Weight::zero()))?; + let current_allowance = >::allowance(asset.clone(), &owner, &spender); + + let weight = match value.cmp(¤t_allowance) { + // If the new value is equal to the current allowance, do nothing. + Equal => Weight::zero(), + // If the new value is greater than the current allowance, approve the difference + // because `approve_transfer` works additively (see `pallet-assets`). + Greater => { + >::approve_transfer( + origin, + asset.into(), + T::Lookup::unlookup(spender), + value.saturating_sub(current_allowance), + ) + .map_err(|e| e.with_weight(Weight::zero()))?; + Weight::zero() + }, + // If the new value is less than the current allowance, cancel the approval and + // set the new value. + Less => { + let spender_source = T::Lookup::unlookup(spender); + >::cancel_approval( + origin.clone(), + asset.clone().into(), + spender_source.clone(), + ) + .map_err(|e| e.with_weight(Weight::zero()))?; + if value.is_zero() { + Weight::zero() + } else { + >::approve_transfer(origin, asset.into(), spender_source, value)?; + Weight::zero() + } + }, + }; + Ok(Some(weight).into()) +} + +fn burn, I>( + origin: OriginFor, + asset: AssetIdOf, + account: AccountIdOf, + value: BalanceOf, +) -> DispatchResultWithPostInfo { + let current_balance = >::balance(asset.clone(), &account); + if current_balance < value { + return Err(pallet_assets::Error::::BalanceLow + // TODO: weight: ::WeightInfo::balance_of() + .with_weight(Weight::zero())); + } + >::burn(origin, asset.into(), T::Lookup::unlookup(account.clone()), value)?; + Ok(().into()) +} + +fn clear_metadata, I>(origin: OriginFor, asset: AssetIdOf) -> DispatchResult { + >::clear_metadata(origin, asset.into()) +} + +fn create, I>( + origin: OriginFor, + admin: AccountIdOf, + min_balance: BalanceOf, +) -> Result, DispatchError> { + let id = NextAssetId::::get().unwrap_or_default(); + >::create(origin, id.clone().into(), T::Lookup::unlookup(admin), min_balance)?; + Ok(id) +} + +fn exists, I>(asset: AssetIdOf) -> bool { + >::asset_exists(asset) +} + +fn mint, I>( + origin: OriginFor, + asset: AssetIdOf, + account: AccountIdOf, + value: BalanceOf, +) -> DispatchResult { + >::mint(origin, asset.into(), T::Lookup::unlookup(account), value) +} + +fn set_metadata, I>( + origin: OriginFor, + asset: AssetIdOf, + name: Vec, + symbol: Vec, + decimals: u8, +) -> DispatchResult { + >::set_metadata(origin, asset.into(), name, symbol, decimals) +} + +fn start_destroy, I>(origin: OriginFor, asset: AssetIdOf) -> DispatchResult { + >::start_destroy(origin, asset.into()) +} + +fn transfer, I>( + origin: OriginFor, + asset: AssetIdOf, + to: AccountIdOf, + value: BalanceOf, +) -> DispatchResult { + >::transfer(origin, asset.into(), T::Lookup::unlookup(to.clone()), value) +} + +fn transfer_from, I>( + origin: OriginFor, + asset: AssetIdOf, + from: AccountIdOf, + to: AccountIdOf, + value: BalanceOf, +) -> DispatchResult { + >::transfer_approved( + origin, + asset.into(), + T::Lookup::unlookup(from), + T::Lookup::unlookup(to), + value, + ) +} diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs new file mode 100644 index 000000000..ac16fc672 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -0,0 +1,401 @@ +use alloc::string::String; + +use frame_support::{ + sp_runtime::{traits::AtLeast32Bit, TokenError}, + traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, +}; +use pallet_revive::precompiles::alloy::primitives::ruint::UintTryFrom; +use AddressMatcher::Prefix; +use IERC20::*; + +use super::*; + +sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); + +/// Precompile providing an interface of the ERC-20 standard as defined in the ERC. +pub struct Erc20(PhantomData<(T, I)>); +impl< + const PREFIX: u16, + T: frame_system::Config + Config + pallet_revive::Config, + I: 'static, + > Precompile for Erc20 +where + U256: UintTryFrom + UintTryTo, +{ + type Interface = IERC20Calls; + type T = T; + + const HAS_CONTRACT_INFO: bool = false; + const MATCHER: AddressMatcher = + Prefix(NonZero::new(PREFIX).expect("expected non-zero precompile address")); + + fn call( + address: &[u8; 20], + input: &Self::Interface, + env: &mut impl Ext, + ) -> Result, Error> { + use IERC20::{IERC20Calls::*, *}; + + let id: AssetIdOf = u32::from_be_bytes( + address[..4] + .try_into() + .map_err(|_| DispatchError::Token(TokenError::UnknownAsset))?, + ) + .into(); + + match input { + // IERC20 + totalSupply(_) => { + // TODO: charge based on benchmarked weight + let total_supply = U256::saturating_from(>::total_supply(id)); + Ok(totalSupplyCall::abi_encode_returns(&(total_supply,))) + }, + balanceOf(balanceOfCall { account }) => { + // TODO: charge based on benchmarked weight + let account = env.to_account_id(&(*account.0).into()); + let balance = U256::saturating_from(>::balance(id, account)); + Ok(balanceOfCall::abi_encode_returns(&(balance,))) + }, + transfer(transferCall { to, value }) => { + // TODO: charge based on benchmarked weight + let from = >::to_address(env.caller().account_id()?).0.into(); + + super::transfer::( + to_runtime_origin(env.caller()), + id, + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + let value = value.clone(); + deposit_event::(env, address, Transfer { from, to: to.clone(), value }); + Ok(transferCall::abi_encode_returns(&(true,))) + }, + allowance(allowanceCall { owner, spender }) => { + // TODO: charge based on benchmarked weight + let owner = env.to_account_id(&(*owner.0).into()); + let spender = env.to_account_id(&(*spender.0).into()); + let remaining = + U256::saturating_from(>::allowance(id, &owner, &spender)); + Ok(allowanceCall::abi_encode_returns(&(remaining,))) + }, + approve(approveCall { spender, value }) => { + // TODO: charge based on benchmarked weight + let owner = >::to_address(env.caller().account_id()?).0.into(); + + super::approve::( + to_runtime_origin(env.caller()), + id, + env.to_account_id(&(*spender.0).into()), + value.saturating_to(), + ) // TODO: adjust weight + .map_err(|e| e.error)?; + + let event = Approval { owner, spender: spender.clone(), value: value.clone() }; + deposit_event(env, address, event); + Ok(approveCall::abi_encode_returns(&(true,))) + }, + transferFrom(transferFromCall { from, to, value }) => { + // TODO: charge based on benchmarked weight + + transfer_from::( + to_runtime_origin(env.caller()), + id.into(), + env.to_account_id(&(*from.0).into()), + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + let from = from.clone(); + let value = value.clone(); + deposit_event(env, address, Transfer { from, to: to.clone(), value }); + Ok(transferFromCall::abi_encode_returns(&(true,))) + }, + // IERC20Metadata + name(_) => { + // TODO: charge based on benchmarked weight + let result = >::name(id); + // TODO: improve + let result = String::from_utf8_lossy(result.as_slice()); + Ok(nameCall::abi_encode_returns(&(result,))) + }, + symbol(_) => { + // TODO: charge based on benchmarked weight + let result = >::symbol(id); + // TODO: improve + let result = String::from_utf8_lossy(result.as_slice()); + Ok(symbolCall::abi_encode_returns(&(result,))) + }, + decimals(_) => { + // TODO: charge based on benchmarked weight + let result = >::decimals(id); + Ok(decimalsCall::abi_encode_returns(&(result,))) + }, + } + } +} + +impl, I: 'static> Erc20 { + pub fn address(id: u32) -> [u8; 20] { + prefixed_address(PREFIX, id) + } +} + +#[cfg(test)] +mod tests { + use frame_support::{assert_ok, sp_runtime::app_crypto::sp_core::bytes::to_hex}; + use mock::Test; + use pallet_assets::Instance1; + use pallet_revive::{ + precompiles::{alloy::sol_types::SolType, ExtWithInfo}, + test_utils::{ALICE, ALICE_ADDR, BOB, BOB_ADDR}, + }; + use IERC20Calls::*; + use IERC20::{Approval, Transfer}; + + use super::*; + use crate::mock::{ExtBuilder, RuntimeOrigin}; + + const ERC20: u16 = 101; + + type Assets = mock::Assets; + type Erc20 = super::Erc20; + + #[test] + fn total_supply_works() { + let id = u32::MAX; + let total_supply = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_balances(vec![(id, ALICE, total_supply)]) + .build_with_env(|mut call_setup| { + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + id, + &totalSupply(totalSupplyCall {}) + ) + .unwrap(), + U256::from(total_supply) + ); + }); + } + + #[test] + fn balance_of_works() { + let id = u32::MAX; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_balances(vec![(id, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + id, + &balanceOf(balanceOfCall { account: ALICE_ADDR.0.into() }) + ) + .unwrap(), + U256::from(endowment) + ); + + assert_eq!(Assets::balance(id, ALICE), endowment); + }); + } + + #[test] + fn transfer_works() { + let id = u32::MAX; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(id, BOB, true, 1)]) + .with_asset_balances(vec![(id, BOB, endowment)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(BOB)); + assert_eq!(Assets::balance(id, BOB), endowment); + assert_eq!(Assets::balance(id, ALICE), 0); + + let value = endowment / 2; + assert!(call_precompile::( + &mut call_setup.ext().0, + id, + &IERC20Calls::transfer(IERC20::transferCall { + to: ALICE_ADDR.0.into(), + value: U256::from(value) + }) + ) + .unwrap()); + + assert_eq!(Assets::balance(id, BOB), endowment - value); + assert_eq!(Assets::balance(id, ALICE), value); + let from = BOB_ADDR.0.into(); + let to = ALICE_ADDR.0.into(); + let event = Transfer { from, to, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, id), event); + }); + } + + #[test] + fn allowance_works() { + let id = u32::MAX; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + id, + BOB, + value + )); + + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + id, + &allowance(allowanceCall { + owner: ALICE_ADDR.0.into(), + spender: BOB_ADDR.0.into(), + }) + ) + .unwrap(), + U256::from(value) + ); + }, + ); + } + + #[test] + fn approve_works() { + let id = u32::MAX; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + + assert_eq!(Assets::allowance(id, &ALICE, &BOB), 0); + + assert!(call_precompile::( + &mut call_setup.ext().0, + id, + &IERC20Calls::approve(IERC20::approveCall { + spender: BOB_ADDR.0.into(), + value: U256::from(value) + }) + ) + .unwrap()); + + assert_eq!(Assets::allowance(id, &ALICE, &BOB), value); + let owner = ALICE_ADDR.0.into(); + let spender = BOB_ADDR.0.into(); + let event = Approval { owner, spender, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, id), event); + }, + ); + } + + #[test] + fn transfer_from_works() { + let id = u32::MAX; + let endowment = 10_000_000; + let value = endowment / 2; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, true, 1)]) + .with_asset_balances(vec![(id, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + assert_eq!(Assets::balance(id, ALICE), endowment); + assert_eq!(Assets::balance(id, BOB), 0); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + id, + BOB, + value + )); + call_setup.set_origin(Origin::Signed(BOB)); + + assert!(call_precompile::( + &mut call_setup.ext().0, + id, + &transferFrom(IERC20::transferFromCall { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + value: U256::from(value), + }) + ) + .unwrap()); + + assert_eq!(Assets::balance(id, ALICE), endowment - value); + assert_eq!(Assets::balance(id, BOB), value); + let from = ALICE_ADDR.0.into(); + let to = BOB_ADDR.0.into(); + let event = Transfer { from, to, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, id), event); + }); + } + + #[test] + fn name_works() { + let id = u32::MAX; + let _name = "name"; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_metadata(vec![(id, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) + .build_with_env(|mut call_setup| { + assert_eq!( + call_precompile::(&mut call_setup.ext().0, id, &name(nameCall {})) + .unwrap() + .as_str(), + _name + ); + }); + } + + #[test] + fn symbol_works() { + let id = u32::MAX; + let _symbol = "symbol"; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_metadata(vec![(id, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) + .build_with_env(|mut call_setup| { + assert_eq!( + call_precompile::(&mut call_setup.ext().0, id, &symbol(symbolCall {})) + .unwrap() + .as_str(), + _symbol + ); + }); + } + + #[test] + fn decimals_works() { + let id = u32::MAX; + let _decimals = u8::MAX; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_metadata(vec![(id, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) + .build_with_env(|mut call_setup| { + let mut ext = call_setup.ext().0; + assert_eq!( + call_precompile::(&mut ext, id, &decimals(decimalsCall {})).unwrap() as u8, + _decimals + ); + }); + } + + #[test] + fn selectors_match_standard() { + assert_eq!(to_hex(&decimalsCall::SELECTOR, false), "0x313ce567"); + assert_eq!(to_hex(&nameCall::SELECTOR, false), "0x06fdde03"); + assert_eq!(to_hex(&symbolCall::SELECTOR, false), "0x95d89b41"); + } + + fn call_precompile::RustType>>( + ext: &mut impl ExtWithInfo, + id: u32, + input: &IERC20Calls, + ) -> Result { + super::call_precompile::(ext, &prefixed_address(ERC20, id), input) + } +} diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol new file mode 100644 index 000000000..48a9395a1 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol @@ -0,0 +1,83 @@ +/** + * @dev Interface of the ERC-20 standard as defined in the ERC. + * Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol + */ +interface IERC20 { + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. + * `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); + + /** + * @dev Returns the value of tokens in existence. + */ + function totalSupply() external view returns (uint256); + /** + * @dev Returns the value of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + /** + * @dev Moves a `value` amount of tokens from the caller's account to `to`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address to, uint256 value) external returns (bool); + /** + * @dev Returns the remaining number of tokens that `spender` will be allowed to spend on + * behalf of `owner` through {transferFrom}. This is zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + /** + * @dev Sets a `value` amount of tokens as the allowance of `spender` over the caller's + * tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk that + * someone may use both the old and the new allowance by unfortunate transaction ordering. + * One possible solution to mitigate this race condition is to first reduce the spender's + * allowance to 0 and set the desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event.\ + */ + function approve(address spender, uint256 value) external returns (bool); + /** + * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. + * `value` is then deducted from the caller's allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom(address from, address to, uint256 value) external returns (bool); + + // Extensions: `sol!` macro does not support inheritance, so extensions need to be included in same interface + + // IERC20Metadata: Interface for the optional metadata functions from the ERC-20 standard. + // Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol + + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory); + /** + * @dev Returns the symbol of the token. + */ + function symbol() external view returns (string memory); + /** + * @dev Returns the decimals places of the token. + */ + function decimals() external view returns (uint8); +} \ No newline at end of file diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol new file mode 100644 index 000000000..0b37600c1 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol @@ -0,0 +1,60 @@ +/** + * @dev The fungibles precompile offers a streamlined interface for interacting with fungible tokens. The goal is to + * provide a simplified, consistent API that adheres to standards in the smart contract space. + */ +// TODO: consider size of id -> uint256 (word) +interface IFungibles { + /** + * @dev Create a new token with an automatically generated identifier. + */ + function create(address admin, uint256 minBalance) external returns (uint32 id); + /** + * @dev Set the metadata for a token. + */ + function setMetadata(uint32 id, string name, string symbol, uint8 decimals) external; + /** + * @dev Clear the metadata for a token. + */ + function clearMetadata(uint32 id) external; + /** + * @dev Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + */ + function mint(uint32 id, address account, uint256 value) external; + /** + * @dev Transfers `value` amount of tokens from the caller's account to account `to`. + */ + function transfer(uint32 id, address to, uint256 value) external; + /** + * @dev Approves `spender` to spend `value` amount of tokens on behalf of the caller. + */ + function approve(uint32 id, address spender, uint256 value) external; + /** + * @dev Transfers `value` amount tokens on behalf of `from` to account `to`. + */ + function transferFrom(uint32 id, address from, address to, uint256 value) external; + /** + * @dev Destroys `value` amount of tokens from `account`, reducing the total supply. + */ + function burn(uint32 id, address account, uint256 value) external; + /** + * @dev Start the process of destroying a token. + */ + function startDestroy(uint32 id) external; + /** + * @dev Whether a specified token exists. + */ + function exists(uint32 id) external view returns (bool); + + /** + * @dev Event emitted when allowance by `owner` to `spender` changes. + */ + event Approval(uint32 id, address owner, address spender, uint256 value); + /** + * @dev Event emitted when a token is created. + */ + event Created(uint32 id, address creator, address admin); + /** + * @dev Event emitted when a token transfer occurs. + */ + event Transfer(uint32 indexed id, address indexed from, address indexed to, uint256 value); +} \ No newline at end of file diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs new file mode 100644 index 000000000..e4a0d9b0c --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -0,0 +1,569 @@ +pub use erc20::{Erc20, IERC20}; +use pallet_revive::precompiles::alloy::{ + primitives::{ruint::UintTryTo, Address}, + sol_types::SolCall, +}; +use IFungibles::*; + +use super::*; + +mod erc20; + +sol!("src/fungibles/precompiles/interfaces/IFungibles.sol"); + +/// The fungibles precompile offers a streamlined interface for interacting with fungible tokens. +/// The goal is to provide a simplified, consistent API that adheres to standards in the smart +/// contract space. +pub struct Fungibles(PhantomData<(T, I)>); +impl< + const FIXED: u16, + T: frame_system::Config + + Config + Into> + + pallet_revive::Config, + I: 'static, + > Precompile for Fungibles +where + U256: UintTryTo<>::Balance>, +{ + type Interface = IFungiblesCalls; + type T = T; + + const HAS_CONTRACT_INFO: bool = false; + const MATCHER: AddressMatcher = + Fixed(NonZero::new(FIXED).expect("expected non-zero precompile address")); + + fn call( + address: &[u8; 20], + input: &Self::Interface, + env: &mut impl Ext, + ) -> Result, Error> { + use IFungibles::IFungiblesCalls::*; + match input { + create(createCall { admin, minBalance }) => { + // TODO: charge based on benchmarked weight + let creator = >::to_address(env.caller().account_id()?).0.into(); + + let id = self::create::( + to_runtime_origin(env.caller()), + env.to_account_id(&(*admin.0).into()), + minBalance.saturating_to(), + )? + .into(); + + deposit_event(env, address, Created { id, creator, admin: admin.clone() }); + Ok(createCall::abi_encode_returns(&(id,))) + }, + mint(mintCall { id, account, value }) => { + // TODO: charge based on benchmarked weight + + self::mint::( + to_runtime_origin(env.caller()), + (*id).into(), + env.to_account_id(&(*account.0).into()), + value.saturating_to(), + )?; + + let from = Address::default(); + let to = account.clone(); + deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + Ok(mintCall::abi_encode_returns(&())) + }, + transfer(transferCall { id, to, value }) => { + // TODO: charge based on benchmarked weight + let from = >::to_address(env.caller().account_id()?).0.into(); + + self::transfer::( + to_runtime_origin(env.caller()), + (*id).into(), + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + let to = to.clone(); + deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + Ok(transferCall::abi_encode_returns(&())) + }, + approve(approveCall { id, spender, value }) => { + // TODO: charge based on benchmarked weight + let owner = >::to_address(env.caller().account_id()?).0.into(); + + self::approve::( + to_runtime_origin(env.caller()), + (*id).into(), + env.to_account_id(&(*spender.0).into()), + value.saturating_to(), + ) // TODO: adjust weight + .map_err(|e| e.error)?; + + let spender = spender.clone(); + let value = value.clone(); + deposit_event(env, address, Approval { id: *id, owner, spender, value }); + Ok(approveCall::abi_encode_returns(&())) + }, + transferFrom(transferFromCall { id, from, to, value }) => { + // TODO: charge based on benchmarked weight + + transfer_from::( + to_runtime_origin(env.caller()), + (*id).into(), + env.to_account_id(&(*from.0).into()), + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + let from = from.clone(); + let value = value.clone(); + deposit_event(env, address, Transfer { id: *id, from, to: to.clone(), value }); + Ok(transferFromCall::abi_encode_returns(&())) + }, + burn(burnCall { id, account, value }) => { + // TODO: charge based on benchmarked weight + + self::burn::( + to_runtime_origin(env.caller()), + (*id).into(), + env.to_account_id(&(*account.0).into()), + value.saturating_to(), + ) // TODO: adjust weight + .map_err(|e| e.error)?; + + let from = account.clone(); + let to = Address::default(); + deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + Ok(burnCall::abi_encode_returns(&())) + }, + startDestroy(startDestroyCall { id }) => { + // TODO: charge based on benchmarked weight + start_destroy::(to_runtime_origin(env.caller()), (*id).into())?; + Ok(startDestroyCall::abi_encode_returns(&())) + }, + exists(existsCall { id }) => { + let result = self::exists::((*id).into()); + Ok(existsCall::abi_encode_returns(&(result,))) + }, + setMetadata(setMetadataCall { id, name, symbol, decimals }) => { + // TODO: charge based on benchmarked weight + set_metadata::( + to_runtime_origin(env.caller()), + (*id).into(), + name.as_bytes().to_vec(), + symbol.as_bytes().to_vec(), + *decimals, + )?; + Ok(setMetadataCall::abi_encode_returns(&())) + }, + clearMetadata(clearMetadataCall { id }) => { + // TODO: charge based on benchmarked weight + clear_metadata::(to_runtime_origin(env.caller()), (*id).into())?; + Ok(clearMetadataCall::abi_encode_returns(&())) + }, + } + } +} + +impl, I: 'static> Fungibles { + pub const fn address() -> [u8; 20] { + fixed_address(FIXED) + } +} + +#[cfg(test)] +mod tests { + use frame_support::{assert_ok, traits::fungibles::Inspect, weights::Weight, BoundedVec}; + use mock::{Assets, ExtBuilder, *}; + use pallet_assets::{AssetDetails, AssetMetadata, AssetStatus, Instance1}; + use pallet_revive::{ + precompiles::{ + alloy::sol_types::{SolInterface, SolType}, + ExtWithInfo, + }, + test_utils::{ALICE_ADDR, BOB, BOB_ADDR}, + DepositLimit::*, + }; + + use super::{ + IFungibles::IFungiblesCalls::{clearMetadata, setMetadata, startDestroy}, + *, + }; + + const FUNGIBLES: u16 = 100; + const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); + + type Asset = pallet_assets::Asset; + type Fungibles = super::Fungibles; + type Metadata = pallet_assets::Metadata; + + #[test] + fn create_works() { + let id = 0u32; + let min_balance = 1; + ExtBuilder::new().build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert!(!Assets::asset_exists(id)); + + let mut ext = call_setup.ext().0; + let result: u32 = call_precompile( + &mut ext, + &IFungiblesCalls::create(createCall { + admin: BOB_ADDR.0.into(), + minBalance: U256::from(min_balance), + }), + ) + .unwrap(); + + assert_eq!(result, id); + assert!(Assets::asset_exists(id)); + assert_eq!( + Asset::get(id).unwrap(), + AssetDetails { + owner: ALICE, + issuer: BOB, + admin: BOB, + freezer: BOB, + supply: 0, + deposit: min_balance, + min_balance, + is_sufficient: false, + accounts: 0, + sufficients: 0, + approvals: 0, + status: AssetStatus::Live, + } + ); + + let event = Created { id, creator: ALICE_ADDR.0.into(), admin: BOB_ADDR.0.into() }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn create_via_bare_call_works() { + let id = 0u32; + let origin = RuntimeOrigin::signed(ALICE); + ExtBuilder::new().build().execute_with(|| { + assert!(!Assets::asset_exists(id)); + + let result = bare_call::( + origin, + ADDRESS.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + IFungiblesCalls::create(createCall { + admin: BOB_ADDR.0.into(), + minBalance: U256::from(1), + }) + .abi_encode(), + ) + .unwrap(); + + assert_eq!(result, id); + assert!(Assets::asset_exists(id)); + let event = Created { id, creator: ALICE_ADDR.0.into(), admin: BOB_ADDR.0.into() }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn mint_works() { + let id = 1; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::balance(id, ALICE), 0); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::mint(mintCall { + id, + account: ALICE_ADDR.0.into(), + value: U256::from(value) + }) + )); + + assert_eq!(Assets::balance(id, ALICE), value); + let from = Address::default(); + let to = ALICE_ADDR.0.into(); + let event = Transfer { id, from, to, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }, + ); + } + + #[test] + fn transfer_works() { + let id = 1; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, true, 1)]) + .with_asset_balances(vec![(id, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::balance(id, ALICE), endowment); + assert_eq!(Assets::balance(id, BOB), 0); + + let value = endowment / 2; + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::transfer(transferCall { + id, + to: BOB_ADDR.0.into(), + value: U256::from(value) + }) + )); + + assert_eq!(Assets::balance(id, ALICE), endowment - value); + assert_eq!(Assets::balance(id, BOB), value); + + let from = ALICE_ADDR.0.into(); + let to = BOB_ADDR.0.into(); + let event = Transfer { id, from, to, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn approve_works() { + let id = 1; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::allowance(id, &ALICE, &BOB), 0); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::approve(approveCall { + id, + spender: BOB_ADDR.0.into(), + value: U256::from(value), + }) + )); + + assert_eq!(Assets::allowance(id, &ALICE, &BOB), value); + let owner = ALICE_ADDR.0.into(); + let spender = BOB_ADDR.0.into(); + let event = Approval { id, owner, spender, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }, + ); + } + + #[test] + fn transfer_from_works() { + let id = 1; + let endowment = 10_000_000; + let value = endowment / 2; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, true, 1)]) + .with_asset_balances(vec![(id, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + assert_eq!(Assets::balance(id, ALICE), endowment); + assert_eq!(Assets::balance(id, BOB), 0); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + id, + BOB, + value + )); + call_setup.set_origin(Origin::Signed(BOB)); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::transferFrom(transferFromCall { + id, + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + value: U256::from(value), + }) + )); + + assert_eq!(Assets::balance(id, ALICE), endowment - value); + assert_eq!(Assets::balance(id, BOB), value); + let from = ALICE_ADDR.0.into(); + let to = BOB_ADDR.0.into(); + let event = Transfer { id, from, to, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn burn_works() { + let id = 1; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_balances(vec![(id, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::balance(id, ALICE), endowment); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::burn(burnCall { + id, + account: ALICE_ADDR.0.into(), + value: U256::from(endowment), + }), + )); + + assert_eq!(Assets::balance(id, ALICE), 0); + let from = ALICE_ADDR.0.into(); + let to = Address::default(); + let event = Transfer { id, from, to, value: U256::from(endowment) }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn start_destroy_works() { + let id = 1; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Asset::get(id).unwrap().status, AssetStatus::Live); + + let mut ext = call_setup.ext().0; + assert_ok!(call_precompile::<()>(&mut ext, &startDestroy(startDestroyCall { id }))); + + assert_eq!(Asset::get(id).unwrap().status, AssetStatus::Destroying); + }, + ); + } + + #[test] + fn exists_works() { + let id = 1; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert!(Assets::asset_exists(id)); + + let mut ext = call_setup.ext().0; + assert!(call_precompile::( + &mut ext, + &IFungiblesCalls::exists(existsCall { id }) + ) + .unwrap()); + + let id = id + 1; + assert!(!Assets::asset_exists(id)); + assert!(!call_precompile::( + &mut ext, + &IFungiblesCalls::exists(existsCall { id }) + ) + .unwrap()); + }, + ); + } + + #[test] + fn exists_via_bare_call_works() { + let id = 1; + let origin = RuntimeOrigin::signed(ALICE); + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .build() + .execute_with(|| { + assert!(Assets::asset_exists(id)); + + let asset_exists = bare_call::( + origin.clone(), + ADDRESS.into(), + 0, + Weight::MAX, + Unchecked, + IFungiblesCalls::exists(existsCall { id }).abi_encode(), + ) + .unwrap(); + assert!(asset_exists); + + let id = id + 1; + assert!(!Assets::asset_exists(id)); + let exists = bare_call::( + origin, + ADDRESS.into(), + 0, + Weight::MAX, + Unchecked, + IFungiblesCalls::exists(existsCall { id }).abi_encode(), + ) + .unwrap(); + assert!(!exists); + }); + } + + #[test] + fn set_metadata_works() { + let id = 1; + let name = "name".to_string(); + let symbol = "symbol".to_string(); + let decimals = u8::MAX; + ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Metadata::get(id), AssetMetadata::default()); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &setMetadata(setMetadataCall { + id, + name: name.clone(), + symbol: symbol.clone(), + decimals + }) + )); + + assert_eq!( + Metadata::get(id), + AssetMetadata { + deposit: 11, + name: BoundedVec::truncate_from(name.into_bytes()), + symbol: BoundedVec::truncate_from(symbol.into_bytes()), + decimals, + is_frozen: false, + } + ); + }, + ); + } + + #[test] + fn clear_metadata_works() { + let id = 1; + let name = b"name".to_vec(); + let symbol = b"symbol".to_vec(); + let decimals = u8::MAX; + ExtBuilder::new() + .with_assets(vec![(id, ALICE, false, 1)]) + .with_asset_metadata(vec![(id, name.clone(), symbol.clone(), decimals)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!( + Metadata::get(id), + AssetMetadata { + deposit: 0, + name: BoundedVec::truncate_from(name), + symbol: BoundedVec::truncate_from(symbol), + decimals, + is_frozen: false, + } + ); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &clearMetadata(clearMetadataCall { id }) + )); + + assert_eq!(Metadata::get(id), AssetMetadata::default()); + }); + } + + fn call_precompile::RustType>>( + ext: &mut impl ExtWithInfo, + input: &IFungiblesCalls, + ) -> Result { + super::call_precompile::(ext, &ADDRESS, input) + } +} diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs new file mode 100644 index 000000000..f5edb0410 --- /dev/null +++ b/pallets/api-vnext/src/lib.rs @@ -0,0 +1,146 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate alloc; + +use alloc::vec::Vec; +use core::{convert::Into, marker::PhantomData, num::NonZero}; + +use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; +#[cfg(feature = "fungibles")] +pub use fungibles::precompiles::{Erc20, Fungibles}; +pub use pallet_revive::precompiles::alloy::primitives::U256; +use pallet_revive::{ + evm::{H160, H256}, + precompiles::{ + alloy::{sol, sol_types::SolEvent}, + AddressMatcher, Error, Ext, Precompile, + }, + AddressMapper as _, Config, Origin, +}; +#[cfg(test)] +use { + frame_support::{ + pallet_prelude::{DispatchError, Weight}, + sp_runtime::traits::Bounded, + }, + frame_system::pallet_prelude::OriginFor, + pallet_revive::{precompiles::alloy::sol_types::SolValue, BalanceOf, DepositLimit, MomentOf}, +}; + +#[cfg(feature = "fungibles")] +pub mod fungibles; +#[cfg(test)] +mod mock; + +type AccountIdOf = ::AccountId; +type AddressMapper = ::AddressMapper; +type Assets = pallet_assets::Pallet; + +// A bare call to a contract. +#[cfg(test)] +fn bare_call< + T: Config, + O: SolValue + + From<::RustType>, +>( + origin: OriginFor, + dest: H160, + value: BalanceOf, + gas_limit: Weight, + storage_deposit_limit: DepositLimit>, + data: Vec, +) -> Result +where + BalanceOf: Into + TryFrom + Bounded, + MomentOf: Into, + T::Hash: frame_support::traits::IsType, +{ + let result = pallet_revive::Pallet::::bare_call( + origin, + dest, + value, + gas_limit, + storage_deposit_limit, + data, + ) + .result?; + assert!(!result.did_revert()); + Ok(decode::(&result.data)) +} + +// A direct call to a precompile. +#[cfg(test)] +fn call_precompile< + P: Precompile, + O: SolValue + + From<::RustType>, +>( + ext: &mut impl pallet_revive::precompiles::ExtWithInfo, + address: &[u8; 20], + input: &P::Interface, +) -> Result { + pallet_revive::precompiles::run::precompile::(ext, address, input).map(|o| decode(&o)) +} + +#[cfg(test)] +fn decode< + T: SolValue + + From<::RustType>, +>( + data: &[u8], +) -> T { + T::abi_decode(data, true).expect("unable to decode") +} + +fn deposit_event( + _env: &mut impl Ext, + address: impl Into, + event: impl SolEvent, +) { + // TODO: ensure that env.deposit_event impl is correct + let topics = topics(&event); + let data = event.encode_data(); + // env.deposit_event(topics, data); + // TODO: charge gas + // Workaround to emit events explicitly as precompile, as env.deposit uses derived address of + // dummy contract when using `CallSetup` within tests + let revive_event = + pallet_revive::Event::ContractEmitted { contract: address.into(), data, topics }; + >::deposit_event(::RuntimeEvent::from(revive_event)) +} + +#[cfg(test)] +fn assert_last_event(address: impl Into, event: impl SolEvent) { + mock::System::assert_last_event( + pallet_revive::Event::ContractEmitted { + contract: address.into(), + data: event.encode_data(), + topics: topics(&event), + } + .into(), + ) +} + +const fn fixed_address(n: u16) -> [u8; 20] { + AddressMatcher::Fixed(NonZero::new(n).unwrap()).base_address() +} + +fn prefixed_address(n: u16, prefix: u32) -> [u8; 20] { + let mut address = AddressMatcher::Prefix(NonZero::new(n).unwrap()).base_address(); + address[..4].copy_from_slice(&prefix.to_be_bytes()); + address +} + +// TODO: verify +fn topics(event: &impl SolEvent) -> Vec { + event.encode_topics().into_iter().map(|t| (*t.0).into()).collect() +} + +/// Creates a new `RuntimeOrigin` from an ['Origin']. +// TODO: upstream? +pub fn to_runtime_origin(o: Origin) -> T::RuntimeOrigin { + match o { + Origin::Root => RawOrigin::Root.into(), + Origin::Signed(account) => RawOrigin::Signed(account).into(), + } +} diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs new file mode 100644 index 000000000..566b76a58 --- /dev/null +++ b/pallets/api-vnext/src/mock.rs @@ -0,0 +1,141 @@ +use codec::Compact; +use frame_support::{ + derive_impl, + sp_runtime::{traits::AccountIdLookup, AccountId32, BuildStorage}, + traits::AsEnsureOriginWithArg, +}; +use frame_system::{EnsureRoot, EnsureSigned}; +use pallet_assets::AutoIncAssetId; +use pallet_revive::precompiles::run::CallSetup; +pub(crate) use pallet_revive::test_utils::ALICE; + +pub(crate) type Balance = u128; +type Block = frame_system::mocking::MockBlock; +type Erc20 = crate::Erc20; +type Fungibles = crate::Fungibles; + +#[frame_support::runtime] +mod runtime { + #[runtime::runtime] + #[runtime::derive( + RuntimeCall, + RuntimeEvent, + RuntimeError, + RuntimeOrigin, + RuntimeFreezeReason, + RuntimeHoldReason, + RuntimeSlashReason, + RuntimeLockId, + RuntimeTask, + RuntimeViewFunction + )] + pub struct Test; + + #[runtime::pallet_index(0)] + pub type Assets = pallet_assets::Pallet; + #[runtime::pallet_index(1)] + pub type Balances = pallet_balances::Pallet; + #[runtime::pallet_index(2)] + pub type Contracts = pallet_revive::Pallet; + #[runtime::pallet_index(3)] + pub type System = frame_system::Pallet; + #[runtime::pallet_index(4)] + pub type Timestamp = pallet_timestamp::Pallet; +} + +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] +impl pallet_assets::Config for Test { + type AssetIdParameter = Compact; + type Balance = Balance; + type CallbackHandle = AutoIncAssetId; + type CreateOrigin = AsEnsureOriginWithArg>; + type Currency = Balances; + type ForceOrigin = EnsureRoot; +} + +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] +impl pallet_balances::Config for Test { + type AccountStore = System; + type Balance = Balance; +} + +#[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)] +impl pallet_revive::Config for Test { + type AddressMapper = pallet_revive::AccountId32Mapper; + type Currency = Balances; + type Precompiles = + (Fungibles<100, pallet_assets::Instance1>, Erc20<101, pallet_assets::Instance1>); + type Time = Timestamp; +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::Config for Test { + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId32; + type Block = Block; + type Lookup = AccountIdLookup; +} + +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] +impl pallet_timestamp::Config for Test {} + +pub(crate) struct ExtBuilder { + assets: Option>, + asset_accounts: Option>, + asset_metadata: Option, Vec, u8)>>, +} +impl ExtBuilder { + pub(crate) fn new() -> Self { + Self { assets: None, asset_accounts: None, asset_metadata: None } + } + + pub(crate) fn with_assets(mut self, assets: Vec<(u32, AccountId32, bool, u128)>) -> Self { + self.assets = Some(assets); + self + } + + pub(crate) fn with_asset_balances(mut self, accounts: Vec<(u32, AccountId32, u128)>) -> Self { + self.asset_accounts = Some(accounts); + self + } + + pub(crate) fn with_asset_metadata( + mut self, + metadata: Vec<(u32, Vec, Vec, u8)>, + ) -> Self { + self.asset_metadata = Some(metadata); + self + } + + pub(crate) fn build(mut self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + pallet_balances::GenesisConfig:: { + balances: vec![(ALICE, 10_000_000_000)], + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); + + pallet_assets::GenesisConfig:: { + assets: self.assets.take().unwrap_or_default(), + metadata: self.asset_metadata.take().unwrap_or_default(), + accounts: self.asset_accounts.take().unwrap_or_default(), + next_asset_id: Some(0), + } + .assimilate_storage(&mut t) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } + + pub(crate) fn build_with_env(self, execute: impl FnOnce(CallSetup) -> R) -> R { + self.build().execute_with(|| { + let call_setup = CallSetup::::default(); + // let (ext, _) = call_setup.ext(); + execute(call_setup) + }) + } +} From 458b2fb24c53ca632e5ceb301fb6f36d06635fde Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 28 May 2025 10:50:26 +0100 Subject: [PATCH 040/162] feat(devnet): add fungibles precompiles --- Cargo.lock | 17 ++++++ runtime/devnet/Cargo.toml | 3 + runtime/devnet/src/config/contracts.rs | 84 +++++++++++++++++++++++++- 3 files changed, 101 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab8409f2c..7136be3a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9264,6 +9264,21 @@ dependencies = [ "staging-xcm 7.0.1", ] +[[package]] +name = "pallet-api-vnext" +version = "0.1.0" +dependencies = [ + "frame-support 28.0.0", + "frame-system 28.0.0", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", + "pallet-revive", + "pallet-timestamp 27.0.0", + "parity-scale-codec", + "scale-info", + "sp-io 30.0.0", +] + [[package]] name = "pallet-asset-conversion" version = "10.0.0" @@ -14342,6 +14357,7 @@ dependencies = [ "ismp-parachain-runtime-api", "log", "pallet-api", + "pallet-api-vnext", "pallet-assets 29.1.0", "pallet-aura 27.0.0", "pallet-authorship 28.0.0", @@ -14382,6 +14398,7 @@ dependencies = [ "sp-genesis-builder 0.8.0", "sp-inherents 26.0.0", "sp-io 30.0.0", + "sp-keyring 31.0.0", "sp-mmr-primitives 26.0.0", "sp-offchain 26.0.0", "sp-runtime 31.0.1", diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 79376a1c1..a9a76b6c4 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -25,6 +25,7 @@ smallvec.workspace = true # Local pallet-api.workspace = true +pallet-api-vnext = { workspace = true, features = [ "fungibles" ] } pallet-nfts.workspace = true pop-chain-extension.workspace = true pop-primitives.workspace = true @@ -106,6 +107,7 @@ pallet-ismp-runtime-api.workspace = true enumflags2.workspace = true env_logger.workspace = true hex.workspace = true +sp-keyring.workspace = true [features] default = [ "std" ] @@ -133,6 +135,7 @@ std = [ "ismp-parachain/std", "ismp/std", "log/std", + "pallet-api-vnext/std", "pallet-api/std", "pallet-assets/std", "pallet-aura/std", diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 8ae093576..f5887f302 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -9,10 +9,13 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - deposit, Balance, Balances, Perbill, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeHoldReason, Timestamp, TransactionPayment, + config::assets::TrustBackedAssetsInstance, deposit, Balance, Balances, Perbill, PolkadotXcm, + Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, TransactionPayment, }; +type Erc20 = pallet_api_vnext::Erc20; +type Fungibles = pallet_api_vnext::Fungibles; + fn schedule() -> pallet_contracts::Schedule { pallet_contracts::Schedule { limits: pallet_contracts::Limits { @@ -104,7 +107,8 @@ impl pallet_revive::Config for Runtime { type NativeToEthRatio = NativeToEthRatio; // 512 MB. Used in an integrity test that verifies the runtime has enough memory. type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; - type Precompiles = (); + type Precompiles = + (Fungibles<100, TrustBackedAssetsInstance>, Erc20<101, TrustBackedAssetsInstance>); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -139,3 +143,77 @@ fn contracts_prevents_runtime_calls() { TypeId::of::() ); } + +#[cfg(test)] +mod tests { + use frame_support::{assert_ok, traits::fungible::Mutate}; + use pallet_api_vnext::{ + fungibles::precompiles::{IFungibles::*, IERC20}, + U256, + }; + use pallet_revive::{precompiles::alloy::sol_types::SolCall, AddressMapper}; + use sp_core::{bytes::to_hex, H160}; + use sp_keyring::Sr25519Keyring::{Alice, Bob}; + use sp_runtime::Weight; + + use super::*; + use crate::{Assets, Revive, RuntimeOrigin, System}; + + type AccountId32Mapper = pallet_revive::AccountId32Mapper; + type Asset = pallet_assets::Asset; + type NextAssetId = pallet_assets::NextAssetId; + + fn new_test_ext() -> sp_io::TestExternalities { + let mut ext = sp_io::TestExternalities::new_empty(); + ext.execute_with(|| { + System::set_block_number(1); + Balances::set_balance(&Alice.to_account_id(), 100 * UNIT); + Balances::set_balance(&Bob.to_account_id(), 1 * UNIT); + NextAssetId::put(1); + }); + ext + } + + #[test] + fn fungibles_precompiles_work() { + let caller = Alice.to_account_id(); + let origin = RuntimeOrigin::signed(caller.clone()); + let origin_addr: H160 = AccountId32Mapper::to_address(&Alice.to_account_id()); + let id = 1; + let fungibles_addr: H160 = Fungibles::<100, TrustBackedAssetsInstance>::address().into(); + let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(id).into(); + let total_supply: Balance = 10_000; + new_test_ext().execute_with(|| { + assert_ok!(Revive::map_account(origin.clone())); + assert_ok!(Revive::map_account(RuntimeOrigin::signed(Bob.to_account_id()))); + + // Create a token via fungibles precompile + println!("IFungibles precompile: {}", to_hex(&fungibles_addr.0, false)); + let call = + createCall { admin: origin_addr.0.into(), minBalance: U256::from(1) }.abi_encode(); + println!("IFungibles.create: {}", to_hex(&call, false)); + assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); + let asset_details = Asset::get(id).unwrap(); + assert_eq!(asset_details.owner, caller); + assert_eq!(asset_details.admin, caller); + + // Mint via fungibles precompile + let call = + mintCall { id, account: origin_addr.0.into(), value: U256::from(total_supply) } + .abi_encode(); + println!("IFungibles.mint: {}", to_hex(&call, false)); + assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); + + // Transfer via erc20 precompile + println!("IERC20 precompile: {}", to_hex(&erc20_addr.0, false)); + let call = IERC20::transferCall { + to: AccountId32Mapper::to_address(&Bob.to_account_id()).0.into(), + value: U256::from(total_supply / 2), + } + .abi_encode(); + println!("IERC20.transfer: {}", to_hex(&call, false)); + assert_ok!(Revive::call(origin.clone(), erc20_addr, 0, Weight::zero(), 0, call)); + assert_eq!(Assets::balance(id, &Bob.to_account_id()), total_supply / 2); + }) + } +} From bd5d0ef09cbbc1502d04ba8136417393960a0cc0 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 28 May 2025 11:25:47 +0100 Subject: [PATCH 041/162] build(deps): propagate runtime-benchmarks feature --- pallets/api-vnext/Cargo.toml | 1 + runtime/devnet/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/pallets/api-vnext/Cargo.toml b/pallets/api-vnext/Cargo.toml index bf75b4269..67d8c1cae 100644 --- a/pallets/api-vnext/Cargo.toml +++ b/pallets/api-vnext/Cargo.toml @@ -28,6 +28,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", + "pallet-revive/runtime-benchmarks", ] std = [ "frame-support/std", diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index a9a76b6c4..4931aa5ba 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -200,6 +200,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-api-vnext/runtime-benchmarks", "pallet-api/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", From 922f76675dc3f898737240f0580e3567049b1196 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 28 May 2025 16:09:41 +0100 Subject: [PATCH 042/162] build: disable doctest based on incompatible comments in .sol files --- pallets/api-vnext/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pallets/api-vnext/Cargo.toml b/pallets/api-vnext/Cargo.toml index 67d8c1cae..fcb813991 100644 --- a/pallets/api-vnext/Cargo.toml +++ b/pallets/api-vnext/Cargo.toml @@ -8,6 +8,9 @@ name = "pallet-api-vnext" repository.workspace = true version = "0.1.0" +[lib] +doctest = false + [dependencies] codec.workspace = true frame-support.workspace = true From 7b205e8930c3efb820256aba64f5da30cf5c4bee Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 4 Jun 2025 10:15:25 +0100 Subject: [PATCH 043/162] fix(precompiles/interfaces): use calldata specifiers for string parameters --- .../precompiles/interfaces/IFungibles.sol | 63 +++++++++++++------ 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol index 0b37600c1..a27864dab 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol @@ -6,55 +6,82 @@ interface IFungibles { /** * @dev Create a new token with an automatically generated identifier. - */ - function create(address admin, uint256 minBalance) external returns (uint32 id); + */ + function create( + address admin, + uint256 minBalance + ) external returns (uint32 id); + /** * @dev Set the metadata for a token. - */ - function setMetadata(uint32 id, string name, string symbol, uint8 decimals) external; + */ + function setMetadata( + uint32 id, + string calldata name, + string calldata symbol, + uint8 decimals + ) external; + /** * @dev Clear the metadata for a token. - */ + */ function clearMetadata(uint32 id) external; + /** * @dev Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. - */ + */ function mint(uint32 id, address account, uint256 value) external; + /** * @dev Transfers `value` amount of tokens from the caller's account to account `to`. - */ + */ function transfer(uint32 id, address to, uint256 value) external; + /** * @dev Approves `spender` to spend `value` amount of tokens on behalf of the caller. - */ + */ function approve(uint32 id, address spender, uint256 value) external; + /** * @dev Transfers `value` amount tokens on behalf of `from` to account `to`. - */ - function transferFrom(uint32 id, address from, address to, uint256 value) external; + */ + function transferFrom( + uint32 id, + address from, + address to, + uint256 value + ) external; + /** * @dev Destroys `value` amount of tokens from `account`, reducing the total supply. - */ + */ function burn(uint32 id, address account, uint256 value) external; + /** * @dev Start the process of destroying a token. - */ + */ function startDestroy(uint32 id) external; + /** * @dev Whether a specified token exists. - */ + */ function exists(uint32 id) external view returns (bool); /** * @dev Event emitted when allowance by `owner` to `spender` changes. - */ + */ event Approval(uint32 id, address owner, address spender, uint256 value); /** * @dev Event emitted when a token is created. - */ + */ event Created(uint32 id, address creator, address admin); /** * @dev Event emitted when a token transfer occurs. - */ - event Transfer(uint32 indexed id, address indexed from, address indexed to, uint256 value); -} \ No newline at end of file + */ + event Transfer( + uint32 indexed id, + address indexed from, + address indexed to, + uint256 value + ); +} From 65b4f3f17116983131d561c7dfcc0873ef5e1796 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 4 Jun 2025 10:15:56 +0100 Subject: [PATCH 044/162] style(precompiles/interfaces): formatting --- .../precompiles/interfaces/IERC20.sol | 98 +++++++++++-------- 1 file changed, 58 insertions(+), 40 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol index 48a9395a1..08173ed8c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol @@ -5,63 +5,79 @@ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). - * - * Note that `value` may be zero. - */ + * + * Note that `value` may be zero. + */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. * `value` is the new allowance. - */ - event Approval(address indexed owner, address indexed spender, uint256 value); + */ + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); /** * @dev Returns the value of tokens in existence. - */ + */ function totalSupply() external view returns (uint256); + /** * @dev Returns the value of tokens owned by `account`. - */ + */ function balanceOf(address account) external view returns (uint256); + /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ function transfer(address to, uint256 value) external returns (bool); + /** * @dev Returns the remaining number of tokens that `spender` will be allowed to spend on - * behalf of `owner` through {transferFrom}. This is zero by default. - * - * This value changes when {approve} or {transferFrom} are called. - */ - function allowance(address owner, address spender) external view returns (uint256); + * behalf of `owner` through {transferFrom}. This is zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance( + address owner, + address spender + ) external view returns (uint256); + /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the caller's - * tokens. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * IMPORTANT: Beware that changing an allowance with this method brings the risk that - * someone may use both the old and the new allowance by unfortunate transaction ordering. - * One possible solution to mitigate this race condition is to first reduce the spender's - * allowance to 0 and set the desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * Emits an {Approval} event.\ - */ + * tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk that + * someone may use both the old and the new allowance by unfortunate transaction ordering. + * One possible solution to mitigate this race condition is to first reduce the spender's + * allowance to 0 and set the desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event.\ + */ function approve(address spender, uint256 value) external returns (bool); + /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. - * `value` is then deducted from the caller's allowance. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transferFrom(address from, address to, uint256 value) external returns (bool); + * `value` is then deducted from the caller's allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address from, + address to, + uint256 value + ) external returns (bool); // Extensions: `sol!` macro does not support inheritance, so extensions need to be included in same interface @@ -70,14 +86,16 @@ interface IERC20 { /** * @dev Returns the name of the token. - */ + */ function name() external view returns (string memory); + /** * @dev Returns the symbol of the token. - */ + */ function symbol() external view returns (string memory); + /** * @dev Returns the decimals places of the token. - */ + */ function decimals() external view returns (uint8); -} \ No newline at end of file +} From 8603816dde7e8d4364d99faef56b5b2bb99aea18 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 4 Jun 2025 10:37:10 +0100 Subject: [PATCH 045/162] refactor: use upcoming assetidextractor from pallet-assets --- pallets/api-vnext/src/fungibles/mod.rs | 18 ++++++++++++++++++ .../src/fungibles/precompiles/erc20.rs | 9 ++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index b918ba3b8..3a9aa5472 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -145,3 +145,21 @@ fn transfer_from, I>( value, ) } + +// TODO: replace with type in pallet_assets once available in next release +pub struct InlineAssetIdExtractor; +impl AssetIdExtractor for InlineAssetIdExtractor { + type AssetId = u32; + + fn asset_id_from_address(addr: &[u8; 20]) -> Result { + let bytes: [u8; 4] = addr[0..4].try_into().expect("slice is 4 bytes; qed"); + let index = u32::from_be_bytes(bytes); + return Ok(index.into()); + } +} +/// Mean of extracting the asset id from the precompile address. +pub trait AssetIdExtractor { + type AssetId; + /// Extracts the asset id from the address. + fn asset_id_from_address(address: &[u8; 20]) -> Result; +} diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index ac16fc672..8ced57c70 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -1,7 +1,7 @@ use alloc::string::String; use frame_support::{ - sp_runtime::{traits::AtLeast32Bit, TokenError}, + sp_runtime::{traits::AtLeast32Bit}, traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, }; use pallet_revive::precompiles::alloy::primitives::ruint::UintTryFrom; @@ -36,12 +36,7 @@ where ) -> Result, Error> { use IERC20::{IERC20Calls::*, *}; - let id: AssetIdOf = u32::from_be_bytes( - address[..4] - .try_into() - .map_err(|_| DispatchError::Token(TokenError::UnknownAsset))?, - ) - .into(); + let id = InlineAssetIdExtractor::asset_id_from_address(address)?.into(); match input { // IERC20 From 93379635799c61f1d2469e6c63d0c57fcc984785 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 4 Jun 2025 11:05:59 +0100 Subject: [PATCH 046/162] refactor(api-vnext): resolve clippy warnings --- pallets/api-vnext/src/fungibles/mod.rs | 2 +- .../src/fungibles/precompiles/erc20.rs | 11 ++++------ .../src/fungibles/precompiles/mod.rs | 21 +++++++------------ 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index 3a9aa5472..3131690cc 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -154,7 +154,7 @@ impl AssetIdExtractor for InlineAssetIdExtractor { fn asset_id_from_address(addr: &[u8; 20]) -> Result { let bytes: [u8; 4] = addr[0..4].try_into().expect("slice is 4 bytes; qed"); let index = u32::from_be_bytes(bytes); - return Ok(index.into()); + Ok(index) } } /// Mean of extracting the asset id from the precompile address. diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 8ced57c70..c7ceaefe0 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -62,8 +62,7 @@ where value.saturating_to(), )?; - let value = value.clone(); - deposit_event::(env, address, Transfer { from, to: to.clone(), value }); + deposit_event::(env, address, Transfer { from, to: *to, value: *value }); Ok(transferCall::abi_encode_returns(&(true,))) }, allowance(allowanceCall { owner, spender }) => { @@ -86,7 +85,7 @@ where ) // TODO: adjust weight .map_err(|e| e.error)?; - let event = Approval { owner, spender: spender.clone(), value: value.clone() }; + let event = Approval { owner, spender: *spender, value: *value }; deposit_event(env, address, event); Ok(approveCall::abi_encode_returns(&(true,))) }, @@ -95,15 +94,13 @@ where transfer_from::( to_runtime_origin(env.caller()), - id.into(), + id, env.to_account_id(&(*from.0).into()), env.to_account_id(&(*to.0).into()), value.saturating_to(), )?; - let from = from.clone(); - let value = value.clone(); - deposit_event(env, address, Transfer { from, to: to.clone(), value }); + deposit_event(env, address, Transfer { from: *from, to: *to, value: *value }); Ok(transferFromCall::abi_encode_returns(&(true,))) }, // IERC20Metadata diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index e4a0d9b0c..d1722324c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -50,7 +50,7 @@ where )? .into(); - deposit_event(env, address, Created { id, creator, admin: admin.clone() }); + deposit_event(env, address, Created { id, creator, admin: *admin }); Ok(createCall::abi_encode_returns(&(id,))) }, mint(mintCall { id, account, value }) => { @@ -64,8 +64,8 @@ where )?; let from = Address::default(); - let to = account.clone(); - deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + let to = *account; + deposit_event(env, address, Transfer { id: *id, from, to, value: *value }); Ok(mintCall::abi_encode_returns(&())) }, transfer(transferCall { id, to, value }) => { @@ -79,8 +79,7 @@ where value.saturating_to(), )?; - let to = to.clone(); - deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + deposit_event(env, address, Transfer { id: *id, from, to: *to, value: *value }); Ok(transferCall::abi_encode_returns(&())) }, approve(approveCall { id, spender, value }) => { @@ -95,9 +94,7 @@ where ) // TODO: adjust weight .map_err(|e| e.error)?; - let spender = spender.clone(); - let value = value.clone(); - deposit_event(env, address, Approval { id: *id, owner, spender, value }); + deposit_event(env, address, Approval { id: *id, owner, spender: *spender, value: *value }); Ok(approveCall::abi_encode_returns(&())) }, transferFrom(transferFromCall { id, from, to, value }) => { @@ -111,9 +108,7 @@ where value.saturating_to(), )?; - let from = from.clone(); - let value = value.clone(); - deposit_event(env, address, Transfer { id: *id, from, to: to.clone(), value }); + deposit_event(env, address, Transfer { id: *id, from: *from, to: *to, value: *value }); Ok(transferFromCall::abi_encode_returns(&())) }, burn(burnCall { id, account, value }) => { @@ -127,9 +122,9 @@ where ) // TODO: adjust weight .map_err(|e| e.error)?; - let from = account.clone(); + let from = account; let to = Address::default(); - deposit_event(env, address, Transfer { id: *id, from, to, value: value.clone() }); + deposit_event(env, address, Transfer { id: *id, from: *from, to, value: *value }); Ok(burnCall::abi_encode_returns(&())) }, startDestroy(startDestroyCall { id }) => { From 4917aaed80909ed304509d2d3dcbd098e846c579 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 4 Jun 2025 11:39:52 +0100 Subject: [PATCH 047/162] style: formatting --- pallets/api-vnext/src/fungibles/precompiles/erc20.rs | 2 +- pallets/api-vnext/src/fungibles/precompiles/mod.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index c7ceaefe0..7aef13f9e 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -1,7 +1,7 @@ use alloc::string::String; use frame_support::{ - sp_runtime::{traits::AtLeast32Bit}, + sp_runtime::traits::AtLeast32Bit, traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, }; use pallet_revive::precompiles::alloy::primitives::ruint::UintTryFrom; diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index d1722324c..f5f61bf76 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -94,7 +94,8 @@ where ) // TODO: adjust weight .map_err(|e| e.error)?; - deposit_event(env, address, Approval { id: *id, owner, spender: *spender, value: *value }); + let spender = *spender; + deposit_event(env, address, Approval { id: *id, owner, spender, value: *value }); Ok(approveCall::abi_encode_returns(&())) }, transferFrom(transferFromCall { id, from, to, value }) => { @@ -108,7 +109,8 @@ where value.saturating_to(), )?; - deposit_event(env, address, Transfer { id: *id, from: *from, to: *to, value: *value }); + let value = *value; + deposit_event(env, address, Transfer { id: *id, from: *from, to: *to, value }); Ok(transferFromCall::abi_encode_returns(&())) }, burn(burnCall { id, account, value }) => { From af8d53d0c533390e9a8cbcefa74972bbc0191ade Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 6 Jun 2025 12:55:17 +0100 Subject: [PATCH 048/162] feat(pop-api): add initial fungibles api and example --- Cargo.toml | 1 + pop-api-vnext/.gitignore | 11 + pop-api-vnext/Cargo.toml | 28 ++ pop-api-vnext/examples/.gitignore | 9 + .../examples/fungibles-vnext/Cargo.toml | 24 ++ pop-api-vnext/examples/fungibles-vnext/lib.rs | 147 ++++++++++ pop-api-vnext/src/lib.rs | 272 ++++++++++++++++++ runtime/devnet/src/config/contracts.rs | 121 +++++++- 8 files changed, 601 insertions(+), 12 deletions(-) create mode 100644 pop-api-vnext/.gitignore create mode 100644 pop-api-vnext/Cargo.toml create mode 100644 pop-api-vnext/examples/.gitignore create mode 100644 pop-api-vnext/examples/fungibles-vnext/Cargo.toml create mode 100644 pop-api-vnext/examples/fungibles-vnext/lib.rs create mode 100644 pop-api-vnext/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index a9ad9aad3..4a13ee9f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ repository = "https://github.com/r0gue-io/pop-node/" exclude = [ "extension/contract", "pop-api", + "pop-api-vnext", "tests/contracts", ] members = [ diff --git a/pop-api-vnext/.gitignore b/pop-api-vnext/.gitignore new file mode 100644 index 000000000..e4fa8cd88 --- /dev/null +++ b/pop-api-vnext/.gitignore @@ -0,0 +1,11 @@ +.idea/ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/pop-api-vnext/Cargo.toml b/pop-api-vnext/Cargo.toml new file mode 100644 index 000000000..7a1195b27 --- /dev/null +++ b/pop-api-vnext/Cargo.toml @@ -0,0 +1,28 @@ +[package] +description = "Enabling smart(er) contracts with the power of Polkadot" +edition = "2021" +license = "GPL-3.0-only" +name = "pop-api" +version = "0.1.0" + +[package.metadata.ink-lang] +abi = "sol" + +[dependencies] +ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +pop-primitives = { path = "../primitives", default-features = false } + +[lib] +crate-type = [ "rlib" ] +name = "pop_api" +path = "src/lib.rs" + +[features] +default = [ "std" ] +fungibles = [ ] +messaging = [ ] +nonfungibles = [ ] +std = [ + "ink/std", + "pop-primitives/std", +] diff --git a/pop-api-vnext/examples/.gitignore b/pop-api-vnext/examples/.gitignore new file mode 100644 index 000000000..d60800c86 --- /dev/null +++ b/pop-api-vnext/examples/.gitignore @@ -0,0 +1,9 @@ +# Ignore build artifacts from the local tests sub-crate. +**/target/ + +# Ignore backup files creates by cargo fmt. +**/*.rs.bk + +# Remove Cargo.lock when creating an executable, leave it for libraries +# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock +**/Cargo.lock diff --git a/pop-api-vnext/examples/fungibles-vnext/Cargo.toml b/pop-api-vnext/examples/fungibles-vnext/Cargo.toml new file mode 100644 index 000000000..4b3d4bb9e --- /dev/null +++ b/pop-api-vnext/examples/fungibles-vnext/Cargo.toml @@ -0,0 +1,24 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "fungibles" +version = "0.1.0" + +[package.metadata.ink-lang] +abi = "sol" + +[lib] +path = "lib.rs" + +[dependencies] +ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +pop-api = { path = "../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } + +[dev-dependencies] +hex = { version = "0.4.3" } +scale-info = { version = "2" } + +[features] +default = [ "std" ] +ink-as-dependency = [ ] +std = [ "ink/std", "pop-api/std" ] diff --git a/pop-api-vnext/examples/fungibles-vnext/lib.rs b/pop-api-vnext/examples/fungibles-vnext/lib.rs new file mode 100644 index 000000000..7eaf23f5e --- /dev/null +++ b/pop-api-vnext/examples/fungibles-vnext/lib.rs @@ -0,0 +1,147 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +// NOTE: requires `cargo-contract` built from `master` + +#[ink::contract] +pub mod fungibles { + use ink::U256; + use pop_api::fungibles::{self as api, erc20, erc20::Transfer, TokenId as Id}; + + #[ink(storage)] + pub struct Fungible { + id: Id, + owner: Address, + } + + impl Fungible { + /// Instantiate the contract and create a new token. The token identifier will be stored + /// in contract's storage. + /// + /// # Parameters + /// * - `min_balance` - The minimum balance required for accounts holding this token. + // The `min_balance` ensures accounts hold a minimum amount of tokens, preventing tiny, + // inactive balances from bloating the blockchain state and slowing down the network. + #[ink(constructor, payable)] + #[allow(clippy::new_without_default)] + pub fn new(min_balance: U256) -> Self { + let mut instance = Self { id: 0, owner: Self::env().caller() }; + instance.id = api::create(instance.env().address(), min_balance); + instance + } + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total + /// supply. + /// + /// # Parameters + /// - `account` - The address to be credited with the created tokens. + /// - `value` - The number of tokens to mint. + #[ink(message)] + pub fn mint(&mut self, account: Address, value: U256) { + if let Err(e) = self.ensure_owner() { + // Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 + revert(e) + } + // No-op if `value` is zero. + if value == U256::zero() { + return; + } + api::mint(self.id, account, value); + self.env().emit_event(Transfer { from: Address::zero(), to: account, value }); + } + + /// Transfer the ownership of the contract to another account. + /// + /// # Parameters + /// - `owner` - New owner account. + #[ink(message)] + pub fn transfer_ownership(&mut self, owner: Address) { + if let Err(e) = self.ensure_owner() { + // Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 + revert(e) + } + self.owner = owner; + } + + /// Check if the caller is the owner of the contract. + fn ensure_owner(&self) -> Result<(), Error> { + if self.owner != self.env().caller() { + return Err(Error::NoPermission); + } + Ok(()) + } + } + + // TODO: implement via Erc20 trait once Solidity support available + impl Fungible { + /// Returns the total token supply. + #[ink(message)] + #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector + pub fn totalSupply(&self) -> U256 { + erc20::total_supply(self.id) + } + + /// Returns the account balance for the specified `owner`. + /// + /// # Parameters + /// - `owner` - The address whose balance is being queried. + #[ink(message)] + #[allow(non_snake_case)] + pub fn balanceOf(&self, owner: Address) -> U256 { + erc20::balance_of(self.id, owner) + } + + /// Returns the allowance for a `spender` approved by an `owner`. + /// + /// # Parameters + /// - `owner` - The account that owns the tokens. + /// - `spender` - The account that is allowed to spend the tokens. + #[ink(message)] + pub fn allowance(&self, owner: Address, spender: Address) -> U256 { + erc20::allowance(self.id, owner, spender) + } + + /// Transfers `value` amount of tokens from the contract to account `to` with + /// additional `data` in unspecified format. + /// + /// # Parameters + /// - `to` - The recipient account. + /// - `value` - The number of tokens to transfer. + #[ink(message)] + pub fn transfer(&mut self, to: Address, value: U256) -> bool { + if let Err(e) = self.ensure_owner() { + // Workaround until ink supports Error to Solidity custom error conversion + revert(e) + } + let contract = self.env().address(); + + // No-op if the contract and `to` is the same address or `value` is zero. + if contract == to || value == U256::zero() { + return true; + } + if !erc20::transfer(self.id, to, value) { + revert(Error::TransferFailed) + } + self.env().emit_event(Transfer { from: contract, to, value }); + true + } + } + + pub enum Error { + /// The signing account has no permission to do the operation. + NoPermission, + /// The transfer failed. + TransferFailed, + } + + fn revert(error: Error) -> ! { + use ink::env::{return_value_solidity as return_value, ReturnFlags}; + use Error::*; + + const REVERT: ReturnFlags = ReturnFlags::REVERT; + + match error { + NoPermission => return_value(REVERT, &(0x9d7b369d_u32.to_be_bytes())), + TransferFailed => return_value(REVERT, &(0x90b8ec18_u32.to_be_bytes())), + } + } +} diff --git a/pop-api-vnext/src/lib.rs b/pop-api-vnext/src/lib.rs new file mode 100644 index 000000000..8ec6bae61 --- /dev/null +++ b/pop-api-vnext/src/lib.rs @@ -0,0 +1,272 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{ + env::{ + call::{build_call_solidity, ExecutionInput}, + DefaultEnvironment, + }, + prelude::vec::Vec, + Address, U256, +}; + +/// APIs for fungible tokens. +#[cfg(feature = "fungibles")] +pub mod fungibles { + use super::*; + + const PRECOMPILE: u16 = 100; + + pub type TokenId = u32; + + /// Create a new token with an automatically generated identifier. + #[inline] + pub fn create(admin: Address, min_balance: U256) -> TokenId { + let address = fixed_address(PRECOMPILE); + + // GOAL: + // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); + // precompile.create(admin, min_balance) + + // WORKAROUND: + let selector = 0x0ecaea73_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector).push_arg(admin).push_arg(min_balance)) + .returns::() + .invoke() + } + + /// Whether a specified token exists. + #[inline] + pub fn exists(id: TokenId) -> bool { + let address = fixed_address(PRECOMPILE); + + // GOAL: + // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); + // precompile.exists(id) + + // WORKAROUND: + let selector = 0x13c369ed_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector).push_arg(id)) + .returns::() + .invoke() + } + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total + /// supply. + #[inline] + pub fn mint(id: TokenId, account: Address, value: U256) { + let address = fixed_address(PRECOMPILE); + + // GOAL: + // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); + // precompile.mint(id, address, value) + + // WORKAROUND: + let selector = 0x79d9b87b_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input( + ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value), + ) + .returns::<()>() + .invoke() + } + + /// The fungibles precompile offers a streamlined interface for interacting with fungible + /// tokens. The goal is to provide a simplified, consistent API that adheres to standards in + /// the smart contract space. + #[ink::trait_definition] + pub trait Fungibles { + /// Create a new token with an automatically generated identifier. + #[ink(message)] + fn create(&self, admin: Address, min_balance: U256) -> TokenId; + + /// Set the metadata for a token. + #[ink(message)] + fn set_metadata(&self, id: TokenId, name: Vec, symbol: Vec, decimals: u8); + + /// Clear the metadata for a token. + #[ink(message)] + fn clear_metadata(&self, id: TokenId); + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total + /// supply. + #[ink(message)] + fn mint(&self, id: TokenId, account: Address, value: U256); + + /// Transfers `value` amount of tokens from the caller's account to account `to`. + #[ink(message)] + fn transfer(&self, id: TokenId, to: Address, value: U256); + + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + #[ink(message)] + fn approve(&self, id: TokenId, spender: Address, value: U256); + + /// Transfers `value` amount tokens on behalf of `from` to account `to`. + #[ink(message)] + fn transfer_from(&self, id: TokenId, from: Address, to: Address, value: U256); + + /// Destroys `value` amount of tokens from `account`, reducing the total supply. + #[ink(message)] + fn burn(&self, id: TokenId, address: Address, value: U256); + + /// Start the process of destroying a token. + #[ink(message)] + fn start_destroy(&self, id: TokenId) -> bool; + + /// Whether a specified token exists. + #[ink(message)] + fn exists(&self, id: TokenId) -> bool; + } + + /// APIs for fungible tokens conforming to the ERC20 standard. + pub mod erc20 { + use super::*; + + const PRECOMPILE: u16 = 101; + + /// Returns the value of tokens in existence. + #[inline] + pub fn total_supply(id: TokenId) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let selector = 0x18160ddd_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector)) + .returns::() + .invoke() + } + + /// Returns the value of tokens owned by `account`. + #[inline] + pub fn balance_of(id: TokenId, account: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let selector = 0x70a08231_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector).push_arg(account)) + .returns::() + .invoke() + } + + /// Returns the remaining number of tokens that `spender` will be allowed to spend + /// on behalf of `owner` through [`transfer_from`]. This is zero by default. + /// + /// This value changes when `approve` or [`transfer_from`] are called. + #[inline] + pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let selector = 0xdd62ed3e_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector).push_arg(owner).push_arg(spender)) + .returns::() + .invoke() + } + + /// Returns the value of tokens owned by `account`. + #[inline] + pub fn transfer(id: TokenId, to: Address, value: U256) -> bool { + let address = prefixed_address(PRECOMPILE, id); + let selector = 0x70a08231_u32.to_be_bytes().into(); + build_call_solidity::() + .call(address) + .exec_input(ExecutionInput::new(selector).push_arg(to).push_arg(value)) + .returns::() + .invoke() + } + + /// Emitted when the allowance of a `spender` for an `owner` is set by a call to + /// [`approve`]. `value` is the new allowance. + #[ink::event] + #[cfg_attr(feature = "std", derive(Debug))] + pub struct Approval { + /// The owner providing the allowance. + #[ink(topic)] + pub owner: Address, + /// The beneficiary of the allowance. + #[ink(topic)] + pub spender: Address, + /// The new allowance amount. + pub value: U256, + } + + /// Emitted when `value` tokens are moved from one account (`from`) to another (`to`). + /// + /// Note that `value` may be zero. + #[ink::event] + #[cfg_attr(feature = "std", derive(Debug))] + pub struct Transfer { + /// The source of the transfer. The zero address when minting. + #[ink(topic)] + pub from: Address, + /// The recipient of the transfer. The zero address when burning. + #[ink(topic)] + pub to: Address, + /// The amount transferred (or minted/burned). + pub value: U256, + } + + /// Interface of the ERC-20 standard. + #[ink::trait_definition] + pub trait Erc20 { + /// Returns the value of tokens in existence. + #[ink(message)] + #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector + fn totalSupply(&self) -> U256; + + /// Returns the value of tokens owned by `account`. + #[ink(message)] + #[allow(non_snake_case)] + fn balanceOf(&self, account: Address) -> U256; + + /// Returns the remaining number of tokens that `spender` will be allowed to spend + /// on behalf of `owner` through [`transfer_from`]. This is zero by default. + /// + /// This value changes when `approve` or `[`transfer_from`] are called. + #[ink(message)] + fn allowance(&self, owner: Address, spender: Address) -> U256; + + /// Moves a `value` amount of tokens from the caller's account to `to`. Returns a + /// boolean value indicating whether the operation succeeded. Emits a {Transfer} + /// event. + #[ink(message)] + fn transfer(&self, to: Address, value: U256) -> bool; + } + } +} + +fn fixed_address(n: u16) -> Address { + let shifted = (n as u32) << 16; + + let suffix = shifted.to_be_bytes(); + let mut address = [0u8; 20]; + let mut i = 16; + while i < address.len() { + address[i] = suffix[i - 16]; + i = i + 1; + } + address.into() +} + +fn prefixed_address(n: u16, prefix: u32) -> Address { + let mut address = fixed_address(n); + address.0[..4].copy_from_slice(&prefix.to_be_bytes()); + address +} + +#[test] +fn fixed_address_works() { + assert_eq!(hex::encode(fixed_address(100)), "0000000000000000000000000000000000640000") +} + +#[test] +fn prefixed_address_works() { + assert_eq!( + hex::encode(prefixed_address(101, u32::MAX)), + "ffffffff00000000000000000000000000650000" + ); +} diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index f5887f302..48558a359 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -146,13 +146,18 @@ fn contracts_prevents_runtime_calls() { #[cfg(test)] mod tests { + use codec::Encode; use frame_support::{assert_ok, traits::fungible::Mutate}; - use pallet_api_vnext::{ - fungibles::precompiles::{IFungibles::*, IERC20}, - U256, + use frame_system::pallet_prelude::OriginFor; + use pallet_api_vnext::fungibles::precompiles::{IFungibles::*, IERC20}; + use pallet_revive::{ + precompiles::alloy::{ + primitives, + sol_types::{SolCall, SolType, SolValue}, + }, + AddressMapper, Code, DepositLimit, }; - use pallet_revive::{precompiles::alloy::sol_types::SolCall, AddressMapper}; - use sp_core::{bytes::to_hex, H160}; + use sp_core::{bytes::to_hex, H160, U256}; use sp_keyring::Sr25519Keyring::{Alice, Bob}; use sp_runtime::Weight; @@ -167,7 +172,7 @@ mod tests { let mut ext = sp_io::TestExternalities::new_empty(); ext.execute_with(|| { System::set_block_number(1); - Balances::set_balance(&Alice.to_account_id(), 100 * UNIT); + Balances::set_balance(&Alice.to_account_id(), 1_000 * UNIT); Balances::set_balance(&Bob.to_account_id(), 1 * UNIT); NextAssetId::put(1); }); @@ -178,7 +183,7 @@ mod tests { fn fungibles_precompiles_work() { let caller = Alice.to_account_id(); let origin = RuntimeOrigin::signed(caller.clone()); - let origin_addr: H160 = AccountId32Mapper::to_address(&Alice.to_account_id()); + let origin_addr = AccountId32Mapper::to_address(&caller); let id = 1; let fungibles_addr: H160 = Fungibles::<100, TrustBackedAssetsInstance>::address().into(); let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(id).into(); @@ -190,7 +195,8 @@ mod tests { // Create a token via fungibles precompile println!("IFungibles precompile: {}", to_hex(&fungibles_addr.0, false)); let call = - createCall { admin: origin_addr.0.into(), minBalance: U256::from(1) }.abi_encode(); + createCall { admin: origin_addr.0.into(), minBalance: primitives::U256::from(1) } + .abi_encode(); println!("IFungibles.create: {}", to_hex(&call, false)); assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); let asset_details = Asset::get(id).unwrap(); @@ -198,9 +204,12 @@ mod tests { assert_eq!(asset_details.admin, caller); // Mint via fungibles precompile - let call = - mintCall { id, account: origin_addr.0.into(), value: U256::from(total_supply) } - .abi_encode(); + let call = mintCall { + id, + account: origin_addr.0.into(), + value: primitives::U256::from(total_supply), + } + .abi_encode(); println!("IFungibles.mint: {}", to_hex(&call, false)); assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); @@ -208,7 +217,7 @@ mod tests { println!("IERC20 precompile: {}", to_hex(&erc20_addr.0, false)); let call = IERC20::transferCall { to: AccountId32Mapper::to_address(&Bob.to_account_id()).0.into(), - value: U256::from(total_supply / 2), + value: primitives::U256::from(total_supply / 2), } .abi_encode(); println!("IERC20.transfer: {}", to_hex(&call, false)); @@ -216,4 +225,92 @@ mod tests { assert_eq!(Assets::balance(id, &Bob.to_account_id()), total_supply / 2); }) } + + // Currently ignored due to explicit dependency on built contract + #[ignore] + #[test] + fn fungibles_precompiles_via_contract_works() { + let contract = include_bytes!( + "../../../../pop-api-vnext/examples/fungibles-vnext/target/ink/fungibles.polkavm" + ); + let caller = Alice.to_account_id(); + let origin = RuntimeOrigin::signed(caller.clone()); + let origin_addr = primitives::Address::new(AccountId32Mapper::to_address(&caller).0); + let minimum_value = U256::from(1); + let endowment = primitives::U256::from(10_000); + new_test_ext().execute_with(|| { + assert_ok!(Revive::map_account(origin.clone())); + + // Instantiate contract with some value, required to create underlying asset + let result = Revive::bare_instantiate( + origin.clone(), + 10 * UNIT, + Weight::MAX, + DepositLimit::Unchecked, + Code::Upload(contract.to_vec()), + // Constructors are not yet using Solidity encoding + [blake_selector("new"), minimum_value.encode()].concat(), + None, + ) + .result + .unwrap(); + assert!(!result.result.did_revert()); + + // Interact with contract as Erc20 + call::<()>( + origin.clone(), + result.addr, + [keccak_selector("mint(address,uint256)"), (origin_addr, endowment).abi_encode()] + .concat(), + ); + + let total_supply = call::( + origin.clone(), + result.addr, + keccak_selector("totalSupply()"), + ); + assert_eq!(total_supply, endowment); + + let balance_of = call::( + origin.clone(), + result.addr, + [keccak_selector("balanceOf(address)"), (origin_addr,).abi_encode()].concat(), + ); + assert_eq!(balance_of, endowment); + }); + + fn call::RustType>>( + origin: OriginFor, + contract: H160, + data: Vec, + ) -> T { + let result = + Revive::bare_call(origin, contract, 0, Weight::MAX, DepositLimit::Unchecked, data) + .result + .unwrap(); + assert!(!result.did_revert()); + T::abi_decode(&result.data, true).unwrap() + } + } + + fn blake_selector(name: &str) -> Vec { + let hash = sp_io::hashing::blake2_256(name.as_bytes()); + [hash[0..4].to_vec()].concat() + } + + fn keccak_selector(name: &str) -> Vec { + let hash = sp_io::hashing::keccak_256(name.as_bytes()); + [hash[0..4].to_vec()].concat() + } + + #[test] + fn selectors_work() { + // Constructors currently still use blake encoding + assert_eq!(hex::encode(blake_selector("new")), "9bae9d5e"); + + // Erc20 selectors + assert_eq!(hex::encode(keccak_selector("exists()")), "267c4ae4"); + assert_eq!(hex::encode(keccak_selector("totalSupply()")), "18160ddd"); + assert_eq!(hex::encode(keccak_selector("balanceOf(address)")), "70a08231"); + } } From 8de1e93390e8f964ddf521bf3ae2e604e8d0af6b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 9 Jun 2025 12:21:58 +0100 Subject: [PATCH 049/162] chore: rename example directory --- pop-api-vnext/examples/{fungibles-vnext => fungibles}/Cargo.toml | 0 pop-api-vnext/examples/{fungibles-vnext => fungibles}/lib.rs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename pop-api-vnext/examples/{fungibles-vnext => fungibles}/Cargo.toml (100%) rename pop-api-vnext/examples/{fungibles-vnext => fungibles}/lib.rs (100%) diff --git a/pop-api-vnext/examples/fungibles-vnext/Cargo.toml b/pop-api-vnext/examples/fungibles/Cargo.toml similarity index 100% rename from pop-api-vnext/examples/fungibles-vnext/Cargo.toml rename to pop-api-vnext/examples/fungibles/Cargo.toml diff --git a/pop-api-vnext/examples/fungibles-vnext/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs similarity index 100% rename from pop-api-vnext/examples/fungibles-vnext/lib.rs rename to pop-api-vnext/examples/fungibles/lib.rs From 0f15ad992fe98b9d3a4d996d4c191f3c02e3bac2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 13 Jun 2025 13:29:25 +0100 Subject: [PATCH 050/162] docs: remove trailing slash in comment --- .../api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol index 08173ed8c..7aa8d6c10 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol @@ -61,7 +61,7 @@ interface IERC20 { * allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * - * Emits an {Approval} event.\ + * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); From d9961dd1ef3ce3390af17a6c2adc9ec822b96f90 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 13 Jun 2025 13:32:53 +0100 Subject: [PATCH 051/162] refactor(pop-api): improvements to implementation --- pop-api-vnext/Cargo.toml | 10 +- pop-api-vnext/examples/fungibles/Cargo.toml | 6 +- pop-api-vnext/examples/fungibles/lib.rs | 187 +++++-- pop-api-vnext/src/fungibles/erc20.rs | 509 +++++++++++++++++ pop-api-vnext/src/fungibles/mod.rs | 585 ++++++++++++++++++++ pop-api-vnext/src/lib.rs | 255 +-------- 6 files changed, 1267 insertions(+), 285 deletions(-) create mode 100644 pop-api-vnext/src/fungibles/erc20.rs create mode 100644 pop-api-vnext/src/fungibles/mod.rs diff --git a/pop-api-vnext/Cargo.toml b/pop-api-vnext/Cargo.toml index 7a1195b27..89ec14f51 100644 --- a/pop-api-vnext/Cargo.toml +++ b/pop-api-vnext/Cargo.toml @@ -9,9 +9,13 @@ version = "0.1.0" abi = "sol" [dependencies] -ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } pop-primitives = { path = "../primitives", default-features = false } +[dev-dependencies] +hex = { version = "0.4.3" } + [lib] crate-type = [ "rlib" ] name = "pop_api" @@ -26,3 +30,7 @@ std = [ "ink/std", "pop-primitives/std", ] + +[lints.rust.unexpected_cfgs] +check-cfg = [ 'cfg(ink_abi, values("ink", "sol", "all"))' ] +level = "warn" diff --git a/pop-api-vnext/examples/fungibles/Cargo.toml b/pop-api-vnext/examples/fungibles/Cargo.toml index 4b3d4bb9e..03f9e0bd2 100644 --- a/pop-api-vnext/examples/fungibles/Cargo.toml +++ b/pop-api-vnext/examples/fungibles/Cargo.toml @@ -11,7 +11,7 @@ abi = "sol" path = "lib.rs" [dependencies] -ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } pop-api = { path = "../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } [dev-dependencies] @@ -22,3 +22,7 @@ scale-info = { version = "2" } default = [ "std" ] ink-as-dependency = [ ] std = [ "ink/std", "pop-api/std" ] + +[lints.rust.unexpected_cfgs] +check-cfg = [ 'cfg(ink_abi, values("ink", "sol", "all"))' ] +level = "warn" diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 7eaf23f5e..fecdc96c1 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -4,12 +4,19 @@ #[ink::contract] pub mod fungibles { - use ink::U256; - use pop_api::fungibles::{self as api, erc20, erc20::Transfer, TokenId as Id}; + use ink::{prelude::string::String, U256}; + use pop_api::{ + fungibles::{ + self as api, + erc20::{extensions::Erc20Metadata, Erc20}, + Approval, InvalidRecipient, NoPermission, TokenId, Transfer, + }, + revert, + }; #[ink(storage)] pub struct Fungible { - id: Id, + id: TokenId, owner: Address, } @@ -18,14 +25,23 @@ pub mod fungibles { /// in contract's storage. /// /// # Parameters + /// * - `name` - The name of the token. + /// * - `symbol` - The symbol of the token. /// * - `min_balance` - The minimum balance required for accounts holding this token. + /// * - `decimals` - The number of decimals. + /// + /// NOTE: The minimum balance must be non-zero. // The `min_balance` ensures accounts hold a minimum amount of tokens, preventing tiny, // inactive balances from bloating the blockchain state and slowing down the network. #[ink(constructor, payable)] #[allow(clippy::new_without_default)] - pub fn new(min_balance: U256) -> Self { + pub fn new(name: String, symbol: String, min_balance: U256, decimals: u8) -> Self { let mut instance = Self { id: 0, owner: Self::env().caller() }; - instance.id = api::create(instance.env().address(), min_balance); + match api::create(instance.env().address(), min_balance) { + Ok(id) => instance.id = id, + Err(error) => revert(&error), + } + api::set_metadata(instance.id, name, symbol, decimals); instance } @@ -37,47 +53,63 @@ pub mod fungibles { /// - `value` - The number of tokens to mint. #[ink(message)] pub fn mint(&mut self, account: Address, value: U256) { - if let Err(e) = self.ensure_owner() { + if let Err(error) = self.ensure_owner() { // Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 - revert(e) + revert(&error) } - // No-op if `value` is zero. - if value == U256::zero() { - return; + + if let Err(error) = api::mint(self.id, account, value) { + revert(&error) } - api::mint(self.id, account, value); self.env().emit_event(Transfer { from: Address::zero(), to: account, value }); } + /// Destroys `value` amount of tokens from `account`, reducing the total supply. + /// + /// # Parameters + /// - `account` - The address from which the tokens will be destroyed. + /// - `value` - The number of tokens to destroy. + #[ink(message)] + pub fn burn(&mut self, account: Address, value: U256) { + if let Err(e) = self.ensure_owner() { + revert(&e) + } + + if let Err(error) = api::burn(self.id, account, value) { + revert(&error) + } + self.env().emit_event(Transfer { from: account, to: Address::zero(), value }); + } + /// Transfer the ownership of the contract to another account. /// /// # Parameters /// - `owner` - New owner account. + /// + /// NOTE: the specified owner account is not checked, allowing the zero address to be + /// specified if desired.. #[ink(message)] pub fn transfer_ownership(&mut self, owner: Address) { if let Err(e) = self.ensure_owner() { - // Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 - revert(e) + revert(&e) } self.owner = owner; } /// Check if the caller is the owner of the contract. - fn ensure_owner(&self) -> Result<(), Error> { + fn ensure_owner(&self) -> Result<(), NoPermission> { if self.owner != self.env().caller() { - return Err(Error::NoPermission); + return Err(NoPermission); } Ok(()) } } - // TODO: implement via Erc20 trait once Solidity support available - impl Fungible { + impl Erc20 for Fungible { /// Returns the total token supply. #[ink(message)] - #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector - pub fn totalSupply(&self) -> U256 { - erc20::total_supply(self.id) + fn totalSupply(&self) -> U256 { + api::total_supply(self.id) } /// Returns the account balance for the specified `owner`. @@ -85,63 +117,116 @@ pub mod fungibles { /// # Parameters /// - `owner` - The address whose balance is being queried. #[ink(message)] - #[allow(non_snake_case)] - pub fn balanceOf(&self, owner: Address) -> U256 { - erc20::balance_of(self.id, owner) + fn balanceOf(&self, owner: Address) -> U256 { + api::balance_of(self.id, owner) } /// Returns the allowance for a `spender` approved by an `owner`. /// /// # Parameters - /// - `owner` - The account that owns the tokens. - /// - `spender` - The account that is allowed to spend the tokens. + /// - `owner` - The address that owns the tokens. + /// - `spender` - The address that is allowed to spend the tokens. #[ink(message)] - pub fn allowance(&self, owner: Address, spender: Address) -> U256 { - erc20::allowance(self.id, owner, spender) + fn allowance(&self, owner: Address, spender: Address) -> U256 { + api::allowance(self.id, owner, spender) } - /// Transfers `value` amount of tokens from the contract to account `to` with + /// Transfers `value` amount of tokens from the contract to address `to` with /// additional `data` in unspecified format. /// /// # Parameters - /// - `to` - The recipient account. + /// - `to` - The recipient address. /// - `value` - The number of tokens to transfer. #[ink(message)] - pub fn transfer(&mut self, to: Address, value: U256) -> bool { - if let Err(e) = self.ensure_owner() { - // Workaround until ink supports Error to Solidity custom error conversion - revert(e) + fn transfer(&mut self, to: Address, value: U256) -> bool { + if let Err(error) = self.ensure_owner() { + revert(&error) } let contract = self.env().address(); - // No-op if the contract and `to` is the same address or `value` is zero. - if contract == to || value == U256::zero() { - return true; + // Validate recipient. + if to == contract { + revert(&InvalidRecipient(to)) } - if !erc20::transfer(self.id, to, value) { - revert(Error::TransferFailed) + + if let Err(error) = api::transfer(self.id, to, value) { + revert(&error) } self.env().emit_event(Transfer { from: contract, to, value }); true } - } - pub enum Error { - /// The signing account has no permission to do the operation. - NoPermission, - /// The transfer failed. - TransferFailed, + /// Transfers `value` tokens on behalf of `from` to the account `to`. Contract must be + /// pre-approved by `from`. + /// + /// # Parameters + /// - `from` - The address from which the token balance will be withdrawn. + /// - `to` - The recipient address. + /// - `value` - The number of tokens to transfer. + #[ink(message)] + fn transferFrom(&mut self, from: Address, to: Address, value: U256) -> bool { + if let Err(e) = self.ensure_owner() { + revert(&e) + } + let contract = self.env().address(); + + // A successful transfer reduces the allowance from `from` to the contract and triggers + // an `Approval` event with the updated allowance amount. + if let Err(error) = api::transfer_from(self.id, from, to, value) { + revert(&error) + } + self.env().emit_event(Transfer { from: contract, to, value }); + self.env().emit_event(Approval { + owner: from, + spender: contract, + value: self.allowance(from, contract), + }); + true + } + + /// Approves `spender` to spend `value` amount of tokens on behalf of the contract. + /// + /// Successive calls of this method overwrite previous values. + /// + /// # Parameters + /// - `spender` - The address that is allowed to spend the tokens. + /// - `value` - The number of tokens to approve. + #[ink(message)] + fn approve(&mut self, spender: Address, value: U256) -> bool { + if let Err(e) = self.ensure_owner() { + revert(&e) + } + let contract = self.env().address(); + + // Validate recipient. + if spender == contract { + revert(&InvalidRecipient(spender)) + } + if let Err(error) = api::approve(self.id, spender, value) { + revert(&error) + } + self.env().emit_event(Approval { owner: contract, spender, value }); + true + } } - fn revert(error: Error) -> ! { - use ink::env::{return_value_solidity as return_value, ReturnFlags}; - use Error::*; + impl Erc20Metadata for Fungible { + /// Returns the token name. + #[ink(message)] + fn name(&self) -> String { + api::name(self.id) + } - const REVERT: ReturnFlags = ReturnFlags::REVERT; + /// Returns the token symbol. + #[ink(message)] + fn symbol(&self) -> String { + api::symbol(self.id) + } - match error { - NoPermission => return_value(REVERT, &(0x9d7b369d_u32.to_be_bytes())), - TransferFailed => return_value(REVERT, &(0x90b8ec18_u32.to_be_bytes())), + /// Returns the token decimals. + #[ink(message)] + fn decimals(&self) -> u8 { + api::decimals(self.id) } } } diff --git a/pop-api-vnext/src/fungibles/erc20.rs b/pop-api-vnext/src/fungibles/erc20.rs new file mode 100644 index 000000000..8ef4aff4c --- /dev/null +++ b/pop-api-vnext/src/fungibles/erc20.rs @@ -0,0 +1,509 @@ +pub use errors::*; + +use super::{ + contract_ref, prefixed_address, Address, Pop, SolAddress, SolEncode, SolError, SolType, + SolTypeEncode, String, TokenId, Uint, Vec, U256, +}; +use crate::ensure; + +const PRECOMPILE: u16 = 101; + +/// Interface of the ERC-20 standard. +#[ink::trait_definition] +pub trait Erc20 { + /// Returns the value of tokens in existence. + #[ink(message)] + #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector + fn totalSupply(&self) -> U256; + + /// Returns the value of tokens owned by `account`. + #[ink(message)] + #[allow(non_snake_case)] + fn balanceOf(&self, account: Address) -> U256; + + /// Moves a `value` amount of tokens from the caller's account to `to`. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a [`Transfer`] event. + #[ink(message)] + fn transfer(&mut self, to: Address, value: U256) -> bool; + + /// Returns the remaining number of tokens that `spender` will be allowed to spend + /// on behalf of `owner` through [`transfer_from`]. This is zero by default. + /// + /// This value changes when `approve` or `[`transfer_from`] are called. + #[ink(message)] + fn allowance(&self, owner: Address, spender: Address) -> U256; + + /// Sets a `value` amount of tokens as the allowance of `spender` over the caller's + /// tokens. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits an [`Approval`] event. + #[ink(message)] + fn approve(&mut self, spender: Address, value: U256) -> bool; + + /// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. + /// `value` is then deducted from the caller's allowance. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a [`Transfer`] event. + #[ink(message)] + #[allow(non_snake_case)] + fn transferFrom(&mut self, from: Address, to: Address, value: U256) -> bool; +} + +/// Emitted when the allowance of a `spender` for an `owner` is set by a call to +/// [`approve`]. `value` is the new allowance. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct Approval { + /// The owner providing the allowance. + #[ink(topic)] + pub owner: Address, + /// The beneficiary of the allowance. + #[ink(topic)] + pub spender: Address, + /// The new allowance amount. + pub value: U256, +} + +/// Emitted when `value` tokens are moved from one account (`from`) to another (`to`). +/// +/// Note that `value` may be zero. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct Transfer { + /// The source of the transfer. The zero address when minting. + #[ink(topic)] + pub from: Address, + /// The recipient of the transfer. The zero address when burning. + #[ink(topic)] + pub to: Address, + /// The amount transferred (or minted/burned). + pub value: U256, +} + +/// Returns the value of tokens in existence. +#[inline] +pub fn total_supply(id: TokenId) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20, Pop) = address.into(); + precompile.totalSupply() + + // let selector = 0x18160ddd_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector)) + // .returns::() + // .invoke() +} + +/// Returns the value of tokens owned by `account`. +#[inline] +pub fn balance_of(id: TokenId, account: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20, Pop) = address.into(); + precompile.balanceOf(account) + + // let selector = 0x70a08231_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(account)) + // .returns::() + // .invoke() +} + +/// Returns the value of tokens owned by `account`. +#[inline] +pub fn transfer(id: TokenId, to: Address, value: U256) -> Result { + ensure!(to != Address::zero(), ERC20InvalidSender(to)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, id); + let mut precompile: contract_ref!(Erc20, Pop) = address.into(); + Ok(precompile.transfer(to, value)) + + // let selector = 0xa9059cbb_u32.to_be_bytes().into(); + // let result = build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(to).push_arg(value)) + // .returns::() + // .invoke(); + // Ok(result) +} + +/// Returns the remaining number of tokens that `spender` will be allowed to spend +/// on behalf of `owner` through [`transfer_from`]. This is zero by default. +/// +/// This value changes when `approve` or [`transfer_from`] are called. +#[inline] +pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20, Pop) = address.into(); + precompile.allowance(owner, spender) + + // let selector = 0xdd62ed3e_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(owner).push_arg(spender)) + // .returns::() + // .invoke() +} + +/// Sets a `value` amount of tokens as the allowance of `spender` over the caller's +/// tokens. +/// +/// Returns a boolean value indicating whether the operation succeeded. +/// +/// Emits an [`Approval`] event. +#[inline] +pub fn approve(id: TokenId, spender: Address, value: U256) -> Result { + ensure!(spender != Address::zero(), ERC20InvalidApprover(spender)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, id); + let mut precompile: contract_ref!(Erc20, Pop) = address.into(); + Ok(precompile.approve(spender, value)) + + // let selector = 0x095ea7b3_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(spender).push_arg(value)) + // .returns::() + // .invoke()) +} + +/// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. +/// `value` is then deducted from the caller's allowance. +/// +/// Returns a boolean value indicating whether the operation succeeded. +/// +/// Emits a [`Transfer`] event. +#[inline] +pub fn transfer_from(id: TokenId, from: Address, to: Address, value: U256) -> Result { + ensure!(from != Address::zero(), ERC20InvalidSender(from)); + ensure!(to != Address::zero() && to != from, ERC20InvalidReceiver(to)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, id); + let mut precompile: contract_ref!(Erc20, Pop) = address.into(); + Ok(precompile.transferFrom(from, to, value)) + + // let selector = 0x23b872dd_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(from).push_arg(to).push_arg(value)) + // .returns::() + // .invoke()) +} + +/// Extensions to the ERC-20 standard. +pub mod extensions { + use super::*; + + /// Interface for the optional metadata functions from the ERC-20 standard. + #[ink::trait_definition] + pub trait Erc20Metadata { + /// Returns the name of the token. + #[ink(message)] + fn name(&self) -> String; + + /// Returns the symbol of the token. + #[ink(message)] + fn symbol(&self) -> String; + + /// Returns the decimals places of the token. + #[ink(message)] + fn decimals(&self) -> u8; + } + + /// Returns the name of the token. + #[inline] + pub fn name(id: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + precompile.name() + + // let selector = 0x06fdde03_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector)) + // .returns::() + // .invoke() + } + + /// Returns the symbol of the token. + #[inline] + pub fn symbol(id: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + precompile.symbol() + + // let selector = 0x95d89b41_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector)) + // .returns::() + // .invoke() + } + + /// Returns the decimals places of the token. + #[inline] + pub fn decimals(id: TokenId) -> u8 { + let address = prefixed_address(PRECOMPILE, id); + let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + precompile.decimals() + + // let selector = 0x313ce567_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector)) + // .returns::() + // .invoke() + } +} + +// NOTE: subject to change based on ink!'s support for solidity custom errors. +pub enum Error { + /// Indicates a failure with the `spender`’s `allowance`. + InsufficientAllowance(ERC20InsufficientAllowance), + /// Indicates an error related to the current `balance` of a `sender`. + InsufficientBalance(ERC20InsufficientBalance), + /// Indicates an error related to a specified `value`. + InsufficientValue(ERC20InsufficientValue), + /// Indicates a failure with the `approver` of a token to be approved. + InvalidApprover(ERC20InvalidApprover), + /// Indicates a failure with the token `receiver`. + InvalidReceiver(ERC20InvalidReceiver), + /// Indicates a failure with the token `sender`. + InvalidSender(ERC20InvalidSender), +} + +impl<'a> SolEncode<'a> for Error { + type SolType = (); + + fn encode(&'a self) -> Vec { + use Error::*; + match self { + InsufficientAllowance(e) => e.abi_encode(), + InsufficientBalance(e) => e.abi_encode(), + InsufficientValue(e) => e.abi_encode(), + InvalidApprover(e) => e.abi_encode(), + InvalidReceiver(e) => e.abi_encode(), + InvalidSender(e) => e.abi_encode(), + } + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } +} + +/// Standard ERC-20 errors. +// See https://eips.ethereum.org/EIPS/eip-6093 for more details. +mod errors { + use super::*; + + /// Indicates a failure with the `spender`’s `allowance`. + pub struct ERC20InsufficientAllowance(pub Address, pub U256, pub U256); + impl SolError for ERC20InsufficientAllowance { + type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [251, 143, 65, 178]; + const SIGNATURE: &'static str = "ERC20InsufficientAllowance(address,uint256,uint256)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self( + Address::from(*tuple.0 .0), + U256::from_little_endian(tuple.1.as_le_slice()), + U256::from_little_endian(tuple.2.as_le_slice()), + ) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + self.0.to_sol_type().tokenize(), + self.1.to_sol_type().tokenize(), + self.2.to_sol_type().tokenize(), + ) + } + } + + /// Indicates an error related to the current `balance` of a `sender`. + pub struct ERC20InsufficientBalance(pub Address, pub U256, pub U256); + impl SolError for ERC20InsufficientBalance { + type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [228, 80, 211, 140]; + const SIGNATURE: &'static str = "ERC20InsufficientBalance(address,uint256,uint256)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self( + Address::from(*tuple.0 .0), + U256::from_little_endian(tuple.1.as_le_slice()), + U256::from_little_endian(tuple.2.as_le_slice()), + ) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + self.0.to_sol_type().tokenize(), + self.1.to_sol_type().tokenize(), + self.2.to_sol_type().tokenize(), + ) + } + } + + /// Indicates an error related to a specified `value`. + pub struct ERC20InsufficientValue; + impl SolError for ERC20InsufficientValue { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [191, 254, 152, 173]; + const SIGNATURE: &'static str = "ERC20InsufficientValue()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: ERC20InsufficientValue) -> Self { + Self::InsufficientValue(value) + } + } + + /// Indicates a failure with the `approver` of a token to be approved. + pub struct ERC20InvalidApprover(pub Address); + impl SolError for ERC20InvalidApprover { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [230, 2, 223, 5]; + const SIGNATURE: &'static str = "ERC20InvalidApprover(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } + } + impl From for Error { + fn from(value: ERC20InvalidApprover) -> Self { + Self::InvalidApprover(value) + } + } + + /// Indicates a failure with the token `sender`. + pub struct ERC20InvalidSender(pub Address); + impl SolError for ERC20InvalidSender { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [150, 198, 253, 30]; + const SIGNATURE: &'static str = "ERC20InvalidSender(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } + } + impl From for Error { + fn from(value: ERC20InvalidSender) -> Self { + Self::InvalidSender(value) + } + } + + /// Indicates a failure with the token `receiver`. + pub struct ERC20InvalidReceiver(pub Address); + impl SolError for ERC20InvalidReceiver { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [236u8, 68u8, 47u8, 5u8]; + const SIGNATURE: &'static str = "ERC20InvalidReceiver(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } + } + + impl<'a> SolEncode<'a> for ERC20InvalidReceiver { + type SolType = (&'a Address,); + + #[inline] + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + #[inline] + fn to_sol_type(&'a self) -> Self::SolType { + (&self.0,) + } + } + impl From for Error { + fn from(value: ERC20InvalidReceiver) -> Self { + Self::InvalidReceiver(value) + } + } + + #[test] + fn error_encoding_works() { + for (result, expected) in [ + ( + ERC20InsufficientAllowance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), + "fb8f41b2000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InsufficientBalance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), + "e450d38c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ), + (ERC20InsufficientValue.abi_encode(),"bffe98ad"), + ( + ERC20InvalidApprover([255u8; 20].into()).abi_encode(), + "e602df05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InvalidReceiver([255u8; 20].into()).abi_encode(), + "ec442f05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InvalidSender([255u8; 20].into()).abi_encode(), + "96c6fd1e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ] { + assert_eq!(hex::encode(result), expected) + } + } +} diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs new file mode 100644 index 000000000..f176bd1c4 --- /dev/null +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -0,0 +1,585 @@ +use alloy_sol_types::{ + sol_data::{Address as SolAddress, Uint}, + SolError, SolType, +}; +pub use erc20::{Approval, Transfer}; +pub use errors::*; +use ink::{ + contract_ref, + prelude::{string::String, vec::Vec}, + primitives::sol::SolTypeEncode, + U256, +}; + +pub use super::revert; +use super::*; + +/// APIs for fungible tokens conforming to the ERC20 standard. +pub mod erc20; + +const PRECOMPILE: u16 = 100; + +pub type TokenId = u32; + +/// The fungibles precompile offers a streamlined interface for interacting with fungible +/// tokens. The goal is to provide a simplified, consistent API that adheres to standards in +/// the smart contract space. +#[ink::trait_definition] +pub trait Fungibles { + /// Create a new token with an automatically generated identifier. + #[ink(message)] + fn create(&self, admin: Address, min_balance: U256) -> TokenId; + + /// Set the metadata for a token. + #[ink(message)] + #[allow(non_snake_case)] + fn setMetadata(&self, id: TokenId, name: String, symbol: String, decimals: u8); + + /// Clear the metadata for a token. + #[ink(message)] + #[allow(non_snake_case)] + fn clearMetadata(&self, id: TokenId); + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total + /// supply. + #[ink(message)] + fn mint(&self, id: TokenId, account: Address, value: U256); + + /// Transfers `value` amount of tokens from the caller's account to account `to`. + #[ink(message)] + fn transfer(&self, id: TokenId, to: Address, value: U256); + + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + #[ink(message)] + fn approve(&self, id: TokenId, spender: Address, value: U256); + + /// Transfers `value` amount tokens on behalf of `from` to account `to`. + #[ink(message)] + #[allow(non_snake_case)] + fn transferFrom(&self, id: TokenId, from: Address, to: Address, value: U256); + + /// Destroys `value` amount of tokens from `account`, reducing the total supply. + #[ink(message)] + fn burn(&self, id: TokenId, address: Address, value: U256); + + /// Start the process of destroying a token. + #[ink(message)] + #[allow(non_snake_case)] + fn startDestroy(&self, id: TokenId); + + /// Whether a specified token exists. + #[ink(message)] + fn exists(&self, id: TokenId) -> bool; +} + +/// Create a new token with an automatically generated identifier. +/// +/// # Parameters +/// - `admin` - The account that will administer the token. +/// - `min_balance` - The minimum balance required for accounts holding this token. +/// +/// NOTE: The minimum balance must be non-zero. +#[inline] +pub fn create(admin: Address, min_balance: U256) -> Result { + ensure!(admin != Address::zero(), ZeroAdminAddress); + ensure!(min_balance != U256::zero(), MinBalanceZero); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.create(admin, min_balance)) + + // // WORKAROUND: + // let selector = 0x0ecaea73_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(admin).push_arg(min_balance)) + // .returns::() + // .invoke()) +} + +/// Set the metadata for a token. +#[inline] +pub fn set_metadata(id: TokenId, name: String, symbol: String, decimals: u8) { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.setMetadata(id, name, symbol, decimals) + + // // WORKAROUND: + // let selector = 0xdc331b70_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input( + // ExecutionInput::new(selector) + // .push_arg(id) + // .push_arg(name) + // .push_arg(symbol) + // .push_arg(decimals), + // ) + // .returns::<()>() + // .invoke() +} + +/// Clear the metadata for a token. +#[inline] +pub fn clear_metadata(id: TokenId) { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.clearMetadata(id) + + // // WORKAROUND: + // let selector = 0xc4e4005a_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id)) + // .returns::<()>() + // .invoke() +} + +/// Creates `value` amount of tokens and assigns them to `account`, increasing the total +/// supply. +#[inline] +pub fn mint(id: TokenId, account: Address, value: U256) -> Result<(), Error> { + ensure!(account != Address::zero(), ZeroRecipientAddress); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.mint(id, account, value)) + + // // WORKAROUND: + // let selector = 0x79d9b87b_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value)) + // .returns() + // .invoke()) +} + +/// Transfers `value` amount of tokens from the caller's account to account `to`. +#[inline] +pub fn transfer(id: TokenId, to: Address, value: U256) -> Result<(), Error> { + ensure!(to != Address::zero(), ZeroRecipientAddress); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.transfer(id, to, value)) + + // // WORKAROUND: + // let selector = 0xd09ae45_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(to).push_arg(value)) + // .returns::<()>() + // .invoke()) +} + +/// Approves `spender` to spend `value` amount of tokens on behalf of the caller. +#[inline] +pub fn approve(id: TokenId, spender: Address, value: U256) -> Result<(), Error> { + ensure!(spender != Address::zero(), ZeroRecipientAddress); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.approve(id, spender, value)) + + // // WORKAROUND: + // let selector = 0xf674e563_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(spender).push_arg(value)) + // .returns::<()>() + // .invoke()) +} + +/// Transfers `value` amount tokens on behalf of `from` to account `to`. +#[inline] +pub fn transfer_from(id: TokenId, from: Address, to: Address, value: U256) -> Result<(), Error> { + ensure!(from != Address::zero(), ZeroSenderAddress); + ensure!(to != Address::zero(), ZeroRecipientAddress); + ensure!(to != from, InvalidRecipient(to)); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.transferFrom(id, from, to, value)) + + // // WORKAROUND: + // let selector = 0x0f0bc28d_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input( + // ExecutionInput::new(selector) + // .push_arg(id) + // .push_arg(from) + // .push_arg(to) + // .push_arg(value), + // ) + // .returns::<()>() + // .invoke()) +} + +/// Destroys `value` amount of tokens from `account`, reducing the total supply. +#[inline] +pub fn burn(id: TokenId, account: Address, value: U256) -> Result<(), Error> { + ensure!(account != Address::zero(), ZeroSenderAddress); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.burn(id, account, value)) + + // // WORKAROUND: + // let selector = 0xc3ec6016_u32.to_be_bytes().into(); + // Ok(build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value)) + // .returns() + // .invoke()) +} + +/// Start the process of destroying a token. +#[inline] +pub fn start_destroy(id: TokenId) { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.startDestroy(id) + + // // WORKAROUND: + // let selector = 0x224f84a5_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id)) + // .returns::<()>() + // .invoke() +} + +/// Whether a specified token exists. +#[inline] +pub fn exists(id: TokenId) -> bool { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.exists(id) + + // // WORKAROUND: + // let selector = 0x13c369ed_u32.to_be_bytes().into(); + // build_call_solidity::() + // .call(address) + // .exec_input(ExecutionInput::new(selector).push_arg(id)) + // .returns::() + // .invoke() +} + +/// Returns the total token supply. +#[inline] +pub fn total_supply(id: TokenId) -> U256 { + erc20::total_supply(id) +} + +/// Returns the value of tokens owned by `account`. +#[inline] +pub fn balance_of(id: TokenId, account: Address) -> U256 { + erc20::balance_of(id, account) +} + +/// Returns the remaining number of tokens that `spender` will be allowed to spend +/// on behalf of `owner` through [`transfer_from`]. This is zero by default. +/// +/// This value changes when `approve` or [`transfer_from`] are called. +#[inline] +pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { + erc20::allowance(id, owner, spender) +} + +/// Returns the name of the token. +#[inline] +pub fn name(id: TokenId) -> String { + erc20::extensions::name(id) +} + +/// Returns the symbol of the token. +#[inline] +pub fn symbol(id: TokenId) -> String { + erc20::extensions::symbol(id) +} + +/// Returns the decimals places of the token. +#[inline] +pub fn decimals(id: TokenId) -> u8 { + erc20::extensions::decimals(id) +} + +// NOTE: subject to change based on ink!'s support for solidity custom errors. +pub enum Error { + /// The token recipient is invalid. + InvalidRecipient(InvalidRecipient), + /// The minimum balance should be non-zero. + MinBalanceZero(MinBalanceZero), + /// The signing account has no permission to do the operation. + NoPermission(NoPermission), + /// The `admin` address cannot be the zero address. + ZeroAdminAddress(ZeroAdminAddress), + /// The recipient cannot be the zero address. + ZeroRecipientAddress(ZeroRecipientAddress), + /// The sender cannot be the zero address. + ZeroSenderAddress(ZeroSenderAddress), + /// The specified `value` cannot be zero. + ZeroValue(ZeroValue), +} + +impl<'a> SolEncode<'a> for Error { + type SolType = (); + + fn encode(&'a self) -> Vec { + use Error::*; + match self { + InvalidRecipient(e) => e.abi_encode(), + MinBalanceZero(e) => e.abi_encode(), + NoPermission(e) => e.abi_encode(), + ZeroAdminAddress(e) => e.abi_encode(), + ZeroRecipientAddress(e) => e.abi_encode(), + ZeroSenderAddress(e) => e.abi_encode(), + ZeroValue(e) => e.abi_encode(), + } + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } +} + +mod errors { + use super::*; + + /// The token recipient is invalid. + pub struct InvalidRecipient(pub Address); + impl SolError for InvalidRecipient { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [23, 133, 139, 190]; + const SIGNATURE: &'static str = "InvalidRecipient(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self(Address::from(*tuple.0 .0)) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } + } + impl<'a> SolEncode<'a> for InvalidRecipient { + type SolType = (&'a Address,); + + #[inline] + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + #[inline] + fn to_sol_type(&'a self) -> Self::SolType { + (&self.0,) + } + } + impl From for Error { + fn from(value: InvalidRecipient) -> Self { + Self::InvalidRecipient(value) + } + } + + /// The minimum balance should be non-zero. + pub struct MinBalanceZero; + impl SolError for MinBalanceZero { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [95, 21, 97, 139]; + const SIGNATURE: &'static str = "MinBalanceZero()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: MinBalanceZero) -> Self { + Self::MinBalanceZero(value) + } + } + + /// The signing account has no permission to do the operation. + pub struct NoPermission; + impl SolError for NoPermission { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [157, 123, 54, 157]; + const SIGNATURE: &'static str = "NoPermission()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl<'a> SolEncode<'a> for NoPermission { + type SolType = (); + + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } + } + // impl<'a> SolDecode<'a> for NoPermission { + // type SolType = (); + + // fn decode(data: &[u8]) -> Result + // where + // Self: Sized, + // { + // } + + // fn from_sol_type(value: Self::SolType) -> Self { + // todo!() + // } + // } + + impl From for Error { + fn from(value: NoPermission) -> Self { + Self::NoPermission(value) + } + } + + /// The `admin` address cannot be the zero address. + pub struct ZeroAdminAddress; + impl SolError for ZeroAdminAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [62, 243, 155, 129]; + const SIGNATURE: &'static str = "ZeroAdminAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: ZeroAdminAddress) -> Self { + Self::ZeroAdminAddress(value) + } + } + + /// The recipient cannot be the zero address. + pub struct ZeroRecipientAddress; + impl SolError for ZeroRecipientAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [206, 239, 152, 87]; + const SIGNATURE: &'static str = "ZeroRecipientAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: ZeroRecipientAddress) -> Self { + Self::ZeroRecipientAddress(value) + } + } + + /// The sender cannot be the zero address. + pub struct ZeroSenderAddress; + impl SolError for ZeroSenderAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [255, 54, 43, 196]; + const SIGNATURE: &'static str = "ZeroSenderAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: ZeroSenderAddress) -> Self { + Self::ZeroSenderAddress(value) + } + } + + /// The `value` should be non-zero. + pub struct ZeroValue; + impl SolError for ZeroValue { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [124, 148, 110, 215]; + const SIGNATURE: &'static str = "ZeroValue()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + } + impl From for Error { + fn from(value: ZeroValue) -> Self { + Self::ZeroValue(value) + } + } + + #[test] + fn error_encoding_works() { + for (result, expected) in [ + ( + InvalidRecipient([255u8; 20].into()).abi_encode(), + "17858bbe000000000000000000000000ffffffffffffffffffffffffffffffffffffffff", + ), + (MinBalanceZero.abi_encode(), "5f15618b"), + (NoPermission.abi_encode(), "9d7b369d"), + (ZeroAdminAddress.abi_encode(), "3ef39b81"), + (ZeroRecipientAddress.abi_encode(), "ceef9857"), + (ZeroSenderAddress.abi_encode(), "ff362bc4"), + (ZeroValue.abi_encode(), "7c946ed7"), + ] { + assert_eq!(hex::encode(result), expected) + } + } +} diff --git a/pop-api-vnext/src/lib.rs b/pop-api-vnext/src/lib.rs index 8ec6bae61..d78785777 100644 --- a/pop-api-vnext/src/lib.rs +++ b/pop-api-vnext/src/lib.rs @@ -1,244 +1,24 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] -use ink::{ - env::{ - call::{build_call_solidity, ExecutionInput}, - DefaultEnvironment, - }, - prelude::vec::Vec, - Address, U256, -}; +use ink::{Address, SolEncode}; + +type Pop = ink::env::DefaultEnvironment; /// APIs for fungible tokens. #[cfg(feature = "fungibles")] -pub mod fungibles { - use super::*; - - const PRECOMPILE: u16 = 100; - - pub type TokenId = u32; - - /// Create a new token with an automatically generated identifier. - #[inline] - pub fn create(admin: Address, min_balance: U256) -> TokenId { - let address = fixed_address(PRECOMPILE); - - // GOAL: - // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); - // precompile.create(admin, min_balance) - - // WORKAROUND: - let selector = 0x0ecaea73_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector).push_arg(admin).push_arg(min_balance)) - .returns::() - .invoke() - } - - /// Whether a specified token exists. - #[inline] - pub fn exists(id: TokenId) -> bool { - let address = fixed_address(PRECOMPILE); - - // GOAL: - // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); - // precompile.exists(id) - - // WORKAROUND: - let selector = 0x13c369ed_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector).push_arg(id)) - .returns::() - .invoke() - } - - /// Creates `value` amount of tokens and assigns them to `account`, increasing the total - /// supply. - #[inline] - pub fn mint(id: TokenId, account: Address, value: U256) { - let address = fixed_address(PRECOMPILE); - - // GOAL: - // let precompile: ink::contract_ref!(Fungibles, DefaultEnvironment) = address.into(); - // precompile.mint(id, address, value) - - // WORKAROUND: - let selector = 0x79d9b87b_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input( - ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value), - ) - .returns::<()>() - .invoke() - } - - /// The fungibles precompile offers a streamlined interface for interacting with fungible - /// tokens. The goal is to provide a simplified, consistent API that adheres to standards in - /// the smart contract space. - #[ink::trait_definition] - pub trait Fungibles { - /// Create a new token with an automatically generated identifier. - #[ink(message)] - fn create(&self, admin: Address, min_balance: U256) -> TokenId; - - /// Set the metadata for a token. - #[ink(message)] - fn set_metadata(&self, id: TokenId, name: Vec, symbol: Vec, decimals: u8); - - /// Clear the metadata for a token. - #[ink(message)] - fn clear_metadata(&self, id: TokenId); - - /// Creates `value` amount of tokens and assigns them to `account`, increasing the total - /// supply. - #[ink(message)] - fn mint(&self, id: TokenId, account: Address, value: U256); - - /// Transfers `value` amount of tokens from the caller's account to account `to`. - #[ink(message)] - fn transfer(&self, id: TokenId, to: Address, value: U256); - - /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. - #[ink(message)] - fn approve(&self, id: TokenId, spender: Address, value: U256); - - /// Transfers `value` amount tokens on behalf of `from` to account `to`. - #[ink(message)] - fn transfer_from(&self, id: TokenId, from: Address, to: Address, value: U256); - - /// Destroys `value` amount of tokens from `account`, reducing the total supply. - #[ink(message)] - fn burn(&self, id: TokenId, address: Address, value: U256); +pub mod fungibles; - /// Start the process of destroying a token. - #[ink(message)] - fn start_destroy(&self, id: TokenId) -> bool; - - /// Whether a specified token exists. - #[ink(message)] - fn exists(&self, id: TokenId) -> bool; - } - - /// APIs for fungible tokens conforming to the ERC20 standard. - pub mod erc20 { - use super::*; - - const PRECOMPILE: u16 = 101; - - /// Returns the value of tokens in existence. - #[inline] - pub fn total_supply(id: TokenId) -> U256 { - let address = prefixed_address(PRECOMPILE, id); - let selector = 0x18160ddd_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector)) - .returns::() - .invoke() - } - - /// Returns the value of tokens owned by `account`. - #[inline] - pub fn balance_of(id: TokenId, account: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, id); - let selector = 0x70a08231_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector).push_arg(account)) - .returns::() - .invoke() - } - - /// Returns the remaining number of tokens that `spender` will be allowed to spend - /// on behalf of `owner` through [`transfer_from`]. This is zero by default. - /// - /// This value changes when `approve` or [`transfer_from`] are called. - #[inline] - pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, id); - let selector = 0xdd62ed3e_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector).push_arg(owner).push_arg(spender)) - .returns::() - .invoke() +#[macro_export] +macro_rules! ensure { + ( $x:expr, $y:expr $(,)? ) => {{ + if !$x { + return Err($y.into()); } - - /// Returns the value of tokens owned by `account`. - #[inline] - pub fn transfer(id: TokenId, to: Address, value: U256) -> bool { - let address = prefixed_address(PRECOMPILE, id); - let selector = 0x70a08231_u32.to_be_bytes().into(); - build_call_solidity::() - .call(address) - .exec_input(ExecutionInput::new(selector).push_arg(to).push_arg(value)) - .returns::() - .invoke() - } - - /// Emitted when the allowance of a `spender` for an `owner` is set by a call to - /// [`approve`]. `value` is the new allowance. - #[ink::event] - #[cfg_attr(feature = "std", derive(Debug))] - pub struct Approval { - /// The owner providing the allowance. - #[ink(topic)] - pub owner: Address, - /// The beneficiary of the allowance. - #[ink(topic)] - pub spender: Address, - /// The new allowance amount. - pub value: U256, - } - - /// Emitted when `value` tokens are moved from one account (`from`) to another (`to`). - /// - /// Note that `value` may be zero. - #[ink::event] - #[cfg_attr(feature = "std", derive(Debug))] - pub struct Transfer { - /// The source of the transfer. The zero address when minting. - #[ink(topic)] - pub from: Address, - /// The recipient of the transfer. The zero address when burning. - #[ink(topic)] - pub to: Address, - /// The amount transferred (or minted/burned). - pub value: U256, - } - - /// Interface of the ERC-20 standard. - #[ink::trait_definition] - pub trait Erc20 { - /// Returns the value of tokens in existence. - #[ink(message)] - #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector - fn totalSupply(&self) -> U256; - - /// Returns the value of tokens owned by `account`. - #[ink(message)] - #[allow(non_snake_case)] - fn balanceOf(&self, account: Address) -> U256; - - /// Returns the remaining number of tokens that `spender` will be allowed to spend - /// on behalf of `owner` through [`transfer_from`]. This is zero by default. - /// - /// This value changes when `approve` or `[`transfer_from`] are called. - #[ink(message)] - fn allowance(&self, owner: Address, spender: Address) -> U256; - - /// Moves a `value` amount of tokens from the caller's account to `to`. Returns a - /// boolean value indicating whether the operation succeeded. Emits a {Transfer} - /// event. - #[ink(message)] - fn transfer(&self, to: Address, value: U256) -> bool; - } - } + }}; } +/// Calculates the address of a precompile at index `n`. +#[inline] fn fixed_address(n: u16) -> Address { let shifted = (n as u32) << 16; @@ -252,12 +32,23 @@ fn fixed_address(n: u16) -> Address { address.into() } +/// Calculates the address of a precompile at index `n` and with some additional prefix. +#[inline] fn prefixed_address(n: u16, prefix: u32) -> Address { let mut address = fixed_address(n); address.0[..4].copy_from_slice(&prefix.to_be_bytes()); address } +/// Reverts the current contract execution, rolling back any changes and returning the specified +/// `error`. +// Helper until Solidity support added for Rust errors for automatic reversion based on returning an +// error. +pub fn revert(error: &impl for<'a> SolEncode<'a>) -> ! { + use ink::env::{return_value_solidity, ReturnFlags}; + return_value_solidity(ReturnFlags::REVERT, error) +} + #[test] fn fixed_address_works() { assert_eq!(hex::encode(fixed_address(100)), "0000000000000000000000000000000000640000") From 16d1a273d036de08a89e7235c33c55b0b6154db1 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 13 Jun 2025 13:33:47 +0100 Subject: [PATCH 052/162] test(devnet): improvements to fungibles precompile contract test --- runtime/devnet/src/config/contracts.rs | 36 ++++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 48558a359..d3b27230c 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -226,20 +226,20 @@ mod tests { }) } - // Currently ignored due to explicit dependency on built contract - #[ignore] #[test] fn fungibles_precompiles_via_contract_works() { let contract = include_bytes!( - "../../../../pop-api-vnext/examples/fungibles-vnext/target/ink/fungibles.polkavm" + "../../../../pop-api-vnext/examples/fungibles/target/ink/fungibles.polkavm" ); let caller = Alice.to_account_id(); let origin = RuntimeOrigin::signed(caller.clone()); - let origin_addr = primitives::Address::new(AccountId32Mapper::to_address(&caller).0); + let recipient = Bob.to_account_id(); + let recipient_addr = primitives::Address::new(AccountId32Mapper::to_address(&recipient).0); let minimum_value = U256::from(1); let endowment = primitives::U256::from(10_000); new_test_ext().execute_with(|| { assert_ok!(Revive::map_account(origin.clone())); + assert_ok!(Revive::map_account(RuntimeOrigin::signed(recipient))); // Instantiate contract with some value, required to create underlying asset let result = Revive::bare_instantiate( @@ -249,21 +249,23 @@ mod tests { DepositLimit::Unchecked, Code::Upload(contract.to_vec()), // Constructors are not yet using Solidity encoding - [blake_selector("new"), minimum_value.encode()].concat(), + [blake_selector("new"), ("Name", "SYMBOL", minimum_value, 10u8).encode()].concat(), None, ) .result .unwrap(); assert!(!result.result.did_revert()); + let contract = primitives::Address::new(result.addr.0); - // Interact with contract as Erc20 + // Mint some tokens to the contract call::<()>( origin.clone(), result.addr, - [keccak_selector("mint(address,uint256)"), (origin_addr, endowment).abi_encode()] + [keccak_selector("mint(address,uint256)"), (contract, endowment).abi_encode()] .concat(), ); + // Interact with contract as Erc20 let total_supply = call::( origin.clone(), result.addr, @@ -274,9 +276,27 @@ mod tests { let balance_of = call::( origin.clone(), result.addr, - [keccak_selector("balanceOf(address)"), (origin_addr,).abi_encode()].concat(), + [keccak_selector("balanceOf(address)"), (contract,).abi_encode()].concat(), ); assert_eq!(balance_of, endowment); + + // Transfer tokens from contract to recipient + let value = endowment / primitives::U256::from(2); + assert!(call::( + origin.clone(), + result.addr, + [ + keccak_selector("transfer(address,uint256)"), + (recipient_addr, value).abi_encode(), + ] + .concat(), + )); + let balance_of = call::( + origin.clone(), + result.addr, + [keccak_selector("balanceOf(address)"), (recipient_addr,).abi_encode()].concat(), + ); + assert_eq!(balance_of, value); }); fn call::RustType>>( From 7cdd5b51c9400822b1d3dbe1140884694c18fd17 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 13 Jun 2025 13:39:24 +0100 Subject: [PATCH 053/162] refactor(pop-api): remove redundant code for manual precompile calls --- pop-api-vnext/src/fungibles/erc20.rs | 64 ---------------- pop-api-vnext/src/fungibles/mod.rs | 106 --------------------------- 2 files changed, 170 deletions(-) diff --git a/pop-api-vnext/src/fungibles/erc20.rs b/pop-api-vnext/src/fungibles/erc20.rs index 8ef4aff4c..211982f15 100644 --- a/pop-api-vnext/src/fungibles/erc20.rs +++ b/pop-api-vnext/src/fungibles/erc20.rs @@ -93,13 +93,6 @@ pub fn total_supply(id: TokenId) -> U256 { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.totalSupply() - - // let selector = 0x18160ddd_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector)) - // .returns::() - // .invoke() } /// Returns the value of tokens owned by `account`. @@ -108,13 +101,6 @@ pub fn balance_of(id: TokenId, account: Address) -> U256 { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.balanceOf(account) - - // let selector = 0x70a08231_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(account)) - // .returns::() - // .invoke() } /// Returns the value of tokens owned by `account`. @@ -126,14 +112,6 @@ pub fn transfer(id: TokenId, to: Address, value: U256) -> Result { let address = prefixed_address(PRECOMPILE, id); let mut precompile: contract_ref!(Erc20, Pop) = address.into(); Ok(precompile.transfer(to, value)) - - // let selector = 0xa9059cbb_u32.to_be_bytes().into(); - // let result = build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(to).push_arg(value)) - // .returns::() - // .invoke(); - // Ok(result) } /// Returns the remaining number of tokens that `spender` will be allowed to spend @@ -145,13 +123,6 @@ pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.allowance(owner, spender) - - // let selector = 0xdd62ed3e_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(owner).push_arg(spender)) - // .returns::() - // .invoke() } /// Sets a `value` amount of tokens as the allowance of `spender` over the caller's @@ -168,13 +139,6 @@ pub fn approve(id: TokenId, spender: Address, value: U256) -> Result() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(spender).push_arg(value)) - // .returns::() - // .invoke()) } /// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. @@ -192,13 +156,6 @@ pub fn transfer_from(id: TokenId, from: Address, to: Address, value: U256) -> Re let address = prefixed_address(PRECOMPILE, id); let mut precompile: contract_ref!(Erc20, Pop) = address.into(); Ok(precompile.transferFrom(from, to, value)) - - // let selector = 0x23b872dd_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(from).push_arg(to).push_arg(value)) - // .returns::() - // .invoke()) } /// Extensions to the ERC-20 standard. @@ -227,13 +184,6 @@ pub mod extensions { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.name() - - // let selector = 0x06fdde03_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector)) - // .returns::() - // .invoke() } /// Returns the symbol of the token. @@ -242,13 +192,6 @@ pub mod extensions { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.symbol() - - // let selector = 0x95d89b41_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector)) - // .returns::() - // .invoke() } /// Returns the decimals places of the token. @@ -257,13 +200,6 @@ pub mod extensions { let address = prefixed_address(PRECOMPILE, id); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.decimals() - - // let selector = 0x313ce567_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector)) - // .returns::() - // .invoke() } } diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index f176bd1c4..cd286bbea 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -87,14 +87,6 @@ pub fn create(admin: Address, min_balance: U256) -> Result { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.create(admin, min_balance)) - - // // WORKAROUND: - // let selector = 0x0ecaea73_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(admin).push_arg(min_balance)) - // .returns::() - // .invoke()) } /// Set the metadata for a token. @@ -103,20 +95,6 @@ pub fn set_metadata(id: TokenId, name: String, symbol: String, decimals: u8) { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); precompile.setMetadata(id, name, symbol, decimals) - - // // WORKAROUND: - // let selector = 0xdc331b70_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input( - // ExecutionInput::new(selector) - // .push_arg(id) - // .push_arg(name) - // .push_arg(symbol) - // .push_arg(decimals), - // ) - // .returns::<()>() - // .invoke() } /// Clear the metadata for a token. @@ -125,14 +103,6 @@ pub fn clear_metadata(id: TokenId) { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); precompile.clearMetadata(id) - - // // WORKAROUND: - // let selector = 0xc4e4005a_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id)) - // .returns::<()>() - // .invoke() } /// Creates `value` amount of tokens and assigns them to `account`, increasing the total @@ -145,14 +115,6 @@ pub fn mint(id: TokenId, account: Address, value: U256) -> Result<(), Error> { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.mint(id, account, value)) - - // // WORKAROUND: - // let selector = 0x79d9b87b_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value)) - // .returns() - // .invoke()) } /// Transfers `value` amount of tokens from the caller's account to account `to`. @@ -164,14 +126,6 @@ pub fn transfer(id: TokenId, to: Address, value: U256) -> Result<(), Error> { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.transfer(id, to, value)) - - // // WORKAROUND: - // let selector = 0xd09ae45_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(to).push_arg(value)) - // .returns::<()>() - // .invoke()) } /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. @@ -183,14 +137,6 @@ pub fn approve(id: TokenId, spender: Address, value: U256) -> Result<(), Error> let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.approve(id, spender, value)) - - // // WORKAROUND: - // let selector = 0xf674e563_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(spender).push_arg(value)) - // .returns::<()>() - // .invoke()) } /// Transfers `value` amount tokens on behalf of `from` to account `to`. @@ -204,20 +150,6 @@ pub fn transfer_from(id: TokenId, from: Address, to: Address, value: U256) -> Re let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.transferFrom(id, from, to, value)) - - // // WORKAROUND: - // let selector = 0x0f0bc28d_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input( - // ExecutionInput::new(selector) - // .push_arg(id) - // .push_arg(from) - // .push_arg(to) - // .push_arg(value), - // ) - // .returns::<()>() - // .invoke()) } /// Destroys `value` amount of tokens from `account`, reducing the total supply. @@ -229,14 +161,6 @@ pub fn burn(id: TokenId, account: Address, value: U256) -> Result<(), Error> { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); Ok(precompile.burn(id, account, value)) - - // // WORKAROUND: - // let selector = 0xc3ec6016_u32.to_be_bytes().into(); - // Ok(build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id).push_arg(account).push_arg(value)) - // .returns() - // .invoke()) } /// Start the process of destroying a token. @@ -245,14 +169,6 @@ pub fn start_destroy(id: TokenId) { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); precompile.startDestroy(id) - - // // WORKAROUND: - // let selector = 0x224f84a5_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id)) - // .returns::<()>() - // .invoke() } /// Whether a specified token exists. @@ -261,14 +177,6 @@ pub fn exists(id: TokenId) -> bool { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); precompile.exists(id) - - // // WORKAROUND: - // let selector = 0x13c369ed_u32.to_be_bytes().into(); - // build_call_solidity::() - // .call(address) - // .exec_input(ExecutionInput::new(selector).push_arg(id)) - // .returns::() - // .invoke() } /// Returns the total token supply. @@ -445,20 +353,6 @@ mod errors { () } } - // impl<'a> SolDecode<'a> for NoPermission { - // type SolType = (); - - // fn decode(data: &[u8]) -> Result - // where - // Self: Sized, - // { - // } - - // fn from_sol_type(value: Self::SolType) -> Self { - // todo!() - // } - // } - impl From for Error { fn from(value: NoPermission) -> Self { Self::NoPermission(value) From 5e5be282c56d1f5f41dcf6834e33d32f9b207cb3 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 14 Jun 2025 09:49:08 +0100 Subject: [PATCH 054/162] refactor(fungibles): ensure feature parity with prior implementation --- pallets/api-vnext/src/fungibles/mod.rs | 80 +- .../src/fungibles/precompiles/erc20.rs | 165 ++-- .../precompiles/interfaces/IFungibles.sol | 173 +++- .../src/fungibles/precompiles/mod.rs | 793 ++++++++++++------ pop-api-vnext/examples/fungibles/lib.rs | 66 +- pop-api-vnext/src/fungibles/erc20.rs | 43 +- pop-api-vnext/src/fungibles/mod.rs | 381 +++++++-- runtime/devnet/src/config/contracts.rs | 10 +- 8 files changed, 1246 insertions(+), 465 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index 3131690cc..c93c6c995 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -1,8 +1,10 @@ use core::cmp::Ordering::{Equal, Greater, Less}; use frame_support::{ - dispatch::{DispatchResult, DispatchResultWithPostInfo, WithPostDispatchInfo}, - pallet_prelude::{DispatchError, Zero}, + dispatch::{ + DispatchErrorWithPostInfo, DispatchResult, DispatchResultWithPostInfo, WithPostDispatchInfo, + }, + pallet_prelude::{CheckedSub, DispatchError, Zero}, sp_runtime::Saturating, traits::fungibles::{approvals::Inspect as _, Inspect as _}, weights::Weight, @@ -94,10 +96,84 @@ fn create, I>( Ok(id) } +fn decrease_allowance, I>( + origin: OriginFor, + asset: AssetIdOf, + spender: AccountIdOf, + value: BalanceOf, +) -> Result<(BalanceOf, Option), DispatchErrorWithPostInfo> { + let owner = ensure_signed(origin.clone()).map_err(|e| { + e.with_weight( + // TODO: WeightOf::::approve(0, 0) + Weight::zero(), + ) + })?; + if value.is_zero() { + return Ok(( + value, + Some( + // TODO: WeightOf::::approve(0, 0) + Weight::zero(), + ), + )); + } + let current_allowance = >::allowance(asset.clone(), &owner, &spender); + let spender_source = T::Lookup::unlookup(spender.clone()); + let asset_param: >::AssetIdParameter = asset.clone().into(); + + // Cancel the approval and approve `new_allowance` if difference is more than zero. + let new_allowance = current_allowance + .checked_sub(&value) + .ok_or(pallet_assets::Error::::Unapproved)?; + >::cancel_approval(origin.clone(), asset_param.clone(), spender_source.clone()) + .map_err(|e| { + e.with_weight( + // TODO: WeightOf::::approve(0, 1) + Weight::zero(), + ) + })?; + let weight = if new_allowance.is_zero() { + // TODO: WeightOf::::approve(0, 1) + Weight::zero() + } else { + >::approve_transfer(origin, asset_param, spender_source, new_allowance)?; + // TODO: WeightOf::::approve(1, 1) + Weight::zero() + }; + Ok((new_allowance, Some(weight).into())) +} + fn exists, I>(asset: AssetIdOf) -> bool { >::asset_exists(asset) } +fn increase_allowance, I>( + origin: OriginFor, + asset: AssetIdOf, + spender: AccountIdOf, + value: BalanceOf, +) -> Result, DispatchErrorWithPostInfo> { + let owner = ensure_signed(origin.clone()).map_err(|e| { + e.with_weight( + // TODO: WeightOf::::approve(0, 0) + Weight::zero(), + ) + })?; + >::approve_transfer( + origin, + asset.clone().into(), + T::Lookup::unlookup(spender.clone()), + value, + ) + .map_err(|e| { + e.with_weight( + // TODO: AssetsWeightInfoOf::::approve_transfer() + Weight::zero(), + ) + })?; + Ok(>::allowance(asset, &owner, &spender)) +} + fn mint, I>( origin: OriginFor, asset: AssetIdOf, diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 7aef13f9e..785941d08 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -1,14 +1,18 @@ -use alloc::string::String; +use alloc::{string::String, vec::Vec}; use frame_support::{ sp_runtime::traits::AtLeast32Bit, traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, }; -use pallet_revive::precompiles::alloy::primitives::ruint::UintTryFrom; +use pallet_revive::AddressMapper as _; use AddressMatcher::Prefix; use IERC20::*; -use super::*; +use super::{ + deposit_event, prefixed_address, sol, to_runtime_origin, AddressMapper, AddressMatcher, + AssetIdExtractor, Assets, Config, Error, Ext, InlineAssetIdExtractor, NonZero, PhantomData, + Precompile, SolCall, UintTryFrom, UintTryTo, U256, +}; sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); @@ -36,19 +40,19 @@ where ) -> Result, Error> { use IERC20::{IERC20Calls::*, *}; - let id = InlineAssetIdExtractor::asset_id_from_address(address)?.into(); + let token = InlineAssetIdExtractor::asset_id_from_address(address)?.into(); match input { // IERC20 totalSupply(_) => { // TODO: charge based on benchmarked weight - let total_supply = U256::saturating_from(>::total_supply(id)); + let total_supply = U256::saturating_from(>::total_supply(token)); Ok(totalSupplyCall::abi_encode_returns(&(total_supply,))) }, balanceOf(balanceOfCall { account }) => { // TODO: charge based on benchmarked weight let account = env.to_account_id(&(*account.0).into()); - let balance = U256::saturating_from(>::balance(id, account)); + let balance = U256::saturating_from(>::balance(token, account)); Ok(balanceOfCall::abi_encode_returns(&(balance,))) }, transfer(transferCall { to, value }) => { @@ -57,7 +61,7 @@ where super::transfer::( to_runtime_origin(env.caller()), - id, + token, env.to_account_id(&(*to.0).into()), value.saturating_to(), )?; @@ -70,7 +74,7 @@ where let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); let remaining = - U256::saturating_from(>::allowance(id, &owner, &spender)); + U256::saturating_from(>::allowance(token, &owner, &spender)); Ok(allowanceCall::abi_encode_returns(&(remaining,))) }, approve(approveCall { spender, value }) => { @@ -79,7 +83,7 @@ where super::approve::( to_runtime_origin(env.caller()), - id, + token, env.to_account_id(&(*spender.0).into()), value.saturating_to(), ) // TODO: adjust weight @@ -92,9 +96,9 @@ where transferFrom(transferFromCall { from, to, value }) => { // TODO: charge based on benchmarked weight - transfer_from::( + super::transfer_from::( to_runtime_origin(env.caller()), - id, + token, env.to_account_id(&(*from.0).into()), env.to_account_id(&(*to.0).into()), value.saturating_to(), @@ -106,21 +110,21 @@ where // IERC20Metadata name(_) => { // TODO: charge based on benchmarked weight - let result = >::name(id); + let result = >::name(token); // TODO: improve let result = String::from_utf8_lossy(result.as_slice()); Ok(nameCall::abi_encode_returns(&(result,))) }, symbol(_) => { // TODO: charge based on benchmarked weight - let result = >::symbol(id); + let result = >::symbol(token); // TODO: improve let result = String::from_utf8_lossy(result.as_slice()); Ok(symbolCall::abi_encode_returns(&(result,))) }, decimals(_) => { // TODO: charge based on benchmarked weight - let result = >::decimals(id); + let result = >::decimals(token); Ok(decimalsCall::abi_encode_returns(&(result,))) }, } @@ -136,35 +140,41 @@ impl, I: 'static> Erc20 { #[cfg(test)] mod tests { use frame_support::{assert_ok, sp_runtime::app_crypto::sp_core::bytes::to_hex}; - use mock::Test; use pallet_assets::Instance1; use pallet_revive::{ - precompiles::{alloy::sol_types::SolType, ExtWithInfo}, + precompiles::{ + alloy::sol_types::{SolType, SolValue}, + ExtWithInfo, + }, test_utils::{ALICE, ALICE_ADDR, BOB, BOB_ADDR}, + Origin, }; use IERC20Calls::*; use IERC20::{Approval, Transfer}; use super::*; - use crate::mock::{ExtBuilder, RuntimeOrigin}; + use crate::{ + assert_last_event, + fungibles::approve, + mock::{Assets, ExtBuilder, RuntimeOrigin, Test}, + }; const ERC20: u16 = 101; - type Assets = mock::Assets; type Erc20 = super::Erc20; #[test] fn total_supply_works() { - let id = u32::MAX; + let token = u32::MAX; let total_supply = 10_000_000; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_balances(vec![(id, ALICE, total_supply)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, total_supply)]) .build_with_env(|mut call_setup| { assert_eq!( call_precompile::( &mut call_setup.ext().0, - id, + token, &totalSupply(totalSupplyCall {}) ) .unwrap(), @@ -175,44 +185,44 @@ mod tests { #[test] fn balance_of_works() { - let id = u32::MAX; + let token = u32::MAX; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_balances(vec![(id, ALICE, endowment)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) .build_with_env(|mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); assert_eq!( call_precompile::( &mut call_setup.ext().0, - id, + token, &balanceOf(balanceOfCall { account: ALICE_ADDR.0.into() }) ) .unwrap(), U256::from(endowment) ); - assert_eq!(Assets::balance(id, ALICE), endowment); + assert_eq!(Assets::balance(token, ALICE), endowment); }); } #[test] fn transfer_works() { - let id = u32::MAX; + let token = u32::MAX; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(id, BOB, true, 1)]) - .with_asset_balances(vec![(id, BOB, endowment)]) + .with_assets(vec![(token, BOB, true, 1)]) + .with_asset_balances(vec![(token, BOB, endowment)]) .build_with_env(|mut call_setup| { call_setup.set_origin(Origin::Signed(BOB)); - assert_eq!(Assets::balance(id, BOB), endowment); - assert_eq!(Assets::balance(id, ALICE), 0); + assert_eq!(Assets::balance(token, BOB), endowment); + assert_eq!(Assets::balance(token, ALICE), 0); let value = endowment / 2; assert!(call_precompile::( &mut call_setup.ext().0, - id, + token, &IERC20Calls::transfer(IERC20::transferCall { to: ALICE_ADDR.0.into(), value: U256::from(value) @@ -220,24 +230,24 @@ mod tests { ) .unwrap()); - assert_eq!(Assets::balance(id, BOB), endowment - value); - assert_eq!(Assets::balance(id, ALICE), value); + assert_eq!(Assets::balance(token, BOB), endowment - value); + assert_eq!(Assets::balance(token, ALICE), value); let from = BOB_ADDR.0.into(); let to = ALICE_ADDR.0.into(); let event = Transfer { from, to, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, id), event); + assert_last_event(prefixed_address(ERC20, token), event); }); } #[test] fn allowance_works() { - let id = u32::MAX; + let token = u32::MAX; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { - assert_ok!(super::approve::( + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), - id, + token, BOB, value )); @@ -245,7 +255,7 @@ mod tests { assert_eq!( call_precompile::( &mut call_setup.ext().0, - id, + token, &allowance(allowanceCall { owner: ALICE_ADDR.0.into(), spender: BOB_ADDR.0.into(), @@ -260,17 +270,17 @@ mod tests { #[test] fn approve_works() { - let id = u32::MAX; + let token = u32::MAX; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::allowance(id, &ALICE, &BOB), 0); + assert_eq!(Assets::allowance(token, &ALICE, &BOB), 0); assert!(call_precompile::( &mut call_setup.ext().0, - id, + token, &IERC20Calls::approve(IERC20::approveCall { spender: BOB_ADDR.0.into(), value: U256::from(value) @@ -278,29 +288,29 @@ mod tests { ) .unwrap()); - assert_eq!(Assets::allowance(id, &ALICE, &BOB), value); + assert_eq!(Assets::allowance(token, &ALICE, &BOB), value); let owner = ALICE_ADDR.0.into(); let spender = BOB_ADDR.0.into(); let event = Approval { owner, spender, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, id), event); + assert_last_event(prefixed_address(ERC20, token), event); }, ); } #[test] fn transfer_from_works() { - let id = u32::MAX; + let token = u32::MAX; let endowment = 10_000_000; let value = endowment / 2; ExtBuilder::new() - .with_assets(vec![(id, ALICE, true, 1)]) - .with_asset_balances(vec![(id, ALICE, endowment)]) + .with_assets(vec![(token, ALICE, true, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) .build_with_env(|mut call_setup| { - assert_eq!(Assets::balance(id, ALICE), endowment); - assert_eq!(Assets::balance(id, BOB), 0); - assert_ok!(super::approve::( + assert_eq!(Assets::balance(token, ALICE), endowment); + assert_eq!(Assets::balance(token, BOB), 0); + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), - id, + token, BOB, value )); @@ -308,7 +318,7 @@ mod tests { assert!(call_precompile::( &mut call_setup.ext().0, - id, + token, &transferFrom(IERC20::transferFromCall { from: ALICE_ADDR.0.into(), to: BOB_ADDR.0.into(), @@ -317,25 +327,25 @@ mod tests { ) .unwrap()); - assert_eq!(Assets::balance(id, ALICE), endowment - value); - assert_eq!(Assets::balance(id, BOB), value); + assert_eq!(Assets::balance(token, ALICE), endowment - value); + assert_eq!(Assets::balance(token, BOB), value); let from = ALICE_ADDR.0.into(); let to = BOB_ADDR.0.into(); let event = Transfer { from, to, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, id), event); + assert_last_event(prefixed_address(ERC20, token), event); }); } #[test] fn name_works() { - let id = u32::MAX; + let token = u32::MAX; let _name = "name"; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_metadata(vec![(id, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) .build_with_env(|mut call_setup| { assert_eq!( - call_precompile::(&mut call_setup.ext().0, id, &name(nameCall {})) + call_precompile::(&mut call_setup.ext().0, token, &name(nameCall {})) .unwrap() .as_str(), _name @@ -345,16 +355,20 @@ mod tests { #[test] fn symbol_works() { - let id = u32::MAX; + let token = u32::MAX; let _symbol = "symbol"; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_metadata(vec![(id, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) .build_with_env(|mut call_setup| { assert_eq!( - call_precompile::(&mut call_setup.ext().0, id, &symbol(symbolCall {})) - .unwrap() - .as_str(), + call_precompile::( + &mut call_setup.ext().0, + token, + &symbol(symbolCall {}) + ) + .unwrap() + .as_str(), _symbol ); }); @@ -362,15 +376,16 @@ mod tests { #[test] fn decimals_works() { - let id = u32::MAX; + let token = u32::MAX; let _decimals = u8::MAX; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_metadata(vec![(id, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) .build_with_env(|mut call_setup| { let mut ext = call_setup.ext().0; assert_eq!( - call_precompile::(&mut ext, id, &decimals(decimalsCall {})).unwrap() as u8, + call_precompile::(&mut ext, token, &decimals(decimalsCall {})).unwrap() + as u8, _decimals ); }); @@ -384,10 +399,10 @@ mod tests { } fn call_precompile::RustType>>( - ext: &mut impl ExtWithInfo, - id: u32, + ext: &mut impl ExtWithInfo, + token: u32, input: &IERC20Calls, ) -> Result { - super::call_precompile::(ext, &prefixed_address(ERC20, id), input) + crate::call_precompile::(ext, &prefixed_address(ERC20, token), input) } } diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol index a27864dab..99719f137 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol @@ -1,11 +1,71 @@ /** - * @dev The fungibles precompile offers a streamlined interface for interacting with fungible tokens. The goal is to - * provide a simplified, consistent API that adheres to standards in the smart contract space. + * @title The fungibles precompile offers a streamlined interface for interacting with fungible + * tokens. The goal is to provide a simplified, consistent API that adheres to standards in the + * smart contract space. */ // TODO: consider size of id -> uint256 (word) interface IFungibles { /** - * @dev Create a new token with an automatically generated identifier. + * @notice Transfers `value` amount of tokens from the caller's account to account `to`. + * @param token The token to transfer. + * @param to The recipient account. + * @param value The number of tokens to transfer. + */ + function transfer(uint32 token, address to, uint256 value) external; + + /** + * @notice Transfers `value` amount tokens on behalf of `from` to account `to`. + * @param token The token to transfer. + * @param from The account from which the token balance will be withdrawn. + * @param to The recipient account. + * @param value The number of tokens to transfer. + */ + function transferFrom( + uint32 token, + address from, + address to, + uint256 value + ) external; + + /** + * @notice Approves `spender` to spend `value` amount of tokens on behalf of the caller. + * @param token The token to approve. + * @param spender The account that is allowed to spend the tokens. + * @param value The number of tokens to approve. + */ + function approve(uint32 token, address spender, uint256 value) external; + + /** + * @notice Increases the allowance of `spender` by `value` amount of tokens. + * @param token The token to have an allowance increased. + * @param spender The account that is allowed to spend the tokens. + * @param value The number of tokens to increase the allowance by. + * @return allowance The resulting allowance of `spender`. + */ + function increaseAllowance( + uint32 token, + address spender, + uint256 value + ) external returns (uint256 allowance); + + /** + * @notice Decreases the allowance of `spender` by `value` amount of tokens. + * @param token The token to have an allowance decreased. + * @param spender The account that is allowed to spend the tokens. + * @param value The number of tokens to decrease the allowance by. + * @return allowance The resulting allowance of `spender`. + */ + function decreaseAllowance( + uint32 token, + address spender, + uint256 value + ) external returns (uint256 allowance); + + /** + * @notice Create a new token with an automatically generated identifier. + * @param admin The account that will administer the token. + * @param minBalance The minimum balance required for accounts holding this token. + * @return id The resulting identifier of the token. */ function create( address admin, @@ -13,75 +73,124 @@ interface IFungibles { ) external returns (uint32 id); /** - * @dev Set the metadata for a token. + * @notice Start the process of destroying a token. + * @dev See `pallet-assets` documentation for more information. Related dispatchables are`destroy_accounts`, `destroy_approvals`, `finish_destroy`. + * @param token The token to be destroyed. + */ + function startDestroy(uint32 token) external; + + /** + * @notice Set the metadata for a token. + * @param token The token to update. + * @param name The user friendly name of this token. + * @param symbol The exchange symbol for this token. + * @param decimals The number of decimals this token uses to represent one unit. */ function setMetadata( - uint32 id, + uint32 token, string calldata name, string calldata symbol, uint8 decimals ) external; /** - * @dev Clear the metadata for a token. + * @notice Clear the metadata for a token. + * @param token The token to update. */ - function clearMetadata(uint32 id) external; + function clearMetadata(uint32 token) external; /** - * @dev Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + * @notice Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + * @param token The token to mint. + * @param token The account to be credited with the created tokens. + * @param value The number of tokens to mint. */ - function mint(uint32 id, address account, uint256 value) external; + function mint(uint32 token, address account, uint256 value) external; /** - * @dev Transfers `value` amount of tokens from the caller's account to account `to`. + * @notice Destroys `value` amount of tokens from `account`, reducing the total supply. + * @param token The token to burn. + * @param account The account from which the tokens will be destroyed. + * @param value The number of tokens to destroy. */ - function transfer(uint32 id, address to, uint256 value) external; + function burn(uint32 token, address account, uint256 value) external; /** - * @dev Approves `spender` to spend `value` amount of tokens on behalf of the caller. + * @notice Total token supply for a specified token. + * @param token The token. */ - function approve(uint32 id, address spender, uint256 value) external; + function totalSupply(uint32 token) external view returns (uint256); /** - * @dev Transfers `value` amount tokens on behalf of `from` to account `to`. + * @notice Account balance for a specified `token` and `owner`. + * @param token The token. + * @param owner The owner of the token. */ - function transferFrom( - uint32 id, - address from, - address to, - uint256 value - ) external; + function balanceOf( + uint32 token, + address owner + ) external view returns (uint256); /** - * @dev Destroys `value` amount of tokens from `account`, reducing the total supply. + * @notice Allowance for a `spender` approved by an `owner`, for a specified `token`. + * @param token The token. + * @param owner The owner of the token. + * @param spender The spender with an allowance. */ - function burn(uint32 id, address account, uint256 value) external; + function allowance( + uint32 token, + address owner, + address spender + ) external view returns (uint256); /** - * @dev Start the process of destroying a token. + * @notice Name of the specified token. */ - function startDestroy(uint32 id) external; + function name(uint32 token) external view returns (string memory); /** - * @dev Whether a specified token exists. + * @notice Symbol for the specified token. */ - function exists(uint32 id) external view returns (bool); + function symbol(uint32 token) external view returns (string memory); /** - * @dev Event emitted when allowance by `owner` to `spender` changes. + * @notice Decimals for the specified token. */ - event Approval(uint32 id, address owner, address spender, uint256 value); + function decimals(uint32 token) external view returns (uint8); + /** - * @dev Event emitted when a token is created. + * @notice Whether the specified token exists. */ - event Created(uint32 id, address creator, address admin); + function exists(uint32 token) external view returns (bool); + + /** + * @notice Event emitted when allowance by `owner` to `spender` changes. + * @param token The token. + * @param owner The owner providing the allowance. + * @param spender The beneficiary of the allowance. + * @param value The new allowance amount. + */ + event Approval(uint32 token, address owner, address spender, uint256 value); + /** - * @dev Event emitted when a token transfer occurs. + * @notice Event emitted when a token transfer occurs. + * @param token The token. + * @param from The source of the transfer. The zero address when minting. + * @param to The recipient of the transfer. The zero address when burning. + * @param value The amount transferred (or minted/burned). */ event Transfer( - uint32 indexed id, + uint32 indexed token, address indexed from, address indexed to, uint256 value ); + + /** + * @notice Event emitted when a token is created. + * @param id The token identifier. + * @param creator The creator of the token. + * @param admin The administrator of the token. + */ + event Created(uint32 id, address creator, address admin); } diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index f5f61bf76..bb2309d8e 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -1,6 +1,12 @@ +use alloc::string::String; + pub use erc20::{Erc20, IERC20}; +use frame_support::traits::fungibles::metadata::Inspect as _; use pallet_revive::precompiles::alloy::{ - primitives::{ruint::UintTryTo, Address}, + primitives::{ + ruint::{UintTryFrom, UintTryTo}, + Address, + }, sol_types::SolCall, }; use IFungibles::*; @@ -23,7 +29,7 @@ impl< I: 'static, > Precompile for Fungibles where - U256: UintTryTo<>::Balance>, + U256: UintTryFrom + UintTryTo<>::Balance>, { type Interface = IFungiblesCalls; type T = T; @@ -37,88 +43,155 @@ where input: &Self::Interface, env: &mut impl Ext, ) -> Result, Error> { - use IFungibles::IFungiblesCalls::*; match input { - create(createCall { admin, minBalance }) => { + IFungiblesCalls::transfer(transferCall { token, to, value }) => { // TODO: charge based on benchmarked weight - let creator = >::to_address(env.caller().account_id()?).0.into(); + let from = >::to_address(env.caller().account_id()?).0.into(); - let id = self::create::( + self::transfer::( to_runtime_origin(env.caller()), - env.to_account_id(&(*admin.0).into()), - minBalance.saturating_to(), - )? - .into(); + (*token).into(), + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; - deposit_event(env, address, Created { id, creator, admin: *admin }); - Ok(createCall::abi_encode_returns(&(id,))) + deposit_event( + env, + address, + Transfer { token: *token, from, to: *to, value: *value }, + ); + Ok(transferCall::abi_encode_returns(&())) }, - mint(mintCall { id, account, value }) => { + IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { // TODO: charge based on benchmarked weight - self::mint::( + transfer_from::( to_runtime_origin(env.caller()), - (*id).into(), - env.to_account_id(&(*account.0).into()), + (*token).into(), + env.to_account_id(&(*from.0).into()), + env.to_account_id(&(*to.0).into()), value.saturating_to(), )?; - let from = Address::default(); - let to = *account; - deposit_event(env, address, Transfer { id: *id, from, to, value: *value }); - Ok(mintCall::abi_encode_returns(&())) + let value = *value; + deposit_event( + env, + address, + Transfer { token: *token, from: *from, to: *to, value }, + ); + Ok(transferFromCall::abi_encode_returns(&())) }, - transfer(transferCall { id, to, value }) => { + IFungiblesCalls::approve(approveCall { token, spender, value }) => { // TODO: charge based on benchmarked weight - let from = >::to_address(env.caller().account_id()?).0.into(); + let owner = >::to_address(env.caller().account_id()?).0.into(); - self::transfer::( + self::approve::( to_runtime_origin(env.caller()), - (*id).into(), - env.to_account_id(&(*to.0).into()), + (*token).into(), + env.to_account_id(&(*spender.0).into()), value.saturating_to(), - )?; + ) // TODO: adjust weight + .map_err(|e| e.error)?; - deposit_event(env, address, Transfer { id: *id, from, to: *to, value: *value }); - Ok(transferCall::abi_encode_returns(&())) + let spender = *spender; + deposit_event( + env, + address, + Approval { token: *token, owner, spender, value: *value }, + ); + Ok(approveCall::abi_encode_returns(&())) }, - approve(approveCall { id, spender, value }) => { + IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { // TODO: charge based on benchmarked weight let owner = >::to_address(env.caller().account_id()?).0.into(); - self::approve::( + let value = U256::saturating_from( + self::increase_allowance::( + to_runtime_origin(env.caller()), + (*token).into(), + env.to_account_id(&(*spender.0).into()), + value.saturating_to(), + ) // TODO: adjust weight + .map_err(|e| e.error)?, + ); + + let spender = *spender; + deposit_event(env, address, Approval { token: *token, owner, spender, value }); + Ok(increaseAllowanceCall::abi_encode_returns(&(value,))) + }, + IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { token, spender, value }) => { + // TODO: charge based on benchmarked weight + let owner = >::to_address(env.caller().account_id()?).0.into(); + + let (value, weight) = self::decrease_allowance::( to_runtime_origin(env.caller()), - (*id).into(), + (*token).into(), env.to_account_id(&(*spender.0).into()), value.saturating_to(), ) // TODO: adjust weight .map_err(|e| e.error)?; + let value = U256::saturating_from(value); let spender = *spender; - deposit_event(env, address, Approval { id: *id, owner, spender, value: *value }); - Ok(approveCall::abi_encode_returns(&())) + deposit_event(env, address, Approval { token: *token, owner, spender, value }); + Ok(decreaseAllowanceCall::abi_encode_returns(&(value,))) }, - transferFrom(transferFromCall { id, from, to, value }) => { + IFungiblesCalls::create(createCall { admin, minBalance }) => { // TODO: charge based on benchmarked weight + let creator = >::to_address(env.caller().account_id()?).0.into(); - transfer_from::( + let id = self::create::( to_runtime_origin(env.caller()), - (*id).into(), - env.to_account_id(&(*from.0).into()), - env.to_account_id(&(*to.0).into()), + env.to_account_id(&(*admin.0).into()), + minBalance.saturating_to(), + )? + .into(); + + deposit_event(env, address, Created { id, creator, admin: *admin }); + Ok(createCall::abi_encode_returns(&(id,))) + }, + IFungiblesCalls::startDestroy(startDestroyCall { token }) => { + // TODO: charge based on benchmarked weight + start_destroy::(to_runtime_origin(env.caller()), (*token).into())?; + Ok(startDestroyCall::abi_encode_returns(&())) + }, + IFungiblesCalls::setMetadata(setMetadataCall { token, name, symbol, decimals }) => { + // TODO: charge based on benchmarked weight + set_metadata::( + to_runtime_origin(env.caller()), + (*token).into(), + name.as_bytes().to_vec(), + symbol.as_bytes().to_vec(), + *decimals, + )?; + Ok(setMetadataCall::abi_encode_returns(&())) + }, + IFungiblesCalls::clearMetadata(clearMetadataCall { token }) => { + // TODO: charge based on benchmarked weight + clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; + Ok(clearMetadataCall::abi_encode_returns(&())) + }, + IFungiblesCalls::mint(mintCall { token, account, value }) => { + // TODO: charge based on benchmarked weight + + self::mint::( + to_runtime_origin(env.caller()), + (*token).into(), + env.to_account_id(&(*account.0).into()), value.saturating_to(), )?; - let value = *value; - deposit_event(env, address, Transfer { id: *id, from: *from, to: *to, value }); - Ok(transferFromCall::abi_encode_returns(&())) + let from = Address::default(); + let to = *account; + deposit_event(env, address, Transfer { token: *token, from, to, value: *value }); + Ok(mintCall::abi_encode_returns(&())) }, - burn(burnCall { id, account, value }) => { + IFungiblesCalls::burn(burnCall { token, account, value }) => { // TODO: charge based on benchmarked weight self::burn::( to_runtime_origin(env.caller()), - (*id).into(), + (*token).into(), env.to_account_id(&(*account.0).into()), value.saturating_to(), ) // TODO: adjust weight @@ -126,33 +199,60 @@ where let from = account; let to = Address::default(); - deposit_event(env, address, Transfer { id: *id, from: *from, to, value: *value }); + deposit_event( + env, + address, + Transfer { token: *token, from: *from, to, value: *value }, + ); Ok(burnCall::abi_encode_returns(&())) }, - startDestroy(startDestroyCall { id }) => { + IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { // TODO: charge based on benchmarked weight - start_destroy::(to_runtime_origin(env.caller()), (*id).into())?; - Ok(startDestroyCall::abi_encode_returns(&())) + let total_supply = + U256::saturating_from(>::total_supply((*token).into())); + Ok(totalSupplyCall::abi_encode_returns(&(total_supply,))) }, - exists(existsCall { id }) => { - let result = self::exists::((*id).into()); - Ok(existsCall::abi_encode_returns(&(result,))) + IFungiblesCalls::balanceOf(balanceOfCall { token, owner }) => { + // TODO: charge based on benchmarked weight + let account = env.to_account_id(&(*owner.0).into()); + let balance = + U256::saturating_from(>::balance((*token).into(), account)); + Ok(balanceOfCall::abi_encode_returns(&(balance,))) }, - setMetadata(setMetadataCall { id, name, symbol, decimals }) => { + IFungiblesCalls::allowance(allowanceCall { token, owner, spender }) => { // TODO: charge based on benchmarked weight - set_metadata::( - to_runtime_origin(env.caller()), - (*id).into(), - name.as_bytes().to_vec(), - symbol.as_bytes().to_vec(), - *decimals, - )?; - Ok(setMetadataCall::abi_encode_returns(&())) + let owner = env.to_account_id(&(*owner.0).into()); + let spender = env.to_account_id(&(*spender.0).into()); + let remaining = U256::saturating_from(>::allowance( + (*token).into(), + &owner, + &spender, + )); + Ok(allowanceCall::abi_encode_returns(&(remaining,))) }, - clearMetadata(clearMetadataCall { id }) => { + IFungiblesCalls::name(nameCall { token }) => { // TODO: charge based on benchmarked weight - clear_metadata::(to_runtime_origin(env.caller()), (*id).into())?; - Ok(clearMetadataCall::abi_encode_returns(&())) + let result = >::name((*token).into()); + // TODO: improve + let result = String::from_utf8_lossy(result.as_slice()); + Ok(nameCall::abi_encode_returns(&(result,))) + }, + IFungiblesCalls::symbol(symbolCall { token }) => { + // TODO: charge based on benchmarked weight + let result = >::symbol((*token).into()); + // TODO: improve + let result = String::from_utf8_lossy(result.as_slice()); + Ok(nameCall::abi_encode_returns(&(result,))) + }, + IFungiblesCalls::decimals(decimalsCall { token }) => { + // TODO: charge based on benchmarked weight + let result = >::decimals((*token).into()); + Ok(decimalsCall::abi_encode_returns(&(result,))) + }, + IFungiblesCalls::exists(existsCall { token }) => { + // TODO: charge based on benchmarked weight + let result = self::exists::((*token).into()); + Ok(existsCall::abi_encode_returns(&(result,))) }, } } @@ -166,7 +266,10 @@ impl, I: 'static> Fungibles { #[cfg(test)] mod tests { - use frame_support::{assert_ok, traits::fungibles::Inspect, weights::Weight, BoundedVec}; + use frame_support::{ + assert_ok, sp_runtime::traits::AccountIdLookup, traits::fungibles::Inspect, + weights::Weight, BoundedVec, + }; use mock::{Assets, ExtBuilder, *}; use pallet_assets::{AssetDetails, AssetMetadata, AssetStatus, Instance1}; use pallet_revive::{ @@ -190,6 +293,179 @@ mod tests { type Fungibles = super::Fungibles; type Metadata = pallet_assets::Metadata; + #[test] + fn transfer_works() { + let token = 1; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, true, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::balance(token, ALICE), endowment); + assert_eq!(Assets::balance(token, BOB), 0); + + let value = endowment / 2; + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::transfer(transferCall { + token, + to: BOB_ADDR.0.into(), + value: U256::from(value) + }) + )); + + assert_eq!(Assets::balance(token, ALICE), endowment - value); + assert_eq!(Assets::balance(token, BOB), value); + + let from = ALICE_ADDR.0.into(); + let to = BOB_ADDR.0.into(); + let event = Transfer { token, from, to, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn transfer_from_works() { + let token = 1; + let endowment = 10_000_000; + let value = endowment / 2; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, true, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) + .build_with_env(|mut call_setup| { + assert_eq!(Assets::balance(token, ALICE), endowment); + assert_eq!(Assets::balance(token, BOB), 0); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + token, + BOB, + value + )); + call_setup.set_origin(Origin::Signed(BOB)); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::transferFrom(transferFromCall { + token, + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + value: U256::from(value), + }) + )); + + assert_eq!(Assets::balance(token, ALICE), endowment - value); + assert_eq!(Assets::balance(token, BOB), value); + let from = ALICE_ADDR.0.into(); + let to = BOB_ADDR.0.into(); + let event = Transfer { token, from, to, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn approve_works() { + let token = 1; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::allowance(token, &ALICE, &BOB), 0); + + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + &IFungiblesCalls::approve(approveCall { + token, + spender: BOB_ADDR.0.into(), + value: U256::from(value), + }) + )); + + assert_eq!(Assets::allowance(token, &ALICE, &BOB), value); + let owner = ALICE_ADDR.0.into(); + let spender = BOB_ADDR.0.into(); + let event = Approval { token, owner, spender, value: U256::from(value) }; + assert_last_event(ADDRESS, event); + }, + ); + } + + #[test] + fn increase_allowance_works() { + let token = 1; + let origin = ALICE; + let spender = BOB; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(origin.clone())); + assert_ok!(Assets::approve_transfer( + RuntimeOrigin::signed(origin.clone()), + token.into(), + AccountIdLookup::unlookup(spender.clone()), + value, + )); + assert_eq!(Assets::allowance(token, &origin, &spender), value); + + // Double the allowance. + let allowance = call_precompile::( + &mut call_setup.ext().0, + &IFungiblesCalls::increaseAllowance(increaseAllowanceCall { + token, + spender: BOB_ADDR.0.into(), + value: U256::from(value), + }), + ) + .unwrap(); + + assert_eq!(allowance, U256::from(value * 2)); + assert_eq!(Assets::allowance(token, &origin, &spender), value * 2); + let owner = ALICE_ADDR.0.into(); + let spender = BOB_ADDR.0.into(); + let event = Approval { token, owner, spender, value: U256::from(allowance) }; + assert_last_event(ADDRESS, event); + }, + ); + } + + #[test] + fn decrease_allowance_works() { + let token = 1; + let origin = ALICE; + let spender = BOB; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(origin.clone())); + assert_ok!(Assets::approve_transfer( + RuntimeOrigin::signed(origin.clone()), + token.into(), + AccountIdLookup::unlookup(spender.clone()), + value, + )); + assert_eq!(Assets::allowance(token, &origin, &spender), value); + + // Halve the allowance. + let allowance = call_precompile::( + &mut call_setup.ext().0, + &IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { + token, + spender: BOB_ADDR.0.into(), + value: U256::from(value / 2), + }), + ) + .unwrap(); + + assert_eq!(allowance, U256::from(value / 2)); + assert_eq!(Assets::allowance(token, &origin, &spender), value / 2); + let owner = ALICE_ADDR.0.into(); + let spender = BOB_ADDR.0.into(); + let event = Approval { token, owner, spender, value: U256::from(allowance) }; + assert_last_event(ADDRESS, event); + }, + ); + } + #[test] fn create_works() { let id = 0u32; @@ -262,193 +538,296 @@ mod tests { } #[test] - fn mint_works() { - let id = 1; - let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + fn start_destroy_works() { + let token = 1; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(id, ALICE), 0); + assert_eq!(Asset::get(token).unwrap().status, AssetStatus::Live); + + let mut ext = call_setup.ext().0; + assert_ok!(call_precompile::<()>( + &mut ext, + &startDestroy(startDestroyCall { token }) + )); + + assert_eq!(Asset::get(token).unwrap().status, AssetStatus::Destroying); + }, + ); + } + + #[test] + fn set_metadata_works() { + let token = 1; + let name = "name".to_string(); + let symbol = "symbol".to_string(); + let decimals = u8::MAX; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( + |mut call_setup| { + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Metadata::get(token), AssetMetadata::default()); assert_ok!(call_precompile::<()>( &mut call_setup.ext().0, - &IFungiblesCalls::mint(mintCall { - id, - account: ALICE_ADDR.0.into(), - value: U256::from(value) + &setMetadata(setMetadataCall { + token, + name: name.clone(), + symbol: symbol.clone(), + decimals }) )); - assert_eq!(Assets::balance(id, ALICE), value); - let from = Address::default(); - let to = ALICE_ADDR.0.into(); - let event = Transfer { id, from, to, value: U256::from(value) }; - assert_last_event(ADDRESS, event); + assert_eq!( + Metadata::get(token), + AssetMetadata { + deposit: 11, + name: BoundedVec::truncate_from(name.into_bytes()), + symbol: BoundedVec::truncate_from(symbol.into_bytes()), + decimals, + is_frozen: false, + } + ); }, ); } #[test] - fn transfer_works() { - let id = 1; - let endowment = 10_000_000; + fn clear_metadata_works() { + let token = 1; + let name = b"name".to_vec(); + let symbol = b"symbol".to_vec(); + let decimals = u8::MAX; ExtBuilder::new() - .with_assets(vec![(id, ALICE, true, 1)]) - .with_asset_balances(vec![(id, ALICE, endowment)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, name.clone(), symbol.clone(), decimals)]) .build_with_env(|mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(id, ALICE), endowment); - assert_eq!(Assets::balance(id, BOB), 0); + assert_eq!( + Metadata::get(token), + AssetMetadata { + deposit: 0, + name: BoundedVec::truncate_from(name), + symbol: BoundedVec::truncate_from(symbol), + decimals, + is_frozen: false, + } + ); - let value = endowment / 2; assert_ok!(call_precompile::<()>( &mut call_setup.ext().0, - &IFungiblesCalls::transfer(transferCall { - id, - to: BOB_ADDR.0.into(), - value: U256::from(value) - }) + &clearMetadata(clearMetadataCall { token }) )); - assert_eq!(Assets::balance(id, ALICE), endowment - value); - assert_eq!(Assets::balance(id, BOB), value); - - let from = ALICE_ADDR.0.into(); - let to = BOB_ADDR.0.into(); - let event = Transfer { id, from, to, value: U256::from(value) }; - assert_last_event(ADDRESS, event); + assert_eq!(Metadata::get(token), AssetMetadata::default()); }); } #[test] - fn approve_works() { - let id = 1; + fn mint_works() { + let token = 1; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::allowance(id, &ALICE, &BOB), 0); + assert_eq!(Assets::balance(token, ALICE), 0); assert_ok!(call_precompile::<()>( &mut call_setup.ext().0, - &IFungiblesCalls::approve(approveCall { - id, - spender: BOB_ADDR.0.into(), - value: U256::from(value), + &IFungiblesCalls::mint(mintCall { + token, + account: ALICE_ADDR.0.into(), + value: U256::from(value) }) )); - assert_eq!(Assets::allowance(id, &ALICE, &BOB), value); - let owner = ALICE_ADDR.0.into(); - let spender = BOB_ADDR.0.into(); - let event = Approval { id, owner, spender, value: U256::from(value) }; + assert_eq!(Assets::balance(token, ALICE), value); + let from = Address::default(); + let to = ALICE_ADDR.0.into(); + let event = Transfer { token, from, to, value: U256::from(value) }; assert_last_event(ADDRESS, event); }, ); } #[test] - fn transfer_from_works() { - let id = 1; + fn burn_works() { + let token = 1; let endowment = 10_000_000; - let value = endowment / 2; ExtBuilder::new() - .with_assets(vec![(id, ALICE, true, 1)]) - .with_asset_balances(vec![(id, ALICE, endowment)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) .build_with_env(|mut call_setup| { - assert_eq!(Assets::balance(id, ALICE), endowment); - assert_eq!(Assets::balance(id, BOB), 0); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - id, - BOB, - value - )); - call_setup.set_origin(Origin::Signed(BOB)); + call_setup.set_origin(Origin::Signed(ALICE)); + assert_eq!(Assets::balance(token, ALICE), endowment); assert_ok!(call_precompile::<()>( &mut call_setup.ext().0, - &IFungiblesCalls::transferFrom(transferFromCall { - id, - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), - value: U256::from(value), - }) + &IFungiblesCalls::burn(burnCall { + token, + account: ALICE_ADDR.0.into(), + value: U256::from(endowment), + }), )); - assert_eq!(Assets::balance(id, ALICE), endowment - value); - assert_eq!(Assets::balance(id, BOB), value); + assert_eq!(Assets::balance(token, ALICE), 0); let from = ALICE_ADDR.0.into(); - let to = BOB_ADDR.0.into(); - let event = Transfer { id, from, to, value: U256::from(value) }; + let to = Address::default(); + let event = Transfer { token, from, to, value: U256::from(endowment) }; assert_last_event(ADDRESS, event); }); } #[test] - fn burn_works() { - let id = 1; + fn total_supply_works() { + let token = u32::MAX; + let total_supply = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, total_supply)]) + .build_with_env(|mut call_setup| { + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + &IFungiblesCalls::totalSupply(totalSupplyCall { token }) + ) + .unwrap(), + U256::from(total_supply) + ); + }); + } + + #[test] + fn balance_of_works() { + let token = u32::MAX; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_balances(vec![(id, ALICE, endowment)]) + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, endowment)]) .build_with_env(|mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(id, ALICE), endowment); - assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, - &IFungiblesCalls::burn(burnCall { - id, - account: ALICE_ADDR.0.into(), - value: U256::from(endowment), - }), - )); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + &IFungiblesCalls::balanceOf(balanceOfCall { + token, + owner: ALICE_ADDR.0.into() + }) + ) + .unwrap(), + U256::from(endowment) + ); - assert_eq!(Assets::balance(id, ALICE), 0); - let from = ALICE_ADDR.0.into(); - let to = Address::default(); - let event = Transfer { id, from, to, value: U256::from(endowment) }; - assert_last_event(ADDRESS, event); + assert_eq!(Assets::balance(token, ALICE), endowment); }); } #[test] - fn start_destroy_works() { - let id = 1; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + fn allowance_works() { + let token = u32::MAX; + let value = 10_000_000; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Asset::get(id).unwrap().status, AssetStatus::Live); - - let mut ext = call_setup.ext().0; - assert_ok!(call_precompile::<()>(&mut ext, &startDestroy(startDestroyCall { id }))); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + token, + BOB, + value + )); - assert_eq!(Asset::get(id).unwrap().status, AssetStatus::Destroying); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + &IFungiblesCalls::allowance(allowanceCall { + token, + owner: ALICE_ADDR.0.into(), + spender: BOB_ADDR.0.into(), + }) + ) + .unwrap(), + U256::from(value) + ); }, ); } + #[test] + fn name_works() { + let token = 1; + let name = "name".to_string(); + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, name.as_bytes().into(), b"symbol".to_vec(), u8::MAX)]) + .build_with_env(|mut call_setup| { + let mut ext = call_setup.ext().0; + assert_eq!( + call_precompile::(&mut ext, &IFungiblesCalls::name(nameCall { token })) + .unwrap(), + name + ); + }); + } + + #[test] + fn symbol_works() { + let token = 1; + let symbol = "symbol".to_string(); + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), symbol.as_bytes().into(), u8::MAX)]) + .build_with_env(|mut call_setup| { + let mut ext = call_setup.ext().0; + assert_eq!( + call_precompile::( + &mut ext, + &IFungiblesCalls::symbol(symbolCall { token }) + ) + .unwrap(), + symbol + ); + }); + } + + #[test] + fn decimals_works() { + let token = 1; + let decimals = u8::MAX; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), decimals)]) + .build_with_env(|mut call_setup| { + let mut ext = call_setup.ext().0; + assert_eq!( + call_precompile::( + &mut ext, + &IFungiblesCalls::decimals(decimalsCall { token }) + ) + .unwrap() as u8, + decimals + ); + }); + } + #[test] fn exists_works() { - let id = 1; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( + let token = 1; + ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( |mut call_setup| { call_setup.set_origin(Origin::Signed(ALICE)); - assert!(Assets::asset_exists(id)); + assert!(Assets::asset_exists(token)); let mut ext = call_setup.ext().0; assert!(call_precompile::( &mut ext, - &IFungiblesCalls::exists(existsCall { id }) + &IFungiblesCalls::exists(existsCall { token }) ) .unwrap()); - let id = id + 1; - assert!(!Assets::asset_exists(id)); + let token = token + 1; + assert!(!Assets::asset_exists(token)); assert!(!call_precompile::( &mut ext, - &IFungiblesCalls::exists(existsCall { id }) + &IFungiblesCalls::exists(existsCall { token }) ) .unwrap()); }, @@ -457,13 +836,13 @@ mod tests { #[test] fn exists_via_bare_call_works() { - let id = 1; + let token = 1; let origin = RuntimeOrigin::signed(ALICE); ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) + .with_assets(vec![(token, ALICE, false, 1)]) .build() .execute_with(|| { - assert!(Assets::asset_exists(id)); + assert!(Assets::asset_exists(token)); let asset_exists = bare_call::( origin.clone(), @@ -471,92 +850,26 @@ mod tests { 0, Weight::MAX, Unchecked, - IFungiblesCalls::exists(existsCall { id }).abi_encode(), + IFungiblesCalls::exists(existsCall { token }).abi_encode(), ) .unwrap(); assert!(asset_exists); - let id = id + 1; - assert!(!Assets::asset_exists(id)); + let token = token + 1; + assert!(!Assets::asset_exists(token)); let exists = bare_call::( origin, ADDRESS.into(), 0, Weight::MAX, Unchecked, - IFungiblesCalls::exists(existsCall { id }).abi_encode(), + IFungiblesCalls::exists(existsCall { token }).abi_encode(), ) .unwrap(); assert!(!exists); }); } - #[test] - fn set_metadata_works() { - let id = 1; - let name = "name".to_string(); - let symbol = "symbol".to_string(); - let decimals = u8::MAX; - ExtBuilder::new().with_assets(vec![(id, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Metadata::get(id), AssetMetadata::default()); - - assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, - &setMetadata(setMetadataCall { - id, - name: name.clone(), - symbol: symbol.clone(), - decimals - }) - )); - - assert_eq!( - Metadata::get(id), - AssetMetadata { - deposit: 11, - name: BoundedVec::truncate_from(name.into_bytes()), - symbol: BoundedVec::truncate_from(symbol.into_bytes()), - decimals, - is_frozen: false, - } - ); - }, - ); - } - - #[test] - fn clear_metadata_works() { - let id = 1; - let name = b"name".to_vec(); - let symbol = b"symbol".to_vec(); - let decimals = u8::MAX; - ExtBuilder::new() - .with_assets(vec![(id, ALICE, false, 1)]) - .with_asset_metadata(vec![(id, name.clone(), symbol.clone(), decimals)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!( - Metadata::get(id), - AssetMetadata { - deposit: 0, - name: BoundedVec::truncate_from(name), - symbol: BoundedVec::truncate_from(symbol), - decimals, - is_frozen: false, - } - ); - - assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, - &clearMetadata(clearMetadataCall { id }) - )); - - assert_eq!(Metadata::get(id), AssetMetadata::default()); - }); - } - fn call_precompile::RustType>>( ext: &mut impl ExtWithInfo, input: &IFungiblesCalls, diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index fecdc96c1..25cb83d88 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -1,18 +1,20 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] +use ink::{prelude::string::String, U256}; +use pop_api::{ + fungibles::{ + self as api, + erc20::{extensions::Erc20Metadata, Erc20}, + Approval, InvalidRecipient, NoPermission, TokenId, Transfer, + }, + revert, +}; + // NOTE: requires `cargo-contract` built from `master` #[ink::contract] pub mod fungibles { - use ink::{prelude::string::String, U256}; - use pop_api::{ - fungibles::{ - self as api, - erc20::{extensions::Erc20Metadata, Erc20}, - Approval, InvalidRecipient, NoPermission, TokenId, Transfer, - }, - revert, - }; + use super::*; #[ink(storage)] pub struct Fungible { @@ -64,6 +66,52 @@ pub mod fungibles { self.env().emit_event(Transfer { from: Address::zero(), to: account, value }); } + /// Increases the allowance of `spender` by `value` amount of tokens. + /// + /// # Parameters + /// - `spender` - The account that is allowed to spend the tokens. + /// - `value` - The number of tokens to increase the allowance by. + #[ink(message)] + pub fn increase_allowance(&mut self, spender: Address, value: U256) { + if let Err(e) = self.ensure_owner() { + revert(&e) + } + let contract = self.env().address(); + + // Validate recipient. + if spender == contract { + revert(&InvalidRecipient(spender)) + } + if let Err(error) = api::increase_allowance(self.id, spender, value) { + revert(&error) + } + let allowance = self.allowance(contract, spender); + self.env().emit_event(Approval { owner: contract, spender, value: allowance }); + } + + /// Decreases the allowance of `spender` by `value` amount of tokens. + /// + /// # Parameters + /// - `spender` - The account that is allowed to spend the tokens. + /// - `value` - The number of tokens to decrease the allowance by. + #[ink(message)] + pub fn decrease_allowance(&mut self, spender: Address, value: U256) { + if let Err(e) = self.ensure_owner() { + revert(&e) + } + let contract = self.env().address(); + + // Validate recipient. + if spender == contract { + revert(&InvalidRecipient(spender)) + } + if let Err(error) = api::decrease_allowance(self.id, spender, value) { + revert(&error) + } + let value = self.allowance(contract, spender); + self.env().emit_event(Approval { owner: contract, spender, value }); + } + /// Destroys `value` amount of tokens from `account`, reducing the total supply. /// /// # Parameters diff --git a/pop-api-vnext/src/fungibles/erc20.rs b/pop-api-vnext/src/fungibles/erc20.rs index 211982f15..bde784533 100644 --- a/pop-api-vnext/src/fungibles/erc20.rs +++ b/pop-api-vnext/src/fungibles/erc20.rs @@ -13,7 +13,7 @@ const PRECOMPILE: u16 = 101; pub trait Erc20 { /// Returns the value of tokens in existence. #[ink(message)] - #[allow(non_snake_case)] // Required to ensure message name results in correct sol selector + #[allow(non_snake_case)] fn totalSupply(&self) -> U256; /// Returns the value of tokens owned by `account`. @@ -89,27 +89,27 @@ pub struct Transfer { /// Returns the value of tokens in existence. #[inline] -pub fn total_supply(id: TokenId) -> U256 { - let address = prefixed_address(PRECOMPILE, id); +pub fn total_supply(token: TokenId) -> U256 { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.totalSupply() } /// Returns the value of tokens owned by `account`. #[inline] -pub fn balance_of(id: TokenId, account: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, id); +pub fn balance_of(token: TokenId, account: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.balanceOf(account) } /// Returns the value of tokens owned by `account`. #[inline] -pub fn transfer(id: TokenId, to: Address, value: U256) -> Result { +pub fn transfer(token: TokenId, to: Address, value: U256) -> Result { ensure!(to != Address::zero(), ERC20InvalidSender(to)); ensure!(value != U256::zero(), ERC20InsufficientValue); - let address = prefixed_address(PRECOMPILE, id); + let address = prefixed_address(PRECOMPILE, token); let mut precompile: contract_ref!(Erc20, Pop) = address.into(); Ok(precompile.transfer(to, value)) } @@ -119,8 +119,8 @@ pub fn transfer(id: TokenId, to: Address, value: U256) -> Result { /// /// This value changes when `approve` or [`transfer_from`] are called. #[inline] -pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, id); +pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20, Pop) = address.into(); precompile.allowance(owner, spender) } @@ -132,11 +132,11 @@ pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { /// /// Emits an [`Approval`] event. #[inline] -pub fn approve(id: TokenId, spender: Address, value: U256) -> Result { +pub fn approve(token: TokenId, spender: Address, value: U256) -> Result { ensure!(spender != Address::zero(), ERC20InvalidApprover(spender)); ensure!(value != U256::zero(), ERC20InsufficientValue); - let address = prefixed_address(PRECOMPILE, id); + let address = prefixed_address(PRECOMPILE, token); let mut precompile: contract_ref!(Erc20, Pop) = address.into(); Ok(precompile.approve(spender, value)) } @@ -148,12 +148,17 @@ pub fn approve(id: TokenId, spender: Address, value: U256) -> Result Result { +pub fn transfer_from( + token: TokenId, + from: Address, + to: Address, + value: U256, +) -> Result { ensure!(from != Address::zero(), ERC20InvalidSender(from)); ensure!(to != Address::zero() && to != from, ERC20InvalidReceiver(to)); ensure!(value != U256::zero(), ERC20InsufficientValue); - let address = prefixed_address(PRECOMPILE, id); + let address = prefixed_address(PRECOMPILE, token); let mut precompile: contract_ref!(Erc20, Pop) = address.into(); Ok(precompile.transferFrom(from, to, value)) } @@ -180,24 +185,24 @@ pub mod extensions { /// Returns the name of the token. #[inline] - pub fn name(id: TokenId) -> String { - let address = prefixed_address(PRECOMPILE, id); + pub fn name(token: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.name() } /// Returns the symbol of the token. #[inline] - pub fn symbol(id: TokenId) -> String { - let address = prefixed_address(PRECOMPILE, id); + pub fn symbol(token: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.symbol() } /// Returns the decimals places of the token. #[inline] - pub fn decimals(id: TokenId) -> u8 { - let address = prefixed_address(PRECOMPILE, id); + pub fn decimals(token: TokenId) -> u8 { + let address = prefixed_address(PRECOMPILE, token); let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); precompile.decimals() } diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index cd286bbea..1ec13e22b 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -26,196 +26,411 @@ pub type TokenId = u32; /// the smart contract space. #[ink::trait_definition] pub trait Fungibles { + /// Transfers `value` amount of tokens from the caller's account to account `to`. + /// + /// # Parameters + /// - `token` - The token to transfer. + /// - `to` - The recipient account. + /// - `value` - The number of tokens to transfer. + #[ink(message)] + fn transfer(&self, token: TokenId, to: Address, value: U256); + + /// Transfers `value` amount tokens on behalf of `from` to account `to`. + /// + /// # Parameters + /// - `token` - The token to transfer. + /// - `from` - The account from which the token balance will be withdrawn. + /// - `to` - The recipient account. + /// - `value` - The number of tokens to transfer. + #[ink(message)] + #[allow(non_snake_case)] + fn transferFrom(&self, token: TokenId, from: Address, to: Address, value: U256); + + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + /// + /// # Parameters + /// - `token` - The token to approve. + /// - `spender` - The account that is allowed to spend the tokens. + /// - `value` - The number of tokens to approve. + #[ink(message)] + fn approve(&self, token: TokenId, spender: Address, value: U256); + + /// Increases the allowance of `spender` by `value` amount of tokens. + /// + /// # Parameters + /// - `token` - The token to have an allowance increased. + /// - `spender` - The account that is allowed to spend the tokens. + /// - `value` - The number of tokens to increase the allowance by. + #[ink(message)] + #[allow(non_snake_case)] + fn increaseAllowance(&self, token: TokenId, spender: Address, value: U256) -> U256; + + /// Decreases the allowance of `spender` by `value` amount of tokens. + /// + /// # Parameters + /// - `token` - The token to have an allowance decreased. + /// - `spender` - The account that is allowed to spend the tokens. + /// - `value` - The number of tokens to decrease the allowance by. + #[ink(message)] + #[allow(non_snake_case)] + fn decreaseAllowance(&self, token: TokenId, spender: Address, value: U256) -> U256; + /// Create a new token with an automatically generated identifier. + /// + /// # Parameters + /// - `admin` - The account that will administer the token. + /// - `min_balance` - The minimum balance required for accounts holding this token. + /// + /// NOTE: The minimum balance must be non-zero. #[ink(message)] fn create(&self, admin: Address, min_balance: U256) -> TokenId; + /// Start the process of destroying a token. + /// + /// # Parameters + /// - `token` - The token to be destroyed. + #[ink(message)] + #[allow(non_snake_case)] + fn startDestroy(&self, token: TokenId); + /// Set the metadata for a token. + /// + /// # Parameters + /// - `token`: The token to update. + /// - `name`: The user friendly name of this token. + /// - `symbol`: The exchange symbol for this token. + /// - `decimals`: The number of decimals this token uses to represent one unit. #[ink(message)] #[allow(non_snake_case)] - fn setMetadata(&self, id: TokenId, name: String, symbol: String, decimals: u8); + fn setMetadata(&self, token: TokenId, name: String, symbol: String, decimals: u8); /// Clear the metadata for a token. + /// + /// # Parameters + /// - `token` - The token to update. #[ink(message)] #[allow(non_snake_case)] - fn clearMetadata(&self, id: TokenId); + fn clearMetadata(&self, token: TokenId); /// Creates `value` amount of tokens and assigns them to `account`, increasing the total /// supply. + /// + /// # Parameters + /// - `token` - The token to mint. + /// - `account` - The account to be credited with the created tokens. + /// - `value` - The number of tokens to mint. #[ink(message)] - fn mint(&self, id: TokenId, account: Address, value: U256); + fn mint(&self, token: TokenId, account: Address, value: U256); - /// Transfers `value` amount of tokens from the caller's account to account `to`. + /// Destroys `value` amount of tokens from `account`, reducing the total supply. + /// + /// # Parameters + /// - `token` - The token to burn. + /// - `account` - The account from which the tokens will be destroyed. + /// - `value` - The number of tokens to destroy. #[ink(message)] - fn transfer(&self, id: TokenId, to: Address, value: U256); + fn burn(&self, token: TokenId, address: Address, value: U256); - /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + /// Total token supply for a specified token. + /// + /// # Parameters + /// - `token` - The token. #[ink(message)] - fn approve(&self, id: TokenId, spender: Address, value: U256); + #[allow(non_snake_case)] + fn totalSupply(&self, token: TokenId) -> U256; - /// Transfers `value` amount tokens on behalf of `from` to account `to`. + /// Account balance for a specified `token` and `owner`. + /// + /// # Parameters + /// - `token` - The token. + /// - `owner` - The owner of the token. #[ink(message)] #[allow(non_snake_case)] - fn transferFrom(&self, id: TokenId, from: Address, to: Address, value: U256); + fn balanceOf(&self, token: TokenId, owner: Address) -> U256; + + /// Allowance for a `spender` approved by an `owner`, for a specified `token`. + /// + /// # Parameters + /// - `token` - The token. + /// - `owner` - The owner of the token. + /// - `spender` - The spender with an allowance. + #[ink(message)] + fn allowance(&self, token: TokenId, owner: Address, spender: Address) -> U256; - /// Destroys `value` amount of tokens from `account`, reducing the total supply. + /// Name of the specified token. + /// + /// # Parameters + /// - `token` - The token. #[ink(message)] - fn burn(&self, id: TokenId, address: Address, value: U256); + fn name(&self, token: TokenId) -> String; - /// Start the process of destroying a token. + /// Symbol for the specified token. + /// + /// # Parameters + /// - `token` - The token. #[ink(message)] - #[allow(non_snake_case)] - fn startDestroy(&self, id: TokenId); + fn symbol(&self, token: TokenId) -> String; - /// Whether a specified token exists. + /// Decimals for the specified token. + /// + /// # Parameters + /// - `token` - The token. #[ink(message)] - fn exists(&self, id: TokenId) -> bool; + fn decimals(&self, token: TokenId) -> u8; + + /// Whether the specified token exists. + /// + /// # Parameters + /// - `token` - The token. + #[ink(message)] + fn exists(&self, token: TokenId) -> bool; } -/// Create a new token with an automatically generated identifier. +/// Allowance for a `spender` approved by an `owner`, for a specified `token`. /// /// # Parameters -/// - `admin` - The account that will administer the token. -/// - `min_balance` - The minimum balance required for accounts holding this token. -/// -/// NOTE: The minimum balance must be non-zero. +/// - `token` - The token. +/// - `owner` - The owner of the token. +/// - `spender` - The spender with an allowance. #[inline] -pub fn create(admin: Address, min_balance: U256) -> Result { - ensure!(admin != Address::zero(), ZeroAdminAddress); - ensure!(min_balance != U256::zero(), MinBalanceZero); - +pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.create(admin, min_balance)) + precompile.allowance(token, owner, spender) } -/// Set the metadata for a token. +/// Approves `spender` to spend `value` amount of tokens on behalf of the caller. +/// +/// # Parameters +/// - `token` - The token to approve. +/// - `spender` - The account that is allowed to spend the tokens. +/// - `value` - The number of tokens to approve. #[inline] -pub fn set_metadata(id: TokenId, name: String, symbol: String, decimals: u8) { +pub fn approve(token: TokenId, spender: Address, value: U256) -> Result<(), Error> { + ensure!(spender != Address::zero(), ZeroRecipientAddress); + ensure!(value != U256::zero(), ZeroValue); + let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - precompile.setMetadata(id, name, symbol, decimals) + Ok(precompile.approve(token, spender, value)) } -/// Clear the metadata for a token. +/// Account balance for a specified `token` and `owner`. +/// +/// # Parameters +/// - `token` - The token. +/// - `owner` - The owner of the token. #[inline] -pub fn clear_metadata(id: TokenId) { +pub fn balance_of(token: TokenId, account: Address) -> U256 { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - precompile.clearMetadata(id) + precompile.balanceOf(token, account) } -/// Creates `value` amount of tokens and assigns them to `account`, increasing the total -/// supply. +/// Destroys `value` amount of tokens from `account`, reducing the total supply. +/// +/// # Parameters +/// - `token` - The token to burn. +/// - `account` - The account from which the tokens will be destroyed. +/// - `value` - The number of tokens to destroy. #[inline] -pub fn mint(id: TokenId, account: Address, value: U256) -> Result<(), Error> { - ensure!(account != Address::zero(), ZeroRecipientAddress); +pub fn burn(token: TokenId, account: Address, value: U256) -> Result<(), Error> { + ensure!(account != Address::zero(), ZeroSenderAddress); ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.mint(id, account, value)) + Ok(precompile.burn(token, account, value)) } -/// Transfers `value` amount of tokens from the caller's account to account `to`. +/// Clear the metadata for a token. +/// +/// # Parameters +/// - `token` - The token to update. #[inline] -pub fn transfer(id: TokenId, to: Address, value: U256) -> Result<(), Error> { - ensure!(to != Address::zero(), ZeroRecipientAddress); - ensure!(value != U256::zero(), ZeroValue); +pub fn clear_metadata(token: TokenId) { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.clearMetadata(token) +} + +/// Create a new token with an automatically generated identifier. +/// +/// # Parameters +/// - `admin` - The account that will administer the token. +/// - `min_balance` - The minimum balance required for accounts holding this token. +/// +/// NOTE: The minimum balance must be non-zero. +#[inline] +pub fn create(admin: Address, min_balance: U256) -> Result { + ensure!(admin != Address::zero(), ZeroAdminAddress); + ensure!(min_balance != U256::zero(), MinBalanceZero); let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.transfer(id, to, value)) + Ok(precompile.create(admin, min_balance)) } -/// Approves `spender` to spend `value` amount of tokens on behalf of the caller. +/// Decimals for the specified token. +/// +/// # Parameters +/// - `token` - The token. #[inline] -pub fn approve(id: TokenId, spender: Address, value: U256) -> Result<(), Error> { +pub fn decimals(token: TokenId) -> u8 { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.decimals(token) +} + +/// Decreases the allowance of `spender` by `value` amount of tokens. +/// +/// # Parameters +/// - `token` - The token to have an allowance decreased. +/// - `spender` - The account that is allowed to spend the tokens. +/// - `value` - The number of tokens to decrease the allowance by. +pub fn decrease_allowance(token: TokenId, spender: Address, value: U256) -> Result { ensure!(spender != Address::zero(), ZeroRecipientAddress); ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.approve(id, spender, value)) + Ok(precompile.increaseAllowance(token, spender, value)) } -/// Transfers `value` amount tokens on behalf of `from` to account `to`. +/// Whether the specified token exists. +/// +/// # Parameters +/// - `token` - The token. #[inline] -pub fn transfer_from(id: TokenId, from: Address, to: Address, value: U256) -> Result<(), Error> { - ensure!(from != Address::zero(), ZeroSenderAddress); - ensure!(to != Address::zero(), ZeroRecipientAddress); - ensure!(to != from, InvalidRecipient(to)); +pub fn exists(token: TokenId) -> bool { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.exists(token) +} + +/// Increases the allowance of `spender` by `value` amount of tokens. +/// +/// # Parameters +/// - `token` - The token to have an allowance increased. +/// - `spender` - The account that is allowed to spend the tokens. +/// - `value` - The number of tokens to increase the allowance by. +pub fn increase_allowance(token: TokenId, spender: Address, value: U256) -> Result { + ensure!(spender != Address::zero(), ZeroRecipientAddress); ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.transferFrom(id, from, to, value)) + Ok(precompile.increaseAllowance(token, spender, value)) } -/// Destroys `value` amount of tokens from `account`, reducing the total supply. +/// Creates `value` amount of tokens and assigns them to `account`, increasing the total +/// supply. +/// +/// # Parameters +/// - `token` - The token to mint. +/// - `account` - The account to be credited with the created tokens. +/// - `value` - The number of tokens to mint. #[inline] -pub fn burn(id: TokenId, account: Address, value: U256) -> Result<(), Error> { - ensure!(account != Address::zero(), ZeroSenderAddress); +pub fn mint(token: TokenId, account: Address, value: U256) -> Result<(), Error> { + ensure!(account != Address::zero(), ZeroRecipientAddress); ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - Ok(precompile.burn(id, account, value)) + Ok(precompile.mint(token, account, value)) } -/// Start the process of destroying a token. +/// Name of the specified token. +/// +/// # Parameters +/// - `token` - The token. #[inline] -pub fn start_destroy(id: TokenId) { +pub fn name(token: TokenId) -> String { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - precompile.startDestroy(id) + precompile.name(token) } -/// Whether a specified token exists. +/// Set the metadata for a token. +/// +/// # Parameters +/// - `token`: The token to update. +/// - `name`: The user friendly name of this token. +/// - `symbol`: The exchange symbol for this token. +/// - `decimals`: The number of decimals this token uses to represent one unit. #[inline] -pub fn exists(id: TokenId) -> bool { +pub fn set_metadata(token: TokenId, name: String, symbol: String, decimals: u8) { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop) = address.into(); - precompile.exists(id) + precompile.setMetadata(token, name, symbol, decimals) } -/// Returns the total token supply. +/// Start the process of destroying a token. +/// +/// # Parameters +/// - `token` - The token to be destroyed. #[inline] -pub fn total_supply(id: TokenId) -> U256 { - erc20::total_supply(id) +pub fn start_destroy(token: TokenId) { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.startDestroy(token) } -/// Returns the value of tokens owned by `account`. +/// Symbol for the specified token. +/// +/// # Parameters +/// - `token` - The token. #[inline] -pub fn balance_of(id: TokenId, account: Address) -> U256 { - erc20::balance_of(id, account) +pub fn symbol(token: TokenId) -> String { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.symbol(token) } -/// Returns the remaining number of tokens that `spender` will be allowed to spend -/// on behalf of `owner` through [`transfer_from`]. This is zero by default. +/// Total token supply for a specified token. /// -/// This value changes when `approve` or [`transfer_from`] are called. +/// # Parameters +/// - `token` - The token. #[inline] -pub fn allowance(id: TokenId, owner: Address, spender: Address) -> U256 { - erc20::allowance(id, owner, spender) +pub fn total_supply(token: TokenId) -> U256 { + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + precompile.totalSupply(token) } -/// Returns the name of the token. +/// Transfers `value` amount of tokens from the caller's account to account `to`. +/// +/// # Parameters +/// - `token` - The token to transfer. +/// - `to` - The recipient account. +/// - `value` - The number of tokens to transfer. #[inline] -pub fn name(id: TokenId) -> String { - erc20::extensions::name(id) -} +pub fn transfer(token: TokenId, to: Address, value: U256) -> Result<(), Error> { + ensure!(to != Address::zero(), ZeroRecipientAddress); + ensure!(value != U256::zero(), ZeroValue); -/// Returns the symbol of the token. -#[inline] -pub fn symbol(id: TokenId) -> String { - erc20::extensions::symbol(id) + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.transfer(token, to, value)) } -/// Returns the decimals places of the token. +/// Transfers `value` amount tokens on behalf of `from` to account `to`. +/// +/// # Parameters +/// - `token` - The token to transfer. +/// - `from` - The account from which the token balance will be withdrawn. +/// - `to` - The recipient account. +/// - `value` - The number of tokens to transfer. #[inline] -pub fn decimals(id: TokenId) -> u8 { - erc20::extensions::decimals(id) +pub fn transfer_from(token: TokenId, from: Address, to: Address, value: U256) -> Result<(), Error> { + ensure!(from != Address::zero(), ZeroSenderAddress); + ensure!(to != Address::zero(), ZeroRecipientAddress); + ensure!(to != from, InvalidRecipient(to)); + ensure!(value != U256::zero(), ZeroValue); + + let address = fixed_address(PRECOMPILE); + let precompile: contract_ref!(Fungibles, Pop) = address.into(); + Ok(precompile.transferFrom(token, from, to, value)) } // NOTE: subject to change based on ink!'s support for solidity custom errors. diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index d3b27230c..d1b35377a 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -184,9 +184,9 @@ mod tests { let caller = Alice.to_account_id(); let origin = RuntimeOrigin::signed(caller.clone()); let origin_addr = AccountId32Mapper::to_address(&caller); - let id = 1; + let token = 1; let fungibles_addr: H160 = Fungibles::<100, TrustBackedAssetsInstance>::address().into(); - let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(id).into(); + let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(token).into(); let total_supply: Balance = 10_000; new_test_ext().execute_with(|| { assert_ok!(Revive::map_account(origin.clone())); @@ -199,13 +199,13 @@ mod tests { .abi_encode(); println!("IFungibles.create: {}", to_hex(&call, false)); assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); - let asset_details = Asset::get(id).unwrap(); + let asset_details = Asset::get(token).unwrap(); assert_eq!(asset_details.owner, caller); assert_eq!(asset_details.admin, caller); // Mint via fungibles precompile let call = mintCall { - id, + token, account: origin_addr.0.into(), value: primitives::U256::from(total_supply), } @@ -222,7 +222,7 @@ mod tests { .abi_encode(); println!("IERC20.transfer: {}", to_hex(&call, false)); assert_ok!(Revive::call(origin.clone(), erc20_addr, 0, Weight::zero(), 0, call)); - assert_eq!(Assets::balance(id, &Bob.to_account_id()), total_supply / 2); + assert_eq!(Assets::balance(token, &Bob.to_account_id()), total_supply / 2); }) } From 436df6798a5d0da317507dd84c80a5b40255af37 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:17:26 +0100 Subject: [PATCH 055/162] refactor(pop-api): use explicit sol encoding for precompile contract refs --- pop-api-vnext/Cargo.toml | 3 --- pop-api-vnext/src/fungibles/erc20.rs | 20 +++++++-------- pop-api-vnext/src/fungibles/mod.rs | 37 ++++++++++++++-------------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/pop-api-vnext/Cargo.toml b/pop-api-vnext/Cargo.toml index 89ec14f51..50c407f31 100644 --- a/pop-api-vnext/Cargo.toml +++ b/pop-api-vnext/Cargo.toml @@ -5,9 +5,6 @@ license = "GPL-3.0-only" name = "pop-api" version = "0.1.0" -[package.metadata.ink-lang] -abi = "sol" - [dependencies] alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } diff --git a/pop-api-vnext/src/fungibles/erc20.rs b/pop-api-vnext/src/fungibles/erc20.rs index bde784533..909b2838c 100644 --- a/pop-api-vnext/src/fungibles/erc20.rs +++ b/pop-api-vnext/src/fungibles/erc20.rs @@ -1,7 +1,7 @@ pub use errors::*; use super::{ - contract_ref, prefixed_address, Address, Pop, SolAddress, SolEncode, SolError, SolType, + contract_ref, prefixed_address, Address, Pop, Sol, SolAddress, SolEncode, SolError, SolType, SolTypeEncode, String, TokenId, Uint, Vec, U256, }; use crate::ensure; @@ -91,7 +91,7 @@ pub struct Transfer { #[inline] pub fn total_supply(token: TokenId) -> U256 { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop) = address.into(); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); precompile.totalSupply() } @@ -99,7 +99,7 @@ pub fn total_supply(token: TokenId) -> U256 { #[inline] pub fn balance_of(token: TokenId, account: Address) -> U256 { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop) = address.into(); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); precompile.balanceOf(account) } @@ -110,7 +110,7 @@ pub fn transfer(token: TokenId, to: Address, value: U256) -> Result ensure!(value != U256::zero(), ERC20InsufficientValue); let address = prefixed_address(PRECOMPILE, token); - let mut precompile: contract_ref!(Erc20, Pop) = address.into(); + let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); Ok(precompile.transfer(to, value)) } @@ -121,7 +121,7 @@ pub fn transfer(token: TokenId, to: Address, value: U256) -> Result #[inline] pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop) = address.into(); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); precompile.allowance(owner, spender) } @@ -137,7 +137,7 @@ pub fn approve(token: TokenId, spender: Address, value: U256) -> Result String { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); precompile.name() } @@ -195,7 +195,7 @@ pub mod extensions { #[inline] pub fn symbol(token: TokenId) -> String { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); precompile.symbol() } @@ -203,7 +203,7 @@ pub mod extensions { #[inline] pub fn decimals(token: TokenId) -> u8 { let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop) = address.into(); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); precompile.decimals() } } diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index 1ec13e22b..0bea36445 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -5,6 +5,7 @@ use alloy_sol_types::{ pub use erc20::{Approval, Transfer}; pub use errors::*; use ink::{ + abi::Sol, contract_ref, prelude::{string::String, vec::Vec}, primitives::sol::SolTypeEncode, @@ -195,7 +196,7 @@ pub trait Fungibles { #[inline] pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.allowance(token, owner, spender) } @@ -211,7 +212,7 @@ pub fn approve(token: TokenId, spender: Address, value: U256) -> Result<(), Erro ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.approve(token, spender, value)) } @@ -223,7 +224,7 @@ pub fn approve(token: TokenId, spender: Address, value: U256) -> Result<(), Erro #[inline] pub fn balance_of(token: TokenId, account: Address) -> U256 { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.balanceOf(token, account) } @@ -239,7 +240,7 @@ pub fn burn(token: TokenId, account: Address, value: U256) -> Result<(), Error> ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.burn(token, account, value)) } @@ -250,7 +251,7 @@ pub fn burn(token: TokenId, account: Address, value: U256) -> Result<(), Error> #[inline] pub fn clear_metadata(token: TokenId) { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.clearMetadata(token) } @@ -267,7 +268,7 @@ pub fn create(admin: Address, min_balance: U256) -> Result { ensure!(min_balance != U256::zero(), MinBalanceZero); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.create(admin, min_balance)) } @@ -278,7 +279,7 @@ pub fn create(admin: Address, min_balance: U256) -> Result { #[inline] pub fn decimals(token: TokenId) -> u8 { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.decimals(token) } @@ -293,7 +294,7 @@ pub fn decrease_allowance(token: TokenId, spender: Address, value: U256) -> Resu ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.increaseAllowance(token, spender, value)) } @@ -304,7 +305,7 @@ pub fn decrease_allowance(token: TokenId, spender: Address, value: U256) -> Resu #[inline] pub fn exists(token: TokenId) -> bool { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.exists(token) } @@ -319,7 +320,7 @@ pub fn increase_allowance(token: TokenId, spender: Address, value: U256) -> Resu ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.increaseAllowance(token, spender, value)) } @@ -336,7 +337,7 @@ pub fn mint(token: TokenId, account: Address, value: U256) -> Result<(), Error> ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.mint(token, account, value)) } @@ -347,7 +348,7 @@ pub fn mint(token: TokenId, account: Address, value: U256) -> Result<(), Error> #[inline] pub fn name(token: TokenId) -> String { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.name(token) } @@ -361,7 +362,7 @@ pub fn name(token: TokenId) -> String { #[inline] pub fn set_metadata(token: TokenId, name: String, symbol: String, decimals: u8) { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.setMetadata(token, name, symbol, decimals) } @@ -372,7 +373,7 @@ pub fn set_metadata(token: TokenId, name: String, symbol: String, decimals: u8) #[inline] pub fn start_destroy(token: TokenId) { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.startDestroy(token) } @@ -383,7 +384,7 @@ pub fn start_destroy(token: TokenId) { #[inline] pub fn symbol(token: TokenId) -> String { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.symbol(token) } @@ -394,7 +395,7 @@ pub fn symbol(token: TokenId) -> String { #[inline] pub fn total_supply(token: TokenId) -> U256 { let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); precompile.totalSupply(token) } @@ -410,7 +411,7 @@ pub fn transfer(token: TokenId, to: Address, value: U256) -> Result<(), Error> { ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.transfer(token, to, value)) } @@ -429,7 +430,7 @@ pub fn transfer_from(token: TokenId, from: Address, to: Address, value: U256) -> ensure!(value != U256::zero(), ZeroValue); let address = fixed_address(PRECOMPILE); - let precompile: contract_ref!(Fungibles, Pop) = address.into(); + let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.transferFrom(token, from, to, value)) } From 961eac2b684edaeb01b59312fc954a20694f6746 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:29:20 +0100 Subject: [PATCH 056/162] docs(examples): update parameter description based on review comment --- pop-api-vnext/examples/fungibles/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 25cb83d88..226eba684 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -163,7 +163,7 @@ pub mod fungibles { /// Returns the account balance for the specified `owner`. /// /// # Parameters - /// - `owner` - The address whose balance is being queried. + /// - `owner` - The account whose balance is being queried. #[ink(message)] fn balanceOf(&self, owner: Address) -> U256 { api::balance_of(self.id, owner) From 0a2db359fe46b9df4030a98207240c639dabad73 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:38:37 +0100 Subject: [PATCH 057/162] docs(api): add public function doc --- pallets/api-vnext/src/fungibles/precompiles/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index bb2309d8e..cf6f55284 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -259,6 +259,7 @@ where } impl, I: 'static> Fungibles { + /// The address of the precompile. pub const fn address() -> [u8; 20] { fixed_address(FIXED) } From dca987c56745b58f53fb351fa2498bca13c6d950 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:41:50 +0100 Subject: [PATCH 058/162] docs(example): update constructor parameter doc style to match messages --- pop-api-vnext/examples/fungibles/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 226eba684..3ba492286 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -27,10 +27,10 @@ pub mod fungibles { /// in contract's storage. /// /// # Parameters - /// * - `name` - The name of the token. - /// * - `symbol` - The symbol of the token. - /// * - `min_balance` - The minimum balance required for accounts holding this token. - /// * - `decimals` - The number of decimals. + /// - `name` - The name of the token. + /// - `symbol` - The symbol of the token. + /// - `min_balance` - The minimum balance required for accounts holding this token. + /// - `decimals` - The number of decimals. /// /// NOTE: The minimum balance must be non-zero. // The `min_balance` ensures accounts hold a minimum amount of tokens, preventing tiny, From 4f86e783e8c0b0ad2601bfd753409d760a65af34 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:45:50 +0100 Subject: [PATCH 059/162] docs(example): use account instead of address in doc comments --- pop-api-vnext/examples/fungibles/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 3ba492286..557a3be96 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -51,7 +51,7 @@ pub mod fungibles { /// supply. /// /// # Parameters - /// - `account` - The address to be credited with the created tokens. + /// - `account` - The account to be credited with the created tokens. /// - `value` - The number of tokens to mint. #[ink(message)] pub fn mint(&mut self, account: Address, value: U256) { @@ -115,7 +115,7 @@ pub mod fungibles { /// Destroys `value` amount of tokens from `account`, reducing the total supply. /// /// # Parameters - /// - `account` - The address from which the tokens will be destroyed. + /// - `account` - The account from which the tokens will be destroyed. /// - `value` - The number of tokens to destroy. #[ink(message)] pub fn burn(&mut self, account: Address, value: U256) { @@ -172,18 +172,18 @@ pub mod fungibles { /// Returns the allowance for a `spender` approved by an `owner`. /// /// # Parameters - /// - `owner` - The address that owns the tokens. - /// - `spender` - The address that is allowed to spend the tokens. + /// - `owner` - The account that owns the tokens. + /// - `spender` - The account that is allowed to spend the tokens. #[ink(message)] fn allowance(&self, owner: Address, spender: Address) -> U256 { api::allowance(self.id, owner, spender) } - /// Transfers `value` amount of tokens from the contract to address `to` with + /// Transfers `value` amount of tokens from the contract to account `to` with /// additional `data` in unspecified format. /// /// # Parameters - /// - `to` - The recipient address. + /// - `to` - The recipient account. /// - `value` - The number of tokens to transfer. #[ink(message)] fn transfer(&mut self, to: Address, value: U256) -> bool { @@ -208,8 +208,8 @@ pub mod fungibles { /// pre-approved by `from`. /// /// # Parameters - /// - `from` - The address from which the token balance will be withdrawn. - /// - `to` - The recipient address. + /// - `from` - The account from which the token balance will be withdrawn. + /// - `to` - The recipient account. /// - `value` - The number of tokens to transfer. #[ink(message)] fn transferFrom(&mut self, from: Address, to: Address, value: U256) -> bool { @@ -237,7 +237,7 @@ pub mod fungibles { /// Successive calls of this method overwrite previous values. /// /// # Parameters - /// - `spender` - The address that is allowed to spend the tokens. + /// - `spender` - The account that is allowed to spend the tokens. /// - `value` - The number of tokens to approve. #[ink(message)] fn approve(&mut self, spender: Address, value: U256) -> bool { From 1f91c931d8f385be05cc784417944d7ff3968e00 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:55:53 +0100 Subject: [PATCH 060/162] docs(example): add todo prefix to comment --- pop-api-vnext/examples/fungibles/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 557a3be96..409503526 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -56,7 +56,7 @@ pub mod fungibles { #[ink(message)] pub fn mint(&mut self, account: Address, value: U256) { if let Err(error) = self.ensure_owner() { - // Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 + // TODO: Workaround until ink supports Error to Solidity custom error conversion; https://github.com/use-ink/ink/issues/2404 revert(&error) } From b9a4153883764b315743971d0febc9b9e2c498a6 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 11:57:59 +0100 Subject: [PATCH 061/162] docs(api): add public function doc --- pallets/api-vnext/src/fungibles/precompiles/erc20.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 785941d08..d569bf30d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -132,6 +132,7 @@ where } impl, I: 'static> Erc20 { + /// The address of the precompile. pub fn address(id: u32) -> [u8; 20] { prefixed_address(PREFIX, id) } From 7c887eb9b0be84638c3b8a2313f72bc020c1d30d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 16 Jun 2025 12:09:45 +0100 Subject: [PATCH 062/162] test(api): remove additional check deemed unnecessary --- pallets/api-vnext/src/fungibles/precompiles/erc20.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index d569bf30d..dea34d000 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -203,8 +203,6 @@ mod tests { .unwrap(), U256::from(endowment) ); - - assert_eq!(Assets::balance(token, ALICE), endowment); }); } From 8729836fec1bd75d0a6e13ec7c1705aba34811a3 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 17 Jun 2025 09:09:42 +0100 Subject: [PATCH 063/162] docs(api): add fungibles doc comments --- pallets/api-vnext/src/fungibles/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index c93c6c995..dc33fdda1 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -1,3 +1,7 @@ +//! The fungibles API offers a streamlined interface for interacting with fungible tokens. The +//! goal is to provide a simplified, consistent API that adheres to standards in the smart contract +//! space. + use core::cmp::Ordering::{Equal, Greater, Less}; use frame_support::{ @@ -15,6 +19,7 @@ use AddressMatcher::Fixed; use super::*; +/// The fungibles precompiles offer a streamlined interface for interacting with fungible tokens. pub mod precompiles; type AssetIdOf = >::AssetId; From 748f708724f878e685b686be9d0ceaf89792fb3f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 10:15:57 +0100 Subject: [PATCH 064/162] refactor(precompiles): add license and version requirement --- .../api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol | 3 +++ .../src/fungibles/precompiles/interfaces/IFungibles.sol | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol index 7aa8d6c10..9e78dcfae 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.30; + /** * @dev Interface of the ERC-20 standard as defined in the ERC. * Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol index 99719f137..f58fb962d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol +++ b/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.30; + /** * @title The fungibles precompile offers a streamlined interface for interacting with fungible * tokens. The goal is to provide a simplified, consistent API that adheres to standards in the From cdf91f254937adfe841f5699c674d4d6d8d36b47 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 10:17:15 +0100 Subject: [PATCH 065/162] refactor(precompiles): update return types after rebase --- .../src/fungibles/precompiles/erc20.rs | 24 +++++------ .../src/fungibles/precompiles/mod.rs | 42 +++++++++---------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index dea34d000..701226820 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -47,13 +47,13 @@ where totalSupply(_) => { // TODO: charge based on benchmarked weight let total_supply = U256::saturating_from(>::total_supply(token)); - Ok(totalSupplyCall::abi_encode_returns(&(total_supply,))) + Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, balanceOf(balanceOfCall { account }) => { // TODO: charge based on benchmarked weight let account = env.to_account_id(&(*account.0).into()); let balance = U256::saturating_from(>::balance(token, account)); - Ok(balanceOfCall::abi_encode_returns(&(balance,))) + Ok(balanceOfCall::abi_encode_returns(&balance)) }, transfer(transferCall { to, value }) => { // TODO: charge based on benchmarked weight @@ -67,7 +67,7 @@ where )?; deposit_event::(env, address, Transfer { from, to: *to, value: *value }); - Ok(transferCall::abi_encode_returns(&(true,))) + Ok(transferCall::abi_encode_returns(&true)) }, allowance(allowanceCall { owner, spender }) => { // TODO: charge based on benchmarked weight @@ -75,7 +75,7 @@ where let spender = env.to_account_id(&(*spender.0).into()); let remaining = U256::saturating_from(>::allowance(token, &owner, &spender)); - Ok(allowanceCall::abi_encode_returns(&(remaining,))) + Ok(allowanceCall::abi_encode_returns(&remaining)) }, approve(approveCall { spender, value }) => { // TODO: charge based on benchmarked weight @@ -91,7 +91,7 @@ where let event = Approval { owner, spender: *spender, value: *value }; deposit_event(env, address, event); - Ok(approveCall::abi_encode_returns(&(true,))) + Ok(approveCall::abi_encode_returns(&true)) }, transferFrom(transferFromCall { from, to, value }) => { // TODO: charge based on benchmarked weight @@ -105,27 +105,25 @@ where )?; deposit_event(env, address, Transfer { from: *from, to: *to, value: *value }); - Ok(transferFromCall::abi_encode_returns(&(true,))) + Ok(transferFromCall::abi_encode_returns(&true)) }, // IERC20Metadata name(_) => { // TODO: charge based on benchmarked weight let result = >::name(token); - // TODO: improve - let result = String::from_utf8_lossy(result.as_slice()); - Ok(nameCall::abi_encode_returns(&(result,))) + let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, symbol(_) => { // TODO: charge based on benchmarked weight let result = >::symbol(token); - // TODO: improve - let result = String::from_utf8_lossy(result.as_slice()); - Ok(symbolCall::abi_encode_returns(&(result,))) + let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(symbolCall::abi_encode_returns(&result)) }, decimals(_) => { // TODO: charge based on benchmarked weight let result = >::decimals(token); - Ok(decimalsCall::abi_encode_returns(&(result,))) + Ok(decimalsCall::abi_encode_returns(&result)) }, } } diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index cf6f55284..715530529 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -60,7 +60,7 @@ where address, Transfer { token: *token, from, to: *to, value: *value }, ); - Ok(transferCall::abi_encode_returns(&())) + Ok(transferCall::abi_encode_returns(&transferReturn{})) }, IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { // TODO: charge based on benchmarked weight @@ -79,7 +79,7 @@ where address, Transfer { token: *token, from: *from, to: *to, value }, ); - Ok(transferFromCall::abi_encode_returns(&())) + Ok(transferFromCall::abi_encode_returns(&transferFromReturn{})) }, IFungiblesCalls::approve(approveCall { token, spender, value }) => { // TODO: charge based on benchmarked weight @@ -99,7 +99,7 @@ where address, Approval { token: *token, owner, spender, value: *value }, ); - Ok(approveCall::abi_encode_returns(&())) + Ok(approveCall::abi_encode_returns(&approveReturn{})) }, IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { // TODO: charge based on benchmarked weight @@ -117,7 +117,7 @@ where let spender = *spender; deposit_event(env, address, Approval { token: *token, owner, spender, value }); - Ok(increaseAllowanceCall::abi_encode_returns(&(value,))) + Ok(increaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { token, spender, value }) => { // TODO: charge based on benchmarked weight @@ -134,7 +134,7 @@ where let spender = *spender; deposit_event(env, address, Approval { token: *token, owner, spender, value }); - Ok(decreaseAllowanceCall::abi_encode_returns(&(value,))) + Ok(decreaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::create(createCall { admin, minBalance }) => { // TODO: charge based on benchmarked weight @@ -148,12 +148,12 @@ where .into(); deposit_event(env, address, Created { id, creator, admin: *admin }); - Ok(createCall::abi_encode_returns(&(id,))) + Ok(createCall::abi_encode_returns(&id)) }, IFungiblesCalls::startDestroy(startDestroyCall { token }) => { // TODO: charge based on benchmarked weight start_destroy::(to_runtime_origin(env.caller()), (*token).into())?; - Ok(startDestroyCall::abi_encode_returns(&())) + Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn{})) }, IFungiblesCalls::setMetadata(setMetadataCall { token, name, symbol, decimals }) => { // TODO: charge based on benchmarked weight @@ -164,12 +164,12 @@ where symbol.as_bytes().to_vec(), *decimals, )?; - Ok(setMetadataCall::abi_encode_returns(&())) + Ok(setMetadataCall::abi_encode_returns(&setMetadataReturn{})) }, IFungiblesCalls::clearMetadata(clearMetadataCall { token }) => { // TODO: charge based on benchmarked weight clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; - Ok(clearMetadataCall::abi_encode_returns(&())) + Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn{})) }, IFungiblesCalls::mint(mintCall { token, account, value }) => { // TODO: charge based on benchmarked weight @@ -184,7 +184,7 @@ where let from = Address::default(); let to = *account; deposit_event(env, address, Transfer { token: *token, from, to, value: *value }); - Ok(mintCall::abi_encode_returns(&())) + Ok(mintCall::abi_encode_returns(&mintReturn{})) }, IFungiblesCalls::burn(burnCall { token, account, value }) => { // TODO: charge based on benchmarked weight @@ -204,20 +204,20 @@ where address, Transfer { token: *token, from: *from, to, value: *value }, ); - Ok(burnCall::abi_encode_returns(&())) + Ok(burnCall::abi_encode_returns(&burnReturn{})) }, IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { // TODO: charge based on benchmarked weight let total_supply = U256::saturating_from(>::total_supply((*token).into())); - Ok(totalSupplyCall::abi_encode_returns(&(total_supply,))) + Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, IFungiblesCalls::balanceOf(balanceOfCall { token, owner }) => { // TODO: charge based on benchmarked weight let account = env.to_account_id(&(*owner.0).into()); let balance = U256::saturating_from(>::balance((*token).into(), account)); - Ok(balanceOfCall::abi_encode_returns(&(balance,))) + Ok(balanceOfCall::abi_encode_returns(&balance)) }, IFungiblesCalls::allowance(allowanceCall { token, owner, spender }) => { // TODO: charge based on benchmarked weight @@ -228,31 +228,29 @@ where &owner, &spender, )); - Ok(allowanceCall::abi_encode_returns(&(remaining,))) + Ok(allowanceCall::abi_encode_returns(&remaining)) }, IFungiblesCalls::name(nameCall { token }) => { // TODO: charge based on benchmarked weight let result = >::name((*token).into()); - // TODO: improve - let result = String::from_utf8_lossy(result.as_slice()); - Ok(nameCall::abi_encode_returns(&(result,))) + let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::symbol(symbolCall { token }) => { // TODO: charge based on benchmarked weight let result = >::symbol((*token).into()); - // TODO: improve - let result = String::from_utf8_lossy(result.as_slice()); - Ok(nameCall::abi_encode_returns(&(result,))) + let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::decimals(decimalsCall { token }) => { // TODO: charge based on benchmarked weight let result = >::decimals((*token).into()); - Ok(decimalsCall::abi_encode_returns(&(result,))) + Ok(decimalsCall::abi_encode_returns(&result)) }, IFungiblesCalls::exists(existsCall { token }) => { // TODO: charge based on benchmarked weight let result = self::exists::((*token).into()); - Ok(existsCall::abi_encode_returns(&(result,))) + Ok(existsCall::abi_encode_returns(&result)) }, } } From 0da29f2c01a01da2a9b54bfc1b04af3965da7e97 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 12:31:28 +0100 Subject: [PATCH 066/162] test(api): resolve breaking changes after rebase --- pallets/api-vnext/src/lib.rs | 9 +++++++-- pallets/api-vnext/src/mock.rs | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index f5edb0410..e328feef6 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -69,7 +69,7 @@ where } // A direct call to a precompile. -#[cfg(test)] +#[cfg(all(test, feature = "runtime-benchmarks"))] fn call_precompile< P: Precompile, O: SolValue @@ -89,7 +89,7 @@ fn decode< >( data: &[u8], ) -> T { - T::abi_decode(data, true).expect("unable to decode") + T::abi_decode(data).expect("unable to decode") } fn deposit_event( @@ -131,6 +131,11 @@ fn prefixed_address(n: u16, prefix: u32) -> [u8; 20] { address } +#[cfg(test)] +fn to_address(account: &::AccountId) -> H160 { + pallet_revive::AccountId32Mapper::::to_address(account) +} + // TODO: verify fn topics(event: &impl SolEvent) -> Vec { event.encode_topics().into_iter().map(|t| (*t.0).into()).collect() diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 566b76a58..fdb2d2260 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -6,7 +6,6 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSigned}; use pallet_assets::AutoIncAssetId; -use pallet_revive::precompiles::run::CallSetup; pub(crate) use pallet_revive::test_utils::ALICE; pub(crate) type Balance = u128; @@ -63,9 +62,11 @@ impl pallet_balances::Config for Test { impl pallet_revive::Config for Test { type AddressMapper = pallet_revive::AccountId32Mapper; type Currency = Balances; + type InstantiateOrigin = EnsureSigned; type Precompiles = (Fungibles<100, pallet_assets::Instance1>, Erc20<101, pallet_assets::Instance1>); type Time = Timestamp; + type UploadOrigin = EnsureSigned; } #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] @@ -131,9 +132,13 @@ impl ExtBuilder { ext } - pub(crate) fn build_with_env(self, execute: impl FnOnce(CallSetup) -> R) -> R { + #[cfg(feature = "runtime-benchmarks")] + pub(crate) fn build_with_env( + self, + execute: impl FnOnce(pallet_revive::precompiles::run::CallSetup) -> R, + ) -> R { self.build().execute_with(|| { - let call_setup = CallSetup::::default(); + let call_setup = pallet_revive::precompiles::run::CallSetup::::default(); // let (ext, _) = call_setup.ext(); execute(call_setup) }) From 84ffd309d27f77efd5993d1c5c38f052bfb6106f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 12:32:16 +0100 Subject: [PATCH 067/162] test(api): improve fungibles precompile tests after rebase --- .../src/fungibles/precompiles/mod.rs | 435 ++++++++---------- 1 file changed, 196 insertions(+), 239 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 715530529..8e87212c1 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -60,7 +60,7 @@ where address, Transfer { token: *token, from, to: *to, value: *value }, ); - Ok(transferCall::abi_encode_returns(&transferReturn{})) + Ok(transferCall::abi_encode_returns(&transferReturn {})) }, IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { // TODO: charge based on benchmarked weight @@ -79,7 +79,7 @@ where address, Transfer { token: *token, from: *from, to: *to, value }, ); - Ok(transferFromCall::abi_encode_returns(&transferFromReturn{})) + Ok(transferFromCall::abi_encode_returns(&transferFromReturn {})) }, IFungiblesCalls::approve(approveCall { token, spender, value }) => { // TODO: charge based on benchmarked weight @@ -99,7 +99,7 @@ where address, Approval { token: *token, owner, spender, value: *value }, ); - Ok(approveCall::abi_encode_returns(&approveReturn{})) + Ok(approveCall::abi_encode_returns(&approveReturn {})) }, IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { // TODO: charge based on benchmarked weight @@ -153,7 +153,7 @@ where IFungiblesCalls::startDestroy(startDestroyCall { token }) => { // TODO: charge based on benchmarked weight start_destroy::(to_runtime_origin(env.caller()), (*token).into())?; - Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn{})) + Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn {})) }, IFungiblesCalls::setMetadata(setMetadataCall { token, name, symbol, decimals }) => { // TODO: charge based on benchmarked weight @@ -164,12 +164,12 @@ where symbol.as_bytes().to_vec(), *decimals, )?; - Ok(setMetadataCall::abi_encode_returns(&setMetadataReturn{})) + Ok(setMetadataCall::abi_encode_returns(&setMetadataReturn {})) }, IFungiblesCalls::clearMetadata(clearMetadataCall { token }) => { // TODO: charge based on benchmarked weight clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; - Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn{})) + Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn {})) }, IFungiblesCalls::mint(mintCall { token, account, value }) => { // TODO: charge based on benchmarked weight @@ -184,7 +184,7 @@ where let from = Address::default(); let to = *account; deposit_event(env, address, Transfer { token: *token, from, to, value: *value }); - Ok(mintCall::abi_encode_returns(&mintReturn{})) + Ok(mintCall::abi_encode_returns(&mintReturn {})) }, IFungiblesCalls::burn(burnCall { token, account, value }) => { // TODO: charge based on benchmarked weight @@ -204,7 +204,7 @@ where address, Transfer { token: *token, from: *from, to, value: *value }, ); - Ok(burnCall::abi_encode_returns(&burnReturn{})) + Ok(burnCall::abi_encode_returns(&burnReturn {})) }, IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { // TODO: charge based on benchmarked weight @@ -272,12 +272,8 @@ mod tests { use mock::{Assets, ExtBuilder, *}; use pallet_assets::{AssetDetails, AssetMetadata, AssetStatus, Instance1}; use pallet_revive::{ - precompiles::{ - alloy::sol_types::{SolInterface, SolType}, - ExtWithInfo, - }, - test_utils::{ALICE_ADDR, BOB, BOB_ADDR}, - DepositLimit::*, + precompiles::alloy::sol_types::{SolInterface, SolType}, + test_utils::{ALICE, BOB, CHARLIE}, }; use super::{ @@ -288,37 +284,39 @@ mod tests { const FUNGIBLES: u16 = 100; const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); + type AccountId = ::AccountId; type Asset = pallet_assets::Asset; - type Fungibles = super::Fungibles; type Metadata = pallet_assets::Metadata; #[test] fn transfer_works() { let token = 1; + let origin = ALICE; let endowment = 10_000_000; + let to = BOB; ExtBuilder::new() - .with_assets(vec![(token, ALICE, true, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(token, ALICE), endowment); - assert_eq!(Assets::balance(token, BOB), 0); + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, origin.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &origin), endowment); + assert_eq!(Assets::balance(token, &to), 0); let value = endowment / 2; assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::transfer(transferCall { token, - to: BOB_ADDR.0.into(), + to: to_address(&to).0.into(), value: U256::from(value) }) )); - assert_eq!(Assets::balance(token, ALICE), endowment - value); - assert_eq!(Assets::balance(token, BOB), value); + assert_eq!(Assets::balance(token, &origin), endowment - value); + assert_eq!(Assets::balance(token, &to), value); - let from = ALICE_ADDR.0.into(); - let to = BOB_ADDR.0.into(); + let from = to_address(&origin).0.into(); + let to = to_address(&to).0.into(); let event = Transfer { token, from, to, value: U256::from(value) }; assert_last_event(ADDRESS, event); }); @@ -327,36 +325,39 @@ mod tests { #[test] fn transfer_from_works() { let token = 1; + let origin = BOB; + let from = ALICE; let endowment = 10_000_000; + let to = CHARLIE; let value = endowment / 2; ExtBuilder::new() - .with_assets(vec![(token, ALICE, true, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - assert_eq!(Assets::balance(token, ALICE), endowment); - assert_eq!(Assets::balance(token, BOB), 0); + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, from.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &from), endowment); + assert_eq!(Assets::balance(token, &to), 0); assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(from.clone()), token, - BOB, + origin.clone(), value )); - call_setup.set_origin(Origin::Signed(BOB)); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::transferFrom(transferFromCall { token, - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), + from: to_address(&from).0.into(), + to: to_address(&to).0.into(), value: U256::from(value), }) )); - assert_eq!(Assets::balance(token, ALICE), endowment - value); - assert_eq!(Assets::balance(token, BOB), value); - let from = ALICE_ADDR.0.into(); - let to = BOB_ADDR.0.into(); + assert_eq!(Assets::balance(token, &from), endowment - value); + assert_eq!(Assets::balance(token, &to), value); + let from = to_address(&from).0.into(); + let to = to_address(&to).0.into(); let event = Transfer { token, from, to, value: U256::from(value) }; assert_last_event(ADDRESS, event); }); @@ -365,28 +366,30 @@ mod tests { #[test] fn approve_works() { let token = 1; + let origin = ALICE; + let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::allowance(token, &ALICE, &BOB), 0); + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { + assert_eq!(Assets::allowance(token, &origin, &spender), 0); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::approve(approveCall { token, - spender: BOB_ADDR.0.into(), + spender: to_address(&spender).0.into(), value: U256::from(value), }) )); - assert_eq!(Assets::allowance(token, &ALICE, &BOB), value); - let owner = ALICE_ADDR.0.into(); - let spender = BOB_ADDR.0.into(); + assert_eq!(Assets::allowance(token, &origin, &spender), value); + let owner = to_address(&origin).0.into(); + let spender = to_address(&spender).0.into(); let event = Approval { token, owner, spender, value: U256::from(value) }; assert_last_event(ADDRESS, event); - }, - ); + }); } #[test] @@ -395,9 +398,10 @@ mod tests { let origin = ALICE; let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(origin.clone())); + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { assert_ok!(Assets::approve_transfer( RuntimeOrigin::signed(origin.clone()), token.into(), @@ -408,10 +412,10 @@ mod tests { // Double the allowance. let allowance = call_precompile::( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, - spender: BOB_ADDR.0.into(), + spender: to_address(&spender).0.into(), value: U256::from(value), }), ) @@ -419,12 +423,11 @@ mod tests { assert_eq!(allowance, U256::from(value * 2)); assert_eq!(Assets::allowance(token, &origin, &spender), value * 2); - let owner = ALICE_ADDR.0.into(); - let spender = BOB_ADDR.0.into(); + let owner = to_address(&origin).0.into(); + let spender = to_address(&spender).0.into(); let event = Approval { token, owner, spender, value: U256::from(allowance) }; assert_last_event(ADDRESS, event); - }, - ); + }); } #[test] @@ -433,9 +436,10 @@ mod tests { let origin = ALICE; let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(origin.clone())); + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { assert_ok!(Assets::approve_transfer( RuntimeOrigin::signed(origin.clone()), token.into(), @@ -446,10 +450,10 @@ mod tests { // Halve the allowance. let allowance = call_precompile::( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { token, - spender: BOB_ADDR.0.into(), + spender: to_address(&spender).0.into(), value: U256::from(value / 2), }), ) @@ -457,41 +461,42 @@ mod tests { assert_eq!(allowance, U256::from(value / 2)); assert_eq!(Assets::allowance(token, &origin, &spender), value / 2); - let owner = ALICE_ADDR.0.into(); - let spender = BOB_ADDR.0.into(); + let owner = to_address(&origin).0.into(); + let spender = to_address(&spender).0.into(); let event = Approval { token, owner, spender, value: U256::from(allowance) }; assert_last_event(ADDRESS, event); - }, - ); + }); } #[test] fn create_works() { - let id = 0u32; + let token = 0; + let origin = ALICE; + let admin = BOB; let min_balance = 1; - ExtBuilder::new().build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert!(!Assets::asset_exists(id)); - - let mut ext = call_setup.ext().0; - let result: u32 = call_precompile( - &mut ext, - &IFungiblesCalls::create(createCall { - admin: BOB_ADDR.0.into(), - minBalance: U256::from(min_balance), - }), - ) - .unwrap(); - - assert_eq!(result, id); - assert!(Assets::asset_exists(id)); + ExtBuilder::new().build().execute_with(|| { + assert!(!Assets::asset_exists(token)); + assert_eq!( - Asset::get(id).unwrap(), + call_precompile::( + &origin, + &IFungiblesCalls::create(createCall { + admin: to_address(&admin).0.into(), + minBalance: U256::from(min_balance), + }), + ) + .unwrap(), + token + ); + + assert!(Assets::asset_exists(token)); + assert_eq!( + Asset::get(token).unwrap(), AssetDetails { - owner: ALICE, - issuer: BOB, - admin: BOB, - freezer: BOB, + owner: origin.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), supply: 0, deposit: min_balance, min_balance, @@ -503,35 +508,9 @@ mod tests { } ); - let event = Created { id, creator: ALICE_ADDR.0.into(), admin: BOB_ADDR.0.into() }; - assert_last_event(ADDRESS, event); - }); - } - - #[test] - fn create_via_bare_call_works() { - let id = 0u32; - let origin = RuntimeOrigin::signed(ALICE); - ExtBuilder::new().build().execute_with(|| { - assert!(!Assets::asset_exists(id)); - - let result = bare_call::( - origin, - ADDRESS.into(), - 0, - Weight::MAX, - DepositLimit::Balance(u128::MAX), - IFungiblesCalls::create(createCall { - admin: BOB_ADDR.0.into(), - minBalance: U256::from(1), - }) - .abi_encode(), - ) - .unwrap(); - - assert_eq!(result, id); - assert!(Assets::asset_exists(id)); - let event = Created { id, creator: ALICE_ADDR.0.into(), admin: BOB_ADDR.0.into() }; + let creator = to_address(&origin).0.into(); + let admin = to_address(&admin).0.into(); + let event = Created { id: token, creator, admin }; assert_last_event(ADDRESS, event); }); } @@ -539,35 +518,37 @@ mod tests { #[test] fn start_destroy_works() { let token = 1; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); + let origin = ALICE; + ExtBuilder::new() + .with_assets(vec![(token, origin.clone(), false, 1)]) + .build() + .execute_with(|| { assert_eq!(Asset::get(token).unwrap().status, AssetStatus::Live); - let mut ext = call_setup.ext().0; assert_ok!(call_precompile::<()>( - &mut ext, + &origin, &startDestroy(startDestroyCall { token }) )); assert_eq!(Asset::get(token).unwrap().status, AssetStatus::Destroying); - }, - ); + }); } #[test] fn set_metadata_works() { let token = 1; + let origin = ALICE; let name = "name".to_string(); let symbol = "symbol".to_string(); let decimals = u8::MAX; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); + ExtBuilder::new() + .with_assets(vec![(token, origin.clone(), false, 1)]) + .build() + .execute_with(|| { assert_eq!(Metadata::get(token), AssetMetadata::default()); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &setMetadata(setMetadataCall { token, name: name.clone(), @@ -586,21 +567,21 @@ mod tests { is_frozen: false, } ); - }, - ); + }); } #[test] fn clear_metadata_works() { let token = 1; + let origin = ALICE; let name = b"name".to_vec(); let symbol = b"symbol".to_vec(); let decimals = u8::MAX; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, origin.clone(), false, 1)]) .with_asset_metadata(vec![(token, name.clone(), symbol.clone(), decimals)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); + .build() + .execute_with(|| { assert_eq!( Metadata::get(token), AssetMetadata { @@ -613,7 +594,7 @@ mod tests { ); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &clearMetadata(clearMetadataCall { token }) )); @@ -624,52 +605,54 @@ mod tests { #[test] fn mint_works() { let token = 1; + let origin = ALICE; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(token, ALICE), 0); + ExtBuilder::new() + .with_assets(vec![(token, origin.clone(), false, 1)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &origin), 0); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::mint(mintCall { token, - account: ALICE_ADDR.0.into(), + account: to_address(&origin).0.into(), value: U256::from(value) }) )); - assert_eq!(Assets::balance(token, ALICE), value); + assert_eq!(Assets::balance(token, &origin), value); let from = Address::default(); - let to = ALICE_ADDR.0.into(); + let to = to_address(&origin).0.into(); let event = Transfer { token, from, to, value: U256::from(value) }; assert_last_event(ADDRESS, event); - }, - ); + }); } #[test] fn burn_works() { let token = 1; + let origin = ALICE; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - assert_eq!(Assets::balance(token, ALICE), endowment); + .with_assets(vec![(token, origin.clone(), false, 1)]) + .with_asset_balances(vec![(token, origin.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &origin), endowment); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &origin, &IFungiblesCalls::burn(burnCall { token, - account: ALICE_ADDR.0.into(), + account: to_address(&origin).0.into(), value: U256::from(endowment), }), )); - assert_eq!(Assets::balance(token, ALICE), 0); - let from = ALICE_ADDR.0.into(); + assert_eq!(Assets::balance(token, &origin), 0); + let from = to_address(&origin).0.into(); let to = Address::default(); let event = Transfer { token, from, to, value: U256::from(endowment) }; assert_last_event(ADDRESS, event); @@ -678,15 +661,16 @@ mod tests { #[test] fn total_supply_works() { - let token = u32::MAX; + let token = 1; let total_supply = 10_000_000; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_balances(vec![(token, ALICE, total_supply)]) - .build_with_env(|mut call_setup| { + .build() + .execute_with(|| { assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &BOB, &IFungiblesCalls::totalSupply(totalSupplyCall { token }) ) .unwrap(), @@ -697,57 +681,60 @@ mod tests { #[test] fn balance_of_works() { - let token = u32::MAX; + let token = 1; + let owner = ALICE; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_balances(vec![(token, owner.clone(), endowment)]) + .build() + .execute_with(|| { assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &BOB, &IFungiblesCalls::balanceOf(balanceOfCall { token, - owner: ALICE_ADDR.0.into() + owner: to_address(&owner).0.into() }) ) .unwrap(), U256::from(endowment) ); - assert_eq!(Assets::balance(token, ALICE), endowment); + assert_eq!(Assets::balance(token, owner), endowment); }); } #[test] fn allowance_works() { - let token = u32::MAX; + let token = 1; + let owner = ALICE; + let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(owner.clone()), token, - BOB, + spender.clone(), value )); assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &BOB, &IFungiblesCalls::allowance(allowanceCall { token, - owner: ALICE_ADDR.0.into(), - spender: BOB_ADDR.0.into(), + owner: to_address(&owner).0.into(), + spender: to_address(&spender).0.into(), }) ) .unwrap(), U256::from(value) ); - }, - ); + }); } #[test] @@ -755,12 +742,12 @@ mod tests { let token = 1; let name = "name".to_string(); ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, name.as_bytes().into(), b"symbol".to_vec(), u8::MAX)]) - .build_with_env(|mut call_setup| { - let mut ext = call_setup.ext().0; + .build() + .execute_with(|| { assert_eq!( - call_precompile::(&mut ext, &IFungiblesCalls::name(nameCall { token })) + call_precompile::(&ALICE, &IFungiblesCalls::name(nameCall { token })) .unwrap(), name ); @@ -772,13 +759,13 @@ mod tests { let token = 1; let symbol = "symbol".to_string(); ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, b"name".to_vec(), symbol.as_bytes().into(), u8::MAX)]) - .build_with_env(|mut call_setup| { - let mut ext = call_setup.ext().0; + .build() + .execute_with(|| { assert_eq!( call_precompile::( - &mut ext, + &ALICE, &IFungiblesCalls::symbol(symbolCall { token }) ) .unwrap(), @@ -792,13 +779,13 @@ mod tests { let token = 1; let decimals = u8::MAX; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), decimals)]) - .build_with_env(|mut call_setup| { - let mut ext = call_setup.ext().0; + .build() + .execute_with(|| { assert_eq!( call_precompile::( - &mut ext, + &ALICE, &IFungiblesCalls::decimals(decimalsCall { token }) ) .unwrap() as u8, @@ -810,14 +797,14 @@ mod tests { #[test] fn exists_works() { let token = 1; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { assert!(Assets::asset_exists(token)); - let mut ext = call_setup.ext().0; assert!(call_precompile::( - &mut ext, + &ALICE, &IFungiblesCalls::exists(existsCall { token }) ) .unwrap()); @@ -825,54 +812,24 @@ mod tests { let token = token + 1; assert!(!Assets::asset_exists(token)); assert!(!call_precompile::( - &mut ext, + &ALICE, &IFungiblesCalls::exists(existsCall { token }) ) .unwrap()); - }, - ); - } - - #[test] - fn exists_via_bare_call_works() { - let token = 1; - let origin = RuntimeOrigin::signed(ALICE); - ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) - .build() - .execute_with(|| { - assert!(Assets::asset_exists(token)); - - let asset_exists = bare_call::( - origin.clone(), - ADDRESS.into(), - 0, - Weight::MAX, - Unchecked, - IFungiblesCalls::exists(existsCall { token }).abi_encode(), - ) - .unwrap(); - assert!(asset_exists); - - let token = token + 1; - assert!(!Assets::asset_exists(token)); - let exists = bare_call::( - origin, - ADDRESS.into(), - 0, - Weight::MAX, - Unchecked, - IFungiblesCalls::exists(existsCall { token }).abi_encode(), - ) - .unwrap(); - assert!(!exists); }); } fn call_precompile::RustType>>( - ext: &mut impl ExtWithInfo, + origin: &AccountId, input: &IFungiblesCalls, - ) -> Result { - super::call_precompile::(ext, &ADDRESS, input) + ) -> Result { + bare_call::( + RuntimeOrigin::signed(origin.clone()), + ADDRESS.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + input.abi_encode(), + ) } } From f5220249651b48fdc24023882f004f7e98dba1e8 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 12:56:55 +0100 Subject: [PATCH 068/162] test(api): improve erc20 precompile tests after rebase --- .../src/fungibles/precompiles/erc20.rs | 212 +++++++++--------- 1 file changed, 111 insertions(+), 101 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 701226820..97f50cd00 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -138,45 +138,42 @@ impl, I: 'static> Erc20 { #[cfg(test)] mod tests { - use frame_support::{assert_ok, sp_runtime::app_crypto::sp_core::bytes::to_hex}; + use frame_support::{ + assert_ok, + sp_runtime::{app_crypto::sp_core::bytes::to_hex, DispatchError}, + }; use pallet_assets::Instance1; use pallet_revive::{ - precompiles::{ - alloy::sol_types::{SolType, SolValue}, - ExtWithInfo, - }, - test_utils::{ALICE, ALICE_ADDR, BOB, BOB_ADDR}, - Origin, + precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, + test_utils::{ALICE, BOB, CHARLIE}, }; use IERC20Calls::*; use IERC20::{Approval, Transfer}; use super::*; use crate::{ - assert_last_event, + assert_last_event, bare_call, fungibles::approve, mock::{Assets, ExtBuilder, RuntimeOrigin, Test}, + to_address, DepositLimit, Weight, }; const ERC20: u16 = 101; - type Erc20 = super::Erc20; + type AccountId = ::AccountId; #[test] fn total_supply_works() { - let token = u32::MAX; + let token = 1; let total_supply = 10_000_000; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_balances(vec![(token, ALICE, total_supply)]) - .build_with_env(|mut call_setup| { + .build() + .execute_with(|| { assert_eq!( - call_precompile::( - &mut call_setup.ext().0, - token, - &totalSupply(totalSupplyCall {}) - ) - .unwrap(), + call_precompile::(&ALICE, token, &totalSupply(totalSupplyCall {})) + .unwrap(), U256::from(total_supply) ); }); @@ -184,19 +181,19 @@ mod tests { #[test] fn balance_of_works() { - let token = u32::MAX; + let token = 1; + let account = ALICE; let endowment = 10_000_000; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_balances(vec![(token, account.clone(), endowment)]) + .build() + .execute_with(|| { assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &BOB, token, - &balanceOf(balanceOfCall { account: ALICE_ADDR.0.into() }) + &balanceOf(balanceOfCall { account: to_address(&account).0.into() }) ) .unwrap(), U256::from(endowment) @@ -206,31 +203,33 @@ mod tests { #[test] fn transfer_works() { - let token = u32::MAX; + let token = 1; + let origin = ALICE; let endowment = 10_000_000; + let to = BOB; ExtBuilder::new() - .with_assets(vec![(token, BOB, true, 1)]) - .with_asset_balances(vec![(token, BOB, endowment)]) - .build_with_env(|mut call_setup| { - call_setup.set_origin(Origin::Signed(BOB)); - assert_eq!(Assets::balance(token, BOB), endowment); - assert_eq!(Assets::balance(token, ALICE), 0); + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, origin.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &origin), endowment); + assert_eq!(Assets::balance(token, &to), 0); let value = endowment / 2; assert!(call_precompile::( - &mut call_setup.ext().0, + &origin, token, &IERC20Calls::transfer(IERC20::transferCall { - to: ALICE_ADDR.0.into(), + to: to_address(&to).0.into(), value: U256::from(value) }) ) .unwrap()); - assert_eq!(Assets::balance(token, BOB), endowment - value); - assert_eq!(Assets::balance(token, ALICE), value); - let from = BOB_ADDR.0.into(); - let to = ALICE_ADDR.0.into(); + assert_eq!(Assets::balance(token, &origin), endowment - value); + assert_eq!(Assets::balance(token, &to), value); + let from = to_address(&origin).0.into(); + let to = to_address(&to).0.into(); let event = Transfer { from, to, value: U256::from(value) }; assert_last_event(prefixed_address(ERC20, token), event); }); @@ -238,12 +237,16 @@ mod tests { #[test] fn allowance_works() { - let token = u32::MAX; + let token = 1; + let owner = ALICE; + let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(owner.clone()), token, BOB, value @@ -251,83 +254,86 @@ mod tests { assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &BOB, token, &allowance(allowanceCall { - owner: ALICE_ADDR.0.into(), - spender: BOB_ADDR.0.into(), + owner: to_address(&owner).0.into(), + spender: to_address(&spender).0.into(), }) ) .unwrap(), U256::from(value) ); - }, - ); + }); } #[test] fn approve_works() { - let token = u32::MAX; + let token = 1; + let origin = ALICE; + let spender = BOB; let value = 10_000_000; - ExtBuilder::new().with_assets(vec![(token, ALICE, false, 1)]).build_with_env( - |mut call_setup| { - call_setup.set_origin(Origin::Signed(ALICE)); - - assert_eq!(Assets::allowance(token, &ALICE, &BOB), 0); + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { + assert_eq!(Assets::allowance(token, &origin, &spender), 0); assert!(call_precompile::( - &mut call_setup.ext().0, + &origin, token, &IERC20Calls::approve(IERC20::approveCall { - spender: BOB_ADDR.0.into(), + spender: to_address(&spender).0.into(), value: U256::from(value) }) ) .unwrap()); - assert_eq!(Assets::allowance(token, &ALICE, &BOB), value); - let owner = ALICE_ADDR.0.into(); - let spender = BOB_ADDR.0.into(); + assert_eq!(Assets::allowance(token, &origin, &spender), value); + let owner = to_address(&origin).0.into(); + let spender = to_address(&spender).0.into(); let event = Approval { owner, spender, value: U256::from(value) }; assert_last_event(prefixed_address(ERC20, token), event); - }, - ); + }); } #[test] fn transfer_from_works() { - let token = u32::MAX; + let token = 1; + let origin = BOB; + let from = ALICE; let endowment = 10_000_000; + let to = CHARLIE; let value = endowment / 2; ExtBuilder::new() - .with_assets(vec![(token, ALICE, true, 1)]) - .with_asset_balances(vec![(token, ALICE, endowment)]) - .build_with_env(|mut call_setup| { - assert_eq!(Assets::balance(token, ALICE), endowment); - assert_eq!(Assets::balance(token, BOB), 0); + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, from.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &from), endowment); + assert_eq!(Assets::balance(token, &to), 0); assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(from.clone()), token, - BOB, + origin.clone(), value )); - call_setup.set_origin(Origin::Signed(BOB)); assert!(call_precompile::( - &mut call_setup.ext().0, + &origin, token, &transferFrom(IERC20::transferFromCall { - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), + from: to_address(&from).0.into(), + to: to_address(&to).0.into(), value: U256::from(value), }) ) .unwrap()); - assert_eq!(Assets::balance(token, ALICE), endowment - value); - assert_eq!(Assets::balance(token, BOB), value); - let from = ALICE_ADDR.0.into(); - let to = BOB_ADDR.0.into(); + assert_eq!(Assets::balance(token, &from), endowment - value); + assert_eq!(Assets::balance(token, &to), value); + let from = to_address(&from).0.into(); + let to = to_address(&to).0.into(); let event = Transfer { from, to, value: U256::from(value) }; assert_last_event(prefixed_address(ERC20, token), event); }); @@ -335,16 +341,15 @@ mod tests { #[test] fn name_works() { - let token = u32::MAX; + let token = 1; let _name = "name"; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) - .build_with_env(|mut call_setup| { + .build() + .execute_with(|| { assert_eq!( - call_precompile::(&mut call_setup.ext().0, token, &name(nameCall {})) - .unwrap() - .as_str(), + call_precompile::(&ALICE, token, &name(nameCall {})).unwrap().as_str(), _name ); }); @@ -352,20 +357,17 @@ mod tests { #[test] fn symbol_works() { - let token = u32::MAX; + let token = 1; let _symbol = "symbol"; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) - .build_with_env(|mut call_setup| { + .build() + .execute_with(|| { assert_eq!( - call_precompile::( - &mut call_setup.ext().0, - token, - &symbol(symbolCall {}) - ) - .unwrap() - .as_str(), + call_precompile::(&ALICE, token, &symbol(symbolCall {})) + .unwrap() + .as_str(), _symbol ); }); @@ -373,15 +375,15 @@ mod tests { #[test] fn decimals_works() { - let token = u32::MAX; + let token = 1; let _decimals = u8::MAX; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) - .build_with_env(|mut call_setup| { - let mut ext = call_setup.ext().0; + .build() + .execute_with(|| { assert_eq!( - call_precompile::(&mut ext, token, &decimals(decimalsCall {})).unwrap() + call_precompile::(&ALICE, token, &decimals(decimalsCall {})).unwrap() as u8, _decimals ); @@ -396,10 +398,18 @@ mod tests { } fn call_precompile::RustType>>( - ext: &mut impl ExtWithInfo, + origin: &AccountId, token: u32, input: &IERC20Calls, - ) -> Result { - crate::call_precompile::(ext, &prefixed_address(ERC20, token), input) + ) -> Result { + let address = prefixed_address(ERC20, token); + bare_call::( + RuntimeOrigin::signed(origin.clone()), + address.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + input.abi_encode(), + ) } } From 3ab17450ae75980df48f74a8f2978febf48f57db Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 13:03:32 +0100 Subject: [PATCH 069/162] test(api): define precompile constants within mock runtime --- pallets/api-vnext/src/fungibles/precompiles/erc20.rs | 4 +--- pallets/api-vnext/src/fungibles/precompiles/mod.rs | 1 - pallets/api-vnext/src/mock.rs | 5 ++++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 97f50cd00..98a08cb2d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -154,12 +154,10 @@ mod tests { use crate::{ assert_last_event, bare_call, fungibles::approve, - mock::{Assets, ExtBuilder, RuntimeOrigin, Test}, + mock::{Assets, ExtBuilder, RuntimeOrigin, Test, ERC20}, to_address, DepositLimit, Weight, }; - const ERC20: u16 = 101; - type AccountId = ::AccountId; #[test] diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 8e87212c1..3929bf30d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -281,7 +281,6 @@ mod tests { *, }; - const FUNGIBLES: u16 = 100; const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); type AccountId = ::AccountId; diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index fdb2d2260..19eed1511 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -13,6 +13,9 @@ type Block = frame_system::mocking::MockBlock; type Erc20 = crate::Erc20; type Fungibles = crate::Fungibles; +pub(crate) const ERC20: u16 = 2; +pub(crate) const FUNGIBLES: u16 = 1; + #[frame_support::runtime] mod runtime { #[runtime::runtime] @@ -64,7 +67,7 @@ impl pallet_revive::Config for Test { type Currency = Balances; type InstantiateOrigin = EnsureSigned; type Precompiles = - (Fungibles<100, pallet_assets::Instance1>, Erc20<101, pallet_assets::Instance1>); + (Fungibles, Erc20); type Time = Timestamp; type UploadOrigin = EnsureSigned; } From 1f6cf52ff969d8826639dddaa263b4cad7beda0f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 13:06:59 +0100 Subject: [PATCH 070/162] refactor(api): use asset id extractors from pallet-assets --- pallets/api-vnext/src/fungibles/mod.rs | 18 ------------------ .../src/fungibles/precompiles/erc20.rs | 6 +++--- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index dc33fdda1..6bbb6b971 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -226,21 +226,3 @@ fn transfer_from, I>( value, ) } - -// TODO: replace with type in pallet_assets once available in next release -pub struct InlineAssetIdExtractor; -impl AssetIdExtractor for InlineAssetIdExtractor { - type AssetId = u32; - - fn asset_id_from_address(addr: &[u8; 20]) -> Result { - let bytes: [u8; 4] = addr[0..4].try_into().expect("slice is 4 bytes; qed"); - let index = u32::from_be_bytes(bytes); - Ok(index) - } -} -/// Mean of extracting the asset id from the precompile address. -pub trait AssetIdExtractor { - type AssetId; - /// Extracts the asset id from the address. - fn asset_id_from_address(address: &[u8; 20]) -> Result; -} diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 98a08cb2d..f582ad148 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -4,14 +4,14 @@ use frame_support::{ sp_runtime::traits::AtLeast32Bit, traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, }; +use pallet_assets::precompiles::{AssetIdExtractor, InlineAssetIdExtractor}; use pallet_revive::AddressMapper as _; use AddressMatcher::Prefix; use IERC20::*; use super::{ - deposit_event, prefixed_address, sol, to_runtime_origin, AddressMapper, AddressMatcher, - AssetIdExtractor, Assets, Config, Error, Ext, InlineAssetIdExtractor, NonZero, PhantomData, - Precompile, SolCall, UintTryFrom, UintTryTo, U256, + deposit_event, prefixed_address, sol, to_runtime_origin, AddressMapper, AddressMatcher, Assets, + Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, UintTryFrom, UintTryTo, U256, }; sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); From 0f2ed8a1dfadd372b7385981f8e954048ba0b488 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 13:24:10 +0100 Subject: [PATCH 071/162] test(devnet): resolve breaking changes after rebase --- runtime/devnet/src/config/contracts.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index d1b35377a..e5155a86b 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -246,7 +246,7 @@ mod tests { origin.clone(), 10 * UNIT, Weight::MAX, - DepositLimit::Unchecked, + DepositLimit::Balance(u128::MAX), Code::Upload(contract.to_vec()), // Constructors are not yet using Solidity encoding [blake_selector("new"), ("Name", "SYMBOL", minimum_value, 10u8).encode()].concat(), @@ -304,12 +304,18 @@ mod tests { contract: H160, data: Vec, ) -> T { - let result = - Revive::bare_call(origin, contract, 0, Weight::MAX, DepositLimit::Unchecked, data) - .result - .unwrap(); + let result = Revive::bare_call( + origin, + contract, + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + data, + ) + .result + .unwrap(); assert!(!result.did_revert()); - T::abi_decode(&result.data, true).unwrap() + T::abi_decode(&result.data).unwrap() } } From ac05cb7e578418d15a19e79a3501b55df219ff78 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 23:43:55 +0100 Subject: [PATCH 072/162] refactor(api): import soltype --- pallets/api-vnext/src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index e328feef6..3b9efe32f 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -24,7 +24,10 @@ use { sp_runtime::traits::Bounded, }, frame_system::pallet_prelude::OriginFor, - pallet_revive::{precompiles::alloy::sol_types::SolValue, BalanceOf, DepositLimit, MomentOf}, + pallet_revive::{ + precompiles::alloy::sol_types::{SolType, SolValue}, + BalanceOf, DepositLimit, MomentOf, + }, }; #[cfg(feature = "fungibles")] @@ -83,12 +86,7 @@ fn call_precompile< } #[cfg(test)] -fn decode< - T: SolValue - + From<::RustType>, ->( - data: &[u8], -) -> T { +fn decode::RustType>>(data: &[u8]) -> T { T::abi_decode(data).expect("unable to decode") } From 752d67799dad6800ed9cc752585804e2039707ae Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 23:44:38 +0100 Subject: [PATCH 073/162] refactor(api): correct fungibles trait parameter names --- pop-api-vnext/src/fungibles/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index 0bea36445..eaa04d5ed 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -130,7 +130,7 @@ pub trait Fungibles { /// - `account` - The account from which the tokens will be destroyed. /// - `value` - The number of tokens to destroy. #[ink(message)] - fn burn(&self, token: TokenId, address: Address, value: U256); + fn burn(&self, token: TokenId, account: Address, value: U256); /// Total token supply for a specified token. /// @@ -222,10 +222,10 @@ pub fn approve(token: TokenId, spender: Address, value: U256) -> Result<(), Erro /// - `token` - The token. /// - `owner` - The owner of the token. #[inline] -pub fn balance_of(token: TokenId, account: Address) -> U256 { +pub fn balance_of(token: TokenId, owner: Address) -> U256 { let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); - precompile.balanceOf(token, account) + precompile.balanceOf(token, owner) } /// Destroys `value` amount of tokens from `account`, reducing the total supply. From 50041b3bb9a538059884aaf46f5f151985818ed8 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Jun 2025 23:45:02 +0100 Subject: [PATCH 074/162] refactor(devnet): simplify selector implementations --- runtime/devnet/src/config/contracts.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index e5155a86b..1b21c581a 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -320,13 +320,11 @@ mod tests { } fn blake_selector(name: &str) -> Vec { - let hash = sp_io::hashing::blake2_256(name.as_bytes()); - [hash[0..4].to_vec()].concat() + sp_io::hashing::blake2_256(name.as_bytes())[0..4].to_vec() } fn keccak_selector(name: &str) -> Vec { - let hash = sp_io::hashing::keccak_256(name.as_bytes()); - [hash[0..4].to_vec()].concat() + sp_io::hashing::keccak_256(name.as_bytes())[0..4].to_vec() } #[test] From b3e2c9decbb39190d886fb33815889c578cebd4a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 09:58:31 +0100 Subject: [PATCH 075/162] test(api): add initial integration tests --- Cargo.lock | 1107 +++++++++++++++-- Cargo.toml | 1 + pop-api-vnext/integration-tests/Cargo.toml | 47 + pop-api-vnext/integration-tests/build.rs | 58 + .../contracts/fungibles/Cargo.toml | 29 + .../contracts/fungibles/lib.rs | 134 ++ .../integration-tests/src/fungibles.rs | 479 +++++++ pop-api-vnext/integration-tests/src/lib.rs | 145 +++ 8 files changed, 1917 insertions(+), 83 deletions(-) create mode 100644 pop-api-vnext/integration-tests/Cargo.toml create mode 100644 pop-api-vnext/integration-tests/build.rs create mode 100644 pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml create mode 100644 pop-api-vnext/integration-tests/contracts/fungibles/lib.rs create mode 100644 pop-api-vnext/integration-tests/src/fungibles.rs create mode 100644 pop-api-vnext/integration-tests/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 7136be3a3..4a2074fc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,17 +110,47 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "alloy-core" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8bcce99ad10fe02640cfaec1c6bc809b837c783c1d52906aa5af66e2a196f6" +dependencies = [ + "alloy-dyn-abi 0.8.25", + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-rlp", + "alloy-sol-types 0.8.25", +] + [[package]] name = "alloy-core" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5968f48d7a62587cd874bd84034831da4f7f577ce5de984828e376766efc0f32" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", + "alloy-dyn-abi 1.2.0", + "alloy-json-abi 1.2.0", + "alloy-primitives 1.2.0", "alloy-rlp", - "alloy-sol-types", + "alloy-sol-types 1.2.0", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "alloy-sol-types 0.8.25", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", ] [[package]] @@ -129,28 +159,67 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9135eb501feccf7f4cb8a183afd406a65483fdad7bbd7332d0470e5d725c92f" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", + "alloy-json-abi 1.2.0", + "alloy-primitives 1.2.0", + "alloy-sol-type-parser 1.2.0", + "alloy-sol-types 1.2.0", "itoa", "serde", "serde_json", "winnow", ] +[[package]] +name = "alloy-json-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" +dependencies = [ + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "serde", + "serde_json", +] + [[package]] name = "alloy-json-abi" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b26fdd571915bafe857fccba4ee1a4f352965800e46a53e4a5f50187b7776fa" dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", + "alloy-primitives 1.2.0", + "alloy-sol-type-parser 1.2.0", "serde", "serde_json", ] +[[package]] +name = "alloy-primitives" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.3", + "indexmap 2.9.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + [[package]] name = "alloy-primitives" version = "1.2.0" @@ -188,18 +257,50 @@ dependencies = [ "bytes", ] +[[package]] +name = "alloy-sol-macro" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" +dependencies = [ + "alloy-sol-macro-expander 0.8.25", + "alloy-sol-macro-input 0.8.25", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "alloy-sol-macro" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4be1ce1274ddd7fdfac86e5ece1b225e9bba1f2327e20fbb30ee6b9cc1423fe" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 1.2.0", + "alloy-sol-macro-input 1.2.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" +dependencies = [ + "alloy-sol-macro-input 0.8.25", + "const-hex", + "heck 0.5.0", + "indexmap 2.9.0", "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.101", + "syn-solidity 0.8.25", + "tiny-keccak", ] [[package]] @@ -208,7 +309,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01e92f3708ea4e0d9139001c86c051c538af0146944a2a9c7181753bd944bf57" dependencies = [ - "alloy-sol-macro-input", + "alloy-sol-macro-input 1.2.0", "const-hex", "heck 0.5.0", "indexmap 2.9.0", @@ -216,10 +317,26 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.101", - "syn-solidity", + "syn-solidity 1.2.0", "tiny-keccak", ] +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.101", + "syn-solidity 0.8.25", +] + [[package]] name = "alloy-sol-macro-input" version = "1.2.0" @@ -233,7 +350,17 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.101", - "syn-solidity", + "syn-solidity 1.2.0", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d162f8524adfdfb0e4bd0505c734c985f3e2474eb022af32eef0d52a4f3935c" +dependencies = [ + "serde", + "winnow", ] [[package]] @@ -246,15 +373,28 @@ dependencies = [ "winnow", ] +[[package]] +name = "alloy-sol-types" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-macro 0.8.25", + "const-hex", + "serde", +] + [[package]] name = "alloy-sol-types" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6185e98a79cf19010722f48a74b5a65d153631d2f038cabd250f4b9e9813b8ad" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", + "alloy-json-abi 1.2.0", + "alloy-primitives 1.2.0", + "alloy-sol-macro 1.2.0", "serde", ] @@ -966,7 +1106,7 @@ dependencies = [ "pallet-nfts 22.0.0", "pallet-nfts-runtime-api 14.0.0", "pallet-proxy 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-session 28.0.0", "pallet-state-trie-migration 29.0.0", "pallet-timestamp 27.0.0", @@ -1054,8 +1194,8 @@ dependencies = [ "impl-trait-for-tuples", "pallet-asset-conversion 10.0.0", "pallet-assets 29.1.0", - "pallet-revive", - "pallet-revive-uapi", + "pallet-revive 0.1.0", + "pallet-revive-uapi 0.1.0", "pallet-xcm 7.0.0", "parachains-common 7.0.0", "parity-scale-codec", @@ -2541,6 +2681,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "colored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "combine" version = "4.6.7" @@ -2691,8 +2840,8 @@ dependencies = [ "bollard", "cargo_metadata 0.19.2", "clap", - "colored", - "contract-metadata", + "colored 2.2.0", + "contract-metadata 5.0.3", "crossterm", "duct", "heck 0.5.0", @@ -2718,7 +2867,48 @@ dependencies = [ "wasm-opt", "wasmparser 0.220.1", "which", - "zip", + "zip 2.4.2", +] + +[[package]] +name = "contract-build" +version = "6.0.0-alpha.1" +source = "git+https://github.com/use-ink/cargo-contract#d19dfd68932b207b86e74c2f5e9c149f89f80556" +dependencies = [ + "alloy-json-abi 0.8.25", + "anyhow", + "blake2 0.10.6", + "bollard", + "cargo_metadata 0.19.2", + "clap", + "colored 3.0.0", + "contract-metadata 6.0.0-alpha", + "crossterm", + "duct", + "heck 0.5.0", + "hex", + "impl-serde 0.5.0", + "ink_metadata 6.0.0-alpha", + "itertools 0.13.0", + "parity-scale-codec", + "polkavm-linker 0.22.0", + "regex", + "rustc_version 0.4.1", + "semver 1.0.26", + "serde", + "serde_json", + "sha3", + "tempfile", + "term_size", + "tokio", + "tokio-stream", + "toml 0.8.22", + "tracing", + "url", + "uzers", + "walkdir", + "which", + "zip 3.0.0", ] [[package]] @@ -2735,6 +2925,19 @@ dependencies = [ "url", ] +[[package]] +name = "contract-metadata" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/cargo-contract#d19dfd68932b207b86e74c2f5e9c149f89f80556" +dependencies = [ + "anyhow", + "impl-serde 0.5.0", + "semver 1.0.26", + "serde", + "serde_json", + "url", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -4784,7 +4987,7 @@ name = "ethereum-standards" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ - "alloy-core", + "alloy-core 1.2.0", ] [[package]] @@ -5157,6 +5360,31 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-benchmarking" +version = "40.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9e5fcdb30bb83b2d97d7e718127230e0fbbad82b9c32dedf63971f08709def" +dependencies = [ + "frame-support 40.1.0", + "frame-support-procedural 33.0.1", + "frame-system 40.1.0", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api 36.0.1", + "sp-application-crypto 40.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", + "sp-runtime-interface 29.0.1", + "sp-storage 22.0.0", + "static_assertions", +] + [[package]] name = "frame-benchmarking-cli" version = "32.0.0" @@ -5215,11 +5443,25 @@ dependencies = [ "sp-version 29.0.0", "sp-wasm-interface 20.0.0", "subxt", - "subxt-signer", + "subxt-signer 0.41.0", "thiserror 1.0.69", "thousands", ] +[[package]] +name = "frame-decode" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6027a409bac4fe95b4d107f965fcdbc252fc89d884a360d076b3070b6128c094" +dependencies = [ + "frame-metadata 17.0.0", + "parity-scale-codec", + "scale-decode 0.14.0", + "scale-info", + "scale-type-resolver 0.2.0", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "frame-decode" version = "0.7.1" @@ -5340,6 +5582,17 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701bac17e9b55e0f95067c428ebcb46496587f08e8cf4ccc0fe5903bea10dbb8" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "frame-metadata" version = "20.0.0" @@ -5493,6 +5746,48 @@ dependencies = [ "tt-call", ] +[[package]] +name = "frame-support" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" +dependencies = [ + "aquamarine", + "array-bytes", + "binary-merkle-tree 16.0.0", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata 20.0.0", + "frame-support-procedural 33.0.1", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "sp-api 36.0.1", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-genesis-builder 0.17.0", + "sp-inherents 36.0.0", + "sp-io 40.0.1", + "sp-metadata-ir 0.10.0", + "sp-runtime 41.1.0", + "sp-staking 38.0.0", + "sp-state-machine 0.45.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 17.1.0", + "sp-trie 39.1.0", + "sp-weights 31.1.0", + "tt-call", +] + [[package]] name = "frame-support-procedural" version = "23.0.0" @@ -5534,6 +5829,27 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "frame-support-procedural" +version = "33.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "docify", + "expander", + "frame-support-procedural-tools 13.0.1", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 2.0.101", +] + [[package]] name = "frame-support-procedural-tools" version = "10.0.0" @@ -5601,22 +5917,42 @@ dependencies = [ [[package]] name = "frame-system" -version = "38.0.0" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c7fa02f8c305496d2ae52edaecdb9d165f11afa965e05686d7d7dd1ce93611" +dependencies = [ + "cfg-if", + "docify", + "frame-support 38.2.0", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-io 38.0.2", + "sp-runtime 39.0.5", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-version 37.0.0", + "sp-weights 31.1.0", +] + +[[package]] +name = "frame-system" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7fa02f8c305496d2ae52edaecdb9d165f11afa965e05686d7d7dd1ce93611" +checksum = "bfc20d95c35bad22eb8b8d7ef91197a439483458237b176e621d9210f2fbff15" dependencies = [ "cfg-if", "docify", - "frame-support 38.2.0", + "frame-support 40.1.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 38.0.2", - "sp-runtime 39.0.5", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 37.0.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", + "sp-version 39.0.0", "sp-weights 31.1.0", ] @@ -6879,9 +7215,9 @@ dependencies = [ "derive_more 1.0.0", "ink_env", "ink_macro", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 5.1.1", + "ink_prelude 5.1.1", + "ink_primitives 5.1.1", "ink_storage", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", @@ -6910,7 +7246,7 @@ dependencies = [ "heck 0.5.0", "impl-serde 0.4.0", "ink_ir", - "ink_primitives", + "ink_primitives 5.1.1", "itertools 0.12.1", "parity-scale-codec", "proc-macro2", @@ -6928,7 +7264,7 @@ checksum = "d273f2aa983d04a6476d3c5ac76ddbef07555664b88f923996e7465e261dda48" dependencies = [ "blake2 0.10.6", "derive_more 1.0.0", - "ink_primitives", + "ink_primitives 5.1.1", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", "secp256k1 0.28.2", @@ -6948,8 +7284,8 @@ dependencies = [ "derive_more 1.0.0", "ink_allocator", "ink_engine", - "ink_prelude", - "ink_primitives", + "ink_prelude 5.1.1", + "ink_primitives 5.1.1", "ink_storage_traits", "num-traits", "pallet-contracts-uapi 9.0.0", @@ -6976,7 +7312,7 @@ dependencies = [ "blake2 0.10.6", "either", "impl-serde 0.4.0", - "ink_prelude", + "ink_prelude 5.1.1", "itertools 0.12.1", "proc-macro2", "quote", @@ -6991,7 +7327,7 @@ checksum = "8ce9465553d3066a8e28bd94a94880289084c4ff12f1852312553e902fa1ffdd" dependencies = [ "ink_codegen", "ink_ir", - "ink_primitives", + "ink_primitives 5.1.1", "parity-scale-codec", "proc-macro2", "quote", @@ -7007,8 +7343,8 @@ checksum = "27135c651274087ba0578d2c07866c31d8dd481ae8de5bb7295fe3931491aa80" dependencies = [ "derive_more 1.0.0", "impl-serde 0.4.0", - "ink_prelude", - "ink_primitives", + "ink_prelude 5.1.1", + "ink_primitives 5.1.1", "linkme", "parity-scale-codec", "scale-info", @@ -7016,6 +7352,21 @@ dependencies = [ "serde", ] +[[package]] +name = "ink_metadata" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=master#641f05706e4f7ff1fb7c60e261ed0f4bc833f2f0" +dependencies = [ + "derive_more 2.0.1", + "impl-serde 0.5.0", + "ink_prelude 6.0.0-alpha", + "ink_primitives 6.0.0-alpha", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + [[package]] name = "ink_prelude" version = "5.1.1" @@ -7025,6 +7376,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_prelude" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=master#641f05706e4f7ff1fb7c60e261ed0f4bc833f2f0" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_primitives" version = "5.1.1" @@ -7032,7 +7391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a530c1b352a53176ea718f3a65f15003e54e0474ec12353ea0e0e5bb60b25741" dependencies = [ "derive_more 1.0.0", - "ink_prelude", + "ink_prelude 5.1.1", "parity-scale-codec", "scale-decode 0.11.1", "scale-encode 0.6.0", @@ -7040,6 +7399,33 @@ dependencies = [ "xxhash-rust", ] +[[package]] +name = "ink_primitives" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=master#641f05706e4f7ff1fb7c60e261ed0f4bc833f2f0" +dependencies = [ + "alloy-sol-types 1.2.0", + "cfg-if", + "derive_more 2.0.1", + "impl-trait-for-tuples", + "ink_prelude 6.0.0-alpha", + "itertools 0.14.0", + "num-traits", + "pallet-revive 0.5.0", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "paste", + "primitive-types 0.13.1", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime-interface 29.0.1", + "xxhash-rust", +] + [[package]] name = "ink_storage" version = "5.1.1" @@ -7050,9 +7436,9 @@ dependencies = [ "cfg-if", "derive_more 1.0.0", "ink_env", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 5.1.1", + "ink_prelude 5.1.1", + "ink_primitives 5.1.1", "ink_storage_traits", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", @@ -7065,9 +7451,9 @@ version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde9b3f4a1e355682e5d13fd5639e5da4d0a2029537292e05a4255ea1169663e" dependencies = [ - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 5.1.1", + "ink_prelude 5.1.1", + "ink_primitives 5.1.1", "parity-scale-codec", "scale-info", ] @@ -9272,7 +9658,7 @@ dependencies = [ "frame-system 28.0.0", "pallet-assets 29.1.0", "pallet-balances 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-timestamp 27.0.0", "parity-scale-codec", "scale-info", @@ -9316,6 +9702,25 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "pallet-asset-conversion" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e063e39ad8ecd3c2b00c963f50cdf79e614c819a01e1c1ce9993287075b1b4d9" +dependencies = [ + "frame-benchmarking 40.2.0", + "frame-support 40.1.0", + "frame-system 40.1.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-api 36.0.1", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", +] + [[package]] name = "pallet-asset-conversion-ops" version = "0.1.0" @@ -9456,7 +9861,7 @@ dependencies = [ "frame-system 28.0.0", "impl-trait-for-tuples", "log", - "pallet-revive", + "pallet-revive 0.1.0", "parity-scale-codec", "scale-info", "sp-core 28.0.0", @@ -11070,7 +11475,7 @@ name = "pallet-revive" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ - "alloy-core", + "alloy-core 1.2.0", "derive_more 0.99.20", "environmental", "ethereum-standards", @@ -11085,9 +11490,9 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "pallet-revive-fixtures", - "pallet-revive-proc-macro", - "pallet-revive-uapi", + "pallet-revive-fixtures 0.1.0", + "pallet-revive-proc-macro 0.1.0", + "pallet-revive-uapi 0.1.0", "pallet-transaction-payment 28.0.0", "parity-scale-codec", "paste", @@ -11110,7 +11515,54 @@ dependencies = [ "staging-xcm 7.0.1", "staging-xcm-builder 7.0.0", "substrate-bn", - "subxt-signer", + "subxt-signer 0.41.0", +] + +[[package]] +name = "pallet-revive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "895fe6f50f621a69132697b8b43d29d1db4d9ff445eec410bf1fc98cd7e9412c" +dependencies = [ + "alloy-core 0.8.25", + "derive_more 0.99.20", + "environmental", + "ethabi-decode 2.0.0", + "ethereum-types 0.15.1", + "frame-benchmarking 40.2.0", + "frame-support 40.1.0", + "frame-system 40.1.0", + "hex-literal", + "impl-trait-for-tuples", + "log", + "num-bigint", + "num-integer", + "num-traits", + "pallet-revive-fixtures 0.3.0", + "pallet-revive-proc-macro 0.3.0", + "pallet-revive-uapi 0.4.0", + "pallet-transaction-payment 40.0.0", + "parity-scale-codec", + "paste", + "polkavm 0.21.0", + "polkavm-common 0.21.0", + "rand 0.8.5", + "ripemd", + "rlp 0.6.1", + "scale-info", + "serde", + "sp-api 36.0.1", + "sp-arithmetic 26.1.0", + "sp-consensus-aura 0.42.0", + "sp-consensus-babe 0.42.1", + "sp-consensus-slots 0.42.1", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", + "staging-xcm 16.2.0", + "staging-xcm-builder 20.1.1", + "substrate-bn", + "subxt-signer 0.38.1", ] [[package]] @@ -11120,13 +11572,28 @@ source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c dependencies = [ "anyhow", "cargo_metadata 0.15.4", - "pallet-revive-uapi", + "pallet-revive-uapi 0.1.0", "polkavm-linker 0.21.0", "sp-core 28.0.0", "sp-io 30.0.0", "toml 0.8.22", ] +[[package]] +name = "pallet-revive-fixtures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1df19ca809f036d6ddf1632039e9db312f92dbe8f9390e6722ad808cd95377" +dependencies = [ + "anyhow", + "cargo_metadata 0.15.4", + "pallet-revive-uapi 0.4.0", + "polkavm-linker 0.21.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "toml 0.8.22", +] + [[package]] name = "pallet-revive-proc-macro" version = "0.1.0" @@ -11137,13 +11604,37 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "pallet-revive-proc-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c2dc2fc6961da23fefc54689ce81a8e006f6988bc465dcc9ab9db905d31766" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "pallet-revive-uapi" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ "bitflags 1.3.2", - "pallet-revive-proc-macro", + "pallet-revive-proc-macro 0.1.0", + "parity-scale-codec", + "polkavm-derive 0.21.0", + "scale-info", +] + +[[package]] +name = "pallet-revive-uapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb8f45102c6279f59f55e0051fc6c26b996619d7842800dfaf3a2583459a1c7" +dependencies = [ + "bitflags 1.3.2", + "pallet-revive-proc-macro 0.3.0", "parity-scale-codec", "polkavm-derive 0.21.0", "scale-info", @@ -11574,6 +12065,23 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "pallet-transaction-payment" +version = "40.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ebd61b64848e39e5615832c964dc10b63bcebff26a9ec1cb867b4087240a03" +dependencies = [ + "frame-benchmarking 40.2.0", + "frame-support 40.1.0", + "frame-system 40.1.0", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", +] + [[package]] name = "pallet-transaction-payment-rpc" version = "30.0.0" @@ -12646,6 +13154,18 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "polkadot-core-primitives" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7c519ee804fd08d7464871bd2fe164e8f0683501ea59d2a10f5ef214dacb3b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core 36.1.0", + "sp-runtime 41.1.0", +] + [[package]] name = "polkadot-dispute-distribution" version = "7.0.0" @@ -13241,6 +13761,23 @@ dependencies = [ "sp-weights 31.1.0", ] +[[package]] +name = "polkadot-parachain-primitives" +version = "16.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72943c0948c686b47bacb1a03e59baff63bfba2e16e208d77f0f8615827f8564" +dependencies = [ + "bounded-collections", + "derive_more 0.99.20", + "parity-scale-codec", + "polkadot-core-primitives 17.1.0", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-runtime 41.1.0", + "sp-weights 31.1.0", +] + [[package]] name = "polkadot-primitives" version = "7.0.0" @@ -13600,6 +14137,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "polkadot-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb819108697967452fa6d8d96ab4c0d48cbaa423b3156499dcb24f1cf95d6775" +dependencies = [ + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "polkadot-sdk-frame" version = "0.1.0" @@ -13866,6 +14412,12 @@ dependencies = [ "polkavm-assembler 0.21.0", ] +[[package]] +name = "polkavm-common" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538810ffdaa629113b9f436f43ba487a6cceacc04a769ac3cdcd32fcf87351cd" + [[package]] name = "polkavm-common" version = "0.24.0" @@ -14047,6 +14599,22 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "polkavm-linker" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9d349fb26ebfbf4b1794f08c045a543f8a6daf0878ce5b5c8b5ed06980a818" +dependencies = [ + "dirs", + "gimli 0.31.1", + "hashbrown 0.14.5", + "log", + "object 0.36.7", + "polkavm-common 0.22.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + [[package]] name = "polkavm-linker" version = "0.24.0" @@ -14150,7 +14718,7 @@ dependencies = [ name = "pop-api-integration-tests" version = "0.1.0" dependencies = [ - "contract-build", + "contract-build 5.0.3", "env_logger 0.11.8", "frame-support 28.0.0", "frame-system 28.0.0", @@ -14174,11 +14742,32 @@ dependencies = [ "staging-xcm-executor 7.0.0", ] +[[package]] +name = "pop-api-vnext-integration-tests" +version = "0.1.0" +dependencies = [ + "contract-build 6.0.0-alpha.1", + "env_logger 0.11.8", + "frame-support 28.0.0", + "frame-system 28.0.0", + "log", + "pallet-assets 29.1.0", + "pallet-balances 28.0.0", + "pallet-revive 0.1.0", + "parity-scale-codec", + "pop-api", + "pop-primitives", + "pop-runtime-devnet", + "pop-runtime-testnet", + "sp-io 30.0.0", + "sp-runtime 31.0.1", +] + [[package]] name = "pop-chain-extension" version = "0.1.0" dependencies = [ - "contract-build", + "contract-build 5.0.3", "env_logger 0.11.8", "frame-support 28.0.0", "frame-system 28.0.0", @@ -14302,7 +14891,7 @@ dependencies = [ "pallet-nfts 22.0.0", "pallet-preimage 28.0.0", "pallet-proxy 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-scheduler 29.0.0", "pallet-session 28.0.0", "pallet-sudo 28.0.0", @@ -14373,7 +14962,7 @@ dependencies = [ "pallet-nfts-runtime-api 14.0.0", "pallet-preimage 28.0.0", "pallet-proxy 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-scheduler 29.0.0", "pallet-session 28.0.0", "pallet-sudo 28.0.0", @@ -14453,7 +15042,7 @@ dependencies = [ "pallet-nfts-runtime-api 14.0.0", "pallet-preimage 28.0.0", "pallet-proxy 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-scheduler 29.0.0", "pallet-session 28.0.0", "pallet-sudo 28.0.0", @@ -14544,7 +15133,7 @@ dependencies = [ "pallet-nfts-runtime-api 14.0.0", "pallet-preimage 28.0.0", "pallet-proxy 28.0.0", - "pallet-revive", + "pallet-revive 0.1.0", "pallet-scheduler 29.0.0", "pallet-session 28.0.0", "pallet-sudo 28.0.0", @@ -15060,6 +15649,7 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", + "serde", ] [[package]] @@ -17161,7 +17751,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" dependencies = [ "parity-scale-codec", + "scale-info", "scale-type-resolver 0.2.0", + "serde", ] [[package]] @@ -17203,6 +17795,21 @@ dependencies = [ "smallvec", ] +[[package]] +name = "scale-decode" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode-derive 0.14.0", + "scale-type-resolver 0.2.0", + "smallvec", +] + [[package]] name = "scale-decode" version = "0.16.0" @@ -17230,6 +17837,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-decode-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed9401effa946b493f9f84dc03714cca98119b230497df6f3df6b84a2b03648" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "scale-decode-derive" version = "0.16.0" @@ -17244,14 +17863,29 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.6.0" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" +dependencies = [ + "derive_more 0.99.20", + "parity-scale-codec", + "scale-encode-derive 0.6.0", + "scale-type-resolver 0.1.1", + "smallvec", +] + +[[package]] +name = "scale-encode" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" +checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" dependencies = [ - "derive_more 0.99.20", + "derive_more 1.0.0", "parity-scale-codec", - "scale-encode-derive 0.6.0", - "scale-type-resolver 0.1.1", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-encode-derive 0.8.0", + "scale-type-resolver 0.2.0", "smallvec", ] @@ -17283,6 +17917,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-encode-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102fbc6236de6c53906c0b262f12c7aa69c2bdc604862c12728f5f4d370bc137" +dependencies = [ + "darling 0.20.11", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "scale-encode-derive" version = "0.10.0" @@ -17355,6 +18002,22 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "scale-value" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e0ef2a0ee1e02a69ada37feb87ea1616ce9808aca072befe2d3131bf28576e" +dependencies = [ + "derive_more 1.0.0", + "either", + "parity-scale-codec", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-type-resolver 0.2.0", +] + [[package]] name = "scale-value" version = "0.18.0" @@ -18403,7 +19066,7 @@ name = "snowbridge-outbound-queue-primitives" version = "0.2.0" source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c4dc261e8ba51327d68a969f0671ca" dependencies = [ - "alloy-core", + "alloy-core 1.2.0", "ethabi-decode 2.0.0", "frame-support 28.0.0", "frame-system 28.0.0", @@ -18840,6 +19503,23 @@ dependencies = [ "sp-timestamp 34.0.0", ] +[[package]] +name = "sp-consensus-aura" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4f3b3414e7620ad72d0000b520e0570dca38dc63e160c95164ff3f789020cc1" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api 36.0.1", + "sp-application-crypto 40.1.0", + "sp-consensus-slots 0.42.1", + "sp-inherents 36.0.0", + "sp-runtime 41.1.0", + "sp-timestamp 36.0.0", +] + [[package]] name = "sp-consensus-babe" version = "0.32.0" @@ -18877,6 +19557,25 @@ dependencies = [ "sp-timestamp 34.0.0", ] +[[package]] +name = "sp-consensus-babe" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b54310103ae4f0e3228e217e2a9ccaca0d7c3502d3aa276623febf4c722ca397" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api 36.0.1", + "sp-application-crypto 40.1.0", + "sp-consensus-slots 0.42.1", + "sp-core 36.1.0", + "sp-inherents 36.0.0", + "sp-runtime 41.1.0", + "sp-timestamp 36.0.0", +] + [[package]] name = "sp-consensus-beefy" version = "13.0.0" @@ -18977,6 +19676,18 @@ dependencies = [ "sp-timestamp 34.0.0", ] +[[package]] +name = "sp-consensus-slots" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc83d9e7b1d58e1d020c20d7208b00d21fa73dcf92721114eae432b9f01e62d5" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-timestamp 36.0.0", +] + [[package]] name = "sp-core" version = "28.0.0" @@ -19255,6 +19966,19 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "sp-genesis-builder" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api 36.0.1", + "sp-runtime 41.1.0", +] + [[package]] name = "sp-inherents" version = "26.0.0" @@ -19282,6 +20006,20 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sp-inherents" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 41.1.0", + "thiserror 1.0.69", +] + [[package]] name = "sp-io" version = "30.0.0" @@ -19834,6 +20572,20 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "sp-staking" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-runtime 41.1.0", +] + [[package]] name = "sp-state-machine" version = "0.35.0" @@ -19994,6 +20746,19 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sp-timestamp" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176c77326c15425a15e085261161a9435f9a3c0d4bf61dae6dccf05b957a51c6" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents 36.0.0", + "sp-runtime 41.1.0", + "thiserror 1.0.69", +] + [[package]] name = "sp-tracing" version = "16.0.0" @@ -20426,6 +21191,28 @@ dependencies = [ "xcm-procedural 10.1.0", ] +[[package]] +name = "staging-xcm" +version = "16.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0126278d7fc6d7dec55e5a109f838bbf401dd084aecf2597e4e11ea07515a0a" +dependencies = [ + "array-bytes", + "bounded-collections", + "derive-where", + "environmental", + "frame-support 40.1.0", + "hex-literal", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime 41.1.0", + "sp-weights 31.1.0", + "xcm-procedural 11.0.2", +] + [[package]] name = "staging-xcm-builder" version = "7.0.0" @@ -20473,6 +21260,31 @@ dependencies = [ "staging-xcm-executor 17.0.2", ] +[[package]] +name = "staging-xcm-builder" +version = "20.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f031952c1496cf7f86d19ab38e3264be9a54b7d8eecb25ba69f977cc7549d08" +dependencies = [ + "environmental", + "frame-support 40.1.0", + "frame-system 40.1.0", + "impl-trait-for-tuples", + "pallet-asset-conversion 22.0.0", + "pallet-transaction-payment 40.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 16.1.0", + "scale-info", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", + "sp-weights 31.1.0", + "staging-xcm 16.2.0", + "staging-xcm-executor 19.1.2", + "tracing", +] + [[package]] name = "staging-xcm-executor" version = "7.0.0" @@ -20514,6 +21326,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "staging-xcm-executor" +version = "19.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9bc315e8c7018fcfe0371ce4b7e726fb699e37b2acc3e5effb87a7d131a3ff" +dependencies = [ + "environmental", + "frame-benchmarking 40.2.0", + "frame-support 40.1.0", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime 41.1.0", + "sp-weights 31.1.0", + "staging-xcm 16.2.0", + "tracing", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -20840,14 +21673,14 @@ dependencies = [ "scale-decode 0.16.0", "scale-encode 0.10.0", "scale-info", - "scale-value", + "scale-value 0.18.0", "serde", "serde_json", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "subxt-core", + "subxt-core 0.41.0", "subxt-lightclient", "subxt-macro", - "subxt-metadata", + "subxt-metadata 0.41.0", "subxt-rpcs", "thiserror 2.0.12", "tokio", @@ -20869,11 +21702,40 @@ dependencies = [ "quote", "scale-info", "scale-typegen", - "subxt-metadata", + "subxt-metadata 0.41.0", "syn 2.0.101", "thiserror 2.0.12", ] +[[package]] +name = "subxt-core" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7a1bc6c9c1724971636a66e3225a7253cdb35bb6efb81524a6c71c04f08c59" +dependencies = [ + "base58", + "blake2 0.10.6", + "derive-where", + "frame-decode 0.5.1", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "hex", + "impl-serde 0.5.0", + "keccak-hash", + "parity-scale-codec", + "polkadot-sdk", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-value 0.17.0", + "serde", + "serde_json", + "subxt-metadata 0.38.1", + "tracing", +] + [[package]] name = "subxt-core" version = "0.41.0" @@ -20883,7 +21745,7 @@ dependencies = [ "base58", "blake2 0.10.6", "derive-where", - "frame-decode", + "frame-decode 0.7.1", "frame-metadata 20.0.0", "hashbrown 0.14.5", "hex", @@ -20895,11 +21757,11 @@ dependencies = [ "scale-decode 0.16.0", "scale-encode 0.10.0", "scale-info", - "scale-value", + "scale-value 0.18.0", "serde", "serde_json", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "subxt-metadata", + "subxt-metadata 0.41.0", "thiserror 2.0.12", "tracing", ] @@ -20937,13 +21799,27 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "subxt-metadata" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacd4e7484fef58deaa2dcb32d94753a864b208a668c0dd0c28be1d8abeeadb2" +dependencies = [ + "frame-decode 0.5.1", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "parity-scale-codec", + "polkadot-sdk", + "scale-info", +] + [[package]] name = "subxt-metadata" version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff4591673600c4388e21305788282414d26c791b4dee21b7cb0b19c10076f98" dependencies = [ - "frame-decode", + "frame-decode 0.7.1", "frame-metadata 20.0.0", "hashbrown 0.14.5", "parity-scale-codec", @@ -20968,13 +21844,42 @@ dependencies = [ "primitive-types 0.13.1", "serde", "serde_json", - "subxt-core", + "subxt-core 0.41.0", "subxt-lightclient", "thiserror 2.0.12", "tracing", "url", ] +[[package]] +name = "subxt-signer" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d680352d04665b1e4eb6f9d2a54b800c4d8e1b20478e69be1b7d975b08d9fc34" +dependencies = [ + "base64 0.22.1", + "bip32", + "bip39", + "cfg-if", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "keccak-hash", + "parity-scale-codec", + "pbkdf2", + "polkadot-sdk", + "regex", + "schnorrkel 0.11.4", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "subxt-core 0.38.1", + "zeroize", +] + [[package]] name = "subxt-signer" version = "0.41.0" @@ -21000,7 +21905,7 @@ dependencies = [ "serde_json", "sha2 0.10.9", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "subxt-core", + "subxt-core 0.41.0", "thiserror 2.0.12", "zeroize", ] @@ -21038,6 +21943,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560533fbd6914b94a8fb5cc803ed6801c3455668db3b810702c57612bac9412" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "syn-solidity" version = "1.2.0" @@ -23341,6 +24258,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "xcm-procedural" +version = "11.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d3d21c65cbf847ae0b1a8e6411b614d269d3108c6c649b039bffcf225e89aa4" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "xcm-runtime-apis" version = "0.1.1" @@ -23591,6 +24520,18 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "zip" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" +dependencies = [ + "arbitrary", + "crc32fast", + "indexmap 2.9.0", + "memchr", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/Cargo.toml b/Cargo.toml index 4a13ee9f8..0303fd70f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ members = [ "integration-tests", "node", "pallets/*", + "pop-api-vnext/integration-tests", "pop-api/integration-tests", "primitives", "runtime/devnet", diff --git a/pop-api-vnext/integration-tests/Cargo.toml b/pop-api-vnext/integration-tests/Cargo.toml new file mode 100644 index 000000000..d57908d9c --- /dev/null +++ b/pop-api-vnext/integration-tests/Cargo.toml @@ -0,0 +1,47 @@ +[package] +build = "build.rs" +edition = "2021" +name = "pop-api-vnext-integration-tests" +version = "0.1.0" + +[build-dependencies] +contract-build = { git = "https://github.com/use-ink/cargo-contract" } + +[dev-dependencies] +codec.workspace = true +env_logger.workspace = true +frame-support = { workspace = true, default-features = false } +frame-system = { workspace = true, default-features = false } +log.workspace = true +pallet-assets = { workspace = true, default-features = false } +pallet-balances = { workspace = true, default-features = false } +pallet-revive = { workspace = true, default-features = false } +pop-api = { path = "../../pop-api", default-features = false, features = [ + "fungibles", + "messaging", + "nonfungibles", +] } +pop-primitives = { workspace = true, default-features = false } +pop-runtime-devnet.workspace = true +pop-runtime-testnet.workspace = true +sp-io = { workspace = true, default-features = false } +sp-runtime = { workspace = true, default-features = false } + +[features] +default = [ "devnet", "std" ] +devnet = [ "pop-runtime-devnet/default" ] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "pallet-assets/std", + "pallet-balances/std", + "pallet-revive/std", + "pop-api/std", + "pop-primitives/std", + "pop-runtime-devnet/std", + "pop-runtime-testnet/std", + "sp-io/std", + "sp-runtime/std", +] +testnet = [ "pop-runtime-testnet/default" ] diff --git a/pop-api-vnext/integration-tests/build.rs b/pop-api-vnext/integration-tests/build.rs new file mode 100644 index 000000000..21334ac20 --- /dev/null +++ b/pop-api-vnext/integration-tests/build.rs @@ -0,0 +1,58 @@ +use std::{ + fs, + path::{Path, PathBuf}, + process, +}; + +use contract_build::{ + execute, BuildArtifacts, BuildMode, BuildResult, ExecuteArgs, ManifestPath, OutputType, + Verbosity, +}; + +fn main() { + let contracts_dir = PathBuf::from("./contracts/"); + let contract_dirs = match get_subcontract_directories(&contracts_dir) { + Ok(dirs) => dirs, + Err(e) => { + eprintln!("Failed to read contracts directory: {}", e); + process::exit(1); + }, + }; + + for contract in contract_dirs { + if let Err(e) = build_contract(&contract) { + eprintln!("Failed to build contract {}: {}", contract.display(), e); + process::exit(1); + } + } +} + +// Function to retrieve all subdirectories in a given directory. +fn get_subcontract_directories(contracts_dir: &Path) -> Result, String> { + fs::read_dir(contracts_dir) + .map_err(|e| format!("Could not read directory '{}': {}", contracts_dir.display(), e))? + .filter_map(|entry| match entry { + Ok(entry) if entry.path().is_dir() => Some(Ok(entry.path())), + Ok(_) => None, + Err(e) => Some(Err(format!("Error reading directory entry: {}", e))), + }) + .collect() +} + +// Function to build a contract given its directory. +fn build_contract(contract_dir: &Path) -> Result { + let manifest_path = ManifestPath::new(contract_dir.join("Cargo.toml")).map_err(|e| { + format!("Could not retrieve manifest path for {}: {}", contract_dir.display(), e) + })?; + + let args = ExecuteArgs { + build_artifact: BuildArtifacts::CodeOnly, + build_mode: BuildMode::Debug, + manifest_path, + output_type: OutputType::HumanReadable, + verbosity: Verbosity::Default, + ..Default::default() + }; + + execute(args).map_err(|e| format!("Build failed for {}: {}", contract_dir.display(), e)) +} diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml new file mode 100644 index 000000000..da78763da --- /dev/null +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml @@ -0,0 +1,29 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "fungibles" +version = "0.1.0" + +[package.metadata.ink-lang] +abi = "sol" + +[workspace] + +[dependencies] +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } +pop-api = { path = "../../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } + +[dev-dependencies] +scale-info = { version = "2" } + +[lib] +path = "lib.rs" + +[features] +default = [ "std" ] +ink-as-dependency = [ ] +std = [ "ink/std", "pop-api/std" ] + +[lints.rust.unexpected_cfgs] +check-cfg = [ 'cfg(ink_abi, values("ink", "sol", "all"))' ] +level = "warn" diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs new file mode 100644 index 000000000..3f957f129 --- /dev/null +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -0,0 +1,134 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{prelude::string::String, U256}; +use pop_api::fungibles::{self as api, Fungibles, TokenId}; + +#[ink::contract] +pub mod fungibles { + + use pop_api::revert; + + use super::*; + + #[ink(storage)] + pub struct Fungible; + + impl Fungible { + #[ink(constructor, payable)] + #[allow(clippy::new_without_default)] + pub fn new() -> Self { + Self {} + } + } + + impl Fungibles for Fungible { + #[ink(message)] + fn transfer(&self, token: TokenId, to: Address, value: U256) { + if let Err(error) = api::transfer(token, to, value) { + revert(&error) + } + } + + #[ink(message)] + fn transferFrom(&self, token: TokenId, from: Address, to: Address, value: U256) { + if let Err(error) = api::transfer_from(token, from, to, value) { + revert(&error) + } + } + + #[ink(message)] + fn approve(&self, token: TokenId, spender: Address, value: U256) { + if let Err(error) = api::approve(token, spender, value) { + revert(&error) + } + } + + #[ink(message)] + fn increaseAllowance(&self, token: TokenId, spender: Address, value: U256) -> U256 { + match api::increase_allowance(token, spender, value) { + Ok(allowance) => allowance, + Err(error) => revert(&error), + } + } + + #[ink(message)] + fn decreaseAllowance(&self, token: TokenId, spender: Address, value: U256) -> U256 { + match api::decrease_allowance(token, spender, value) { + Ok(allowance) => allowance, + Err(error) => revert(&error), + } + } + + #[ink(message)] + fn create(&self, admin: Address, min_balance: U256) -> TokenId { + match api::create(admin, min_balance) { + Ok(token) => token, + Err(error) => revert(&error), + } + } + + #[ink(message)] + fn startDestroy(&self, token: TokenId) { + api::start_destroy(token); + } + + #[ink(message)] + fn setMetadata(&self, token: TokenId, name: String, symbol: String, decimals: u8) { + api::set_metadata(token, name, symbol, decimals); + } + + #[ink(message)] + fn clearMetadata(&self, token: TokenId) { + api::clear_metadata(token); + } + + #[ink(message)] + fn mint(&self, token: TokenId, account: Address, value: U256) { + if let Err(error) = api::mint(token, account, value) { + revert(&error) + } + } + + #[ink(message)] + fn burn(&self, token: TokenId, account: Address, value: U256) { + if let Err(error) = api::burn(token, account, value) { + revert(&error) + } + } + + #[ink(message)] + fn totalSupply(&self, token: TokenId) -> U256 { + api::total_supply(token) + } + + #[ink(message)] + fn balanceOf(&self, token: TokenId, owner: Address) -> U256 { + api::balance_of(token, owner) + } + + #[ink(message)] + fn allowance(&self, token: TokenId, owner: Address, spender: Address) -> U256 { + api::allowance(token, owner, spender) + } + + #[ink(message)] + fn name(&self, token: TokenId) -> String { + api::name(token) + } + + #[ink(message)] + fn symbol(&self, token: TokenId) -> String { + api::symbol(token) + } + + #[ink(message)] + fn decimals(&self, token: TokenId) -> u8 { + api::decimals(token) + } + + #[ink(message)] + fn exists(&self, token: TokenId) -> bool { + api::exists(token) + } + } +} diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs new file mode 100644 index 000000000..9768b8571 --- /dev/null +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -0,0 +1,479 @@ +use frame_support::traits::fungibles::{ + approvals::Inspect as _, metadata::Inspect as _, Inspect as _, +}; +use pop_primitives::TokenId; + +use super::*; + +const CONTRACT: &str = "contracts/fungibles/target/ink/fungibles.polkavm"; + +#[test] +fn total_supply_works() { + let token = 1; + let endowment = 100; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, BOB, endowment)]) + .build() + .execute_with(|| { + let contract = Contract::new(); + + // Tokens in circulation. + assert_eq!(contract.total_supply(token), Assets::total_supply(token).into()); + assert_eq!(contract.total_supply(token), endowment.into()); + + // No tokens in circulation. + let token = TokenId::MAX; + assert_eq!(contract.total_supply(token), Assets::total_supply(token).into()); + assert_eq!(contract.total_supply(token), 0.into()); + }); +} + +#[test] +fn balance_of_works() { + let token = 1; + let owner = BOB; + let endowment = 100; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, owner.clone(), endowment)]) + .build() + .execute_with(|| { + let contract = Contract::new(); + + // Tokens in circulation. + assert_eq!( + contract.balance_of(token, to_address(&owner)), + Assets::balance(token, &owner).into() + ); + assert_eq!(contract.balance_of(token, to_address(&owner)), endowment.into()); + + // No tokens in circulation. + let token = TokenId::MAX; + assert_eq!( + contract.balance_of(token, to_address(&owner)), + Assets::balance(token, &owner).into() + ); + assert_eq!(contract.balance_of(token, to_address(&owner)), 0.into()); + }); +} + +#[test] +fn allowance_works() { + let token = 1; + let owner = BOB; + let spender = ALICE; + let allowance = 50; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(); + + // Tokens in circulation. + approve(&owner, token, &spender, allowance); + assert_eq!( + contract.allowance(token, to_address(&owner), to_address(&spender)), + Assets::allowance(token, &owner, &spender).into() + ); + assert_eq!( + contract.allowance(token, to_address(&owner), to_address(&spender)), + allowance.into() + ); + + // No tokens in circulation. + let token = TokenId::MAX; + assert_eq!( + contract.allowance(token, to_address(&owner), to_address(&spender)), + Assets::allowance(token, &owner, &spender).into() + ); + assert_eq!( + contract.allowance(token, to_address(&owner), to_address(&spender)), + 0.into() + ); + }); +} + +#[test] +#[ignore] +fn transfer_works() { + todo!() +} + +#[test] +#[ignore] +fn transfer_from_works() { + todo!() +} + +#[test] +#[ignore] +fn approve_works() { + todo!() +} + +#[test] +#[ignore] +fn increase_allowance_works() { + todo!() +} + +#[test] +#[ignore] +fn decrease_allowance_works() { + todo!() +} + +#[test] +fn metadata_works() { + let token = 1; + let name = "name".to_string(); + let symbol = "symbol".to_string(); + let decimals: u8 = 69; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_metadata(vec![( + token, + name.as_bytes().to_vec(), + symbol.as_bytes().to_vec(), + decimals, + )]) + .build() + .execute_with(|| { + let contract = Contract::new(); + + // Existing token. + assert_eq!(contract.name(token).as_bytes(), Assets::name(token).as_slice()); + assert_eq!(contract.name(token), name); + assert_eq!(contract.symbol(token).as_bytes(), Assets::symbol(token).as_slice()); + assert_eq!(contract.symbol(token), symbol); + assert_eq!(contract.decimals(token), Assets::decimals(token)); + assert_eq!(contract.decimals(token), decimals); + + // Token does not exist. + let token = TokenId::MAX; + assert_eq!(contract.name(token), String::default()); + assert_eq!(contract.symbol(token), String::default()); + assert_eq!(contract.decimals(token), 0); + }); +} + +#[test] +#[ignore] +fn create_works() { + todo!() +} + +// Testing a contract that creates a token in the constructor. +#[test] +#[ignore] +fn instantiate_and_create_fungible_works() { + todo!() +} + +#[test] +#[ignore] +fn start_destroy_works() { + todo!() +} + +#[test] +#[ignore] +fn set_metadata_works() { + todo!() +} + +#[test] +#[ignore] +fn clear_metadata_works() { + todo!() +} + +#[test] +fn exists_works() { + let token = 1; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .build() + .execute_with(|| { + let contract = Contract::new(); + + // Tokens in circulation. + assert_eq!(contract.exists(token), Assets::asset_exists(token)); + + // No tokens in circulation. + let token = TokenId::MAX; + assert_eq!(contract.exists(token), Assets::asset_exists(token)); + }); +} + +#[test] +#[ignore] +fn mint_works() { + todo!() +} + +#[test] +#[ignore] +fn burn_works() { + todo!() +} + +// A simple, strongly typed wrapper for the contract. +struct Contract { + address: H160, +} + +impl Contract { + // Create a new instance of the contract through on-chain instantiation. + fn new() -> Self { + let address = instantiate(CONTRACT, 0, None); + Self { address: address.clone() } + } + + fn allowance(&self, token: TokenId, owner: H160, spender: H160) -> U256 { + let owner = alloy::Address::from(owner.0); + let spender = alloy::Address::from(spender.0); + U256::from_little_endian( + self.call::( + ALICE, + keccak_selector("allowance(uint32,address,address)"), + (token, owner, spender).abi_encode(), + 0, + ) + .unwrap() + .as_le_slice(), + ) + } + + fn approve(&mut self, origin: &AccountId, token: TokenId, spender: H160, value: U256) { + let spender = alloy::Address::from(spender.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("approve(uint32,address,uint256)"), + (token, spender, value).abi_encode(), + 0, + ) + .unwrap() + } + + fn balance_of(&self, token: TokenId, owner: H160) -> U256 { + let owner = alloy::Address::from(owner.0); + U256::from_little_endian( + self.call::( + ALICE, + keccak_selector("balanceOf(uint32,address)"), + (token, owner).abi_encode(), + 0, + ) + .unwrap() + .as_le_slice(), + ) + } + + fn burn(&mut self, origin: &AccountId, token: TokenId, account: H160, value: U256) { + let account = alloy::Address::from(account.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("burn(uint32,address,uint256)"), + (token, account, value).abi_encode(), + 0, + ) + .unwrap() + } + + fn clear_metadata(&mut self, origin: &AccountId, token: TokenId) { + self.call( + origin.clone(), + keccak_selector("clearMetadata(uint32)"), + (token,).abi_encode(), + 0, + ) + .unwrap() + } + + fn create(&mut self, origin: &AccountId, admin: H160, min_balance: U256) -> TokenId { + let admin = alloy::Address::from(admin.0); + let min_balance = alloy::U256::from_be_bytes(min_balance.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("create(address,uint256)"), + (admin, min_balance).abi_encode(), + 0, + ) + .unwrap() + } + + fn decimals(&self, token: TokenId) -> u8 { + self.call::(ALICE, keccak_selector("decimals(uint32)"), (token,).abi_encode(), 0) + .unwrap() as u8 + } + + fn decrease_allowance( + &mut self, + origin: &AccountId, + token: TokenId, + spender: H160, + value: U256, + ) -> U256 { + let spender = alloy::Address::from(spender.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + U256::from_little_endian( + self.call::( + origin.clone(), + keccak_selector("decreaseAllowance(uint32,address,uint256)"), + (token, spender, value).abi_encode(), + 0, + ) + .unwrap() + .as_le_slice(), + ) + } + + fn exists(&self, token: TokenId) -> bool { + self.call(ALICE, keccak_selector("exists(uint32)"), (token,).abi_encode(), 0) + .unwrap() + } + + fn increase_allowance( + &mut self, + origin: &AccountId, + token: TokenId, + spender: H160, + value: U256, + ) -> U256 { + let spender = alloy::Address::from(spender.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + U256::from_little_endian( + self.call::( + origin.clone(), + keccak_selector("increaseAllowance(uint32,address,uint256)"), + (token, spender, value).abi_encode(), + 0, + ) + .unwrap() + .as_le_slice(), + ) + } + + fn mint(&mut self, origin: &AccountId, token: TokenId, account: H160, value: U256) { + let account = alloy::Address::from(account.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("mint(uint32,address,uint256)"), + (token, account, value).abi_encode(), + 0, + ) + .unwrap() + } + + fn name(&self, token: TokenId) -> String { + self.call(ALICE, keccak_selector("name(uint32)"), (token,).abi_encode(), 0) + .unwrap() + } + + fn set_metadata( + &mut self, + origin: &AccountId, + token: TokenId, + name: String, + symbol: String, + decimals: u8, + ) { + self.call( + origin.clone(), + keccak_selector("setMetadata(uint32,string,string,uint8)"), + (token, name, symbol, decimals as u16).abi_encode(), + 0, + ) + .unwrap() + } + + fn start_destroy(&mut self, origin: &AccountId, token: TokenId) { + self.call(origin.clone(), keccak_selector("startDestroy(uint32)"), (token,).abi_encode(), 0) + .unwrap() + } + + fn symbol(&self, token: TokenId) -> String { + self.call(ALICE, keccak_selector("symbol(uint32)"), (token,).abi_encode(), 0) + .unwrap() + } + + fn total_supply(&self, token: TokenId) -> U256 { + U256::from_little_endian( + self.call::( + ALICE, + keccak_selector("totalSupply(uint32)"), + (token,).abi_encode(), + 0, + ) + .unwrap() + .as_le_slice(), + ) + } + + fn transfer(&mut self, origin: &AccountId, token: TokenId, to: H160, value: U256) { + let to = alloy::Address::from(to.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("transfer(uint32,address,uint256)"), + (token, to, value).abi_encode(), + 0, + ) + .unwrap() + } + + fn transfer_from( + &mut self, + origin: &AccountId, + token: TokenId, + from: H160, + to: H160, + value: U256, + ) { + let from = alloy::Address::from(from.0); + let to = alloy::Address::from(to.0); + let value = alloy::U256::from_be_bytes(value.to_big_endian()); + self.call( + origin.clone(), + keccak_selector("transferFrom(uint32,address,address,uint256)"), + (token, from, to, value).abi_encode(), + 0, + ) + .unwrap() + } + + fn call::RustType>>( + &self, + origin: AccountId, + selector: [u8; 4], + params: Vec, + value: Balance, + ) -> Result { + let origin = RuntimeOrigin::signed(origin); + let dest = self.address.clone(); + let data = [selector.as_slice(), params.as_slice()].concat(); + let result = bare_call(origin, dest, value, GAS_LIMIT, STORAGE_DEPOSIT_LIMIT, data) + .expect("should work"); + match result.did_revert() { + true => { + println!("{:?}", result.data); + todo!("error conversion") + }, + false => Ok(decode::(&result.data)), + } + } +} + +fn approve(origin: &AccountId, id: TokenId, delegate: &AccountId, amount: Balance) { + assert_ok!(Assets::approve_transfer( + RuntimeOrigin::signed(origin.clone()), + id.into(), + delegate.clone().into(), + amount, + )); +} diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs new file mode 100644 index 000000000..86ef636dc --- /dev/null +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -0,0 +1,145 @@ +#![cfg(test)] + +use std::path::Path; + +use frame_support::{assert_ok, weights::Weight}; +use pallet_assets::{Instance1, NextAssetId}; +use pallet_revive::{ + precompiles::alloy::{ + primitives as alloy, + sol_types::{SolType, SolValue}, + }, + test_utils::{ALICE, BOB}, + AccountId32Mapper, AddressMapper, Code, DepositLimit, ExecReturnValue, H160, U256, +}; +#[cfg(feature = "devnet")] +use pop_runtime_devnet::{ + AccountId, Assets, Balance, Revive, Runtime, RuntimeOrigin, System, UNIT, +}; +use sp_runtime::{BuildStorage, DispatchError}; + +mod fungibles; + +const GAS_LIMIT: Weight = Weight::from_parts(500_000_000_000, 3 * 1024 * 1024); +const INIT_AMOUNT: Balance = 100_000_000 * UNIT; +const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::Balance(Balance::MAX); + +type AssetId = u32; + +fn bare_call( + origin: RuntimeOrigin, + dest: H160, + value: Balance, + gas_limit: Weight, + storage_deposit_limit: DepositLimit, + data: Vec, +) -> Result { + let result = Revive::bare_call(origin, dest, value, gas_limit, storage_deposit_limit, data); + log::info!("contract exec result={result:?}"); + result.result +} + +fn blake_selector(input: &str) -> [u8; 4] { + sp_io::hashing::blake2_256(input.as_bytes())[0..4] + .try_into() + .expect("hash length > 4") +} + +fn decode::RustType>>(data: &[u8]) -> T { + T::abi_decode(data).expect("unable to decode") +} + +// Deploy, instantiate and return contract address. +fn instantiate(contract: impl AsRef, value: u128, salt: Option<[u8; 32]>) -> H160 { + let binary = std::fs::read(contract).expect("could not read .wasm file"); + + let result = Revive::bare_instantiate( + RuntimeOrigin::signed(ALICE), + value, + GAS_LIMIT, + DepositLimit::Balance(Balance::MAX), + Code::Upload(binary), + blake_selector("new").to_vec(), + salt, + ) + .result + .unwrap(); + assert!(!result.result.did_revert(), "deploying contract reverted {:?}", result); + result.addr +} + +fn keccak_selector(input: &str) -> [u8; 4] { + sp_io::hashing::keccak_256(input.as_bytes())[0..4] + .try_into() + .expect("hash length > 4") +} + +fn to_address(account: &AccountId) -> H160 { + AccountId32Mapper::::to_address(account) +} + +pub(crate) struct ExtBuilder { + assets: Option>, + asset_accounts: Option>, + asset_metadata: Option, Vec, u8)>>, +} + +impl ExtBuilder { + pub(crate) fn new() -> Self { + Self { assets: None, asset_accounts: None, asset_metadata: None } + } + + pub(crate) fn with_assets(mut self, assets: Vec<(AssetId, AccountId, bool, Balance)>) -> Self { + self.assets = Some(assets); + self + } + + pub(crate) fn with_asset_balances( + mut self, + accounts: Vec<(AssetId, AccountId, Balance)>, + ) -> Self { + self.asset_accounts = Some(accounts); + self + } + + pub(crate) fn with_asset_metadata( + mut self, + metadata: Vec<(AssetId, Vec, Vec, u8)>, + ) -> Self { + self.asset_metadata = Some(metadata); + self + } + + pub(crate) fn build(mut self) -> sp_io::TestExternalities { + let _ = env_logger::try_init(); + + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .expect("Frame system builds valid default genesis config"); + + pallet_balances::GenesisConfig:: { + // FERDIE has no initial balance. + balances: vec![(ALICE, INIT_AMOUNT), (BOB, INIT_AMOUNT)], + ..Default::default() + } + .assimilate_storage(&mut t) + .expect("Pallet balances storage can be assimilated"); + + pallet_assets::GenesisConfig:: { + assets: self.assets.take().unwrap_or_default(), + metadata: self.asset_metadata.take().unwrap_or_default(), + accounts: self.asset_accounts.take().unwrap_or_default(), + next_asset_id: Some(0), + } + .assimilate_storage(&mut t) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| { + System::set_block_number(1); + NextAssetId::::put(1); + }); + + ext + } +} From 73967d9bc0de782c45c4daa8ed318031c9852e74 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 10:01:39 +0100 Subject: [PATCH 076/162] ci: add job for pop-api-vnext integration tests --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf54f692d..8c09e6a3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: ci on: push: - branches: [ main ] + branches: [main] pull_request: - types: [ opened, synchronize, reopened, ready_for_review ] + types: [opened, synchronize, reopened, ready_for_review] concurrency: # Cancel any in-progress jobs for the same pull request @@ -150,6 +150,17 @@ jobs: - name: Run API integration tests run: cargo test -p pop-api-integration-tests --release --locked --features "${{ matrix.features }}" + api-vnext-integration-tests: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + + - name: Run API integration tests + run: cargo test -p pop-api-vnext-integration-tests --release --locked + api-tests: runs-on: ubuntu-latest steps: From c526787311fe7107cfd3db6e5bf225da1820ff3a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 12:46:25 +0100 Subject: [PATCH 077/162] test(api): minimal implementation of transfer test Solidity error handling still unsupported. --- pop-api-vnext/integration-tests/Cargo.toml | 9 +- .../contracts/fungibles/lib.rs | 5 +- .../integration-tests/src/fungibles.rs | 89 +++++++++++++++++-- pop-api-vnext/integration-tests/src/lib.rs | 24 ++++- 4 files changed, 115 insertions(+), 12 deletions(-) diff --git a/pop-api-vnext/integration-tests/Cargo.toml b/pop-api-vnext/integration-tests/Cargo.toml index d57908d9c..514c7aed0 100644 --- a/pop-api-vnext/integration-tests/Cargo.toml +++ b/pop-api-vnext/integration-tests/Cargo.toml @@ -4,6 +4,9 @@ edition = "2021" name = "pop-api-vnext-integration-tests" version = "0.1.0" +[package.metadata.ink-lang] +abi = "sol" + [build-dependencies] contract-build = { git = "https://github.com/use-ink/cargo-contract" } @@ -16,11 +19,7 @@ log.workspace = true pallet-assets = { workspace = true, default-features = false } pallet-balances = { workspace = true, default-features = false } pallet-revive = { workspace = true, default-features = false } -pop-api = { path = "../../pop-api", default-features = false, features = [ - "fungibles", - "messaging", - "nonfungibles", -] } +pop-api = { path = "../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } pop-primitives = { workspace = true, default-features = false } pop-runtime-devnet.workspace = true pop-runtime-testnet.workspace = true diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 3f957f129..1bf475219 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] use ink::{prelude::string::String, U256}; -use pop_api::fungibles::{self as api, Fungibles, TokenId}; +use pop_api::fungibles::{self as api, Approval, Fungibles, TokenId, Transfer}; #[ink::contract] pub mod fungibles { @@ -27,6 +27,7 @@ pub mod fungibles { if let Err(error) = api::transfer(token, to, value) { revert(&error) } + self.env().emit_event(Transfer { from: self.env().address(), to, value }); } #[ink(message)] @@ -34,6 +35,7 @@ pub mod fungibles { if let Err(error) = api::transfer_from(token, from, to, value) { revert(&error) } + self.env().emit_event(Transfer { from, to, value }); } #[ink(message)] @@ -41,6 +43,7 @@ pub mod fungibles { if let Err(error) = api::approve(token, spender, value) { revert(&error) } + self.env().emit_event(Approval { owner: self.env().address(), spender, value }); } #[ink(message)] diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 9768b8571..47abc0580 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -1,6 +1,8 @@ -use frame_support::traits::fungibles::{ - approvals::Inspect as _, metadata::Inspect as _, Inspect as _, +use frame_support::{ + pallet_prelude::Encode, + traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _, Inspect as _}, }; +use pop_api::fungibles::Transfer; use pop_primitives::TokenId; use super::*; @@ -68,7 +70,7 @@ fn allowance_works() { .with_assets(vec![(token, ALICE, false, 1)]) .build() .execute_with(|| { - let mut contract = Contract::new(); + let contract = Contract::new(); // Tokens in circulation. approve(&owner, token, &spender, allowance); @@ -95,9 +97,61 @@ fn allowance_works() { } #[test] -#[ignore] fn transfer_works() { - todo!() + let token = 1; + let owner = ALICE; + let amount: Balance = 100 * UNIT; + let to = BOB; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(); + + // Token does not exist. + // assert_eq!(transfer(&addr, 1, BOB, amount), Err(Module { index: 52, error: [3, 0] + // })); + // Mint `amount` to contract address. + mint(&owner, token, &to_account_id(&contract.address), amount); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // transfer(&addr, token, BOB, amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + thaw(&owner, token); + // Not enough balance. + // assert_eq!( + // transfer(&addr, token, BOB, amount + 1 * UNIT), + // Err(Module { index: 52, error: [0, 0] }) + // ); + // Not enough balance due to ED. + // assert_eq!( + // transfer(&addr, token, BOB, amount), + // Err(Module { index: 52, error: [0, 0] }) + // ); + // Successful transfer. + let balance_before_transfer = Assets::balance(token, &BOB); + contract.transfer(&owner, token, to_address(&to), (amount / 2).into()); + let balance_after_transfer = Assets::balance(token, &BOB); + assert_eq!(balance_after_transfer, balance_before_transfer + amount / 2); + // Successfully emit event. + let from = contract.address; + let to = to_address(&to); + let expected = Transfer { from, to, value: (amount / 2).into() }.encode(); + assert_eq!(contract.last_event(), expected); + // Transfer token to account that does not exist. + // assert_eq!( + // contract.transfer(&owner, token, to_address(&CHARLIE), (amount / 4).into()), + // Err(Token(CannotCreate)) + // ); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&ALICE, token); + // assert_eq!( + // contract.transfer(&addr, token, BOB, amount / 4), + // Err(Module { index: 52, error: [16, 0] }) + // ); + }); } #[test] @@ -467,6 +521,10 @@ impl Contract { false => Ok(decode::(&result.data)), } } + + fn last_event(&self) -> Vec { + last_contract_event(&self.address) + } } fn approve(origin: &AccountId, id: TokenId, delegate: &AccountId, amount: Balance) { @@ -477,3 +535,24 @@ fn approve(origin: &AccountId, id: TokenId, delegate: &AccountId, amount: Balanc amount, )); } + +fn freeze(origin: &AccountId, id: TokenId) { + assert_ok!(Assets::freeze_asset(RuntimeOrigin::signed(origin.clone()), id.into())); +} + +fn mint(origin: &AccountId, id: TokenId, beneficiary: &AccountId, amount: Balance) { + assert_ok!(Assets::mint( + RuntimeOrigin::signed(origin.clone()), + id.into(), + beneficiary.clone().into(), + amount, + )); +} + +fn start_destroy(origin: &AccountId, id: TokenId) { + assert_ok!(Assets::start_destroy(RuntimeOrigin::signed(origin.clone()), id.into())); +} + +fn thaw(origin: &AccountId, id: TokenId) { + assert_ok!(Assets::thaw_asset(RuntimeOrigin::signed(origin.clone()), id.into())); +} diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index 86ef636dc..fac478ec4 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -26,6 +26,24 @@ const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::Balance(Balan type AssetId = u32; +// Get the last event from `pallet-revive`. +fn last_contract_event(address: &H160) -> Vec { + let events = System::read_events_for_pallet::>(); + let contract_events = events + .iter() + .filter_map(|event| match event { + pallet_revive::Event::::ContractEmitted { contract, data, .. } + if contract == address => + Some(data.as_slice()), + _ => None, + }) + .collect::>(); + contract_events + .last() + .expect("expected an event for the specified contract") + .to_vec() +} + fn bare_call( origin: RuntimeOrigin, dest: H160, @@ -74,6 +92,10 @@ fn keccak_selector(input: &str) -> [u8; 4] { .expect("hash length > 4") } +fn to_account_id(address: &H160) -> AccountId { + AccountId32Mapper::::to_account_id(address) +} + fn to_address(account: &AccountId) -> H160 { AccountId32Mapper::::to_address(account) } @@ -118,7 +140,7 @@ impl ExtBuilder { .expect("Frame system builds valid default genesis config"); pallet_balances::GenesisConfig:: { - // FERDIE has no initial balance. + // CHARLIE has no initial balance. balances: vec![(ALICE, INIT_AMOUNT), (BOB, INIT_AMOUNT)], ..Default::default() } From 134a90721c6104d85c0d11ac58bb28e9f1c27679 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 12:46:38 +0100 Subject: [PATCH 078/162] chore: update cargo.lock --- Cargo.lock | 368 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 327 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a2074fc6..18e4cbf7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -999,7 +999,7 @@ dependencies = [ "frame-system-benchmarking 38.0.0", "frame-system-rpc-runtime-api 34.0.0", "frame-try-runtime 0.44.0", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-asset-conversion 20.0.0", "pallet-asset-conversion-tx-payment 20.0.0", @@ -1087,7 +1087,7 @@ dependencies = [ "frame-system-benchmarking 28.0.0", "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-asset-conversion 10.0.0", "pallet-asset-conversion-ops", @@ -2804,6 +2804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -2888,7 +2889,7 @@ dependencies = [ "heck 0.5.0", "hex", "impl-serde 0.5.0", - "ink_metadata 6.0.0-alpha", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=master)", "itertools 0.13.0", "parity-scale-codec", "polkavm-linker 0.22.0", @@ -4751,7 +4752,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue 0.7.1", "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "pallet-asset-conversion 10.0.0", "pallet-assets 29.1.0", "pallet-balances 28.0.0", @@ -6554,6 +6555,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + [[package]] name = "hickory-proto" version = "0.24.4" @@ -7213,18 +7220,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15d7438a13d38fa8f4eebea8d1e7c2931058eafd0336c79f4141d4ed0162a412" dependencies = [ "derive_more 1.0.0", - "ink_env", - "ink_macro", + "ink_env 5.1.1", + "ink_macro 5.1.1", "ink_metadata 5.1.1", "ink_prelude 5.1.1", "ink_primitives 5.1.1", - "ink_storage", + "ink_storage 5.1.1", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", "scale-info", "staging-xcm 11.0.0", ] +[[package]] +name = "ink" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "const_format", + "deranged", + "derive_more 2.0.1", + "ink_env 6.0.0-alpha", + "ink_macro 6.0.0-alpha", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_storage 6.0.0-alpha", + "keccak-const", + "linkme", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-info", + "sp-io 40.0.1", + "sp-runtime-interface 29.0.1", + "staging-xcm 16.2.0", +] + [[package]] name = "ink_allocator" version = "5.1.1" @@ -7234,6 +7266,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_allocator" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_codegen" version = "5.1.1" @@ -7245,7 +7285,7 @@ dependencies = [ "either", "heck 0.5.0", "impl-serde 0.4.0", - "ink_ir", + "ink_ir 5.1.1", "ink_primitives 5.1.1", "itertools 0.12.1", "parity-scale-codec", @@ -7256,6 +7296,28 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "ink_codegen" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "blake2 0.10.6", + "derive_more 2.0.1", + "either", + "heck 0.5.0", + "impl-serde 0.5.0", + "ink_ir 6.0.0-alpha", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "itertools 0.14.0", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.101", +] + [[package]] name = "ink_engine" version = "5.1.1" @@ -7272,6 +7334,23 @@ dependencies = [ "sha3", ] +[[package]] +name = "ink_engine" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "blake2 0.10.6", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "pallet-revive 0.5.0", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", +] + [[package]] name = "ink_env" version = "5.1.1" @@ -7282,11 +7361,11 @@ dependencies = [ "cfg-if", "const_env", "derive_more 1.0.0", - "ink_allocator", - "ink_engine", + "ink_allocator 5.1.1", + "ink_engine 5.1.1", "ink_prelude 5.1.1", "ink_primitives 5.1.1", - "ink_storage_traits", + "ink_storage_traits 5.1.1", "num-traits", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", @@ -7303,6 +7382,39 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "ink_env" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "blake2 0.10.6", + "cfg-if", + "const_env", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_allocator 6.0.0-alpha", + "ink_engine 6.0.0-alpha", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_storage_traits 6.0.0-alpha", + "num-traits", + "pallet-revive 0.5.0", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "schnorrkel 0.11.4", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", + "sp-io 40.0.1", + "sp-runtime-interface 29.0.1", + "staging-xcm 16.2.0", + "static_assertions", +] + [[package]] name = "ink_ir" version = "5.1.1" @@ -7319,14 +7431,30 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "ink_ir" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "blake2 0.10.6", + "either", + "impl-serde 0.5.0", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "itertools 0.14.0", + "proc-macro2", + "quote", + "sha3", + "syn 2.0.101", +] + [[package]] name = "ink_macro" version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce9465553d3066a8e28bd94a94880289084c4ff12f1852312553e902fa1ffdd" dependencies = [ - "ink_codegen", - "ink_ir", + "ink_codegen 5.1.1", + "ink_ir 5.1.1", "ink_primitives 5.1.1", "parity-scale-codec", "proc-macro2", @@ -7335,6 +7463,21 @@ dependencies = [ "synstructure 0.13.2", ] +[[package]] +name = "ink_macro" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "ink_codegen 6.0.0-alpha", + "ink_ir 6.0.0-alpha", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure 0.13.2", +] + [[package]] name = "ink_metadata" version = "5.1.1" @@ -7359,8 +7502,23 @@ source = "git+https://github.com/use-ink/ink?branch=master#641f05706e4f7ff1fb7c6 dependencies = [ "derive_more 2.0.1", "impl-serde 0.5.0", - "ink_prelude 6.0.0-alpha", - "ink_primitives 6.0.0-alpha", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=master)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=master)", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + +[[package]] +name = "ink_metadata" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "derive_more 2.0.1", + "impl-serde 0.5.0", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", "parity-scale-codec", "scale-info", "schemars", @@ -7384,6 +7542,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_prelude" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_primitives" version = "5.1.1" @@ -7408,7 +7574,34 @@ dependencies = [ "cfg-if", "derive_more 2.0.1", "impl-trait-for-tuples", - "ink_prelude 6.0.0-alpha", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=master)", + "itertools 0.14.0", + "num-traits", + "pallet-revive 0.5.0", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "paste", + "primitive-types 0.13.1", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-runtime-interface 29.0.1", + "xxhash-rust", +] + +[[package]] +name = "ink_primitives" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "alloy-sol-types 1.2.0", + "cfg-if", + "derive_more 2.0.1", + "impl-trait-for-tuples", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", "itertools 0.14.0", "num-traits", "pallet-revive 0.5.0", @@ -7435,16 +7628,34 @@ dependencies = [ "array-init", "cfg-if", "derive_more 1.0.0", - "ink_env", + "ink_env 5.1.1", "ink_metadata 5.1.1", "ink_prelude 5.1.1", "ink_primitives 5.1.1", - "ink_storage_traits", + "ink_storage_traits 5.1.1", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", "scale-info", ] +[[package]] +name = "ink_storage" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "array-init", + "cfg-if", + "derive_more 2.0.1", + "ink_env 6.0.0-alpha", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_storage_traits 6.0.0-alpha", + "pallet-revive-uapi 0.4.0", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "ink_storage_traits" version = "5.1.1" @@ -7458,6 +7669,20 @@ dependencies = [ "scale-info", ] +[[package]] +name = "ink_storage_traits" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +dependencies = [ + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "parity-scale-codec", + "scale-info", + "sp-io 40.0.1", + "sp-runtime-interface 29.0.1", +] + [[package]] name = "inout" version = "0.1.4" @@ -7609,7 +7834,7 @@ dependencies = [ "cumulus-primitives-core 0.7.0", "frame-support 28.0.0", "frame-system 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "ismp", "log", "pallet-ismp", @@ -7935,6 +8160,12 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "keccak-const" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" + [[package]] name = "keccak-hash" version = "0.11.0" @@ -7951,6 +8182,21 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" +[[package]] +name = "konst" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330f0e13e6483b8c34885f7e6c9f19b1a7bd449c673fbb948a51c99d66ef74f4" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "kusama-runtime-constants" version = "1.0.0" @@ -10835,7 +11081,7 @@ dependencies = [ "frame-system 28.0.0", "hash-db", "hex", - "hex-literal", + "hex-literal 0.4.1", "ismp", "jsonrpsee", "pallet-ismp", @@ -11483,7 +11729,7 @@ dependencies = [ "frame-benchmarking 28.0.0", "frame-support 28.0.0", "frame-system 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "humantime-serde", "impl-trait-for-tuples", "log", @@ -11532,7 +11778,7 @@ dependencies = [ "frame-benchmarking 40.2.0", "frame-support 40.1.0", "frame-system 40.1.0", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", "num-bigint", @@ -12705,7 +12951,7 @@ dependencies = [ "frame-system-benchmarking 38.0.0", "frame-system-rpc-runtime-api 34.0.0", "frame-try-runtime 0.44.0", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-asset-rate 17.0.0", "pallet-authority-discovery 38.0.0", @@ -13785,7 +14031,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?rev=a251f77#a251f77f35c dependencies = [ "bitvec", "bounded-collections", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-core-primitives 7.0.0", @@ -13814,7 +14060,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b57bc055fa389372ec5fc0001b99aeffd50f3fd379280ce572d935189bb58dd8" dependencies = [ "bitvec", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-core-primitives 15.0.0", @@ -13841,7 +14087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bb20b75d33212150242d39890d7ededab55f1084160c337f15d0eb8ca8c3ad4" dependencies = [ "bitvec", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-core-primitives 15.0.0", @@ -14455,6 +14701,15 @@ dependencies = [ "polkavm-derive-impl-macro 0.21.0", ] +[[package]] +name = "polkavm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e819eaea986d6a3de2a08840f0cc188db3c318b30f9bb1deb416d8c4beb2ed14" +dependencies = [ + "polkavm-derive-impl-macro 0.22.0", +] + [[package]] name = "polkavm-derive" version = "0.24.0" @@ -14500,6 +14755,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414507a0a7c9451cc81336ef1f5ccbab8fa4aeda402668735aa28331867bd3ef" +dependencies = [ + "polkavm-common 0.22.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "polkavm-derive-impl" version = "0.24.0" @@ -14542,6 +14809,16 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad6a5df4cc6466a219386b04d8bd267ba772f9458a8e9aa7539757ca5b11e2aa" +dependencies = [ + "polkavm-derive-impl 0.22.0", + "syn 2.0.101", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.24.0" @@ -14709,11 +14986,20 @@ version = "0.0.0" dependencies = [ "bitflags 2.9.1", "enumflags2", - "ink", + "ink 5.1.1", "pop-primitives", "sp-io 40.0.1", ] +[[package]] +name = "pop-api" +version = "0.1.0" +dependencies = [ + "alloy-sol-types 1.2.0", + "ink 6.0.0-alpha", + "pop-primitives", +] + [[package]] name = "pop-api-integration-tests" version = "0.1.0" @@ -14732,7 +15018,7 @@ dependencies = [ "pallet-nfts 34.1.0", "pallet-xcm 7.0.0", "parity-scale-codec", - "pop-api", + "pop-api 0.0.0", "pop-primitives", "pop-runtime-devnet", "pop-runtime-testnet", @@ -14755,7 +15041,7 @@ dependencies = [ "pallet-balances 28.0.0", "pallet-revive 0.1.0", "parity-scale-codec", - "pop-api", + "pop-api 0.1.0", "pop-primitives", "pop-runtime-devnet", "pop-runtime-testnet", @@ -14940,7 +15226,7 @@ dependencies = [ "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", "hex", - "hex-literal", + "hex-literal 0.4.1", "ismp", "ismp-parachain", "ismp-parachain-runtime-api", @@ -15109,7 +15395,7 @@ dependencies = [ "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", "hex", - "hex-literal", + "hex-literal 0.4.1", "ismp", "ismp-parachain", "ismp-parachain-runtime-api", @@ -16025,7 +16311,7 @@ dependencies = [ "frame-system-benchmarking 28.0.0", "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-asset-rate 7.0.0", "pallet-authority-discovery 28.0.0", @@ -18965,7 +19251,7 @@ dependencies = [ "bp-relayers", "frame-support 28.0.0", "frame-system 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-parachain-primitives 6.0.0", @@ -18990,7 +19276,7 @@ dependencies = [ "ethabi-decode 1.0.0", "frame-support 38.2.0", "frame-system 38.0.0", - "hex-literal", + "hex-literal 0.4.1", "parity-scale-codec", "polkadot-parachain-primitives 14.0.0", "scale-info", @@ -19013,7 +19299,7 @@ dependencies = [ "ethabi-decode 2.0.0", "ethbloom 0.14.1", "ethereum-types 0.15.1", - "hex-literal", + "hex-literal 0.4.1", "parity-bytes", "parity-scale-codec", "rlp 0.6.1", @@ -19034,7 +19320,7 @@ dependencies = [ "ethabi-decode 1.0.0", "ethbloom 0.13.0", "ethereum-types 0.14.1", - "hex-literal", + "hex-literal 0.4.1", "parity-bytes", "parity-scale-codec", "rlp 0.5.2", @@ -19070,7 +19356,7 @@ dependencies = [ "ethabi-decode 2.0.0", "frame-support 28.0.0", "frame-system 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-parachain-primitives 6.0.0", @@ -19116,7 +19402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aefe74eafeac92e1d9e46b7bb76ec297f6182b4a023f7e7eb7eb8be193f93bef" dependencies = [ "frame-support 38.2.0", - "hex-literal", + "hex-literal 0.4.1", "log", "parity-scale-codec", "scale-info", @@ -21141,7 +21427,7 @@ dependencies = [ "derive-where", "environmental", "frame-support 28.0.0", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -21202,7 +21488,7 @@ dependencies = [ "derive-where", "environmental", "frame-support 40.1.0", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -23491,7 +23777,7 @@ dependencies = [ "frame-system-benchmarking 28.0.0", "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-asset-rate 7.0.0", "pallet-authority-discovery 28.0.0", From 5994adc209acbf8f4edb17690b9c3c4892a34f0e Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 12:48:14 +0100 Subject: [PATCH 079/162] ci: set rustflags for pop-api-vnext integration tests --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c09e6a3b..de3ad7df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,8 @@ jobs: api-vnext-integration-tests: needs: lint runs-on: ubuntu-latest + env: + RUSTFLAGS: '--cfg ink_abi="sol"' steps: - uses: actions/checkout@v4 From 19bf3fb101a2c508a882259bed31ff079c5f204c Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 12:52:15 +0100 Subject: [PATCH 080/162] test(runtime): disable precompiles with contract test Disabled until it can be replaced completely by integration tests. --- runtime/devnet/src/config/contracts.rs | 184 ++++++++++++------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 1b21c581a..8c20263f1 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -226,98 +226,98 @@ mod tests { }) } - #[test] - fn fungibles_precompiles_via_contract_works() { - let contract = include_bytes!( - "../../../../pop-api-vnext/examples/fungibles/target/ink/fungibles.polkavm" - ); - let caller = Alice.to_account_id(); - let origin = RuntimeOrigin::signed(caller.clone()); - let recipient = Bob.to_account_id(); - let recipient_addr = primitives::Address::new(AccountId32Mapper::to_address(&recipient).0); - let minimum_value = U256::from(1); - let endowment = primitives::U256::from(10_000); - new_test_ext().execute_with(|| { - assert_ok!(Revive::map_account(origin.clone())); - assert_ok!(Revive::map_account(RuntimeOrigin::signed(recipient))); - - // Instantiate contract with some value, required to create underlying asset - let result = Revive::bare_instantiate( - origin.clone(), - 10 * UNIT, - Weight::MAX, - DepositLimit::Balance(u128::MAX), - Code::Upload(contract.to_vec()), - // Constructors are not yet using Solidity encoding - [blake_selector("new"), ("Name", "SYMBOL", minimum_value, 10u8).encode()].concat(), - None, - ) - .result - .unwrap(); - assert!(!result.result.did_revert()); - let contract = primitives::Address::new(result.addr.0); - - // Mint some tokens to the contract - call::<()>( - origin.clone(), - result.addr, - [keccak_selector("mint(address,uint256)"), (contract, endowment).abi_encode()] - .concat(), - ); - - // Interact with contract as Erc20 - let total_supply = call::( - origin.clone(), - result.addr, - keccak_selector("totalSupply()"), - ); - assert_eq!(total_supply, endowment); - - let balance_of = call::( - origin.clone(), - result.addr, - [keccak_selector("balanceOf(address)"), (contract,).abi_encode()].concat(), - ); - assert_eq!(balance_of, endowment); - - // Transfer tokens from contract to recipient - let value = endowment / primitives::U256::from(2); - assert!(call::( - origin.clone(), - result.addr, - [ - keccak_selector("transfer(address,uint256)"), - (recipient_addr, value).abi_encode(), - ] - .concat(), - )); - let balance_of = call::( - origin.clone(), - result.addr, - [keccak_selector("balanceOf(address)"), (recipient_addr,).abi_encode()].concat(), - ); - assert_eq!(balance_of, value); - }); - - fn call::RustType>>( - origin: OriginFor, - contract: H160, - data: Vec, - ) -> T { - let result = Revive::bare_call( - origin, - contract, - 0, - Weight::MAX, - DepositLimit::Balance(u128::MAX), - data, - ) - .result - .unwrap(); - assert!(!result.did_revert()); - T::abi_decode(&result.data).unwrap() - } - } + // #[test] + // fn fungibles_precompiles_via_contract_works() { + // let contract = include_bytes!( + // "../../../../pop-api-vnext/examples/fungibles/target/ink/fungibles.polkavm" + // ); + // let caller = Alice.to_account_id(); + // let origin = RuntimeOrigin::signed(caller.clone()); + // let recipient = Bob.to_account_id(); + // let recipient_addr = primitives::Address::new(AccountId32Mapper::to_address(&recipient).0); + // let minimum_value = U256::from(1); + // let endowment = primitives::U256::from(10_000); + // new_test_ext().execute_with(|| { + // assert_ok!(Revive::map_account(origin.clone())); + // assert_ok!(Revive::map_account(RuntimeOrigin::signed(recipient))); + + // // Instantiate contract with some value, required to create underlying asset + // let result = Revive::bare_instantiate( + // origin.clone(), + // 10 * UNIT, + // Weight::MAX, + // DepositLimit::Balance(u128::MAX), + // Code::Upload(contract.to_vec()), + // // Constructors are not yet using Solidity encoding + // [blake_selector("new"), ("Name", "SYMBOL", minimum_value, 10u8).encode()].concat(), + // None, + // ) + // .result + // .unwrap(); + // assert!(!result.result.did_revert()); + // let contract = primitives::Address::new(result.addr.0); + + // // Mint some tokens to the contract + // call::<()>( + // origin.clone(), + // result.addr, + // [keccak_selector("mint(address,uint256)"), (contract, endowment).abi_encode()] + // .concat(), + // ); + + // // Interact with contract as Erc20 + // let total_supply = call::( + // origin.clone(), + // result.addr, + // keccak_selector("totalSupply()"), + // ); + // assert_eq!(total_supply, endowment); + + // let balance_of = call::( + // origin.clone(), + // result.addr, + // [keccak_selector("balanceOf(address)"), (contract,).abi_encode()].concat(), + // ); + // assert_eq!(balance_of, endowment); + + // // Transfer tokens from contract to recipient + // let value = endowment / primitives::U256::from(2); + // assert!(call::( + // origin.clone(), + // result.addr, + // [ + // keccak_selector("transfer(address,uint256)"), + // (recipient_addr, value).abi_encode(), + // ] + // .concat(), + // )); + // let balance_of = call::( + // origin.clone(), + // result.addr, + // [keccak_selector("balanceOf(address)"), (recipient_addr,).abi_encode()].concat(), + // ); + // assert_eq!(balance_of, value); + // }); + + // fn call::RustType>>( + // origin: OriginFor, + // contract: H160, + // data: Vec, + // ) -> T { + // let result = Revive::bare_call( + // origin, + // contract, + // 0, + // Weight::MAX, + // DepositLimit::Balance(u128::MAX), + // data, + // ) + // .result + // .unwrap(); + // assert!(!result.did_revert()); + // T::abi_decode(&result.data).unwrap() + // } + // } fn blake_selector(name: &str) -> Vec { sp_io::hashing::blake2_256(name.as_bytes())[0..4].to_vec() From 80f5d842b2f93e83f367408322eb0b6cb72afbb7 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 13:13:29 +0100 Subject: [PATCH 081/162] test(api): add transfer_from test --- .../integration-tests/src/fungibles.rs | 56 ++++++++++++++++++- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 47abc0580..721cc59a0 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -146,7 +146,7 @@ fn transfer_works() { // Err(Token(CannotCreate)) // ); // Token is not live, i.e. frozen or being destroyed. - start_destroy(&ALICE, token); + start_destroy(&owner, token); // assert_eq!( // contract.transfer(&addr, token, BOB, amount / 4), // Err(Module { index: 52, error: [16, 0] }) @@ -155,9 +155,59 @@ fn transfer_works() { } #[test] -#[ignore] fn transfer_from_works() { - todo!() + let token = 1; + let owner = ALICE; + let amount: Balance = 100 * UNIT; + let to = BOB; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_balances(vec![(token, owner.clone(), amount)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(); + + // Token does not exist. + // assert_eq!( + // transfer_from(&addr, 1, ALICE, BOB, amount / 2), + // Err(Module { index: 52, error: [3, 0] }), + // ); + // Unapproved transfer. + // assert_eq!( + // transfer_from(&addr, token, ALICE, BOB, amount / 2), + // Err(Module { index: 52, error: [10, 0] }) + // ); + // Approve the contract to transfer on behalf of owner. + approve(&owner, token, &to_account_id(&contract.address), amount + 1 * UNIT); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // transfer_from(&addr, token, ALICE, BOB, amount), + // Err(Module { index: 52, error: [16, 0] }), + // ); + thaw(&owner, token); + // Not enough balance. + // assert_eq!( + // transfer_from(&addr, token, ALICE, BOB, amount + 1 * UNIT), + // Err(Module { index: 52, error: [0, 0] }), + // ); + // Successful transfer. + let balance_before_transfer = Assets::balance(token, &BOB); + contract.transfer_from( + &owner, + token, + to_address(&owner), + to_address(&to), + (amount / 2).into(), + ); + let balance_after_transfer = Assets::balance(token, &BOB); + assert_eq!(balance_after_transfer, balance_before_transfer + amount / 2); + // Successfully emit event. + let from = to_address(&owner); + let to = to_address(&to); + let expected = Transfer { from, to, value: (amount / 2).into() }.encode(); + assert_eq!(contract.last_event(), expected); + }); } #[test] From 928f5ff32453bd59367394b7e14aa38a10c0caa9 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 13:50:42 +0100 Subject: [PATCH 082/162] ci: exclude pop-api-integration-tests from test and coverage jobs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de3ad7df2..d7c60558b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - uses: "./.github/actions/init" - name: Run tests - run: cargo test --release --locked --workspace --exclude integration-tests --exclude pop-api-integration-tests --features=runtime-benchmarks + run: cargo test --release --locked --workspace --exclude integration-tests --exclude pop-api-integration-tests --exclude pop-api-vnext-integration-tests --features=runtime-benchmarks integration-tests: needs: lint @@ -207,7 +207,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage - run: cargo llvm-cov --features=runtime-benchmarks,try-runtime,ismp --workspace --exclude integration-tests --exclude pop-api-integration-tests --lib --bins --codecov --output-path codecov.json + run: cargo llvm-cov --features=runtime-benchmarks,try-runtime,ismp --workspace --exclude integration-tests --exclude pop-api-integration-tests --exclude pop-api-vnext-integration-tests --lib --bins --codecov --output-path codecov.json - name: Upload to codecov.io uses: codecov/codecov-action@v4 From 30f92505ad3d18dda35b35807dcdc2d33901716e Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 14:06:24 +0100 Subject: [PATCH 083/162] test(api): add approve test --- .../integration-tests/src/fungibles.rs | 90 ++++++++++++++++--- pop-api-vnext/integration-tests/src/lib.rs | 3 +- 2 files changed, 79 insertions(+), 14 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 721cc59a0..ee7e84496 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -2,8 +2,9 @@ use frame_support::{ pallet_prelude::Encode, traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _, Inspect as _}, }; -use pop_api::fungibles::Transfer; +use pop_api::fungibles::{Approval, Transfer}; use pop_primitives::TokenId; +use sp_io::hashing::twox_256; use super::*; @@ -18,7 +19,7 @@ fn total_supply_works() { .with_asset_balances(vec![(token, BOB, endowment)]) .build() .execute_with(|| { - let contract = Contract::new(); + let contract = Contract::new(0); // Tokens in circulation. assert_eq!(contract.total_supply(token), Assets::total_supply(token).into()); @@ -41,7 +42,7 @@ fn balance_of_works() { .with_asset_balances(vec![(token, owner.clone(), endowment)]) .build() .execute_with(|| { - let contract = Contract::new(); + let contract = Contract::new(0); // Tokens in circulation. assert_eq!( @@ -70,7 +71,7 @@ fn allowance_works() { .with_assets(vec![(token, ALICE, false, 1)]) .build() .execute_with(|| { - let contract = Contract::new(); + let contract = Contract::new(0); // Tokens in circulation. approve(&owner, token, &spender, allowance); @@ -106,7 +107,7 @@ fn transfer_works() { .with_assets(vec![(token, owner.clone(), false, 1)]) .build() .execute_with(|| { - let mut contract = Contract::new(); + let mut contract = Contract::new(0); // Token does not exist. // assert_eq!(transfer(&addr, 1, BOB, amount), Err(Module { index: 52, error: [3, 0] @@ -165,7 +166,7 @@ fn transfer_from_works() { .with_asset_balances(vec![(token, owner.clone(), amount)]) .build() .execute_with(|| { - let mut contract = Contract::new(); + let mut contract = Contract::new(0); // Token does not exist. // assert_eq!( @@ -211,9 +212,71 @@ fn transfer_from_works() { } #[test] -#[ignore] fn approve_works() { - todo!() + let token = 1; + let owner = ALICE; + let amount: Balance = 100 * UNIT; + let delegate = BOB; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_balances(vec![(token, owner.clone(), amount)]) + .build() + .execute_with(|| { + let contract = Contract::new(0); + + // Token does not exist. + // assert_eq!(contract.approve(&addr, TokenId::MAX, &BOB, amount), Err(Module { index: + // 52, error: [3, 0] })); + // assert_eq!(contract.approve(&addr, token, &BOB, amount), Err(ConsumerRemaining)); + let mut contract = Contract::new(INIT_VALUE); + // Mint `amount` to contract address. + mint(&owner, token, &to_account_id(&contract.address), amount); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // contract.approve(&addr, token, &BOB, amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + thaw(&owner, token); + // Successful approvals. + assert_eq!(0, Assets::allowance(token, &to_account_id(&contract.address), &delegate)); + contract.approve( + &to_account_id(&contract.address), + token, + to_address(&delegate), + amount.into(), + ); + assert_eq!( + Assets::allowance(token, &to_account_id(&contract.address), &delegate), + amount + ); + // Successfully emit event. + let spender = to_address(&delegate); + let expected = + Approval { owner: contract.address, spender, value: amount.into() }.encode(); + assert_eq!(contract.last_event(), expected); + // Non-additive, sets new value. + contract.approve( + &to_account_id(&contract.address), + token, + spender, + (amount / 2).into(), + ); + assert_eq!( + Assets::allowance(token, &to_account_id(&contract.address), &delegate), + amount / 2 + ); + // Successfully emit event. + let expected = + Approval { owner: contract.address, spender, value: (amount / 2).into() }.encode(); + assert_eq!(contract.last_event(), expected); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&owner, token); + // assert_eq!( + // approve(&addr, token, &BOB, amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + }); } #[test] @@ -244,7 +307,7 @@ fn metadata_works() { )]) .build() .execute_with(|| { - let contract = Contract::new(); + let contract = Contract::new(0); // Existing token. assert_eq!(contract.name(token).as_bytes(), Assets::name(token).as_slice()); @@ -300,7 +363,7 @@ fn exists_works() { .with_assets(vec![(token, ALICE, false, 1)]) .build() .execute_with(|| { - let contract = Contract::new(); + let contract = Contract::new(0); // Tokens in circulation. assert_eq!(contract.exists(token), Assets::asset_exists(token)); @@ -330,9 +393,10 @@ struct Contract { impl Contract { // Create a new instance of the contract through on-chain instantiation. - fn new() -> Self { - let address = instantiate(CONTRACT, 0, None); - Self { address: address.clone() } + fn new(value: Balance) -> Self { + let salt = twox_256(&value.to_le_bytes()); + let address = instantiate(CONTRACT, value, Some(salt)); + Self { address } } fn allowance(&self, token: TokenId, owner: H160, spender: H160) -> U256 { diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index fac478ec4..9eeb2994e 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -22,6 +22,7 @@ mod fungibles; const GAS_LIMIT: Weight = Weight::from_parts(500_000_000_000, 3 * 1024 * 1024); const INIT_AMOUNT: Balance = 100_000_000 * UNIT; +const INIT_VALUE: Balance = 100 * UNIT; const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::Balance(Balance::MAX); type AssetId = u32; @@ -68,7 +69,7 @@ fn decode::RustType>>(data: &[u8]) -> } // Deploy, instantiate and return contract address. -fn instantiate(contract: impl AsRef, value: u128, salt: Option<[u8; 32]>) -> H160 { +fn instantiate(contract: impl AsRef, value: Balance, salt: Option<[u8; 32]>) -> H160 { let binary = std::fs::read(contract).expect("could not read .wasm file"); let result = Revive::bare_instantiate( From 1f9fdb2a1bd3bfae6c5206f2a5e2b185adb039c2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 14:09:25 +0100 Subject: [PATCH 084/162] test(api): add contract.account_id() helper --- .../integration-tests/src/fungibles.rs | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index ee7e84496..a81171632 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -113,7 +113,7 @@ fn transfer_works() { // assert_eq!(transfer(&addr, 1, BOB, amount), Err(Module { index: 52, error: [3, 0] // })); // Mint `amount` to contract address. - mint(&owner, token, &to_account_id(&contract.address), amount); + mint(&owner, token, &contract.account_id(), amount); // Token is not live, i.e. frozen or being destroyed. freeze(&owner, token); // assert_eq!( @@ -179,7 +179,7 @@ fn transfer_from_works() { // Err(Module { index: 52, error: [10, 0] }) // ); // Approve the contract to transfer on behalf of owner. - approve(&owner, token, &to_account_id(&contract.address), amount + 1 * UNIT); + approve(&owner, token, &contract.account_id(), amount + 1 * UNIT); // Token is not live, i.e. frozen or being destroyed. freeze(&owner, token); // assert_eq!( @@ -230,7 +230,7 @@ fn approve_works() { // assert_eq!(contract.approve(&addr, token, &BOB, amount), Err(ConsumerRemaining)); let mut contract = Contract::new(INIT_VALUE); // Mint `amount` to contract address. - mint(&owner, token, &to_account_id(&contract.address), amount); + mint(&owner, token, &contract.account_id(), amount); // Token is not live, i.e. frozen or being destroyed. freeze(&owner, token); // assert_eq!( @@ -239,33 +239,17 @@ fn approve_works() { // ); thaw(&owner, token); // Successful approvals. - assert_eq!(0, Assets::allowance(token, &to_account_id(&contract.address), &delegate)); - contract.approve( - &to_account_id(&contract.address), - token, - to_address(&delegate), - amount.into(), - ); - assert_eq!( - Assets::allowance(token, &to_account_id(&contract.address), &delegate), - amount - ); + assert_eq!(0, Assets::allowance(token, &contract.account_id(), &delegate)); + contract.approve(&contract.account_id(), token, to_address(&delegate), amount.into()); + assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount); // Successfully emit event. let spender = to_address(&delegate); let expected = Approval { owner: contract.address, spender, value: amount.into() }.encode(); assert_eq!(contract.last_event(), expected); // Non-additive, sets new value. - contract.approve( - &to_account_id(&contract.address), - token, - spender, - (amount / 2).into(), - ); - assert_eq!( - Assets::allowance(token, &to_account_id(&contract.address), &delegate), - amount / 2 - ); + contract.approve(&contract.account_id(), token, spender, (amount / 2).into()); + assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount / 2); // Successfully emit event. let expected = Approval { owner: contract.address, spender, value: (amount / 2).into() }.encode(); @@ -615,6 +599,10 @@ impl Contract { .unwrap() } + fn account_id(&self) -> AccountId { + to_account_id(&self.address) + } + fn call::RustType>>( &self, origin: AccountId, From 618434102f0f67d3d488ca40053d8d7889adc6fe Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 16:43:41 +0100 Subject: [PATCH 085/162] test(api): add increase/decrease allowance tests --- .../integration-tests/src/fungibles.rs | 105 +++++++++++++++++- pop-api-vnext/src/fungibles/mod.rs | 2 +- 2 files changed, 102 insertions(+), 5 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index a81171632..688a84a19 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -264,15 +264,112 @@ fn approve_works() { } #[test] -#[ignore] fn increase_allowance_works() { - todo!() + let token = 1; + let owner = ALICE; + let amount: Balance = 100 * UNIT; + let delegate = BOB; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + // Instantiate a contract without balance - test `ConsumerRemaining. + let contract = Contract::new(0); + // Token does not exist. + // assert_eq!( + // increase_allowance(&addr, 0, &BOB, amount), + // Err(Module { index: 52, error: [3, 0] }) + // ); + mint(&owner, token, &contract.account_id(), amount); + // assert_eq!(contract.increase_allowance(&owner, token, &delegate, amount), + // Err(ConsumerRemaining)); + + // Instantiate a contract with balance. + let mut contract = Contract::new(INIT_VALUE); + // Create token with Alice as owner and mint `amount` to contract address. + mint(&owner, token, &contract.account_id(), amount); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // contract.increase_allowance(&addr, token, &BOB, amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + thaw(&owner, token); + // Successful approvals: + assert_eq!(0, Assets::allowance(token, &contract.account_id(), &delegate)); + assert_eq!( + contract.increase_allowance( + &contract.account_id(), + token, + to_address(&delegate), + amount.into() + ), + amount.into() + ); + assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount); + // Additive. + assert_eq!( + contract.increase_allowance( + &contract.account_id(), + token, + to_address(&delegate), + amount.into() + ), + (amount * 2).into() + ); + assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount * 2); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&owner, token); + // assert_eq!( + // contract.increase_allowance(&addr, token, &BOB, amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + }); } #[test] -#[ignore] fn decrease_allowance_works() { - todo!() + let token = 1; + let owner = ALICE; + let amount: Balance = 100 * UNIT; + let delegate = BOB; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(INIT_VALUE); + + // Mint `amount` to contract address, then approve delegate to spend `amount`. + mint(&owner, token, &contract.account_id(), amount); + approve(&contract.account_id(), token, &delegate, amount); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // decrease_allowance(&addr, token, &BOB, amount), + // Err(Module { index: 52, error: [16, 0] }), + // ); + thaw(&owner, token); + // "Unapproved" error is returned if the current allowance is less than `value`. + // assert_eq!( + // decrease_allowance(&addr, token, &BOB, amount * 2), + // Err(Module { index: 52, error: [10, 0] }), + // ); + // Successfully decrease allowance. + let amount = amount / 2 - 1 * UNIT; + let allowance_before = Assets::allowance(token, &contract.account_id(), &delegate); + assert_eq!( + contract.decrease_allowance(&owner, token, to_address(&delegate), amount.into()), + (allowance_before - amount).into() + ); + let allowance_after = Assets::allowance(token, &contract.account_id(), &delegate); + assert_eq!(allowance_before - allowance_after, amount); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&owner, token); + // assert_eq!( + // contract.decrease_allowance(&addr, token, &delegate, 1 * UNIT), + // Err(Module { index: 52, error: [16, 0] }), + // ); + }); } #[test] diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index eaa04d5ed..380a83772 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -295,7 +295,7 @@ pub fn decrease_allowance(token: TokenId, spender: Address, value: U256) -> Resu let address = fixed_address(PRECOMPILE); let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); - Ok(precompile.increaseAllowance(token, spender, value)) + Ok(precompile.decreaseAllowance(token, spender, value)) } /// Whether the specified token exists. From c270b7737d80fbb8c15e8515a174582d2624fbdc Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 16:54:04 +0100 Subject: [PATCH 086/162] refactor(api): separate out fungibles errors module --- pop-api-vnext/src/fungibles/errors.rs | 257 +++++++++++++++++++++++++ pop-api-vnext/src/fungibles/mod.rs | 261 +------------------------- 2 files changed, 258 insertions(+), 260 deletions(-) create mode 100644 pop-api-vnext/src/fungibles/errors.rs diff --git a/pop-api-vnext/src/fungibles/errors.rs b/pop-api-vnext/src/fungibles/errors.rs new file mode 100644 index 000000000..cafc0d3b1 --- /dev/null +++ b/pop-api-vnext/src/fungibles/errors.rs @@ -0,0 +1,257 @@ +use super::*; + +// NOTE: subject to change based on ink!'s support for solidity custom errors. +pub enum Error { + /// The token recipient is invalid. + InvalidRecipient(InvalidRecipient), + /// The minimum balance should be non-zero. + MinBalanceZero(MinBalanceZero), + /// The signing account has no permission to do the operation. + NoPermission(NoPermission), + /// The `admin` address cannot be the zero address. + ZeroAdminAddress(ZeroAdminAddress), + /// The recipient cannot be the zero address. + ZeroRecipientAddress(ZeroRecipientAddress), + /// The sender cannot be the zero address. + ZeroSenderAddress(ZeroSenderAddress), + /// The specified `value` cannot be zero. + ZeroValue(ZeroValue), +} + +impl<'a> SolEncode<'a> for Error { + type SolType = (); + + fn encode(&'a self) -> Vec { + use Error::*; + match self { + InvalidRecipient(e) => e.abi_encode(), + MinBalanceZero(e) => e.abi_encode(), + NoPermission(e) => e.abi_encode(), + ZeroAdminAddress(e) => e.abi_encode(), + ZeroRecipientAddress(e) => e.abi_encode(), + ZeroSenderAddress(e) => e.abi_encode(), + ZeroValue(e) => e.abi_encode(), + } + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } +} + +/// The token recipient is invalid. +pub struct InvalidRecipient(pub Address); +impl SolError for InvalidRecipient { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [23, 133, 139, 190]; + const SIGNATURE: &'static str = "InvalidRecipient(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self(Address::from(*tuple.0 .0)) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } +} +impl<'a> SolEncode<'a> for InvalidRecipient { + type SolType = (&'a Address,); + + #[inline] + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + #[inline] + fn to_sol_type(&'a self) -> Self::SolType { + (&self.0,) + } +} +impl From for Error { + fn from(value: InvalidRecipient) -> Self { + Self::InvalidRecipient(value) + } +} + +/// The minimum balance should be non-zero. +pub struct MinBalanceZero; +impl SolError for MinBalanceZero { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [95, 21, 97, 139]; + const SIGNATURE: &'static str = "MinBalanceZero()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: MinBalanceZero) -> Self { + Self::MinBalanceZero(value) + } +} + +/// The signing account has no permission to do the operation. +pub struct NoPermission; +impl SolError for NoPermission { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [157, 123, 54, 157]; + const SIGNATURE: &'static str = "NoPermission()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl<'a> SolEncode<'a> for NoPermission { + type SolType = (); + + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } +} +impl From for Error { + fn from(value: NoPermission) -> Self { + Self::NoPermission(value) + } +} + +/// The `admin` address cannot be the zero address. +pub struct ZeroAdminAddress; +impl SolError for ZeroAdminAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [62, 243, 155, 129]; + const SIGNATURE: &'static str = "ZeroAdminAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: ZeroAdminAddress) -> Self { + Self::ZeroAdminAddress(value) + } +} + +/// The recipient cannot be the zero address. +pub struct ZeroRecipientAddress; +impl SolError for ZeroRecipientAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [206, 239, 152, 87]; + const SIGNATURE: &'static str = "ZeroRecipientAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: ZeroRecipientAddress) -> Self { + Self::ZeroRecipientAddress(value) + } +} + +/// The sender cannot be the zero address. +pub struct ZeroSenderAddress; +impl SolError for ZeroSenderAddress { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [255, 54, 43, 196]; + const SIGNATURE: &'static str = "ZeroSenderAddress()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: ZeroSenderAddress) -> Self { + Self::ZeroSenderAddress(value) + } +} + +/// The `value` should be non-zero. +pub struct ZeroValue; +impl SolError for ZeroValue { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [124, 148, 110, 215]; + const SIGNATURE: &'static str = "ZeroValue()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: ZeroValue) -> Self { + Self::ZeroValue(value) + } +} + +#[test] +fn error_encoding_works() { + for (result, expected) in [ + ( + InvalidRecipient([255u8; 20].into()).abi_encode(), + "17858bbe000000000000000000000000ffffffffffffffffffffffffffffffffffffffff", + ), + (MinBalanceZero.abi_encode(), "5f15618b"), + (NoPermission.abi_encode(), "9d7b369d"), + (ZeroAdminAddress.abi_encode(), "3ef39b81"), + (ZeroRecipientAddress.abi_encode(), "ceef9857"), + (ZeroSenderAddress.abi_encode(), "ff362bc4"), + (ZeroValue.abi_encode(), "7c946ed7"), + ] { + assert_eq!(hex::encode(result), expected) + } +} diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index 380a83772..116670e9b 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -17,6 +17,7 @@ use super::*; /// APIs for fungible tokens conforming to the ERC20 standard. pub mod erc20; +pub mod errors; const PRECOMPILE: u16 = 100; @@ -433,263 +434,3 @@ pub fn transfer_from(token: TokenId, from: Address, to: Address, value: U256) -> let precompile: contract_ref!(Fungibles, Pop, Sol) = address.into(); Ok(precompile.transferFrom(token, from, to, value)) } - -// NOTE: subject to change based on ink!'s support for solidity custom errors. -pub enum Error { - /// The token recipient is invalid. - InvalidRecipient(InvalidRecipient), - /// The minimum balance should be non-zero. - MinBalanceZero(MinBalanceZero), - /// The signing account has no permission to do the operation. - NoPermission(NoPermission), - /// The `admin` address cannot be the zero address. - ZeroAdminAddress(ZeroAdminAddress), - /// The recipient cannot be the zero address. - ZeroRecipientAddress(ZeroRecipientAddress), - /// The sender cannot be the zero address. - ZeroSenderAddress(ZeroSenderAddress), - /// The specified `value` cannot be zero. - ZeroValue(ZeroValue), -} - -impl<'a> SolEncode<'a> for Error { - type SolType = (); - - fn encode(&'a self) -> Vec { - use Error::*; - match self { - InvalidRecipient(e) => e.abi_encode(), - MinBalanceZero(e) => e.abi_encode(), - NoPermission(e) => e.abi_encode(), - ZeroAdminAddress(e) => e.abi_encode(), - ZeroRecipientAddress(e) => e.abi_encode(), - ZeroSenderAddress(e) => e.abi_encode(), - ZeroValue(e) => e.abi_encode(), - } - } - - fn to_sol_type(&'a self) -> Self::SolType { - () - } -} - -mod errors { - use super::*; - - /// The token recipient is invalid. - pub struct InvalidRecipient(pub Address); - impl SolError for InvalidRecipient { - type Parameters<'a> = (SolAddress,); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [23, 133, 139, 190]; - const SIGNATURE: &'static str = "InvalidRecipient(address)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self(Address::from(*tuple.0 .0)) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - (self.0.to_sol_type().tokenize(),) - } - } - impl<'a> SolEncode<'a> for InvalidRecipient { - type SolType = (&'a Address,); - - #[inline] - fn encode(&'a self) -> Vec { - self.abi_encode() - } - - #[inline] - fn to_sol_type(&'a self) -> Self::SolType { - (&self.0,) - } - } - impl From for Error { - fn from(value: InvalidRecipient) -> Self { - Self::InvalidRecipient(value) - } - } - - /// The minimum balance should be non-zero. - pub struct MinBalanceZero; - impl SolError for MinBalanceZero { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [95, 21, 97, 139]; - const SIGNATURE: &'static str = "MinBalanceZero()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: MinBalanceZero) -> Self { - Self::MinBalanceZero(value) - } - } - - /// The signing account has no permission to do the operation. - pub struct NoPermission; - impl SolError for NoPermission { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [157, 123, 54, 157]; - const SIGNATURE: &'static str = "NoPermission()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl<'a> SolEncode<'a> for NoPermission { - type SolType = (); - - fn encode(&'a self) -> Vec { - self.abi_encode() - } - - fn to_sol_type(&'a self) -> Self::SolType { - () - } - } - impl From for Error { - fn from(value: NoPermission) -> Self { - Self::NoPermission(value) - } - } - - /// The `admin` address cannot be the zero address. - pub struct ZeroAdminAddress; - impl SolError for ZeroAdminAddress { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [62, 243, 155, 129]; - const SIGNATURE: &'static str = "ZeroAdminAddress()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: ZeroAdminAddress) -> Self { - Self::ZeroAdminAddress(value) - } - } - - /// The recipient cannot be the zero address. - pub struct ZeroRecipientAddress; - impl SolError for ZeroRecipientAddress { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [206, 239, 152, 87]; - const SIGNATURE: &'static str = "ZeroRecipientAddress()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: ZeroRecipientAddress) -> Self { - Self::ZeroRecipientAddress(value) - } - } - - /// The sender cannot be the zero address. - pub struct ZeroSenderAddress; - impl SolError for ZeroSenderAddress { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [255, 54, 43, 196]; - const SIGNATURE: &'static str = "ZeroSenderAddress()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: ZeroSenderAddress) -> Self { - Self::ZeroSenderAddress(value) - } - } - - /// The `value` should be non-zero. - pub struct ZeroValue; - impl SolError for ZeroValue { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [124, 148, 110, 215]; - const SIGNATURE: &'static str = "ZeroValue()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: ZeroValue) -> Self { - Self::ZeroValue(value) - } - } - - #[test] - fn error_encoding_works() { - for (result, expected) in [ - ( - InvalidRecipient([255u8; 20].into()).abi_encode(), - "17858bbe000000000000000000000000ffffffffffffffffffffffffffffffffffffffff", - ), - (MinBalanceZero.abi_encode(), "5f15618b"), - (NoPermission.abi_encode(), "9d7b369d"), - (ZeroAdminAddress.abi_encode(), "3ef39b81"), - (ZeroRecipientAddress.abi_encode(), "ceef9857"), - (ZeroSenderAddress.abi_encode(), "ff362bc4"), - (ZeroValue.abi_encode(), "7c946ed7"), - ] { - assert_eq!(hex::encode(result), expected) - } - } -} From a4b4da0e0c6749dac40f2e8d2c88874a3670cbd4 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 16:57:48 +0100 Subject: [PATCH 087/162] feat(api): add fungibles events --- pop-api-vnext/src/fungibles/events.rs | 63 +++++++++++++++++++++++++++ pop-api-vnext/src/fungibles/mod.rs | 1 + 2 files changed, 64 insertions(+) create mode 100644 pop-api-vnext/src/fungibles/events.rs diff --git a/pop-api-vnext/src/fungibles/events.rs b/pop-api-vnext/src/fungibles/events.rs new file mode 100644 index 000000000..b49f9011b --- /dev/null +++ b/pop-api-vnext/src/fungibles/events.rs @@ -0,0 +1,63 @@ +//! A set of events for use in smart contracts interacting with the fungibles API. +//! +//! The `Transfer` and `Approval` events conform to the ERC-20 standard. The other events +//! (`Create`, `StartDestroy`, `SetMetadata`, `ClearMetadata`) are provided for convenience. +//! +//! These events are not emitted by the API itself but can be used in your contracts to +//! track token operations. Be mindful of the costs associated with emitting events. +//! +//! For more details, refer to [ink! events](https://use.ink/basics/events). + +pub use erc20::{Approval, Transfer}; + +use super::*; + +/// Event emitted when a token is created. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct Created { + /// The token identifier. + #[ink(topic)] + pub id: TokenId, + /// The creator of the token. + #[ink(topic)] + pub creator: Address, + /// The administrator of the token. + #[ink(topic)] + pub admin: Address, +} + +/// Event emitted when a token is in the process of being destroyed. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct DestroyStarted { + /// The token. + #[ink(topic)] + pub token: TokenId, +} + +/// Event emitted when new metadata is set for a token. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct MetadataSet { + /// The token. + #[ink(topic)] + pub token: TokenId, + /// The name of the token. + #[ink(topic)] + pub name: String, + /// The symbol of the token. + #[ink(topic)] + pub symbol: String, + /// The decimals of the token. + pub decimals: u8, +} + +/// Event emitted when metadata is cleared for a token. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct MetadataCleared { + /// The token. + #[ink(topic)] + pub token: TokenId, +} diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/mod.rs index 116670e9b..b04270cf0 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/mod.rs @@ -18,6 +18,7 @@ use super::*; /// APIs for fungible tokens conforming to the ERC20 standard. pub mod erc20; pub mod errors; +pub mod events; const PRECOMPILE: u16 = 100; From 0456b843b1cff67cb23e9063d30a2fa0b63f9b67 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 17:23:28 +0100 Subject: [PATCH 088/162] test(api): add create test --- .../contracts/fungibles/lib.rs | 11 ++++- .../integration-tests/src/fungibles.rs | 41 +++++++++++++++++-- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 1bf475219..148ddf39c 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] use ink::{prelude::string::String, U256}; -use pop_api::fungibles::{self as api, Approval, Fungibles, TokenId, Transfer}; +use pop_api::fungibles::{self as api, events::*, Fungibles, TokenId}; #[ink::contract] pub mod fungibles { @@ -65,7 +65,14 @@ pub mod fungibles { #[ink(message)] fn create(&self, admin: Address, min_balance: U256) -> TokenId { match api::create(admin, min_balance) { - Ok(token) => token, + Ok(token) => { + self.env().emit_event(Created { + id: token, + creator: self.env().address(), + admin, + }); + token + }, Err(error) => revert(&error), } } diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 688a84a19..3acf19c43 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -1,8 +1,10 @@ use frame_support::{ pallet_prelude::Encode, - traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _, Inspect as _}, + traits::fungibles::{ + approvals::Inspect as _, metadata::Inspect as _, roles::Inspect as _, Inspect as _, + }, }; -use pop_api::fungibles::{Approval, Transfer}; +use pop_api::fungibles::events::*; use pop_primitives::TokenId; use sp_io::hashing::twox_256; @@ -407,9 +409,40 @@ fn metadata_works() { } #[test] -#[ignore] fn create_works() { - todo!() + let token = 1; + let creator = ALICE; + let admin = BOB; + ExtBuilder::new().build().execute_with(|| { + // Instantiate a contract without balance for fees. + let contract = Contract::new(0); + // No balance to pay for fees. + // assert_eq!(contract.create(&addr, TOKEN_ID, &addr, 1), Err(Module { index: 10, error: [2, + // 0] }),); + + // Instantiate a contract with insufficient balance for deposit. + let contract = Contract::new(100); + // No balance to pay the deposit. + // assert_eq!(contract.create(&addr, TOKEN_ID, &addr, 1), Err(Module { index: 10, error: [2, + // 0] }),); + + // Instantiate a contract with enough balance. + let mut contract = Contract::new(INIT_VALUE); + // }),); The minimal balance for a token must be non zero. + // assert_eq!(contract.create(&addr, &admin, 0), Err(Module { index: 52, error: [7, 0] }),); + // Create token successfully. + let token = contract.create(&creator, to_address(&admin), 1.into()); + assert_eq!(Assets::owner(token), Some(contract.account_id())); + // Successfully emit event. + let admin = to_address(&admin); + let expected = Created { id: token, creator: contract.address, admin }.encode(); + assert_eq!(contract.last_event(), expected); + // Token ID is already taken. + // assert_eq!( + // contract.create(&addr, TOKEN_ID, &BOB, 1), + // Err(Module { index: 52, error: [5, 0] }), + // ); + }); } // Testing a contract that creates a token in the constructor. From 01d596d82a62984c151220b8e8adac12966e4d03 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 20:28:05 +0100 Subject: [PATCH 089/162] test(api): add start_destroy test --- .../contracts/fungibles/lib.rs | 1 + .../integration-tests/src/fungibles.rs | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 148ddf39c..1e73ec2fc 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -80,6 +80,7 @@ pub mod fungibles { #[ink(message)] fn startDestroy(&self, token: TokenId) { api::start_destroy(token); + self.env().emit_event(DestroyStarted { token }); } #[ink(message)] diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 3acf19c43..9e60c6eb2 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -410,7 +410,6 @@ fn metadata_works() { #[test] fn create_works() { - let token = 1; let creator = ALICE; let admin = BOB; ExtBuilder::new().build().execute_with(|| { @@ -453,9 +452,31 @@ fn instantiate_and_create_fungible_works() { } #[test] -#[ignore] fn start_destroy_works() { - todo!() + let token = 0; + let owner = ALICE; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(INIT_VALUE); + + // Token does not exist. + // assert_eq!( + // contract.start_destroy(&owner, TokenId::MAX), + // Err(Module { index: 52, error: [3, 0] }), + // ); + // No Permission. + // assert_eq!( + // contract.start_destroy(&owner, token), + // Err(Module { index: 52, error: [2, 0] }), + // ); + let token = contract.create(&owner, to_address(&owner), 1.into()); + contract.start_destroy(&owner, token); + // Successfully emit event. + let expected = DestroyStarted { token }.encode(); + assert_eq!(contract.last_event(), expected); + }); } #[test] From 429bb1ae477196f0a5b0dc350805b0429fd81ddb Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 21:30:50 +0100 Subject: [PATCH 090/162] test(api): make contract instantiation origin explicit to simplify api --- .../integration-tests/src/fungibles.rs | 255 ++++++++---------- pop-api-vnext/integration-tests/src/lib.rs | 15 +- 2 files changed, 117 insertions(+), 153 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 9e60c6eb2..f7c7dbdb8 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -21,7 +21,7 @@ fn total_supply_works() { .with_asset_balances(vec![(token, BOB, endowment)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&BOB, 0); // Tokens in circulation. assert_eq!(contract.total_supply(token), Assets::total_supply(token).into()); @@ -37,14 +37,14 @@ fn total_supply_works() { #[test] fn balance_of_works() { let token = 1; - let owner = BOB; + let owner = ALICE; let endowment = 100; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, BOB, false, 1)]) .with_asset_balances(vec![(token, owner.clone(), endowment)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&CHARLIE, 0); // Tokens in circulation. assert_eq!( @@ -66,14 +66,14 @@ fn balance_of_works() { #[test] fn allowance_works() { let token = 1; - let owner = BOB; - let spender = ALICE; + let owner = ALICE; + let spender = BOB; let allowance = 50; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&CHARLIE, 0); // Tokens in circulation. approve(&owner, token, &spender, allowance); @@ -109,7 +109,7 @@ fn transfer_works() { .with_assets(vec![(token, owner.clone(), false, 1)]) .build() .execute_with(|| { - let mut contract = Contract::new(0); + let mut contract = Contract::new(&owner, 0); // Token does not exist. // assert_eq!(transfer(&addr, 1, BOB, amount), Err(Module { index: 52, error: [3, 0] @@ -134,9 +134,9 @@ fn transfer_works() { // Err(Module { index: 52, error: [0, 0] }) // ); // Successful transfer. - let balance_before_transfer = Assets::balance(token, &BOB); - contract.transfer(&owner, token, to_address(&to), (amount / 2).into()); - let balance_after_transfer = Assets::balance(token, &BOB); + let balance_before_transfer = Assets::balance(token, &to); + contract.transfer(token, to_address(&to), (amount / 2).into()); + let balance_after_transfer = Assets::balance(token, &to); assert_eq!(balance_after_transfer, balance_before_transfer + amount / 2); // Successfully emit event. let from = contract.address; @@ -145,13 +145,13 @@ fn transfer_works() { assert_eq!(contract.last_event(), expected); // Transfer token to account that does not exist. // assert_eq!( - // contract.transfer(&owner, token, to_address(&CHARLIE), (amount / 4).into()), + // contract.transfer(token, to_address(&CHARLIE), (amount / 4).into()), // Err(Token(CannotCreate)) // ); // Token is not live, i.e. frozen or being destroyed. start_destroy(&owner, token); // assert_eq!( - // contract.transfer(&addr, token, BOB, amount / 4), + // contract.transfer(token, BOB, amount / 4), // Err(Module { index: 52, error: [16, 0] }) // ); }); @@ -168,7 +168,7 @@ fn transfer_from_works() { .with_asset_balances(vec![(token, owner.clone(), amount)]) .build() .execute_with(|| { - let mut contract = Contract::new(0); + let mut contract = Contract::new(&owner, 0); // Token does not exist. // assert_eq!( @@ -195,15 +195,9 @@ fn transfer_from_works() { // Err(Module { index: 52, error: [0, 0] }), // ); // Successful transfer. - let balance_before_transfer = Assets::balance(token, &BOB); - contract.transfer_from( - &owner, - token, - to_address(&owner), - to_address(&to), - (amount / 2).into(), - ); - let balance_after_transfer = Assets::balance(token, &BOB); + let balance_before_transfer = Assets::balance(token, &to); + contract.transfer_from(token, to_address(&owner), to_address(&to), (amount / 2).into()); + let balance_after_transfer = Assets::balance(token, &to); assert_eq!(balance_after_transfer, balance_before_transfer + amount / 2); // Successfully emit event. let from = to_address(&owner); @@ -217,20 +211,20 @@ fn transfer_from_works() { fn approve_works() { let token = 1; let owner = ALICE; + let spender = BOB; let amount: Balance = 100 * UNIT; - let delegate = BOB; ExtBuilder::new() .with_assets(vec![(token, owner.clone(), false, 1)]) - .with_asset_balances(vec![(token, owner.clone(), amount)]) + //.with_asset_balances(vec![(token, owner.clone(), amount)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&owner, 0); // Token does not exist. // assert_eq!(contract.approve(&addr, TokenId::MAX, &BOB, amount), Err(Module { index: // 52, error: [3, 0] })); // assert_eq!(contract.approve(&addr, token, &BOB, amount), Err(ConsumerRemaining)); - let mut contract = Contract::new(INIT_VALUE); + let mut contract = Contract::new(&owner, INIT_VALUE); // Mint `amount` to contract address. mint(&owner, token, &contract.account_id(), amount); // Token is not live, i.e. frozen or being destroyed. @@ -241,17 +235,20 @@ fn approve_works() { // ); thaw(&owner, token); // Successful approvals. - assert_eq!(0, Assets::allowance(token, &contract.account_id(), &delegate)); - contract.approve(&contract.account_id(), token, to_address(&delegate), amount.into()); - assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount); + assert_eq!(0, Assets::allowance(token, &contract.account_id(), &spender)); + contract.approve(token, to_address(&spender), amount.into()); + assert_eq!(Assets::allowance(token, &contract.account_id(), &spender), amount); // Successfully emit event. - let spender = to_address(&delegate); + let spender = to_address(&spender); let expected = Approval { owner: contract.address, spender, value: amount.into() }.encode(); assert_eq!(contract.last_event(), expected); // Non-additive, sets new value. - contract.approve(&contract.account_id(), token, spender, (amount / 2).into()); - assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount / 2); + contract.approve( token, spender, (amount / 2).into()); + assert_eq!( + Assets::allowance(token, &contract.account_id(), &to_account_id(&spender)), + amount / 2 + ); // Successfully emit event. let expected = Approval { owner: contract.address, spender, value: (amount / 2).into() }.encode(); @@ -269,14 +266,14 @@ fn approve_works() { fn increase_allowance_works() { let token = 1; let owner = ALICE; + let spender = BOB; let amount: Balance = 100 * UNIT; - let delegate = BOB; ExtBuilder::new() .with_assets(vec![(token, owner.clone(), false, 1)]) .build() .execute_with(|| { // Instantiate a contract without balance - test `ConsumerRemaining. - let contract = Contract::new(0); + let contract = Contract::new(&owner, 0); // Token does not exist. // assert_eq!( // increase_allowance(&addr, 0, &BOB, amount), @@ -287,7 +284,7 @@ fn increase_allowance_works() { // Err(ConsumerRemaining)); // Instantiate a contract with balance. - let mut contract = Contract::new(INIT_VALUE); + let mut contract = Contract::new(&owner, INIT_VALUE); // Create token with Alice as owner and mint `amount` to contract address. mint(&owner, token, &contract.account_id(), amount); // Token is not live, i.e. frozen or being destroyed. @@ -298,28 +295,18 @@ fn increase_allowance_works() { // ); thaw(&owner, token); // Successful approvals: - assert_eq!(0, Assets::allowance(token, &contract.account_id(), &delegate)); + assert_eq!(0, Assets::allowance(token, &contract.account_id(), &spender)); assert_eq!( - contract.increase_allowance( - &contract.account_id(), - token, - to_address(&delegate), - amount.into() - ), + contract.increase_allowance(token, to_address(&spender), amount.into()), amount.into() ); - assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount); + assert_eq!(Assets::allowance(token, &contract.account_id(), &spender), amount); // Additive. assert_eq!( - contract.increase_allowance( - &contract.account_id(), - token, - to_address(&delegate), - amount.into() - ), + contract.increase_allowance(token, to_address(&spender), amount.into()), (amount * 2).into() ); - assert_eq!(Assets::allowance(token, &contract.account_id(), &delegate), amount * 2); + assert_eq!(Assets::allowance(token, &contract.account_id(), &spender), amount * 2); // Token is not live, i.e. frozen or being destroyed. start_destroy(&owner, token); // assert_eq!( @@ -333,17 +320,17 @@ fn increase_allowance_works() { fn decrease_allowance_works() { let token = 1; let owner = ALICE; + let spender = BOB; let amount: Balance = 100 * UNIT; - let delegate = BOB; ExtBuilder::new() .with_assets(vec![(token, owner.clone(), false, 1)]) .build() .execute_with(|| { - let mut contract = Contract::new(INIT_VALUE); + let mut contract = Contract::new(&owner, INIT_VALUE); // Mint `amount` to contract address, then approve delegate to spend `amount`. mint(&owner, token, &contract.account_id(), amount); - approve(&contract.account_id(), token, &delegate, amount); + approve(&contract.account_id(), token, &spender, amount); // Token is not live, i.e. frozen or being destroyed. freeze(&owner, token); // assert_eq!( @@ -358,12 +345,12 @@ fn decrease_allowance_works() { // ); // Successfully decrease allowance. let amount = amount / 2 - 1 * UNIT; - let allowance_before = Assets::allowance(token, &contract.account_id(), &delegate); + let allowance_before = Assets::allowance(token, &contract.account_id(), &spender); assert_eq!( - contract.decrease_allowance(&owner, token, to_address(&delegate), amount.into()), + contract.decrease_allowance(token, to_address(&spender), amount.into()), (allowance_before - amount).into() ); - let allowance_after = Assets::allowance(token, &contract.account_id(), &delegate); + let allowance_after = Assets::allowance(token, &contract.account_id(), &spender); assert_eq!(allowance_before - allowance_after, amount); // Token is not live, i.e. frozen or being destroyed. start_destroy(&owner, token); @@ -377,20 +364,16 @@ fn decrease_allowance_works() { #[test] fn metadata_works() { let token = 1; + let owner = ALICE; let name = "name".to_string(); let symbol = "symbol".to_string(); let decimals: u8 = 69; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) - .with_asset_metadata(vec![( - token, - name.as_bytes().to_vec(), - symbol.as_bytes().to_vec(), - decimals, - )]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_metadata(vec![(token, name.clone().into(), symbol.clone().into(), decimals)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&owner, 0); // Existing token. assert_eq!(contract.name(token).as_bytes(), Assets::name(token).as_slice()); @@ -410,30 +393,29 @@ fn metadata_works() { #[test] fn create_works() { - let creator = ALICE; - let admin = BOB; + let owner = ALICE; ExtBuilder::new().build().execute_with(|| { // Instantiate a contract without balance for fees. - let contract = Contract::new(0); + let contract = Contract::new(&owner, 0); // No balance to pay for fees. // assert_eq!(contract.create(&addr, TOKEN_ID, &addr, 1), Err(Module { index: 10, error: [2, // 0] }),); // Instantiate a contract with insufficient balance for deposit. - let contract = Contract::new(100); + let contract = Contract::new(&owner, 100); // No balance to pay the deposit. // assert_eq!(contract.create(&addr, TOKEN_ID, &addr, 1), Err(Module { index: 10, error: [2, // 0] }),); // Instantiate a contract with enough balance. - let mut contract = Contract::new(INIT_VALUE); + let mut contract = Contract::new(&owner, INIT_VALUE); // }),); The minimal balance for a token must be non zero. // assert_eq!(contract.create(&addr, &admin, 0), Err(Module { index: 52, error: [7, 0] }),); // Create token successfully. - let token = contract.create(&creator, to_address(&admin), 1.into()); + let admin = to_address(&owner); + let token = contract.create(admin, 1.into()); assert_eq!(Assets::owner(token), Some(contract.account_id())); // Successfully emit event. - let admin = to_address(&admin); let expected = Created { id: token, creator: contract.address, admin }.encode(); assert_eq!(contract.last_event(), expected); // Token ID is already taken. @@ -456,23 +438,23 @@ fn start_destroy_works() { let token = 0; let owner = ALICE; ExtBuilder::new() - .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { - let mut contract = Contract::new(INIT_VALUE); + let mut contract = Contract::new(&owner, INIT_VALUE); // Token does not exist. // assert_eq!( - // contract.start_destroy(&owner, TokenId::MAX), + // contract.start_destroy(&creator, TokenId::MAX), // Err(Module { index: 52, error: [3, 0] }), // ); // No Permission. // assert_eq!( - // contract.start_destroy(&owner, token), + // contract.start_destroy(&creator, token), // Err(Module { index: 52, error: [2, 0] }), // ); - let token = contract.create(&owner, to_address(&owner), 1.into()); - contract.start_destroy(&owner, token); + let token = contract.create(to_address(&owner), 1.into()); + contract.start_destroy(token); // Successfully emit event. let expected = DestroyStarted { token }.encode(); assert_eq!(contract.last_event(), expected); @@ -494,11 +476,12 @@ fn clear_metadata_works() { #[test] fn exists_works() { let token = 1; + let owner = ALICE; ExtBuilder::new() - .with_assets(vec![(token, ALICE, false, 1)]) + .with_assets(vec![(token, owner.clone(), false, 1)]) .build() .execute_with(|| { - let contract = Contract::new(0); + let contract = Contract::new(&owner, 0); // Tokens in circulation. assert_eq!(contract.exists(token), Assets::asset_exists(token)); @@ -524,14 +507,16 @@ fn burn_works() { // A simple, strongly typed wrapper for the contract. struct Contract { address: H160, + creator: AccountId, } impl Contract { // Create a new instance of the contract through on-chain instantiation. - fn new(value: Balance) -> Self { + fn new(origin: &AccountId, value: Balance) -> Self { let salt = twox_256(&value.to_le_bytes()); - let address = instantiate(CONTRACT, value, Some(salt)); - Self { address } + let address = + instantiate(RuntimeOrigin::signed(origin.clone()), CONTRACT, value, Some(salt)); + Self { address, creator: origin.clone() } } fn allowance(&self, token: TokenId, owner: H160, spender: H160) -> U256 { @@ -539,7 +524,7 @@ impl Contract { let spender = alloy::Address::from(spender.0); U256::from_little_endian( self.call::( - ALICE, + &self.creator, keccak_selector("allowance(uint32,address,address)"), (token, owner, spender).abi_encode(), 0, @@ -549,11 +534,11 @@ impl Contract { ) } - fn approve(&mut self, origin: &AccountId, token: TokenId, spender: H160, value: U256) { + fn approve(&mut self, token: TokenId, spender: H160, value: U256) { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("approve(uint32,address,uint256)"), (token, spender, value).abi_encode(), 0, @@ -565,7 +550,7 @@ impl Contract { let owner = alloy::Address::from(owner.0); U256::from_little_endian( self.call::( - ALICE, + &self.creator, keccak_selector("balanceOf(uint32,address)"), (token, owner).abi_encode(), 0, @@ -575,11 +560,11 @@ impl Contract { ) } - fn burn(&mut self, origin: &AccountId, token: TokenId, account: H160, value: U256) { + fn burn(&mut self, token: TokenId, account: H160, value: U256) { let account = alloy::Address::from(account.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("burn(uint32,address,uint256)"), (token, account, value).abi_encode(), 0, @@ -587,21 +572,16 @@ impl Contract { .unwrap() } - fn clear_metadata(&mut self, origin: &AccountId, token: TokenId) { - self.call( - origin.clone(), - keccak_selector("clearMetadata(uint32)"), - (token,).abi_encode(), - 0, - ) - .unwrap() + fn clear_metadata(&mut self, token: TokenId) { + self.call(&self.creator, keccak_selector("clearMetadata(uint32)"), (token,).abi_encode(), 0) + .unwrap() } - fn create(&mut self, origin: &AccountId, admin: H160, min_balance: U256) -> TokenId { + fn create(&mut self, admin: H160, min_balance: U256) -> TokenId { let admin = alloy::Address::from(admin.0); let min_balance = alloy::U256::from_be_bytes(min_balance.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("create(address,uint256)"), (admin, min_balance).abi_encode(), 0, @@ -610,22 +590,21 @@ impl Contract { } fn decimals(&self, token: TokenId) -> u8 { - self.call::(ALICE, keccak_selector("decimals(uint32)"), (token,).abi_encode(), 0) - .unwrap() as u8 + self.call::( + &self.creator, + keccak_selector("decimals(uint32)"), + (token,).abi_encode(), + 0, + ) + .unwrap() as u8 } - fn decrease_allowance( - &mut self, - origin: &AccountId, - token: TokenId, - spender: H160, - value: U256, - ) -> U256 { + fn decrease_allowance(&mut self, token: TokenId, spender: H160, value: U256) -> U256 { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); U256::from_little_endian( self.call::( - origin.clone(), + &self.creator, keccak_selector("decreaseAllowance(uint32,address,uint256)"), (token, spender, value).abi_encode(), 0, @@ -636,22 +615,16 @@ impl Contract { } fn exists(&self, token: TokenId) -> bool { - self.call(ALICE, keccak_selector("exists(uint32)"), (token,).abi_encode(), 0) + self.call(&self.creator, keccak_selector("exists(uint32)"), (token,).abi_encode(), 0) .unwrap() } - fn increase_allowance( - &mut self, - origin: &AccountId, - token: TokenId, - spender: H160, - value: U256, - ) -> U256 { + fn increase_allowance(&mut self, token: TokenId, spender: H160, value: U256) -> U256 { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); U256::from_little_endian( self.call::( - origin.clone(), + &self.creator, keccak_selector("increaseAllowance(uint32,address,uint256)"), (token, spender, value).abi_encode(), 0, @@ -661,11 +634,11 @@ impl Contract { ) } - fn mint(&mut self, origin: &AccountId, token: TokenId, account: H160, value: U256) { + fn mint(&mut self, token: TokenId, account: H160, value: U256) { let account = alloy::Address::from(account.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("mint(uint32,address,uint256)"), (token, account, value).abi_encode(), 0, @@ -674,20 +647,13 @@ impl Contract { } fn name(&self, token: TokenId) -> String { - self.call(ALICE, keccak_selector("name(uint32)"), (token,).abi_encode(), 0) + self.call(&self.creator, keccak_selector("name(uint32)"), (token,).abi_encode(), 0) .unwrap() } - fn set_metadata( - &mut self, - origin: &AccountId, - token: TokenId, - name: String, - symbol: String, - decimals: u8, - ) { + fn set_metadata(&mut self, token: TokenId, name: String, symbol: String, decimals: u8) { self.call( - origin.clone(), + &self.creator, keccak_selector("setMetadata(uint32,string,string,uint8)"), (token, name, symbol, decimals as u16).abi_encode(), 0, @@ -695,20 +661,20 @@ impl Contract { .unwrap() } - fn start_destroy(&mut self, origin: &AccountId, token: TokenId) { - self.call(origin.clone(), keccak_selector("startDestroy(uint32)"), (token,).abi_encode(), 0) + fn start_destroy(&mut self, token: TokenId) { + self.call(&self.creator, keccak_selector("startDestroy(uint32)"), (token,).abi_encode(), 0) .unwrap() } fn symbol(&self, token: TokenId) -> String { - self.call(ALICE, keccak_selector("symbol(uint32)"), (token,).abi_encode(), 0) + self.call(&self.creator, keccak_selector("symbol(uint32)"), (token,).abi_encode(), 0) .unwrap() } fn total_supply(&self, token: TokenId) -> U256 { U256::from_little_endian( self.call::( - ALICE, + &self.creator, keccak_selector("totalSupply(uint32)"), (token,).abi_encode(), 0, @@ -718,11 +684,11 @@ impl Contract { ) } - fn transfer(&mut self, origin: &AccountId, token: TokenId, to: H160, value: U256) { + fn transfer(&mut self, token: TokenId, to: H160, value: U256) { let to = alloy::Address::from(to.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("transfer(uint32,address,uint256)"), (token, to, value).abi_encode(), 0, @@ -730,19 +696,12 @@ impl Contract { .unwrap() } - fn transfer_from( - &mut self, - origin: &AccountId, - token: TokenId, - from: H160, - to: H160, - value: U256, - ) { + fn transfer_from(&mut self, token: TokenId, from: H160, to: H160, value: U256) { let from = alloy::Address::from(from.0); let to = alloy::Address::from(to.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); self.call( - origin.clone(), + &self.creator, keccak_selector("transferFrom(uint32,address,address,uint256)"), (token, from, to, value).abi_encode(), 0, @@ -756,12 +715,12 @@ impl Contract { fn call::RustType>>( &self, - origin: AccountId, + origin: &AccountId, selector: [u8; 4], params: Vec, value: Balance, ) -> Result { - let origin = RuntimeOrigin::signed(origin); + let origin = RuntimeOrigin::signed(origin.clone()); let dest = self.address.clone(); let data = [selector.as_slice(), params.as_slice()].concat(); let result = bare_call(origin, dest, value, GAS_LIMIT, STORAGE_DEPOSIT_LIMIT, data) diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index 9eeb2994e..4a4398b58 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -9,7 +9,7 @@ use pallet_revive::{ primitives as alloy, sol_types::{SolType, SolValue}, }, - test_utils::{ALICE, BOB}, + test_utils::{ALICE, BOB, CHARLIE}, AccountId32Mapper, AddressMapper, Code, DepositLimit, ExecReturnValue, H160, U256, }; #[cfg(feature = "devnet")] @@ -69,11 +69,16 @@ fn decode::RustType>>(data: &[u8]) -> } // Deploy, instantiate and return contract address. -fn instantiate(contract: impl AsRef, value: Balance, salt: Option<[u8; 32]>) -> H160 { +fn instantiate( + origin: RuntimeOrigin, + contract: impl AsRef, + value: Balance, + salt: Option<[u8; 32]>, +) -> H160 { let binary = std::fs::read(contract).expect("could not read .wasm file"); let result = Revive::bare_instantiate( - RuntimeOrigin::signed(ALICE), + origin, value, GAS_LIMIT, DepositLimit::Balance(Balance::MAX), @@ -141,8 +146,8 @@ impl ExtBuilder { .expect("Frame system builds valid default genesis config"); pallet_balances::GenesisConfig:: { - // CHARLIE has no initial balance. - balances: vec![(ALICE, INIT_AMOUNT), (BOB, INIT_AMOUNT)], + // DJANGO has no initial balance. + balances: vec![(ALICE, INIT_AMOUNT), (BOB, INIT_AMOUNT), (CHARLIE, INIT_AMOUNT)], ..Default::default() } .assimilate_storage(&mut t) From e7f20db2c73e576620e21b2f0ac8af3955ea5dbe Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 19 Jun 2025 21:45:18 +0100 Subject: [PATCH 091/162] test(api): add set_metadata test --- .../contracts/fungibles/lib.rs | 3 +- .../integration-tests/src/fungibles.rs | 86 +++++++++++++------ 2 files changed, 64 insertions(+), 25 deletions(-) diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 1e73ec2fc..a614db09c 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -85,7 +85,8 @@ pub mod fungibles { #[ink(message)] fn setMetadata(&self, token: TokenId, name: String, symbol: String, decimals: u8) { - api::set_metadata(token, name, symbol, decimals); + api::set_metadata(token, name.clone(), symbol.clone(), decimals); + self.env().emit_event(MetadataSet { token, name, symbol, decimals }); } #[ink(message)] diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index f7c7dbdb8..7fd05874f 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -435,36 +435,74 @@ fn instantiate_and_create_fungible_works() { #[test] fn start_destroy_works() { - let token = 0; let owner = ALICE; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .build() - .execute_with(|| { - let mut contract = Contract::new(&owner, INIT_VALUE); + ExtBuilder::new().build().execute_with(|| { + let mut contract = Contract::new(&owner, INIT_VALUE); - // Token does not exist. - // assert_eq!( - // contract.start_destroy(&creator, TokenId::MAX), - // Err(Module { index: 52, error: [3, 0] }), - // ); - // No Permission. - // assert_eq!( - // contract.start_destroy(&creator, token), - // Err(Module { index: 52, error: [2, 0] }), - // ); - let token = contract.create(to_address(&owner), 1.into()); - contract.start_destroy(token); - // Successfully emit event. - let expected = DestroyStarted { token }.encode(); - assert_eq!(contract.last_event(), expected); - }); + // Token does not exist. + // assert_eq!( + // contract.start_destroy(&creator, TokenId::MAX), + // Err(Module { index: 52, error: [3, 0] }), + // ); + // No Permission. + // assert_eq!( + // contract.start_destroy(&creator, token), + // Err(Module { index: 52, error: [2, 0] }), + // ); + let token = contract.create(to_address(&owner), 1.into()); + contract.start_destroy(token); + // Successfully emit event. + let expected = DestroyStarted { token }.encode(); + assert_eq!(contract.last_event(), expected); + }); } #[test] -#[ignore] fn set_metadata_works() { - todo!() + let owner = ALICE; + let name = "name".to_string(); + let symbol = "symbol".to_string(); + let decimals: u8 = 69; + ExtBuilder::new().build().execute_with(|| { + let mut contract = Contract::new(&owner, INIT_VALUE); + + // Token does not exist. + // assert_eq!( + // set_metadata(&addr, TOKEN_ID, vec![0], vec![0], 0u8), + // Err(Module { index: 52, error: [3, 0] }), + // ); + // No Permission. + // assert_eq!( + // set_metadata(&addr, token, vec![0], vec![0], 0u8), + // Err(Module { index: 52, error: [2, 0] }), + // ); + let token = contract.create(to_address(&owner), 1.into()); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // set_metadata(&addr, TOKEN_ID, vec![0], vec![0], 0u8), + // Err(Module { index: 52, error: [16, 0] }), + // ); + thaw(&owner, token); + // TODO: calling the below with a vector of length `100_000` errors in pallet contracts + // `OutputBufferTooSmall. Added to security analysis issue #131 to revisit. + // Set bad metadata - too large values. + // assert_eq!( + // set_metadata(&addr, TOKEN_ID, vec![0; 1000], vec![0; 1000], 0u8), + // Err(Module { index: 52, error: [9, 0] }), + // ); + // Set metadata successfully. + contract.set_metadata(token, name.clone(), symbol.clone(), decimals); + // Successfully emit event. + let expected = MetadataSet { token, name, symbol, decimals }.encode(); + assert_eq!(contract.last_event(), expected); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&contract.account_id(), token); + // assert_eq!( + // set_metadata(&addr, TOKEN_ID, vec![0], vec![0], 0), + // Err(Module { index: 52, error: [16, 0] }), + // ); + }); } #[test] From ce2fcf9f003c144cf6f9cca697e67aa68f5eb8c3 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 12:41:34 +0100 Subject: [PATCH 092/162] test(api): update expectation message to .polkavm --- pop-api-vnext/integration-tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index 4a4398b58..ae7d4b109 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -75,7 +75,7 @@ fn instantiate( value: Balance, salt: Option<[u8; 32]>, ) -> H160 { - let binary = std::fs::read(contract).expect("could not read .wasm file"); + let binary = std::fs::read(contract).expect("could not read .polkavm file"); let result = Revive::bare_instantiate( origin, From 34779359fb943402fd8e5faa2a28c0946c59bbb2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 12:44:00 +0100 Subject: [PATCH 093/162] test(api): add clear_metadata test --- .../contracts/fungibles/lib.rs | 1 + .../integration-tests/src/fungibles.rs | 60 +++++++++++++++++-- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index a614db09c..0ffedb1e0 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -92,6 +92,7 @@ pub mod fungibles { #[ink(message)] fn clearMetadata(&self, token: TokenId) { api::clear_metadata(token); + self.env().emit_event(MetadataCleared { token }); } #[ink(message)] diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 7fd05874f..e67f316f4 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -493,6 +493,10 @@ fn set_metadata_works() { // ); // Set metadata successfully. contract.set_metadata(token, name.clone(), symbol.clone(), decimals); + assert_eq!( + (&contract.name(token), &contract.symbol(token), &contract.decimals(token)), + (&name, &symbol, &decimals) + ); // Successfully emit event. let expected = MetadataSet { token, name, symbol, decimals }.encode(); assert_eq!(contract.last_event(), expected); @@ -506,9 +510,50 @@ fn set_metadata_works() { } #[test] -#[ignore] fn clear_metadata_works() { - todo!() + let token = 0; + let owner = ALICE; + let name = "name".to_string(); + let symbol = "symbol".to_string(); + let decimals: u8 = 69; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(&owner, INIT_VALUE); + + // Token does not exist. + // assert_eq!(contract.clear_metadata(TokenId::MAX), Err(Module { index: 52, error: [3, + // 0] }),); + // No Permission. + // assert_eq!(contract.clear_metadata(token), Err(Module { index: 52, error: [2, 0] + // }),); + let token = contract.create(to_address(&owner), 1.into()); + // Token is not live, i.e. frozen or being destroyed. + freeze(&owner, token); + // assert_eq!( + // contract.clear_metadata(&addr, token), + // Err(Module { index: 52, error: [16, 0] }), + // ); + thaw(&owner, token); + // No metadata set. + // assert_eq!( + // contract.clear_metadata(&addr, token), + // Err(Module { index: 52, error: [3, 0] }), + // ); + contract.set_metadata(token, name, symbol, decimals); + // Clear metadata successfully. + contract.clear_metadata(token); + // Successfully emit event. + let expected = MetadataCleared { token }.encode(); + assert_eq!(contract.last_event(), expected); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&contract.account_id(), token); + // assert_eq!( + // contract.set_metadata(&addr, TOKEN_ID, vec![0], vec![0], decimals), + // Err(Module { index: 52, error: [16, 0] }), + // ); + }); } #[test] @@ -611,8 +656,13 @@ impl Contract { } fn clear_metadata(&mut self, token: TokenId) { - self.call(&self.creator, keccak_selector("clearMetadata(uint32)"), (token,).abi_encode(), 0) - .unwrap() + self.call( + &self.account_id(), // clear_metadata restricted to asset owner + keccak_selector("clearMetadata(uint32)"), + (token,).abi_encode(), + 0, + ) + .unwrap() } fn create(&mut self, admin: H160, min_balance: U256) -> TokenId { @@ -691,7 +741,7 @@ impl Contract { fn set_metadata(&mut self, token: TokenId, name: String, symbol: String, decimals: u8) { self.call( - &self.creator, + &self.account_id(), // set_metadata restricted to asset owner keccak_selector("setMetadata(uint32,string,string,uint8)"), (token, name, symbol, decimals as u16).abi_encode(), 0, From 7790ccba13dd12ff572f6b56da0f3448ad06b8c4 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 13:17:55 +0100 Subject: [PATCH 094/162] test(api): reuse sol types to ease encoding --- Cargo.lock | 1 + pop-api-vnext/integration-tests/Cargo.toml | 2 + .../integration-tests/src/fungibles.rs | 172 +++++------------- pop-api-vnext/integration-tests/src/lib.rs | 2 +- 4 files changed, 53 insertions(+), 124 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18e4cbf7b..4b077887b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15037,6 +15037,7 @@ dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", "log", + "pallet-api-vnext", "pallet-assets 29.1.0", "pallet-balances 28.0.0", "pallet-revive 0.1.0", diff --git a/pop-api-vnext/integration-tests/Cargo.toml b/pop-api-vnext/integration-tests/Cargo.toml index 514c7aed0..7b872b734 100644 --- a/pop-api-vnext/integration-tests/Cargo.toml +++ b/pop-api-vnext/integration-tests/Cargo.toml @@ -16,6 +16,7 @@ env_logger.workspace = true frame-support = { workspace = true, default-features = false } frame-system = { workspace = true, default-features = false } log.workspace = true +pallet-api-vnext = { workspace = true, default-features = false, features = [ "fungibles" ] } pallet-assets = { workspace = true, default-features = false } pallet-balances = { workspace = true, default-features = false } pallet-revive = { workspace = true, default-features = false } @@ -33,6 +34,7 @@ std = [ "codec/std", "frame-support/std", "frame-system/std", + "pallet-api-vnext/std", "pallet-assets/std", "pallet-balances/std", "pallet-revive/std", diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index e67f316f4..a0270f41f 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -4,6 +4,11 @@ use frame_support::{ approvals::Inspect as _, metadata::Inspect as _, roles::Inspect as _, Inspect as _, }, }; +use pallet_api_vnext::fungibles::precompiles::IFungibles::{ + allowanceCall, approveCall, balanceOfCall, burnCall, clearMetadataCall, createCall, + decimalsCall, decreaseAllowanceCall, existsCall, increaseAllowanceCall, mintCall, nameCall, + setMetadataCall, startDestroyCall, symbolCall, totalSupplyCall, transferCall, transferFromCall, +}; use pop_api::fungibles::events::*; use pop_primitives::TokenId; use sp_io::hashing::twox_256; @@ -605,220 +610,141 @@ impl Contract { fn allowance(&self, token: TokenId, owner: H160, spender: H160) -> U256 { let owner = alloy::Address::from(owner.0); let spender = alloy::Address::from(spender.0); - U256::from_little_endian( - self.call::( - &self.creator, - keccak_selector("allowance(uint32,address,address)"), - (token, owner, spender).abi_encode(), - 0, - ) - .unwrap() - .as_le_slice(), - ) + let call = allowanceCall { token, owner, spender }; + U256::from_little_endian(self.call(&self.creator, call, 0).unwrap().as_le_slice()) } fn approve(&mut self, token: TokenId, spender: H160, value: U256) { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - self.call( - &self.creator, - keccak_selector("approve(uint32,address,uint256)"), - (token, spender, value).abi_encode(), - 0, - ) - .unwrap() + let call = approveCall { token, spender, value }; + self.call(&self.creator, call, 0).unwrap(); } fn balance_of(&self, token: TokenId, owner: H160) -> U256 { let owner = alloy::Address::from(owner.0); - U256::from_little_endian( - self.call::( - &self.creator, - keccak_selector("balanceOf(uint32,address)"), - (token, owner).abi_encode(), - 0, - ) - .unwrap() - .as_le_slice(), - ) + let call = balanceOfCall { token, owner }; + U256::from_little_endian(self.call(&self.creator, call, 0).unwrap().as_le_slice()) } fn burn(&mut self, token: TokenId, account: H160, value: U256) { let account = alloy::Address::from(account.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - self.call( - &self.creator, - keccak_selector("burn(uint32,address,uint256)"), - (token, account, value).abi_encode(), - 0, - ) - .unwrap() + let call = burnCall { token, account, value }; + self.call(&self.creator, call, 0).unwrap(); } fn clear_metadata(&mut self, token: TokenId) { + let call = clearMetadataCall { token }; self.call( &self.account_id(), // clear_metadata restricted to asset owner - keccak_selector("clearMetadata(uint32)"), - (token,).abi_encode(), + call, 0, ) - .unwrap() + .unwrap(); } fn create(&mut self, admin: H160, min_balance: U256) -> TokenId { let admin = alloy::Address::from(admin.0); let min_balance = alloy::U256::from_be_bytes(min_balance.to_big_endian()); - self.call( - &self.creator, - keccak_selector("create(address,uint256)"), - (admin, min_balance).abi_encode(), - 0, - ) - .unwrap() + let call = createCall { admin, minBalance: min_balance }; + self.call(&self.creator, call, 0).unwrap() } fn decimals(&self, token: TokenId) -> u8 { - self.call::( - &self.creator, - keccak_selector("decimals(uint32)"), - (token,).abi_encode(), - 0, - ) - .unwrap() as u8 + let call = decimalsCall { token }; + self.call(&self.creator, call, 0).unwrap() } fn decrease_allowance(&mut self, token: TokenId, spender: H160, value: U256) -> U256 { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - U256::from_little_endian( - self.call::( - &self.creator, - keccak_selector("decreaseAllowance(uint32,address,uint256)"), - (token, spender, value).abi_encode(), - 0, - ) - .unwrap() - .as_le_slice(), - ) + let call = decreaseAllowanceCall { token, spender, value }; + U256::from_little_endian(self.call(&self.creator, call, 0).unwrap().as_le_slice()) } fn exists(&self, token: TokenId) -> bool { - self.call(&self.creator, keccak_selector("exists(uint32)"), (token,).abi_encode(), 0) - .unwrap() + let call = existsCall { token }; + self.call(&self.creator, call, 0).unwrap() } fn increase_allowance(&mut self, token: TokenId, spender: H160, value: U256) -> U256 { let spender = alloy::Address::from(spender.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - U256::from_little_endian( - self.call::( - &self.creator, - keccak_selector("increaseAllowance(uint32,address,uint256)"), - (token, spender, value).abi_encode(), - 0, - ) - .unwrap() - .as_le_slice(), - ) + let call = increaseAllowanceCall { token, spender, value }; + U256::from_little_endian(self.call(&self.creator, call, 0).unwrap().as_le_slice()) } fn mint(&mut self, token: TokenId, account: H160, value: U256) { let account = alloy::Address::from(account.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - self.call( - &self.creator, - keccak_selector("mint(uint32,address,uint256)"), - (token, account, value).abi_encode(), - 0, - ) - .unwrap() + let call = mintCall { token, account, value }; + self.call(&self.creator, call, 0).unwrap(); } fn name(&self, token: TokenId) -> String { - self.call(&self.creator, keccak_selector("name(uint32)"), (token,).abi_encode(), 0) - .unwrap() + let call = nameCall { token }; + self.call(&self.creator, call, 0).unwrap() } fn set_metadata(&mut self, token: TokenId, name: String, symbol: String, decimals: u8) { + let call = setMetadataCall { token, name, symbol, decimals }; self.call( &self.account_id(), // set_metadata restricted to asset owner - keccak_selector("setMetadata(uint32,string,string,uint8)"), - (token, name, symbol, decimals as u16).abi_encode(), + call, 0, ) - .unwrap() + .unwrap(); } fn start_destroy(&mut self, token: TokenId) { - self.call(&self.creator, keccak_selector("startDestroy(uint32)"), (token,).abi_encode(), 0) - .unwrap() + let call = startDestroyCall { token }; + self.call(&self.creator, call, 0).unwrap(); } fn symbol(&self, token: TokenId) -> String { - self.call(&self.creator, keccak_selector("symbol(uint32)"), (token,).abi_encode(), 0) - .unwrap() + let call = symbolCall { token }; + self.call(&self.creator, call, 0).unwrap() } fn total_supply(&self, token: TokenId) -> U256 { - U256::from_little_endian( - self.call::( - &self.creator, - keccak_selector("totalSupply(uint32)"), - (token,).abi_encode(), - 0, - ) - .unwrap() - .as_le_slice(), - ) + let call = totalSupplyCall { token }; + U256::from_little_endian(self.call(&self.creator, call, 0).unwrap().as_le_slice()) } fn transfer(&mut self, token: TokenId, to: H160, value: U256) { let to = alloy::Address::from(to.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - self.call( - &self.creator, - keccak_selector("transfer(uint32,address,uint256)"), - (token, to, value).abi_encode(), - 0, - ) - .unwrap() + let call = transferCall { token, to, value }; + self.call(&self.creator, call, 0).unwrap(); } fn transfer_from(&mut self, token: TokenId, from: H160, to: H160, value: U256) { let from = alloy::Address::from(from.0); let to = alloy::Address::from(to.0); let value = alloy::U256::from_be_bytes(value.to_big_endian()); - self.call( - &self.creator, - keccak_selector("transferFrom(uint32,address,address,uint256)"), - (token, from, to, value).abi_encode(), - 0, - ) - .unwrap() + let call = transferFromCall { token, from, to, value }; + self.call(&self.creator, call, 0).unwrap(); } fn account_id(&self) -> AccountId { to_account_id(&self.address) } - fn call::RustType>>( + fn call( &self, origin: &AccountId, - selector: [u8; 4], - params: Vec, + call: T, value: Balance, - ) -> Result { + ) -> Result { let origin = RuntimeOrigin::signed(origin.clone()); let dest = self.address.clone(); - let data = [selector.as_slice(), params.as_slice()].concat(); + let data = call.abi_encode(); let result = bare_call(origin, dest, value, GAS_LIMIT, STORAGE_DEPOSIT_LIMIT, data) .expect("should work"); match result.did_revert() { - true => { - println!("{:?}", result.data); - todo!("error conversion") - }, - false => Ok(decode::(&result.data)), + true => todo!("error conversion: {:?}", result.data), + false => Ok(T::abi_decode_returns(&result.data).expect("unable to decode")), } } diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index ae7d4b109..b252633f6 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -7,7 +7,7 @@ use pallet_assets::{Instance1, NextAssetId}; use pallet_revive::{ precompiles::alloy::{ primitives as alloy, - sol_types::{SolType, SolValue}, + sol_types::{SolCall, SolType, SolValue}, }, test_utils::{ALICE, BOB, CHARLIE}, AccountId32Mapper, AddressMapper, Code, DepositLimit, ExecReturnValue, H160, U256, From b58b67b45bc5332f1426be15e90c30a06e77d046 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 14:02:50 +0100 Subject: [PATCH 095/162] test(api): add mint test --- .../integration-tests/src/fungibles.rs | 63 ++++++++++++++----- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index a0270f41f..768d36376 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -581,9 +581,52 @@ fn exists_works() { } #[test] -#[ignore] fn mint_works() { - todo!() + let token = 0; + let owner = ALICE; + let account = BOB; + let amount: Balance = 100 * UNIT; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(&owner, INIT_VALUE); + + // Token does not exist. + // assert_eq!(mint(&addr, TokenId::MAX, &BOB, amount), Err(Token(UnknownAsset))); + // Minting can only be done by the owner. + // assert_eq!( + // contract.mint(token, &to_address(&account), 1.into()), + // Err(Module { index: 52, error: [2, 0] }) + // ); + // Contract must be admin in order to be able to mint. + let token = contract.create(contract.address, 2.into()); + // Minimum balance of a token can not be zero. + // assert_eq!(contract.mint(token, &account, 1.into()), Err(Token(BelowMinimum))); + // Token is not live, i.e. frozen or being destroyed. + freeze(&contract.account_id(), token); + // assert_eq!( + // contract.mint(token, to_address(&account), amount), + // Err(Module { index: 52, error: [16, 0] }) + // ); + thaw(&contract.account_id(), token); + // Successful mint. + let balance_before_mint = Assets::balance(token, &account); + contract.mint(token, to_address(&account), amount.into()); + let balance_after_mint = Assets::balance(token, &account); + assert_eq!(balance_after_mint, balance_before_mint + amount); + // Account can not hold more tokens than Balance::MAX. + // assert_eq!( + // contract.mint(token, to_address(&account), Balance::MAX.into()), + // Err(Arithmetic(Overflow)) + // ); + // Token is being destroyed. + start_destroy(&contract.account_id(), token); + // assert_eq!( + // contract.mint(token, to_address(&account), amount.into()), + // Err(Token(UnknownAsset)) + // ); + }); } #[test] @@ -636,12 +679,7 @@ impl Contract { fn clear_metadata(&mut self, token: TokenId) { let call = clearMetadataCall { token }; - self.call( - &self.account_id(), // clear_metadata restricted to asset owner - call, - 0, - ) - .unwrap(); + self.call(&self.creator, call, 0).unwrap(); } fn create(&mut self, admin: H160, min_balance: U256) -> TokenId { @@ -689,12 +727,7 @@ impl Contract { fn set_metadata(&mut self, token: TokenId, name: String, symbol: String, decimals: u8) { let call = setMetadataCall { token, name, symbol, decimals }; - self.call( - &self.account_id(), // set_metadata restricted to asset owner - call, - 0, - ) - .unwrap(); + self.call(&self.creator, call, 0).unwrap(); } fn start_destroy(&mut self, token: TokenId) { @@ -743,7 +776,7 @@ impl Contract { let result = bare_call(origin, dest, value, GAS_LIMIT, STORAGE_DEPOSIT_LIMIT, data) .expect("should work"); match result.did_revert() { - true => todo!("error conversion: {:?}", result.data), + true => todo!("error conversion: {:?}", String::from_utf8_lossy(&result.data)), false => Ok(T::abi_decode_returns(&result.data).expect("unable to decode")), } } From 235aadc289c1c290180afa99ca383021ca6e233a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 14:18:29 +0100 Subject: [PATCH 096/162] test(api): add burn test --- .../integration-tests/src/fungibles.rs | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 768d36376..be3ddf874 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -630,9 +630,55 @@ fn mint_works() { } #[test] -#[ignore] fn burn_works() { - todo!() + let token = 0; + let owner = ALICE; + let account = BOB; + let amount: Balance = 100 * UNIT; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_balances(vec![(token, account.clone(), amount)]) + .build() + .execute_with(|| { + let mut contract = Contract::new(&owner, INIT_VALUE); + + // Token does not exist. + // assert_eq!( + // contract.burn(&addr, TokenId::MAX, &account, 0.into()), + // Err(Module { index: 52, error: [3, 0] }) + // ); + // Account has no tokens. + // assert_eq!( + // contract.burn(token, to_address(&account), amount.into()), + // Err(Module { index: 52, error: [0, 0] }) + // ); + // Burning can only be done by the manager. + // assert_eq!( + // contract.burn(token, to_address(&account), 1.into()), + // Err(Module { index: 52, error: [2, 0] }) + // ); + // Contract must be admin in order to be able to burn. + let token = contract.create(contract.address, 1.into()); + contract.mint(token, to_address(&account), (amount * 2).into()); + // Token is not live, i.e. frozen or being destroyed. + freeze(&contract.account_id(), token); + // assert_eq!( + // contract.burn(token, to_address(&account), amount.into()), + // Err(Module { index: 52, error: [16, 0] }) + // ); + thaw(&contract.account_id(), token); + // Successful mint. + let balance_before_burn = Assets::balance(token, &account); + contract.burn(token, to_address(&account), amount.into()); + let balance_after_burn = Assets::balance(token, &account); + assert_eq!(balance_after_burn, balance_before_burn - amount); + // Token is not live, i.e. frozen or being destroyed. + start_destroy(&contract.account_id(), token); + // assert_eq!( + // contract.burn(token, to_address(&account), amount), + // Err(Module { index: 52, error: [17, 0] }) + // ); + }); } // A simple, strongly typed wrapper for the contract. From 76dd4f92e748c78d42372c9e316c31a6103984e9 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 20 Jun 2025 14:46:20 +0100 Subject: [PATCH 097/162] test(api): add create with instantiation test --- .../contracts/fungibles/lib.rs | 18 ++++++++++++ .../integration-tests/src/fungibles.rs | 29 +++++++++++++++++-- pop-api-vnext/integration-tests/src/lib.rs | 3 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 0ffedb1e0..df055b2ae 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -19,6 +19,24 @@ pub mod fungibles { pub fn new() -> Self { Self {} } + + #[ink(constructor, payable)] + pub fn create(min_balance: U256) -> Self { + let contract = Self {}; + // Account of the contract which will be set to the owner of the fungible token. + let owner = contract.env().address(); + match api::create(owner, min_balance) { + Ok(id) => { + contract.env().emit_event(Created { + id, + creator: contract.env().caller(), + admin: owner, + }); + contract + }, + Err(error) => revert(&error), + } + } } impl Fungibles for Fungible { diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index be3ddf874..ddb1764b9 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -433,9 +433,21 @@ fn create_works() { // Testing a contract that creates a token in the constructor. #[test] -#[ignore] fn instantiate_and_create_fungible_works() { - todo!() + let token = 1; + let owner = ALICE; + ExtBuilder::new().build().execute_with(|| { + assert!(!Assets::asset_exists(token)); + + // Successfully create a token when instantiating the contract. + let mut contract = Contract::new_with_create(&owner, INIT_VALUE, 1.into()); + assert_eq!(Assets::owner(token), Some(contract.account_id())); + assert!(Assets::asset_exists(token)); + // Successfully emit event. + let creator = to_address(&owner); + let expected = Created { id: token, creator, admin: contract.address }.encode(); + assert_eq!(contract.last_event(), expected); + }); } #[test] @@ -690,9 +702,20 @@ struct Contract { impl Contract { // Create a new instance of the contract through on-chain instantiation. fn new(origin: &AccountId, value: Balance) -> Self { + let data = blake_selector("new").to_vec(); + let salt = twox_256(&value.to_le_bytes()); + + let address = + instantiate(RuntimeOrigin::signed(origin.clone()), CONTRACT, value, data, Some(salt)); + Self { address, creator: origin.clone() } + } + + // Create a new instance of the contract through on-chain instantiation. + fn new_with_create(origin: &AccountId, value: Balance, min_balance: U256) -> Self { + let data = [blake_selector("create").to_vec(), min_balance.encode()].concat(); let salt = twox_256(&value.to_le_bytes()); let address = - instantiate(RuntimeOrigin::signed(origin.clone()), CONTRACT, value, Some(salt)); + instantiate(RuntimeOrigin::signed(origin.clone()), CONTRACT, value, data, Some(salt)); Self { address, creator: origin.clone() } } diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index b252633f6..b9671c3fa 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -73,6 +73,7 @@ fn instantiate( origin: RuntimeOrigin, contract: impl AsRef, value: Balance, + data: Vec, salt: Option<[u8; 32]>, ) -> H160 { let binary = std::fs::read(contract).expect("could not read .polkavm file"); @@ -83,7 +84,7 @@ fn instantiate( GAS_LIMIT, DepositLimit::Balance(Balance::MAX), Code::Upload(binary), - blake_selector("new").to_vec(), + data, salt, ) .result From dae9917fabbe83914864506e911de481f424d6fa Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 17:07:38 +0100 Subject: [PATCH 098/162] feat(api): initial precompile benchmarking --- pallets/api-vnext/Cargo.toml | 5 + .../api-vnext/src/fungibles/benchmarking.rs | 276 ++++++++++++++++++ pallets/api-vnext/src/fungibles/mod.rs | 118 ++++---- .../src/fungibles/precompiles/erc20.rs | 14 +- .../src/fungibles/precompiles/mod.rs | 62 ++-- pallets/api-vnext/src/fungibles/weights.rs | 242 +++++++++++++++ pallets/api-vnext/src/lib.rs | 14 +- pallets/api-vnext/src/mock.rs | 21 +- runtime/devnet/src/config/api/mod.rs | 4 + runtime/devnet/src/lib.rs | 3 + 10 files changed, 655 insertions(+), 104 deletions(-) create mode 100644 pallets/api-vnext/src/fungibles/benchmarking.rs create mode 100644 pallets/api-vnext/src/fungibles/weights.rs diff --git a/pallets/api-vnext/Cargo.toml b/pallets/api-vnext/Cargo.toml index fcb813991..ebf32e521 100644 --- a/pallets/api-vnext/Cargo.toml +++ b/pallets/api-vnext/Cargo.toml @@ -13,6 +13,7 @@ doctest = false [dependencies] codec.workspace = true +frame-benchmarking.workspace = true frame-support.workspace = true frame-system.workspace = true pallet-assets = { workspace = true, default-features = false, optional = true } @@ -28,17 +29,21 @@ sp-io.workspace = true default = [ "fungibles", "std" ] fungibles = [ "pallet-assets" ] runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", "pallet-revive/runtime-benchmarks", ] std = [ + "codec/std", + "frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-assets?/std", "pallet-balances/std", "pallet-revive/std", "pallet-timestamp/std", + "scale-info/std", "sp-io/std", ] diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs new file mode 100644 index 000000000..32799eff3 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -0,0 +1,276 @@ +//! Benchmarking setup for pallet_api::fungibles::precompiles + +use alloc::vec; + +use frame_benchmarking::v2::{whitelisted_caller as allowlisted_caller, *}; +use frame_support::{ + assert_ok, + pallet_prelude::IsType, + traits::{ + fungible::{Inspect, Mutate as _}, + fungibles::{ + approvals::{self, Inspect as _}, + metadata, Create, + }, + Get, Time, + }, +}; +use pallet_revive::{ + precompiles::{ + alloy::primitives as alloy, + run::{precompile, CallSetup, WasmModule, H256, U256}, + }, + test_utils::{ALICE_ADDR, BOB_ADDR}, + AddressMapper as _, Origin, +}; + +use super::{ + precompiles::{IFungibles::*, IFungiblesCalls, UintTryFrom, UintTryTo}, + Config, NextAssetId, Pallet, +}; +use crate::fixed_address; +#[cfg(test)] +use crate::mock::{ExtBuilder, Test}; + +const FUNGIBLES: u16 = 100; +const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); + +type AddressMapper = ::AddressMapper; +type Assets = pallet_assets::Pallet; +type AssetsBalance = >::Balance; +type AssetsStringLimit = >::StringLimit; +type Balances = ::Currency; +type Fungibles = super::Fungibles; +type TokenId = >::AssetId; + +#[instance_benchmarks( + where + // Precompiles + T: pallet_revive::Config< + Currency: Inspect<::AccountId, Balance: Into + TryFrom>, + Hash: IsType, + Time: Time> + >, + // Fungibles + T: pallet_assets::Config + Into>, + alloy::U256: UintTryFrom> + UintTryTo> +)] +mod benchmarks { + use super::*; + + // Parameter: + // - 'a': whether `approve_transfer` is required. + // - 'c': whether `cancel_approval` is required. + #[benchmark] + fn approve(a: Linear<0, 1>, c: Linear<0, 1>) -> Result<(), BenchmarkError> { + let owner = >::to_account_id(&ALICE_ADDR); + let spender = >::to_account_id(&BOB_ADDR); + let current_allowance = >::from(u32::MAX / 2); + // Set the `current_allowance`. + let token = create::(); + >::set_balance(&owner, u32::MAX.into()); + assert_ok!( as approvals::Mutate>::approve( + token.clone(), + &owner, + &spender, + current_allowance, + )); + let approval_value = match (a, c) { + // Equal to the current allowance. + (0, 0) => current_allowance, + // Greater than the current allowance. + (1, 0) => >::from(u32::MAX), + // Zero. + (0, 1) => >::from(0u32), + // Smaller than the current allowance. + (1, 1) => >::from(u32::MAX / 4), + _ => unreachable!("values can only be 0 or 1"), + }; + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::approve(approveCall { + token: token.clone().into(), + spender: >::to_address(&spender).0.into(), + value: alloy::U256::from(approval_value), + }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::allowance(token.clone(), &owner, &spender), approval_value); + if c == 1 { + assert_has_event::( + pallet_assets::Event::ApprovalCancelled { + asset_id: token.clone(), + owner: owner.clone(), + delegate: spender.clone(), + } + .into(), + ); + } + if a == 1 { + let amount = match c { + // When the allowance was cancelled and then approved with the new value. + 1 => approval_value, + // When the allowance was increased. + 0 => approval_value - current_allowance, + _ => unreachable!("`c` can only be 0 or 1"), + }; + assert_has_event::( + pallet_assets::Event::ApprovedTransfer { + asset_id: token, + source: owner, + delegate: spender, + amount, + } + .into(), + ); + } + Ok(()) + } + + #[benchmark] + fn total_supply() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::totalSupply(totalSupplyCall { token: 0 }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn balance_of() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let token = create::(); + let input = IFungiblesCalls::balanceOf(balanceOfCall { + token: token.into(), + owner: ALICE_ADDR.0.into(), + }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn allowance() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let token = create::(); + let input = IFungiblesCalls::allowance(allowanceCall { + token: token.into(), + owner: ALICE_ADDR.0.into(), + spender: BOB_ADDR.0.into(), + }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn token_name() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let token = create::(); + let input = IFungiblesCalls::name(nameCall { token: token.into() }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn symbol() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let token = create::(); + let input = IFungiblesCalls::symbol(symbolCall { token: token.into() }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn decimals() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::decimals(decimalsCall { token: 0 }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn exists() { + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::exists(existsCall { token: 0 }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + + impl_benchmark_test_suite!(Pallet, ExtBuilder::new().build(), Test); +} + +// Ensure `event` has been emitted. +fn assert_has_event, I>( + event: >::RuntimeEvent, +) { + frame_system::Pallet::::assert_has_event(event.into()); +} + +fn create + pallet_assets::Config + pallet_revive::Config, I>( +) -> TokenId { + let token = NextAssetId::::get().unwrap_or_default(); + let admin: T::AccountId = allowlisted_caller(); + >::set_balance(&admin, u32::MAX.into()); + assert_ok!( as Create>::create( + token.clone(), + admin.clone(), + true, + 1u32.into() + )); + + let max = AssetsStringLimit::::get() as usize; + assert_ok!( as metadata::Mutate>::set( + token.clone(), + &admin, + vec![255u8; max], + vec![255u8; max], + u8::MAX + )); + + token +} + +fn set_up_call< + T: pallet_revive::Config< + Currency: Inspect< + ::AccountId, + Balance: Into + TryFrom, + >, + Hash: IsType, + Time: Time>, + >, +>() -> CallSetup { + CallSetup::::new(WasmModule::dummy()) +} diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index 6bbb6b971..86403a76d 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -14,30 +14,51 @@ use frame_support::{ weights::Weight, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; -use pallet_assets::{Config, NextAssetId}; +pub use pallet::*; +use pallet_assets::NextAssetId; +pub use precompiles::{Erc20, Fungibles}; +use weights::WeightInfo; use AddressMatcher::Fixed; use super::*; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; /// The fungibles precompiles offer a streamlined interface for interacting with fungible tokens. pub mod precompiles; +pub mod weights; -type AssetIdOf = >::AssetId; -type BalanceOf = >::Balance; +type AssetIdOf = >::AssetId; +type BalanceOf = >::Balance; +type WeightOf = >::WeightInfo; -fn approve, I>( +#[frame_support::pallet] +pub mod pallet { + use super::weights::WeightInfo; + + #[pallet::config] + pub trait Config: frame_system::Config { + /// Weight information for precompiles in this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + pub struct Pallet(_); +} + +fn approve + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, spender: AccountIdOf, value: BalanceOf, ) -> DispatchResultWithPostInfo { - // TODO: weights - let owner = ensure_signed(origin.clone()).map_err(|e| e.with_weight(Weight::zero()))?; + let owner = ensure_signed(origin.clone()) + .map_err(|e| e.with_weight(>::approve(0, 0)))?; let current_allowance = >::allowance(asset.clone(), &owner, &spender); let weight = match value.cmp(¤t_allowance) { // If the new value is equal to the current allowance, do nothing. - Equal => Weight::zero(), + Equal => >::approve(0, 0), // If the new value is greater than the current allowance, approve the difference // because `approve_transfer` works additively (see `pallet-assets`). Greater => { @@ -47,8 +68,8 @@ fn approve, I>( T::Lookup::unlookup(spender), value.saturating_sub(current_allowance), ) - .map_err(|e| e.with_weight(Weight::zero()))?; - Weight::zero() + .map_err(|e| e.with_weight(>::approve(1, 0)))?; + >::approve(1, 0) }, // If the new value is less than the current allowance, cancel the approval and // set the new value. @@ -59,19 +80,19 @@ fn approve, I>( asset.clone().into(), spender_source.clone(), ) - .map_err(|e| e.with_weight(Weight::zero()))?; + .map_err(|e| e.with_weight(>::approve(0, 1)))?; if value.is_zero() { - Weight::zero() + >::approve(0, 1) } else { >::approve_transfer(origin, asset.into(), spender_source, value)?; - Weight::zero() + >::approve(1, 1) } }, }; Ok(Some(weight).into()) } -fn burn, I>( +fn burn + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, account: AccountIdOf, @@ -80,18 +101,20 @@ fn burn, I>( let current_balance = >::balance(asset.clone(), &account); if current_balance < value { return Err(pallet_assets::Error::::BalanceLow - // TODO: weight: ::WeightInfo::balance_of() - .with_weight(Weight::zero())); + .with_weight(>::WeightInfo::balance_of())); } >::burn(origin, asset.into(), T::Lookup::unlookup(account.clone()), value)?; Ok(().into()) } -fn clear_metadata, I>(origin: OriginFor, asset: AssetIdOf) -> DispatchResult { +fn clear_metadata, I>( + origin: OriginFor, + asset: AssetIdOf, +) -> DispatchResult { >::clear_metadata(origin, asset.into()) } -fn create, I>( +fn create, I>( origin: OriginFor, admin: AccountIdOf, min_balance: BalanceOf, @@ -101,69 +124,48 @@ fn create, I>( Ok(id) } -fn decrease_allowance, I>( +fn decrease_allowance + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, spender: AccountIdOf, value: BalanceOf, ) -> Result<(BalanceOf, Option), DispatchErrorWithPostInfo> { - let owner = ensure_signed(origin.clone()).map_err(|e| { - e.with_weight( - // TODO: WeightOf::::approve(0, 0) - Weight::zero(), - ) - })?; + let owner = ensure_signed(origin.clone()) + .map_err(|e| e.with_weight(>::approve(0, 0)))?; if value.is_zero() { - return Ok(( - value, - Some( - // TODO: WeightOf::::approve(0, 0) - Weight::zero(), - ), - )); + return Ok((value, Some(>::approve(0, 0)))); } let current_allowance = >::allowance(asset.clone(), &owner, &spender); let spender_source = T::Lookup::unlookup(spender.clone()); - let asset_param: >::AssetIdParameter = asset.clone().into(); + let asset_param: >::AssetIdParameter = asset.clone().into(); // Cancel the approval and approve `new_allowance` if difference is more than zero. let new_allowance = current_allowance .checked_sub(&value) .ok_or(pallet_assets::Error::::Unapproved)?; >::cancel_approval(origin.clone(), asset_param.clone(), spender_source.clone()) - .map_err(|e| { - e.with_weight( - // TODO: WeightOf::::approve(0, 1) - Weight::zero(), - ) - })?; + .map_err(|e| e.with_weight(>::approve(0, 1)))?; let weight = if new_allowance.is_zero() { - // TODO: WeightOf::::approve(0, 1) - Weight::zero() + >::approve(0, 1) } else { >::approve_transfer(origin, asset_param, spender_source, new_allowance)?; - // TODO: WeightOf::::approve(1, 1) - Weight::zero() + >::approve(1, 1) }; Ok((new_allowance, Some(weight).into())) } -fn exists, I>(asset: AssetIdOf) -> bool { +fn exists, I>(asset: AssetIdOf) -> bool { >::asset_exists(asset) } -fn increase_allowance, I>( +fn increase_allowance + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, spender: AccountIdOf, value: BalanceOf, ) -> Result, DispatchErrorWithPostInfo> { - let owner = ensure_signed(origin.clone()).map_err(|e| { - e.with_weight( - // TODO: WeightOf::::approve(0, 0) - Weight::zero(), - ) - })?; + let owner = ensure_signed(origin.clone()) + .map_err(|e| e.with_weight(>::approve(0, 0)))?; >::approve_transfer( origin, asset.clone().into(), @@ -172,14 +174,13 @@ fn increase_allowance, I>( ) .map_err(|e| { e.with_weight( - // TODO: AssetsWeightInfoOf::::approve_transfer() - Weight::zero(), + <>::WeightInfo as pallet_assets::WeightInfo>::approve_transfer(), ) })?; Ok(>::allowance(asset, &owner, &spender)) } -fn mint, I>( +fn mint, I>( origin: OriginFor, asset: AssetIdOf, account: AccountIdOf, @@ -188,7 +189,7 @@ fn mint, I>( >::mint(origin, asset.into(), T::Lookup::unlookup(account), value) } -fn set_metadata, I>( +fn set_metadata, I>( origin: OriginFor, asset: AssetIdOf, name: Vec, @@ -198,11 +199,14 @@ fn set_metadata, I>( >::set_metadata(origin, asset.into(), name, symbol, decimals) } -fn start_destroy, I>(origin: OriginFor, asset: AssetIdOf) -> DispatchResult { +fn start_destroy, I>( + origin: OriginFor, + asset: AssetIdOf, +) -> DispatchResult { >::start_destroy(origin, asset.into()) } -fn transfer, I>( +fn transfer, I>( origin: OriginFor, asset: AssetIdOf, to: AccountIdOf, @@ -211,7 +215,7 @@ fn transfer, I>( >::transfer(origin, asset.into(), T::Lookup::unlookup(to.clone()), value) } -fn transfer_from, I>( +fn transfer_from, I>( origin: OriginFor, asset: AssetIdOf, from: AccountIdOf, diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index f582ad148..9476bba1c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -17,10 +17,13 @@ use super::{ sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); /// Precompile providing an interface of the ERC-20 standard as defined in the ERC. -pub struct Erc20(PhantomData<(T, I)>); +pub struct Erc20(PhantomData<(T, I)>); impl< const PREFIX: u16, - T: frame_system::Config + Config + pallet_revive::Config, + T: frame_system::Config + + pallet_assets::Config + + pallet_revive::Config + + Config, I: 'static, > Precompile for Erc20 where @@ -129,7 +132,7 @@ where } } -impl, I: 'static> Erc20 { +impl, I: 'static> Erc20 { /// The address of the precompile. pub fn address(id: u32) -> [u8; 20] { prefixed_address(PREFIX, id) @@ -142,7 +145,6 @@ mod tests { assert_ok, sp_runtime::{app_crypto::sp_core::bytes::to_hex, DispatchError}, }; - use pallet_assets::Instance1; use pallet_revive::{ precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, test_utils::{ALICE, BOB, CHARLIE}, @@ -243,7 +245,7 @@ mod tests { .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { - assert_ok!(approve::( + assert_ok!(approve::( RuntimeOrigin::signed(owner.clone()), token, BOB, @@ -310,7 +312,7 @@ mod tests { .execute_with(|| { assert_eq!(Assets::balance(token, &from), endowment); assert_eq!(Assets::balance(token, &to), 0); - assert_ok!(approve::( + assert_ok!(approve::( RuntimeOrigin::signed(from.clone()), token, origin.clone(), diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 3929bf30d..82afabced 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -2,14 +2,16 @@ use alloc::string::String; pub use erc20::{Erc20, IERC20}; use frame_support::traits::fungibles::metadata::Inspect as _; -use pallet_revive::precompiles::alloy::{ +pub(super) use pallet_revive::precompiles::alloy::{ primitives::{ ruint::{UintTryFrom, UintTryTo}, Address, }, sol_types::SolCall, }; -use IFungibles::*; +use pallet_revive::precompiles::RuntimeCosts; +use weights::WeightInfo; +pub(super) use IFungibles::*; use super::*; @@ -20,16 +22,18 @@ sol!("src/fungibles/precompiles/interfaces/IFungibles.sol"); /// The fungibles precompile offers a streamlined interface for interacting with fungible tokens. /// The goal is to provide a simplified, consistent API that adheres to standards in the smart /// contract space. -pub struct Fungibles(PhantomData<(T, I)>); +pub struct Fungibles(PhantomData<(T, I)>); impl< const FIXED: u16, T: frame_system::Config - + Config + Into> - + pallet_revive::Config, + + pallet_assets::Config + Into> + + pallet_revive::Config + + Config, I: 'static, > Precompile for Fungibles where - U256: UintTryFrom + UintTryTo<>::Balance>, + U256: UintTryFrom<>::Balance> + + UintTryTo<>::Balance>, { type Interface = IFungiblesCalls; type T = T; @@ -82,17 +86,24 @@ where Ok(transferFromCall::abi_encode_returns(&transferFromReturn {})) }, IFungiblesCalls::approve(approveCall { token, spender, value }) => { - // TODO: charge based on benchmarked weight + let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - self::approve::( + let result = self::approve::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), value.saturating_to(), - ) // TODO: adjust weight + ) .map_err(|e| e.error)?; + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + let spender = *spender; deposit_event( env, @@ -207,48 +218,45 @@ where Ok(burnCall::abi_encode_returns(&burnReturn {})) }, IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::total_supply())?; let total_supply = U256::saturating_from(>::total_supply((*token).into())); Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, IFungiblesCalls::balanceOf(balanceOfCall { token, owner }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::balance_of())?; let account = env.to_account_id(&(*owner.0).into()); let balance = U256::saturating_from(>::balance((*token).into(), account)); Ok(balanceOfCall::abi_encode_returns(&balance)) }, IFungiblesCalls::allowance(allowanceCall { token, owner, spender }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::allowance())?; let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); - let remaining = U256::saturating_from(>::allowance( - (*token).into(), - &owner, - &spender, - )); + let allowance = >::allowance((*token).into(), &owner, &spender); + let remaining = U256::saturating_from(allowance); Ok(allowanceCall::abi_encode_returns(&remaining)) }, IFungiblesCalls::name(nameCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::token_name())?; let result = >::name((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::symbol(symbolCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::symbol())?; let result = >::symbol((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::decimals(decimalsCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::decimals())?; let result = >::decimals((*token).into()); Ok(decimalsCall::abi_encode_returns(&result)) }, IFungiblesCalls::exists(existsCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::exists())?; let result = self::exists::((*token).into()); Ok(existsCall::abi_encode_returns(&result)) }, @@ -256,7 +264,7 @@ where } } -impl, I: 'static> Fungibles { +impl, I: 'static> Fungibles { /// The address of the precompile. pub const fn address() -> [u8; 20] { fixed_address(FIXED) @@ -270,7 +278,7 @@ mod tests { weights::Weight, BoundedVec, }; use mock::{Assets, ExtBuilder, *}; - use pallet_assets::{AssetDetails, AssetMetadata, AssetStatus, Instance1}; + use pallet_assets::{AssetDetails, AssetMetadata, AssetStatus}; use pallet_revive::{ precompiles::alloy::sol_types::{SolInterface, SolType}, test_utils::{ALICE, BOB, CHARLIE}, @@ -284,8 +292,8 @@ mod tests { const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); type AccountId = ::AccountId; - type Asset = pallet_assets::Asset; - type Metadata = pallet_assets::Metadata; + type Asset = pallet_assets::Asset; + type Metadata = pallet_assets::Metadata; #[test] fn transfer_works() { @@ -336,7 +344,7 @@ mod tests { .execute_with(|| { assert_eq!(Assets::balance(token, &from), endowment); assert_eq!(Assets::balance(token, &to), 0); - assert_ok!(approve::( + assert_ok!(approve::( RuntimeOrigin::signed(from.clone()), token, origin.clone(), @@ -714,7 +722,7 @@ mod tests { .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { - assert_ok!(approve::( + assert_ok!(approve::( RuntimeOrigin::signed(owner.clone()), token, spender.clone(), diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs new file mode 100644 index 000000000..f4f16cc25 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -0,0 +1,242 @@ + +//! Autogenerated weights for `pallet_api_vnext::fungibles` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-06-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `R0GUE`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop-devnet-dev")`, DB CACHE: `1024` + +// Executed Command: +// ./target/release/pop-node +// benchmark +// pallet +// --chain=pop-devnet-dev +// --wasm-execution=compiled +// --pallet=pallet-api-vnext::fungibles +// --steps=50 +// --repeat=20 +// --json +// --template=./scripts/templates/pallet-weight-template.hbs +// --output=./pallets/api-vnext/src/fungibles/weights.rs +// --extrinsic= + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for `pallet_api_vnext::fungibles`. +pub trait WeightInfo { + fn approve(a: u32, c: u32, ) -> Weight; + fn total_supply() -> Weight; + fn balance_of() -> Weight; + fn allowance() -> Weight; + fn token_name() -> Weight; + fn symbol() -> Weight; + fn decimals() -> Weight; + fn exists() -> Weight; +} + +/// Weights for `pallet_api_vnext::fungibles` using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:1) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// The range of component `a` is `[0, 1]`. + /// The range of component `c` is `[0, 1]`. + fn approve(a: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `699 + c * (140 ±0)` + // Estimated: `3675` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(8_074_489, 3675) + // Standard Error: 53_265 + .saturating_add(Weight::from_parts(19_925_510, 0).saturating_mul(a.into())) + // Standard Error: 53_265 + .saturating_add(Weight::from_parts(34_050_000, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn total_supply() -> Weight { + // Proof Size summary in bytes: + // Measured: `300` + // Estimated: `3675` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:0) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn balance_of() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3599` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 3599) + .saturating_add(T::DbWeight::get().reads(2_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:2 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:0) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + fn allowance() -> Weight { + // Proof Size summary in bytes: + // Measured: `291` + // Estimated: `6044` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 6044) + .saturating_add(T::DbWeight::get().reads(3_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn token_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `267` + // Estimated: `3605` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `267` + // Estimated: `3605` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3605` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 3605) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn exists() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `3675` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:1) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// The range of component `a` is `[0, 1]`. + /// The range of component `c` is `[0, 1]`. + fn approve(a: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `699 + c * (140 ±0)` + // Estimated: `3675` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(8_074_489, 3675) + // Standard Error: 53_265 + .saturating_add(Weight::from_parts(19_925_510, 0).saturating_mul(a.into())) + // Standard Error: 53_265 + .saturating_add(Weight::from_parts(34_050_000, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn total_supply() -> Weight { + // Proof Size summary in bytes: + // Measured: `300` + // Estimated: `3675` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:0) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn balance_of() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3599` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 3599) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:2 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:0) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + fn allowance() -> Weight { + // Proof Size summary in bytes: + // Measured: `291` + // Estimated: `6044` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 6044) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn token_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `267` + // Estimated: `3605` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `267` + // Estimated: `3605` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Metadata` (r:1 w:0) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3605` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 3605) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn exists() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `3675` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } +} + diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index 3b9efe32f..c3dfc02ac 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -15,7 +15,7 @@ use pallet_revive::{ alloy::{sol, sol_types::SolEvent}, AddressMatcher, Error, Ext, Precompile, }, - AddressMapper as _, Config, Origin, + AddressMapper as _, Origin, }; #[cfg(test)] use { @@ -36,13 +36,13 @@ pub mod fungibles; mod mock; type AccountIdOf = ::AccountId; -type AddressMapper = ::AddressMapper; +type AddressMapper = ::AddressMapper; type Assets = pallet_assets::Pallet; // A bare call to a contract. #[cfg(test)] fn bare_call< - T: Config, + T: pallet_revive::Config, O: SolValue + From<::RustType>, >( @@ -90,7 +90,7 @@ fn decode::RustType>>(data: &[u8]) -> T::abi_decode(data).expect("unable to decode") } -fn deposit_event( +fn deposit_event( _env: &mut impl Ext, address: impl Into, event: impl SolEvent, @@ -104,7 +104,9 @@ fn deposit_event( // dummy contract when using `CallSetup` within tests let revive_event = pallet_revive::Event::ContractEmitted { contract: address.into(), data, topics }; - >::deposit_event(::RuntimeEvent::from(revive_event)) + >::deposit_event(::RuntimeEvent::from( + revive_event, + )) } #[cfg(test)] @@ -141,7 +143,7 @@ fn topics(event: &impl SolEvent) -> Vec { /// Creates a new `RuntimeOrigin` from an ['Origin']. // TODO: upstream? -pub fn to_runtime_origin(o: Origin) -> T::RuntimeOrigin { +pub fn to_runtime_origin(o: Origin) -> T::RuntimeOrigin { match o { Origin::Root => RawOrigin::Root.into(), Origin::Signed(account) => RawOrigin::Signed(account).into(), diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 19eed1511..80bdce74d 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -8,10 +8,10 @@ use frame_system::{EnsureRoot, EnsureSigned}; use pallet_assets::AutoIncAssetId; pub(crate) use pallet_revive::test_utils::ALICE; +use super::fungibles; + pub(crate) type Balance = u128; type Block = frame_system::mocking::MockBlock; -type Erc20 = crate::Erc20; -type Fungibles = crate::Fungibles; pub(crate) const ERC20: u16 = 2; pub(crate) const FUNGIBLES: u16 = 1; @@ -34,7 +34,7 @@ mod runtime { pub struct Test; #[runtime::pallet_index(0)] - pub type Assets = pallet_assets::Pallet; + pub type Assets = pallet_assets::Pallet; #[runtime::pallet_index(1)] pub type Balances = pallet_balances::Pallet; #[runtime::pallet_index(2)] @@ -43,13 +43,15 @@ mod runtime { pub type System = frame_system::Pallet; #[runtime::pallet_index(4)] pub type Timestamp = pallet_timestamp::Pallet; + #[runtime::pallet_index(5)] + pub type Fungibles = fungibles::Pallet; } #[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] -impl pallet_assets::Config for Test { +impl pallet_assets::Config for Test { type AssetIdParameter = Compact; type Balance = Balance; - type CallbackHandle = AutoIncAssetId; + type CallbackHandle = AutoIncAssetId; type CreateOrigin = AsEnsureOriginWithArg>; type Currency = Balances; type ForceOrigin = EnsureRoot; @@ -66,8 +68,7 @@ impl pallet_revive::Config for Test { type AddressMapper = pallet_revive::AccountId32Mapper; type Currency = Balances; type InstantiateOrigin = EnsureSigned; - type Precompiles = - (Fungibles, Erc20); + type Precompiles = (fungibles::Fungibles, fungibles::Erc20); type Time = Timestamp; type UploadOrigin = EnsureSigned; } @@ -83,6 +84,10 @@ impl frame_system::Config for Test { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test {} +impl fungibles::Config for Test { + type WeightInfo = (); +} + pub(crate) struct ExtBuilder { assets: Option>, asset_accounts: Option>, @@ -121,7 +126,7 @@ impl ExtBuilder { .assimilate_storage(&mut t) .unwrap(); - pallet_assets::GenesisConfig:: { + pallet_assets::GenesisConfig:: { assets: self.assets.take().unwrap_or_default(), metadata: self.asset_metadata.take().unwrap_or_default(), accounts: self.asset_accounts.take().unwrap_or_default(), diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index a5b2eafa1..b93d3691a 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -218,6 +218,10 @@ impl Contains for Filter { } } +impl pallet_api_vnext::fungibles::Config for Runtime { + type WeightInfo = (); +} + #[cfg(test)] mod tests { use codec::Encode; diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 6178675e9..cb417f41a 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -706,6 +706,8 @@ mod runtime { pub type Fungibles = fungibles::Pallet; #[runtime::pallet_index(151)] pub type NonFungibles = nonfungibles::Pallet; + #[runtime::pallet_index(152)] + pub type FungiblesvNext = pallet_api_vnext::fungibles::Pallet; } #[cfg(feature = "runtime-benchmarks")] @@ -724,6 +726,7 @@ mod benches { [cumulus_pallet_parachain_system, ParachainSystem] [cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_weight_reclaim, WeightReclaim] + [pallet_api_vnext::fungibles, FungiblesvNext] ); } From f00b70f30a53200c7b3a152396ffc65ac2faab35 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 17:10:06 +0100 Subject: [PATCH 099/162] refactor(api): charge weight for increase/decrease allowance calls --- .../src/fungibles/precompiles/mod.rs | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 82afabced..5124f22f7 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -113,7 +113,7 @@ where Ok(approveCall::abi_encode_returns(&approveReturn {})) }, IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { - // TODO: charge based on benchmarked weight + let charged = env.charge(>::WeightInfo::approve(1, 0))?; let owner = >::to_address(env.caller().account_id()?).0.into(); let value = U256::saturating_from( @@ -122,8 +122,17 @@ where (*token).into(), env.to_account_id(&(*spender.0).into()), value.saturating_to(), - ) // TODO: adjust weight - .map_err(|e| e.error)?, + ) + .map_err(|e| { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + e.error + })?, ); let spender = *spender; @@ -131,16 +140,37 @@ where Ok(increaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { token, spender, value }) => { - // TODO: charge based on benchmarked weight + let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - let (value, weight) = self::decrease_allowance::( + let value = match self::decrease_allowance::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), value.saturating_to(), - ) // TODO: adjust weight - .map_err(|e| e.error)?; + ) { + Ok((value, weight)) => { + // Adjust weight + if let Some(actual_weight) = weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + value + }, + Err(e) => { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + return Err(e.error.into()) + }, + }; + let value = U256::saturating_from(value); let spender = *spender; From 7c9722a44f3085ad101fd0b5ab47c8934d5967a8 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 17:14:18 +0100 Subject: [PATCH 100/162] refactor(api): improve decrease allowance implementation --- pallets/api-vnext/src/fungibles/precompiles/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 5124f22f7..3ddf7859a 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -157,7 +157,7 @@ where env.gas_meter_mut() .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); } - value + U256::saturating_from(value) }, Err(e) => { // Adjust weight @@ -171,8 +171,6 @@ where }, }; - let value = U256::saturating_from(value); - let spender = *spender; deposit_event(env, address, Approval { token: *token, owner, spender, value }); Ok(decreaseAllowanceCall::abi_encode_returns(&value)) From 519e3cdaf9c63fdf8d77f37ccb536e8e7f1858c0 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 20:16:28 +0100 Subject: [PATCH 101/162] feat(api): add clear_metadata benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 37 +++++++--- .../src/fungibles/precompiles/mod.rs | 2 +- pallets/api-vnext/src/fungibles/weights.rs | 67 +++++++++++++------ 3 files changed, 74 insertions(+), 32 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 32799eff3..ff36f5e2f 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -2,7 +2,7 @@ use alloc::vec; -use frame_benchmarking::v2::{whitelisted_caller as allowlisted_caller, *}; +use frame_benchmarking::v2::*; use frame_support::{ assert_ok, pallet_prelude::IsType, @@ -20,7 +20,7 @@ use pallet_revive::{ alloy::primitives as alloy, run::{precompile, CallSetup, WasmModule, H256, U256}, }, - test_utils::{ALICE_ADDR, BOB_ADDR}, + test_utils::{ALICE_ADDR, BOB_ADDR, CHARLIE_ADDR}, AddressMapper as _, Origin, }; @@ -66,8 +66,8 @@ mod benchmarks { let owner = >::to_account_id(&ALICE_ADDR); let spender = >::to_account_id(&BOB_ADDR); let current_allowance = >::from(u32::MAX / 2); + let token = create::(>::to_account_id(&CHARLIE_ADDR)); // Set the `current_allowance`. - let token = create::(); >::set_balance(&owner, u32::MAX.into()); assert_ok!( as approvals::Mutate>::approve( token.clone(), @@ -133,6 +133,21 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn clear_metadata() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = create::(owner.clone()); + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::clearMetadata(clearMetadataCall { token: token.into() }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + } + #[benchmark] fn total_supply() { let mut call_setup = set_up_call(); @@ -147,9 +162,9 @@ mod benchmarks { #[benchmark] fn balance_of() { + let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let token = create::(); let input = IFungiblesCalls::balanceOf(balanceOfCall { token: token.into(), owner: ALICE_ADDR.0.into(), @@ -163,9 +178,9 @@ mod benchmarks { #[benchmark] fn allowance() { + let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let token = create::(); let input = IFungiblesCalls::allowance(allowanceCall { token: token.into(), owner: ALICE_ADDR.0.into(), @@ -180,9 +195,9 @@ mod benchmarks { #[benchmark] fn token_name() { + let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let token = create::(); let input = IFungiblesCalls::name(nameCall { token: token.into() }); #[block] @@ -193,9 +208,9 @@ mod benchmarks { #[benchmark] fn symbol() { + let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let token = create::(); let input = IFungiblesCalls::symbol(symbolCall { token: token.into() }); #[block] @@ -239,13 +254,13 @@ fn assert_has_event, I>( } fn create + pallet_assets::Config + pallet_revive::Config, I>( + owner: T::AccountId, ) -> TokenId { let token = NextAssetId::::get().unwrap_or_default(); - let admin: T::AccountId = allowlisted_caller(); - >::set_balance(&admin, u32::MAX.into()); + >::set_balance(&owner, u32::MAX.into()); assert_ok!( as Create>::create( token.clone(), - admin.clone(), + owner.clone(), true, 1u32.into() )); @@ -253,7 +268,7 @@ fn create + pallet_assets::Config + pallet_rev let max = AssetsStringLimit::::get() as usize; assert_ok!( as metadata::Mutate>::set( token.clone(), - &admin, + &owner, vec![255u8; max], vec![255u8; max], u8::MAX diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 3ddf7859a..7e2085b94 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -206,7 +206,7 @@ where Ok(setMetadataCall::abi_encode_returns(&setMetadataReturn {})) }, IFungiblesCalls::clearMetadata(clearMetadataCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::clear_metadata())?; clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn {})) }, diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index f4f16cc25..53d299456 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -32,6 +32,7 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { fn approve(a: u32, c: u32, ) -> Weight; + fn clear_metadata() -> Weight; fn total_supply() -> Weight; fn balance_of() -> Weight; fn allowance() -> Weight; @@ -57,22 +58,35 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_074_489, 3675) - // Standard Error: 53_265 - .saturating_add(Weight::from_parts(19_925_510, 0).saturating_mul(a.into())) - // Standard Error: 53_265 - .saturating_add(Weight::from_parts(34_050_000, 0).saturating_mul(c.into())) + Weight::from_parts(7_259_183, 3675) + // Standard Error: 88_425 + .saturating_add(Weight::from_parts(21_497_959, 0).saturating_mul(a.into())) + // Standard Error: 88_425 + .saturating_add(Weight::from_parts(35_842_857, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Metadata` (r:1 w:1) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `645` + // Estimated: `3675` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_supply() -> Weight { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -83,7 +97,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } @@ -96,7 +110,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 6044) + Weight::from_parts(11_000_000, 6044) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -106,7 +120,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `267` // Estimated: `3605` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -115,7 +129,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -156,22 +170,35 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_074_489, 3675) - // Standard Error: 53_265 - .saturating_add(Weight::from_parts(19_925_510, 0).saturating_mul(a.into())) - // Standard Error: 53_265 - .saturating_add(Weight::from_parts(34_050_000, 0).saturating_mul(c.into())) + Weight::from_parts(7_259_183, 3675) + // Standard Error: 88_425 + .saturating_add(Weight::from_parts(21_497_959, 0).saturating_mul(a.into())) + // Standard Error: 88_425 + .saturating_add(Weight::from_parts(35_842_857, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Metadata` (r:1 w:1) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `645` + // Estimated: `3675` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_supply() -> Weight { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -182,7 +209,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } @@ -195,7 +222,7 @@ impl WeightInfo for () { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 6044) + Weight::from_parts(11_000_000, 6044) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -205,7 +232,7 @@ impl WeightInfo for () { // Measured: `267` // Estimated: `3605` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -214,7 +241,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } From 6e34cfb8b923d8cdfe1f14bfe1a1cdce8c55a628 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 20:17:23 +0100 Subject: [PATCH 102/162] chore: update cargo.lock --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index 4b077887b..1da780009 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9900,6 +9900,7 @@ dependencies = [ name = "pallet-api-vnext" version = "0.1.0" dependencies = [ + "frame-benchmarking 28.0.0", "frame-support 28.0.0", "frame-system 28.0.0", "pallet-assets 29.1.0", From f10723db7f7f6b50c7918a2a6208fd40607bd402 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 20:54:53 +0100 Subject: [PATCH 103/162] feat(api): add set_metadata benchmark Also adds a few additional improvements. --- .../api-vnext/src/fungibles/benchmarking.rs | 69 +++++++++++--- .../src/fungibles/precompiles/mod.rs | 8 +- pallets/api-vnext/src/fungibles/weights.rs | 93 ++++++++++++------- 3 files changed, 118 insertions(+), 52 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index ff36f5e2f..743752c71 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -1,6 +1,9 @@ //! Benchmarking setup for pallet_api::fungibles::precompiles -use alloc::vec; +use alloc::{ + string::{String, ToString}, + vec, +}; use frame_benchmarking::v2::*; use frame_support::{ @@ -10,7 +13,8 @@ use frame_support::{ fungible::{Inspect, Mutate as _}, fungibles::{ approvals::{self, Inspect as _}, - metadata, Create, + metadata::{self, Inspect as _}, + Create, }, Get, Time, }, @@ -25,7 +29,7 @@ use pallet_revive::{ }; use super::{ - precompiles::{IFungibles::*, IFungiblesCalls, UintTryFrom, UintTryTo}, + precompiles::{IFungibles, IFungiblesCalls, UintTryFrom, UintTryTo}, Config, NextAssetId, Pallet, }; use crate::fixed_address; @@ -90,7 +94,7 @@ mod benchmarks { let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::approve(approveCall { + let input = IFungiblesCalls::approve(IFungibles::approveCall { token: token.clone().into(), spender: >::to_address(&spender).0.into(), value: alloy::U256::from(approval_value), @@ -133,6 +137,35 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn set_metadata() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = create::(owner.clone()); + let max = AssetsStringLimit::::get() as usize; + let name = vec![42u8; max]; + let symbol = vec![42u8; max]; + let decimals = u8::MAX - 1; + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::setMetadata(IFungibles::setMetadataCall { + token: token.clone().into(), + name: String::from_utf8_lossy(&name).to_string(), + symbol: String::from_utf8_lossy(&symbol).to_string(), + decimals, + }); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::name(token.clone()), name); + assert_eq!(>::symbol(token.clone()), symbol); + assert_eq!(>::decimals(token), decimals); + } + #[benchmark] fn clear_metadata() { let owner = >::to_account_id(&ALICE_ADDR); @@ -140,19 +173,25 @@ mod benchmarks { let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::clearMetadata(clearMetadataCall { token: token.into() }); + let input = IFungiblesCalls::clearMetadata(IFungibles::clearMetadataCall { + token: token.clone().into(), + }); #[block] { assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); } + + assert!(>::name(token.clone()).is_empty()); + assert!(>::symbol(token.clone()).is_empty()); + assert_eq!(>::decimals(token), 0); } #[benchmark] fn total_supply() { let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::totalSupply(totalSupplyCall { token: 0 }); + let input = IFungiblesCalls::totalSupply(IFungibles::totalSupplyCall { token: 0 }); #[block] { @@ -165,7 +204,7 @@ mod benchmarks { let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::balanceOf(balanceOfCall { + let input = IFungiblesCalls::balanceOf(IFungibles::balanceOfCall { token: token.into(), owner: ALICE_ADDR.0.into(), }); @@ -181,7 +220,7 @@ mod benchmarks { let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::allowance(allowanceCall { + let input = IFungiblesCalls::allowance(IFungibles::allowanceCall { token: token.into(), owner: ALICE_ADDR.0.into(), spender: BOB_ADDR.0.into(), @@ -194,11 +233,11 @@ mod benchmarks { } #[benchmark] - fn token_name() { + fn metadata_name() { let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::name(nameCall { token: token.into() }); + let input = IFungiblesCalls::name(IFungibles::nameCall { token: token.into() }); #[block] { @@ -207,11 +246,11 @@ mod benchmarks { } #[benchmark] - fn symbol() { + fn metadata_symbol() { let token = create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::symbol(symbolCall { token: token.into() }); + let input = IFungiblesCalls::symbol(IFungibles::symbolCall { token: token.into() }); #[block] { @@ -220,10 +259,10 @@ mod benchmarks { } #[benchmark] - fn decimals() { + fn metadata_decimals() { let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::decimals(decimalsCall { token: 0 }); + let input = IFungiblesCalls::decimals(IFungibles::decimalsCall { token: 0 }); #[block] { @@ -235,7 +274,7 @@ mod benchmarks { fn exists() { let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::exists(existsCall { token: 0 }); + let input = IFungiblesCalls::exists(IFungibles::existsCall { token: 0 }); #[block] { diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 7e2085b94..4982b57fc 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -195,7 +195,7 @@ where Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn {})) }, IFungiblesCalls::setMetadata(setMetadataCall { token, name, symbol, decimals }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::set_metadata())?; set_metadata::( to_runtime_origin(env.caller()), (*token).into(), @@ -267,19 +267,19 @@ where Ok(allowanceCall::abi_encode_returns(&remaining)) }, IFungiblesCalls::name(nameCall { token }) => { - env.charge(>::WeightInfo::token_name())?; + env.charge(>::WeightInfo::metadata_name())?; let result = >::name((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::symbol(symbolCall { token }) => { - env.charge(>::WeightInfo::symbol())?; + env.charge(>::WeightInfo::metadata_symbol())?; let result = >::symbol((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::decimals(decimalsCall { token }) => { - env.charge(>::WeightInfo::decimals())?; + env.charge(>::WeightInfo::metadata_decimals())?; let result = >::decimals((*token).into()); Ok(decimalsCall::abi_encode_returns(&result)) }, diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index 53d299456..0954753e0 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -32,13 +32,14 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { fn approve(a: u32, c: u32, ) -> Weight; + fn set_metadata() -> Weight; fn clear_metadata() -> Weight; fn total_supply() -> Weight; fn balance_of() -> Weight; fn allowance() -> Weight; - fn token_name() -> Weight; - fn symbol() -> Weight; - fn decimals() -> Weight; + fn metadata_name() -> Weight; + fn metadata_symbol() -> Weight; + fn metadata_decimals() -> Weight; fn exists() -> Weight; } @@ -58,11 +59,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_259_183, 3675) - // Standard Error: 88_425 - .saturating_add(Weight::from_parts(21_497_959, 0).saturating_mul(a.into())) - // Standard Error: 88_425 - .saturating_add(Weight::from_parts(35_842_857, 0).saturating_mul(c.into())) + Weight::from_parts(8_414_285, 3675) + // Standard Error: 151_952 + .saturating_add(Weight::from_parts(19_830_612, 0).saturating_mul(a.into())) + // Standard Error: 151_952 + .saturating_add(Weight::from_parts(35_355_102, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -70,12 +71,25 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Metadata` (r:1 w:1) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn set_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `505` + // Estimated: `3675` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Metadata` (r:1 w:1) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) fn clear_metadata() -> Weight { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -86,7 +100,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -98,7 +112,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `346` // Estimated: `3599` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(8_000_000, 3599) + Weight::from_parts(9_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::OriginalAccount` (r:2 w:0) @@ -115,17 +129,17 @@ impl WeightInfo for SubstrateWeight { } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn token_name() -> Weight { + fn metadata_name() -> Weight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 3605) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn symbol() -> Weight { + fn metadata_symbol() -> Weight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` @@ -135,12 +149,12 @@ impl WeightInfo for SubstrateWeight { } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn decimals() -> Weight { + fn metadata_decimals() -> Weight { // Proof Size summary in bytes: // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) @@ -170,11 +184,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_259_183, 3675) - // Standard Error: 88_425 - .saturating_add(Weight::from_parts(21_497_959, 0).saturating_mul(a.into())) - // Standard Error: 88_425 - .saturating_add(Weight::from_parts(35_842_857, 0).saturating_mul(c.into())) + Weight::from_parts(8_414_285, 3675) + // Standard Error: 151_952 + .saturating_add(Weight::from_parts(19_830_612, 0).saturating_mul(a.into())) + // Standard Error: 151_952 + .saturating_add(Weight::from_parts(35_355_102, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -182,12 +196,25 @@ impl WeightInfo for () { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Metadata` (r:1 w:1) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn set_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `505` + // Estimated: `3675` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `Assets::Asset` (r:1 w:0) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Metadata` (r:1 w:1) + /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) fn clear_metadata() -> Weight { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -198,7 +225,7 @@ impl WeightInfo for () { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -210,7 +237,7 @@ impl WeightInfo for () { // Measured: `346` // Estimated: `3599` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(8_000_000, 3599) + Weight::from_parts(9_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::OriginalAccount` (r:2 w:0) @@ -227,17 +254,17 @@ impl WeightInfo for () { } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn token_name() -> Weight { + fn metadata_name() -> Weight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 3605) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn symbol() -> Weight { + fn metadata_symbol() -> Weight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` @@ -247,12 +274,12 @@ impl WeightInfo for () { } /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) - fn decimals() -> Weight { + fn metadata_decimals() -> Weight { // Proof Size summary in bytes: // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) From 6db9046834d591011c8072e1a2613101185e4baf Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 24 Jun 2025 21:05:19 +0100 Subject: [PATCH 104/162] feat(api): add start_destroy benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 22 +++++++ .../src/fungibles/precompiles/mod.rs | 2 +- pallets/api-vnext/src/fungibles/weights.rs | 59 +++++++++++++------ 3 files changed, 64 insertions(+), 19 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 743752c71..2aa24d15a 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -19,6 +19,7 @@ use frame_support::{ Get, Time, }, }; +use pallet_assets::{Asset, AssetStatus}; use pallet_revive::{ precompiles::{ alloy::primitives as alloy, @@ -137,6 +138,27 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn start_destroy() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = create::(owner.clone()); + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::startDestroy(IFungibles::startDestroyCall { + token: token.clone().into(), + }); + + assert_eq!(>::get(token.clone()).unwrap().status, AssetStatus::Live); + + #[block] + { + assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::get(token.clone()).unwrap().status, AssetStatus::Destroying); + } + #[benchmark] fn set_metadata() { let owner = >::to_account_id(&ALICE_ADDR); diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 4982b57fc..1cff218d2 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -190,7 +190,7 @@ where Ok(createCall::abi_encode_returns(&id)) }, IFungiblesCalls::startDestroy(startDestroyCall { token }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::start_destroy())?; start_destroy::(to_runtime_origin(env.caller()), (*token).into())?; Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn {})) }, diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index 0954753e0..e9d8da9be 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -32,6 +32,7 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { fn approve(a: u32, c: u32, ) -> Weight; + fn start_destroy() -> Weight; fn set_metadata() -> Weight; fn clear_metadata() -> Weight; fn total_supply() -> Weight; @@ -59,14 +60,25 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_414_285, 3675) - // Standard Error: 151_952 - .saturating_add(Weight::from_parts(19_830_612, 0).saturating_mul(a.into())) - // Standard Error: 151_952 - .saturating_add(Weight::from_parts(35_355_102, 0).saturating_mul(c.into())) + Weight::from_parts(7_212_244, 3675) + // Standard Error: 51_405 + .saturating_add(Weight::from_parts(20_900_000, 0).saturating_mul(a.into())) + // Standard Error: 51_405 + .saturating_add(Weight::from_parts(35_787_755, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn start_destroy() -> Weight { + // Proof Size summary in bytes: + // Measured: `337` + // Estimated: `3675` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Metadata` (r:1 w:1) @@ -89,7 +101,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `645` // Estimated: `3675` // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 3675) + Weight::from_parts(30_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -112,7 +124,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `346` // Estimated: `3599` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 3599) + Weight::from_parts(8_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::OriginalAccount` (r:2 w:0) @@ -133,7 +145,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -154,7 +166,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3605) + Weight::from_parts(5_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) @@ -184,14 +196,25 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_414_285, 3675) - // Standard Error: 151_952 - .saturating_add(Weight::from_parts(19_830_612, 0).saturating_mul(a.into())) - // Standard Error: 151_952 - .saturating_add(Weight::from_parts(35_355_102, 0).saturating_mul(c.into())) + Weight::from_parts(7_212_244, 3675) + // Standard Error: 51_405 + .saturating_add(Weight::from_parts(20_900_000, 0).saturating_mul(a.into())) + // Standard Error: 51_405 + .saturating_add(Weight::from_parts(35_787_755, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn start_destroy() -> Weight { + // Proof Size summary in bytes: + // Measured: `337` + // Estimated: `3675` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Metadata` (r:1 w:1) @@ -214,7 +237,7 @@ impl WeightInfo for () { // Measured: `645` // Estimated: `3675` // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 3675) + Weight::from_parts(30_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -237,7 +260,7 @@ impl WeightInfo for () { // Measured: `346` // Estimated: `3599` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 3599) + Weight::from_parts(8_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::OriginalAccount` (r:2 w:0) @@ -258,7 +281,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -279,7 +302,7 @@ impl WeightInfo for () { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3605) + Weight::from_parts(5_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) From 26cb86064711cbf12de91f46195e135f16f5a7f2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 14:50:45 +0100 Subject: [PATCH 105/162] feat(api): add create benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 43 +++++++++--- .../src/fungibles/precompiles/mod.rs | 4 +- pallets/api-vnext/src/fungibles/weights.rs | 69 ++++++++++++++----- pallets/api-vnext/src/lib.rs | 29 +++++--- 4 files changed, 103 insertions(+), 42 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 2aa24d15a..22d4259f3 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -14,7 +14,7 @@ use frame_support::{ fungibles::{ approvals::{self, Inspect as _}, metadata::{self, Inspect as _}, - Create, + Create, Inspect as _, }, Get, Time, }, @@ -33,9 +33,9 @@ use super::{ precompiles::{IFungibles, IFungiblesCalls, UintTryFrom, UintTryTo}, Config, NextAssetId, Pallet, }; -use crate::fixed_address; #[cfg(test)] use crate::mock::{ExtBuilder, Test}; +use crate::{call_precompile, fixed_address}; const FUNGIBLES: u16 = 100; const ADDRESS: [u8; 20] = fixed_address(FUNGIBLES); @@ -71,7 +71,7 @@ mod benchmarks { let owner = >::to_account_id(&ALICE_ADDR); let spender = >::to_account_id(&BOB_ADDR); let current_allowance = >::from(u32::MAX / 2); - let token = create::(>::to_account_id(&CHARLIE_ADDR)); + let token = super::create::(>::to_account_id(&CHARLIE_ADDR)); // Set the `current_allowance`. >::set_balance(&owner, u32::MAX.into()); assert_ok!( as approvals::Mutate>::approve( @@ -138,10 +138,33 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn create() { + let owner = >::to_account_id(&ALICE_ADDR); + let admin = BOB_ADDR; + let min_balance: AssetsBalance = 1u8.into(); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::create(IFungibles::createCall { + admin: admin.0.into(), + minBalance: alloy::U256::from(min_balance), + }); + + let mut token = 0; + #[block] + { + token = call_precompile::, _, _>(&mut ext, &ADDRESS, &input).unwrap(); + } + + assert!(>::asset_exists(token.into())); + } + #[benchmark] fn start_destroy() { let owner = >::to_account_id(&ALICE_ADDR); - let token = create::(owner.clone()); + let token = super::create::(owner.clone()); let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; @@ -162,7 +185,7 @@ mod benchmarks { #[benchmark] fn set_metadata() { let owner = >::to_account_id(&ALICE_ADDR); - let token = create::(owner.clone()); + let token = super::create::(owner.clone()); let max = AssetsStringLimit::::get() as usize; let name = vec![42u8; max]; let symbol = vec![42u8; max]; @@ -191,7 +214,7 @@ mod benchmarks { #[benchmark] fn clear_metadata() { let owner = >::to_account_id(&ALICE_ADDR); - let token = create::(owner.clone()); + let token = super::create::(owner.clone()); let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; @@ -223,7 +246,7 @@ mod benchmarks { #[benchmark] fn balance_of() { - let token = create::(>::to_account_id(&ALICE_ADDR)); + let token = super::create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::balanceOf(IFungibles::balanceOfCall { @@ -239,7 +262,7 @@ mod benchmarks { #[benchmark] fn allowance() { - let token = create::(>::to_account_id(&ALICE_ADDR)); + let token = super::create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::allowance(IFungibles::allowanceCall { @@ -256,7 +279,7 @@ mod benchmarks { #[benchmark] fn metadata_name() { - let token = create::(>::to_account_id(&ALICE_ADDR)); + let token = super::create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::name(IFungibles::nameCall { token: token.into() }); @@ -269,7 +292,7 @@ mod benchmarks { #[benchmark] fn metadata_symbol() { - let token = create::(>::to_account_id(&ALICE_ADDR)); + let token = super::create::(>::to_account_id(&ALICE_ADDR)); let mut call_setup = set_up_call(); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::symbol(IFungibles::symbolCall { token: token.into() }); diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 1cff218d2..414129a4c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -5,7 +5,7 @@ use frame_support::traits::fungibles::metadata::Inspect as _; pub(super) use pallet_revive::precompiles::alloy::{ primitives::{ ruint::{UintTryFrom, UintTryTo}, - Address, + Address, U256, }, sol_types::SolCall, }; @@ -176,7 +176,7 @@ where Ok(decreaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::create(createCall { admin, minBalance }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::create())?; let creator = >::to_address(env.caller().account_id()?).0.into(); let id = self::create::( diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index e9d8da9be..a518df732 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_api_vnext::fungibles` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-06-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-06-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `R0GUE`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop-devnet-dev")`, DB CACHE: `1024` @@ -32,6 +32,7 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { fn approve(a: u32, c: u32, ) -> Weight; + fn create() -> Weight; fn start_destroy() -> Weight; fn set_metadata() -> Weight; fn clear_metadata() -> Weight; @@ -60,11 +61,26 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_212_244, 3675) - // Standard Error: 51_405 - .saturating_add(Weight::from_parts(20_900_000, 0).saturating_mul(a.into())) - // Standard Error: 51_405 - .saturating_add(Weight::from_parts(35_787_755, 0).saturating_mul(c.into())) + Weight::from_parts(6_814_285, 3675) + // Standard Error: 132_214 + .saturating_add(Weight::from_parts(21_432_653, 0).saturating_mul(a.into())) + // Standard Error: 132_214 + .saturating_add(Weight::from_parts(36_653_061, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::NextAssetId` (r:1 w:1) + /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `471` + // Estimated: `3675` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(32_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -87,7 +103,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 15_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -112,7 +128,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -136,7 +152,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 6044) + Weight::from_parts(10_000_000, 6044) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -145,7 +161,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 6_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -196,11 +212,26 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_212_244, 3675) - // Standard Error: 51_405 - .saturating_add(Weight::from_parts(20_900_000, 0).saturating_mul(a.into())) - // Standard Error: 51_405 - .saturating_add(Weight::from_parts(35_787_755, 0).saturating_mul(c.into())) + Weight::from_parts(6_814_285, 3675) + // Standard Error: 132_214 + .saturating_add(Weight::from_parts(21_432_653, 0).saturating_mul(a.into())) + // Standard Error: 132_214 + .saturating_add(Weight::from_parts(36_653_061, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::NextAssetId` (r:1 w:1) + /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `471` + // Estimated: `3675` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(32_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -223,7 +254,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 15_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -248,7 +279,7 @@ impl WeightInfo for () { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -272,7 +303,7 @@ impl WeightInfo for () { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 6044) + Weight::from_parts(10_000_000, 6044) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -281,7 +312,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 6_000_000 picoseconds. Weight::from_parts(7_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index c3dfc02ac..67dfc7b4b 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -8,14 +8,14 @@ use core::{convert::Into, marker::PhantomData, num::NonZero}; use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; #[cfg(feature = "fungibles")] pub use fungibles::precompiles::{Erc20, Fungibles}; -pub use pallet_revive::precompiles::alloy::primitives::U256; +#[cfg(any(test, feature = "runtime-benchmarks"))] +use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; use pallet_revive::{ - evm::{H160, H256}, precompiles::{ alloy::{sol, sol_types::SolEvent}, AddressMatcher, Error, Ext, Precompile, }, - AddressMapper as _, Origin, + AddressMapper as _, Origin, H160, H256, U256, }; #[cfg(test)] use { @@ -24,10 +24,7 @@ use { sp_runtime::traits::Bounded, }, frame_system::pallet_prelude::OriginFor, - pallet_revive::{ - precompiles::alloy::sol_types::{SolType, SolValue}, - BalanceOf, DepositLimit, MomentOf, - }, + pallet_revive::{BalanceOf, DepositLimit, MomentOf}, }; #[cfg(feature = "fungibles")] @@ -72,20 +69,30 @@ where } // A direct call to a precompile. -#[cfg(all(test, feature = "runtime-benchmarks"))] +#[cfg(feature = "runtime-benchmarks")] fn call_precompile< - P: Precompile, + P: Precompile, + E: pallet_revive::precompiles::ExtWithInfo< + T: pallet_revive::Config< + Currency: frame_support::traits::fungible::Inspect< + ::AccountId, + Balance: Into + TryFrom, + >, + Hash: frame_support::traits::IsType, + Time: frame_support::traits::Time>, + >, + >, O: SolValue + From<::RustType>, >( - ext: &mut impl pallet_revive::precompiles::ExtWithInfo, + ext: &mut E, address: &[u8; 20], input: &P::Interface, ) -> Result { pallet_revive::precompiles::run::precompile::(ext, address, input).map(|o| decode(&o)) } -#[cfg(test)] +#[cfg(any(test, feature = "runtime-benchmarks"))] fn decode::RustType>>(data: &[u8]) -> T { T::abi_decode(data).expect("unable to decode") } From 6a7570809d0cd3fdc8edcb65ccc55198b244d64d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 14:57:44 +0100 Subject: [PATCH 106/162] refactor(api): move benchmark assertion into block --- pallets/api-vnext/src/fungibles/benchmarking.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 22d4259f3..8c0d97a99 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -152,13 +152,12 @@ mod benchmarks { minBalance: alloy::U256::from(min_balance), }); - let mut token = 0; #[block] { - token = call_precompile::, _, _>(&mut ext, &ADDRESS, &input).unwrap(); + let token = + call_precompile::, _, u32>(&mut ext, &ADDRESS, &input).unwrap(); + assert!(>::asset_exists(token.into())); } - - assert!(>::asset_exists(token.into())); } #[benchmark] From 5b9f2d84cffd8e71a749d11b1949b0d53b273ad5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 15:03:21 +0100 Subject: [PATCH 107/162] refactor(api): use call_precompile helper Provides decoding to ease assertions. --- .../api-vnext/src/fungibles/benchmarking.rs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 8c0d97a99..51c0e9873 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -23,7 +23,7 @@ use pallet_assets::{Asset, AssetStatus}; use pallet_revive::{ precompiles::{ alloy::primitives as alloy, - run::{precompile, CallSetup, WasmModule, H256, U256}, + run::{CallSetup, WasmModule, H256, U256}, }, test_utils::{ALICE_ADDR, BOB_ADDR, CHARLIE_ADDR}, AddressMapper as _, Origin, @@ -103,7 +103,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } assert_eq!(>::allowance(token.clone(), &owner, &spender), approval_value); @@ -175,7 +175,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } assert_eq!(>::get(token.clone()).unwrap().status, AssetStatus::Destroying); @@ -202,7 +202,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } assert_eq!(>::name(token.clone()), name); @@ -223,7 +223,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } assert!(>::name(token.clone()).is_empty()); @@ -239,7 +239,9 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, alloy::U256>( + &mut ext, &ADDRESS, &input + )); } } @@ -255,7 +257,9 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, alloy::U256>( + &mut ext, &ADDRESS, &input + )); } } @@ -272,7 +276,9 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, alloy::U256>( + &mut ext, &ADDRESS, &input + )); } } @@ -285,7 +291,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, String>(&mut ext, &ADDRESS, &input)); } } @@ -298,7 +304,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, String>(&mut ext, &ADDRESS, &input)); } } @@ -310,7 +316,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, u16>(&mut ext, &ADDRESS, &input)); } } @@ -322,7 +328,7 @@ mod benchmarks { #[block] { - assert_ok!(precompile::, _>(&mut ext, &ADDRESS, &input)); + assert_ok!(call_precompile::, _, bool>(&mut ext, &ADDRESS, &input)); } } From 4887070a717de5717e69265aa1419f6dfede7838 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 15:24:03 +0100 Subject: [PATCH 108/162] feat(api): add mint benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 24 ++++ .../src/fungibles/precompiles/mod.rs | 2 +- pallets/api-vnext/src/fungibles/weights.rs | 103 ++++++++++++------ 3 files changed, 94 insertions(+), 35 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 51c0e9873..12b7a0add 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -231,6 +231,30 @@ mod benchmarks { assert_eq!(>::decimals(token), 0); } + #[benchmark] + fn mint() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = super::create::(owner.clone()); + let account = >::to_account_id(&BOB_ADDR); + let value: AssetsBalance = u32::MAX.into(); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::mint(IFungibles::mintCall { + token: token.clone().into(), + account: >::to_address(&account).0.into(), + value: alloy::U256::from(value), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::balance(token, account), value); + } + #[benchmark] fn total_supply() { let mut call_setup = set_up_call(); diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 414129a4c..99dbf3ce8 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -211,7 +211,7 @@ where Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn {})) }, IFungiblesCalls::mint(mintCall { token, account, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::mint())?; self::mint::( to_runtime_origin(env.caller()), diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index a518df732..ea04c5996 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -36,6 +36,7 @@ pub trait WeightInfo { fn start_destroy() -> Weight; fn set_metadata() -> Weight; fn clear_metadata() -> Weight; + fn mint() -> Weight; fn total_supply() -> Weight; fn balance_of() -> Weight; fn allowance() -> Weight; @@ -61,11 +62,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(6_814_285, 3675) - // Standard Error: 132_214 - .saturating_add(Weight::from_parts(21_432_653, 0).saturating_mul(a.into())) - // Standard Error: 132_214 - .saturating_add(Weight::from_parts(36_653_061, 0).saturating_mul(c.into())) + Weight::from_parts(5_474_489, 3675) + // Standard Error: 210_972 + .saturating_add(Weight::from_parts(23_262_244, 0).saturating_mul(a.into())) + // Standard Error: 210_972 + .saturating_add(Weight::from_parts(38_513_265, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -79,8 +80,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(32_000_000, 3675) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(37_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -90,8 +91,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3675) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -103,8 +104,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 3675) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -116,11 +117,28 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 29_000_000 picoseconds. + // Minimum execution time: 30_000_000 picoseconds. Weight::from_parts(30_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `584` + // Estimated: `3675` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_supply() -> Weight { @@ -152,7 +170,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 6044) + Weight::from_parts(11_000_000, 6044) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -161,8 +179,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -172,7 +190,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `267` // Estimated: `3605` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -182,7 +200,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) @@ -212,11 +230,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(6_814_285, 3675) - // Standard Error: 132_214 - .saturating_add(Weight::from_parts(21_432_653, 0).saturating_mul(a.into())) - // Standard Error: 132_214 - .saturating_add(Weight::from_parts(36_653_061, 0).saturating_mul(c.into())) + Weight::from_parts(5_474_489, 3675) + // Standard Error: 210_972 + .saturating_add(Weight::from_parts(23_262_244, 0).saturating_mul(a.into())) + // Standard Error: 210_972 + .saturating_add(Weight::from_parts(38_513_265, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -230,8 +248,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(32_000_000, 3675) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(37_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -241,8 +259,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 3675) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -254,8 +272,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 3675) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -267,11 +285,28 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 29_000_000 picoseconds. + // Minimum execution time: 30_000_000 picoseconds. Weight::from_parts(30_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `584` + // Estimated: `3675` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_supply() -> Weight { @@ -303,7 +338,7 @@ impl WeightInfo for () { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 6044) + Weight::from_parts(11_000_000, 6044) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -312,8 +347,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -323,7 +358,7 @@ impl WeightInfo for () { // Measured: `267` // Estimated: `3605` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(7_000_000, 3605) + Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -333,7 +368,7 @@ impl WeightInfo for () { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) From 4c2b33ec70f84b6454eeb48913f70f8015281e70 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 15:51:06 +0100 Subject: [PATCH 109/162] feat(api): add burn benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 30 ++++- .../src/fungibles/precompiles/mod.rs | 2 +- pallets/api-vnext/src/fungibles/weights.rs | 107 ++++++++++++------ 3 files changed, 100 insertions(+), 39 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 12b7a0add..86cae1b6c 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -10,11 +10,11 @@ use frame_support::{ assert_ok, pallet_prelude::IsType, traits::{ - fungible::{Inspect, Mutate as _}, + fungible::{Inspect, Mutate}, fungibles::{ approvals::{self, Inspect as _}, metadata::{self, Inspect as _}, - Create, Inspect as _, + Create, Inspect as _, Mutate as _, }, Get, Time, }, @@ -255,6 +255,32 @@ mod benchmarks { assert_eq!(>::balance(token, account), value); } + #[benchmark] + fn burn() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = super::create::(owner.clone()); + let account = >::to_account_id(&BOB_ADDR); + let value: AssetsBalance = u32::MAX.into(); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::burn(IFungibles::burnCall { + token: token.clone().into(), + account: >::to_address(&account).0.into(), + value: alloy::U256::from(value), + }); + + >::set_balance(token.clone(), &account, value); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::balance(token, account), 0u8.into()); + } + #[benchmark] fn total_supply() { let mut call_setup = set_up_call(); diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 99dbf3ce8..dd0daef71 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -226,7 +226,7 @@ where Ok(mintCall::abi_encode_returns(&mintReturn {})) }, IFungiblesCalls::burn(burnCall { token, account, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::burn())?; self::burn::( to_runtime_origin(env.caller()), diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index ea04c5996..75a387314 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -37,6 +37,7 @@ pub trait WeightInfo { fn set_metadata() -> Weight; fn clear_metadata() -> Weight; fn mint() -> Weight; + fn burn() -> Weight; fn total_supply() -> Weight; fn balance_of() -> Weight; fn allowance() -> Weight; @@ -62,11 +63,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(5_474_489, 3675) - // Standard Error: 210_972 - .saturating_add(Weight::from_parts(23_262_244, 0).saturating_mul(a.into())) - // Standard Error: 210_972 - .saturating_add(Weight::from_parts(38_513_265, 0).saturating_mul(c.into())) + Weight::from_parts(8_088_775, 3675) + // Standard Error: 83_548 + .saturating_add(Weight::from_parts(19_990_816, 0).saturating_mul(a.into())) + // Standard Error: 83_548 + .saturating_add(Weight::from_parts(34_170_408, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -80,8 +81,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(37_000_000, 3675) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -91,8 +92,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 3675) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -104,8 +105,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 3675) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -117,7 +118,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 30_000_000 picoseconds. + // Minimum execution time: 29_000_000 picoseconds. Weight::from_parts(30_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -134,8 +135,25 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3675) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn burn() -> Weight { + // Proof Size summary in bytes: + // Measured: `744` + // Estimated: `3675` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -146,7 +164,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -157,7 +175,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } @@ -179,7 +197,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -200,7 +218,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3605) + Weight::from_parts(5_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) @@ -230,11 +248,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(5_474_489, 3675) - // Standard Error: 210_972 - .saturating_add(Weight::from_parts(23_262_244, 0).saturating_mul(a.into())) - // Standard Error: 210_972 - .saturating_add(Weight::from_parts(38_513_265, 0).saturating_mul(c.into())) + Weight::from_parts(8_088_775, 3675) + // Standard Error: 83_548 + .saturating_add(Weight::from_parts(19_990_816, 0).saturating_mul(a.into())) + // Standard Error: 83_548 + .saturating_add(Weight::from_parts(34_170_408, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -248,8 +266,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(37_000_000, 3675) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -259,8 +277,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 3675) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -272,8 +290,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 3675) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -285,7 +303,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 30_000_000 picoseconds. + // Minimum execution time: 29_000_000 picoseconds. Weight::from_parts(30_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -302,8 +320,25 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3675) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn burn() -> Weight { + // Proof Size summary in bytes: + // Measured: `744` + // Estimated: `3675` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -314,7 +349,7 @@ impl WeightInfo for () { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -325,7 +360,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } @@ -347,7 +382,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -368,7 +403,7 @@ impl WeightInfo for () { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3605) + Weight::from_parts(5_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) From f6be7e52fb69a8e139317fd2f789849e0bdc290a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 16:02:14 +0100 Subject: [PATCH 110/162] feat(api): add transfer benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 29 ++++++ .../src/fungibles/precompiles/mod.rs | 2 +- pallets/api-vnext/src/fungibles/weights.rs | 99 +++++++++++++------ 3 files changed, 97 insertions(+), 33 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 86cae1b6c..0393562c3 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -63,6 +63,35 @@ type TokenId = >::AssetId; mod benchmarks { use super::*; + #[benchmark] + fn transfer() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = super::create::(owner.clone()); + let to = >::to_account_id(&BOB_ADDR); + let value: AssetsBalance = u32::MAX.into(); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::transfer(IFungibles::transferCall { + token: token.clone().into(), + to: >::to_address(&to).0.into(), + value: alloy::U256::from(value), + }); + + >::set_balance(token.clone(), &owner, value); + assert_eq!(>::balance(token.clone(), &owner), value); + assert_eq!(>::balance(token.clone(), &to), 0u8.into()); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::balance(token.clone(), &owner), 0u8.into()); + assert_eq!(>::balance(token, &to), value); + } + // Parameter: // - 'a': whether `approve_transfer` is required. // - 'c': whether `cancel_approval` is required. diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index dd0daef71..950e40672 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -49,7 +49,7 @@ where ) -> Result, Error> { match input { IFungiblesCalls::transfer(transferCall { token, to, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::transfer())?; let from = >::to_address(env.caller().account_id()?).0.into(); self::transfer::( diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index 75a387314..a76ece18d 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -31,6 +31,7 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { + fn transfer() -> Weight; fn approve(a: u32, c: u32, ) -> Weight; fn create() -> Weight; fn start_destroy() -> Weight; @@ -50,6 +51,23 @@ pub trait WeightInfo { /// Weights for `pallet_api_vnext::fungibles` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:2) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `781` + // Estimated: `6208` + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(48_000_000, 6208) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `Assets::Approvals` (r:1 w:1) @@ -63,11 +81,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_088_775, 3675) - // Standard Error: 83_548 - .saturating_add(Weight::from_parts(19_990_816, 0).saturating_mul(a.into())) - // Standard Error: 83_548 - .saturating_add(Weight::from_parts(34_170_408, 0).saturating_mul(c.into())) + Weight::from_parts(6_576_530, 3675) + // Standard Error: 127_016 + .saturating_add(Weight::from_parts(22_054_081, 0).saturating_mul(a.into())) + // Standard Error: 127_016 + .saturating_add(Weight::from_parts(36_419_387, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -81,8 +99,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(33_000_000, 3675) + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(34_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -105,7 +123,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 15_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -135,8 +153,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 3675) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -152,7 +170,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 39_000_000 picoseconds. + // Minimum execution time: 38_000_000 picoseconds. Weight::from_parts(39_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -164,7 +182,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -175,7 +193,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } @@ -197,7 +215,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -207,7 +225,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -218,7 +236,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) @@ -235,6 +253,23 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests. impl WeightInfo for () { + /// Storage: `Revive::OriginalAccount` (r:1 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:2) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `781` + // Estimated: `6208` + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(48_000_000, 6208) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `Assets::Approvals` (r:1 w:1) @@ -248,11 +283,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(8_088_775, 3675) - // Standard Error: 83_548 - .saturating_add(Weight::from_parts(19_990_816, 0).saturating_mul(a.into())) - // Standard Error: 83_548 - .saturating_add(Weight::from_parts(34_170_408, 0).saturating_mul(c.into())) + Weight::from_parts(6_576_530, 3675) + // Standard Error: 127_016 + .saturating_add(Weight::from_parts(22_054_081, 0).saturating_mul(a.into())) + // Standard Error: 127_016 + .saturating_add(Weight::from_parts(36_419_387, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -266,8 +301,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(33_000_000, 3675) + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(34_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -290,7 +325,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 15_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(15_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -320,8 +355,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 3675) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -337,7 +372,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 39_000_000 picoseconds. + // Minimum execution time: 38_000_000 picoseconds. Weight::from_parts(39_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -349,7 +384,7 @@ impl WeightInfo for () { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(6_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -360,7 +395,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } @@ -382,7 +417,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -392,7 +427,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 7_000_000 picoseconds. + // Minimum execution time: 8_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -403,7 +438,7 @@ impl WeightInfo for () { // Measured: `136` // Estimated: `3605` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 3605) + Weight::from_parts(6_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Assets::Asset` (r:1 w:0) From f0dfab255a364d267b2fcbc6925c59b6971cc254 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 16:44:29 +0100 Subject: [PATCH 111/162] feat(api): add transfer_from benchmark --- .../api-vnext/src/fungibles/benchmarking.rs | 38 ++++++- .../src/fungibles/precompiles/mod.rs | 10 +- pallets/api-vnext/src/fungibles/weights.rs | 107 ++++++++++++------ 3 files changed, 113 insertions(+), 42 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 0393562c3..3d1cdb30f 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -12,7 +12,7 @@ use frame_support::{ traits::{ fungible::{Inspect, Mutate}, fungibles::{ - approvals::{self, Inspect as _}, + approvals::{self, Inspect as _, Mutate as _}, metadata::{self, Inspect as _}, Create, Inspect as _, Mutate as _, }, @@ -92,6 +92,42 @@ mod benchmarks { assert_eq!(>::balance(token, &to), value); } + #[benchmark] + fn transfer_from() { + let owner = >::to_account_id(&ALICE_ADDR); + let token = super::create::(owner.clone()); + let spender = >::to_account_id(&BOB_ADDR); + let to = >::to_account_id(&CHARLIE_ADDR); + let value: AssetsBalance = u32::MAX.into(); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(spender.clone())); + let mut ext = call_setup.ext().0; + let input = IFungiblesCalls::transferFrom(IFungibles::transferFromCall { + token: token.clone().into(), + from: >::to_address(&owner).0.into(), + to: >::to_address(&to).0.into(), + value: alloy::U256::from(value), + }); + + >::set_balance(token.clone(), &owner, value); + assert_eq!(>::balance(token.clone(), &owner), value); + assert_eq!(>::balance(token.clone(), &spender), 0u8.into()); + assert_eq!(>::balance(token.clone(), &to), 0u8.into()); + assert_ok!(>::approve(token.clone(), &owner, &spender, value)); + assert_eq!(>::allowance(token.clone(), &owner, &spender), value); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + assert_eq!(>::balance(token.clone(), &owner), 0u8.into()); + assert_eq!(>::balance(token.clone(), &spender), 0u8.into()); + assert_eq!(>::balance(token.clone(), &to), value); + assert_eq!(>::allowance(token, &owner, &spender), 0u8.into()); + } + // Parameter: // - 'a': whether `approve_transfer` is required. // - 'c': whether `cancel_approval` is required. diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 950e40672..fc7dbdb70 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -67,7 +67,7 @@ where Ok(transferCall::abi_encode_returns(&transferReturn {})) }, IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::transfer_from())?; transfer_from::( to_runtime_origin(env.caller()), @@ -77,12 +77,8 @@ where value.saturating_to(), )?; - let value = *value; - deposit_event( - env, - address, - Transfer { token: *token, from: *from, to: *to, value }, - ); + let event = Transfer { token: *token, from: *from, to: *to, value: *value }; + deposit_event(env, address, event); Ok(transferFromCall::abi_encode_returns(&transferFromReturn {})) }, IFungiblesCalls::approve(approveCall { token, spender, value }) => { diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index a76ece18d..0705da275 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -32,6 +32,7 @@ use core::marker::PhantomData; /// Weight functions needed for `pallet_api_vnext::fungibles`. pub trait WeightInfo { fn transfer() -> Weight; + fn transfer_from() -> Weight; fn approve(a: u32, c: u32, ) -> Weight; fn create() -> Weight; fn start_destroy() -> Weight; @@ -64,10 +65,29 @@ impl WeightInfo for SubstrateWeight { // Measured: `781` // Estimated: `6208` // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(48_000_000, 6208) + Weight::from_parts(49_000_000, 6208) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } + /// Storage: `Revive::OriginalAccount` (r:2 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:1) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:2) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn transfer_from() -> Weight { + // Proof Size summary in bytes: + // Measured: `951` + // Estimated: `6208` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(69_000_000, 6208) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `Assets::Approvals` (r:1 w:1) @@ -81,11 +101,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(6_576_530, 3675) - // Standard Error: 127_016 - .saturating_add(Weight::from_parts(22_054_081, 0).saturating_mul(a.into())) - // Standard Error: 127_016 - .saturating_add(Weight::from_parts(36_419_387, 0).saturating_mul(c.into())) + Weight::from_parts(7_862_244, 3675) + // Standard Error: 43_634 + .saturating_add(Weight::from_parts(20_137_755, 0).saturating_mul(a.into())) + // Standard Error: 43_634 + .saturating_add(Weight::from_parts(35_150_000, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -99,8 +119,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 3675) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -123,8 +143,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 3675) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -137,7 +157,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `645` // Estimated: `3675` // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + Weight::from_parts(29_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -153,8 +173,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -170,8 +190,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 38_000_000 picoseconds. - Weight::from_parts(39_000_000, 3675) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(41_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -182,7 +202,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -193,7 +213,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) } @@ -266,10 +286,29 @@ impl WeightInfo for () { // Measured: `781` // Estimated: `6208` // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(48_000_000, 6208) + Weight::from_parts(49_000_000, 6208) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } + /// Storage: `Revive::OriginalAccount` (r:2 w:0) + /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Approvals` (r:1 w:1) + /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:2) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn transfer_from() -> Weight { + // Proof Size summary in bytes: + // Measured: `951` + // Estimated: `6208` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(69_000_000, 6208) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) + } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `Assets::Approvals` (r:1 w:1) @@ -283,11 +322,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(6_576_530, 3675) - // Standard Error: 127_016 - .saturating_add(Weight::from_parts(22_054_081, 0).saturating_mul(a.into())) - // Standard Error: 127_016 - .saturating_add(Weight::from_parts(36_419_387, 0).saturating_mul(c.into())) + Weight::from_parts(7_862_244, 3675) + // Standard Error: 43_634 + .saturating_add(Weight::from_parts(20_137_755, 0).saturating_mul(a.into())) + // Standard Error: 43_634 + .saturating_add(Weight::from_parts(35_150_000, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -301,8 +340,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3675` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 3675) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -325,8 +364,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `505` // Estimated: `3675` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 3675) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -339,7 +378,7 @@ impl WeightInfo for () { // Measured: `645` // Estimated: `3675` // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + Weight::from_parts(29_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -355,8 +394,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `584` // Estimated: `3675` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 3675) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -372,8 +411,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 38_000_000 picoseconds. - Weight::from_parts(39_000_000, 3675) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(41_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -384,7 +423,7 @@ impl WeightInfo for () { // Measured: `300` // Estimated: `3675` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 3675) + Weight::from_parts(5_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) @@ -395,7 +434,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `346` // Estimated: `3599` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) } From 56974d226d35cc3d51a5b1ccb6accc303f188444 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 16:49:55 +0100 Subject: [PATCH 112/162] refactor(api/fungibles/benchmarking): add copy trait bound to asset id to eliminate manual clones --- .../api-vnext/src/fungibles/benchmarking.rs | 79 ++++++++++--------- pallets/api-vnext/src/fungibles/weights.rs | 68 ++++++++-------- 2 files changed, 74 insertions(+), 73 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index 3d1cdb30f..a3425e6d7 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -57,7 +57,7 @@ type TokenId = >::AssetId; Time: Time> >, // Fungibles - T: pallet_assets::Config + Into>, + T: pallet_assets::Config + Into + Copy>, alloy::U256: UintTryFrom> + UintTryTo> )] mod benchmarks { @@ -74,21 +74,21 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::transfer(IFungibles::transferCall { - token: token.clone().into(), + token: token.into(), to: >::to_address(&to).0.into(), value: alloy::U256::from(value), }); - >::set_balance(token.clone(), &owner, value); - assert_eq!(>::balance(token.clone(), &owner), value); - assert_eq!(>::balance(token.clone(), &to), 0u8.into()); + >::set_balance(token, &owner, value); + assert_eq!(>::balance(token, &owner), value); + assert_eq!(>::balance(token, &to), 0u8.into()); #[block] { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert_eq!(>::balance(token.clone(), &owner), 0u8.into()); + assert_eq!(>::balance(token, &owner), 0u8.into()); assert_eq!(>::balance(token, &to), value); } @@ -104,27 +104,27 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(spender.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::transferFrom(IFungibles::transferFromCall { - token: token.clone().into(), + token: token.into(), from: >::to_address(&owner).0.into(), to: >::to_address(&to).0.into(), value: alloy::U256::from(value), }); - >::set_balance(token.clone(), &owner, value); - assert_eq!(>::balance(token.clone(), &owner), value); - assert_eq!(>::balance(token.clone(), &spender), 0u8.into()); - assert_eq!(>::balance(token.clone(), &to), 0u8.into()); - assert_ok!(>::approve(token.clone(), &owner, &spender, value)); - assert_eq!(>::allowance(token.clone(), &owner, &spender), value); + >::set_balance(token, &owner, value); + assert_eq!(>::balance(token, &owner), value); + assert_eq!(>::balance(token, &spender), 0u8.into()); + assert_eq!(>::balance(token, &to), 0u8.into()); + assert_ok!(>::approve(token, &owner, &spender, value)); + assert_eq!(>::allowance(token, &owner, &spender), value); #[block] { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert_eq!(>::balance(token.clone(), &owner), 0u8.into()); - assert_eq!(>::balance(token.clone(), &spender), 0u8.into()); - assert_eq!(>::balance(token.clone(), &to), value); + assert_eq!(>::balance(token, &owner), 0u8.into()); + assert_eq!(>::balance(token, &spender), 0u8.into()); + assert_eq!(>::balance(token, &to), value); assert_eq!(>::allowance(token, &owner, &spender), 0u8.into()); } @@ -140,7 +140,7 @@ mod benchmarks { // Set the `current_allowance`. >::set_balance(&owner, u32::MAX.into()); assert_ok!( as approvals::Mutate>::approve( - token.clone(), + token, &owner, &spender, current_allowance, @@ -161,7 +161,7 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::approve(IFungibles::approveCall { - token: token.clone().into(), + token: token.into(), spender: >::to_address(&spender).0.into(), value: alloy::U256::from(approval_value), }); @@ -171,11 +171,11 @@ mod benchmarks { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert_eq!(>::allowance(token.clone(), &owner, &spender), approval_value); + assert_eq!(>::allowance(token, &owner, &spender), approval_value); if c == 1 { assert_has_event::( pallet_assets::Event::ApprovalCancelled { - asset_id: token.clone(), + asset_id: token, owner: owner.clone(), delegate: spender.clone(), } @@ -232,18 +232,17 @@ mod benchmarks { let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::startDestroy(IFungibles::startDestroyCall { - token: token.clone().into(), - }); + let input = + IFungiblesCalls::startDestroy(IFungibles::startDestroyCall { token: token.into() }); - assert_eq!(>::get(token.clone()).unwrap().status, AssetStatus::Live); + assert_eq!(>::get(token).unwrap().status, AssetStatus::Live); #[block] { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert_eq!(>::get(token.clone()).unwrap().status, AssetStatus::Destroying); + assert_eq!(>::get(token).unwrap().status, AssetStatus::Destroying); } #[benchmark] @@ -259,7 +258,7 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::setMetadata(IFungibles::setMetadataCall { - token: token.clone().into(), + token: token.into(), name: String::from_utf8_lossy(&name).to_string(), symbol: String::from_utf8_lossy(&symbol).to_string(), decimals, @@ -270,8 +269,8 @@ mod benchmarks { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert_eq!(>::name(token.clone()), name); - assert_eq!(>::symbol(token.clone()), symbol); + assert_eq!(>::name(token), name); + assert_eq!(>::symbol(token), symbol); assert_eq!(>::decimals(token), decimals); } @@ -282,17 +281,16 @@ mod benchmarks { let mut call_setup = set_up_call(); call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; - let input = IFungiblesCalls::clearMetadata(IFungibles::clearMetadataCall { - token: token.clone().into(), - }); + let input = + IFungiblesCalls::clearMetadata(IFungibles::clearMetadataCall { token: token.into() }); #[block] { assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); } - assert!(>::name(token.clone()).is_empty()); - assert!(>::symbol(token.clone()).is_empty()); + assert!(>::name(token).is_empty()); + assert!(>::symbol(token).is_empty()); assert_eq!(>::decimals(token), 0); } @@ -307,7 +305,7 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::mint(IFungibles::mintCall { - token: token.clone().into(), + token: token.into(), account: >::to_address(&account).0.into(), value: alloy::U256::from(value), }); @@ -331,12 +329,12 @@ mod benchmarks { call_setup.set_origin(Origin::Signed(owner.clone())); let mut ext = call_setup.ext().0; let input = IFungiblesCalls::burn(IFungibles::burnCall { - token: token.clone().into(), + token: token.into(), account: >::to_address(&account).0.into(), value: alloy::U256::from(value), }); - >::set_balance(token.clone(), &account, value); + >::set_balance(token, &account, value); #[block] { @@ -457,13 +455,16 @@ fn assert_has_event, I>( frame_system::Pallet::::assert_has_event(event.into()); } -fn create + pallet_assets::Config + pallet_revive::Config, I>( +fn create< + T: Config + pallet_assets::Config + pallet_revive::Config, + I, +>( owner: T::AccountId, ) -> TokenId { let token = NextAssetId::::get().unwrap_or_default(); >::set_balance(&owner, u32::MAX.into()); assert_ok!( as Create>::create( - token.clone(), + token, owner.clone(), true, 1u32.into() @@ -471,7 +472,7 @@ fn create + pallet_assets::Config + pallet_rev let max = AssetsStringLimit::::get() as usize; assert_ok!( as metadata::Mutate>::set( - token.clone(), + token, &owner, vec![255u8; max], vec![255u8; max], diff --git a/pallets/api-vnext/src/fungibles/weights.rs b/pallets/api-vnext/src/fungibles/weights.rs index 0705da275..2cc996118 100644 --- a/pallets/api-vnext/src/fungibles/weights.rs +++ b/pallets/api-vnext/src/fungibles/weights.rs @@ -65,7 +65,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `781` // Estimated: `6208` // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(49_000_000, 6208) + Weight::from_parts(47_000_000, 6208) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -83,8 +83,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `951` // Estimated: `6208` - // Minimum execution time: 68_000_000 picoseconds. - Weight::from_parts(69_000_000, 6208) + // Minimum execution time: 67_000_000 picoseconds. + Weight::from_parts(68_000_000, 6208) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -101,11 +101,11 @@ impl WeightInfo for SubstrateWeight { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_862_244, 3675) - // Standard Error: 43_634 - .saturating_add(Weight::from_parts(20_137_755, 0).saturating_mul(a.into())) - // Standard Error: 43_634 - .saturating_add(Weight::from_parts(35_150_000, 0).saturating_mul(c.into())) + Weight::from_parts(8_044_897, 3675) + // Standard Error: 78_152 + .saturating_add(Weight::from_parts(19_955_102, 0).saturating_mul(a.into())) + // Standard Error: 78_152 + .saturating_add(Weight::from_parts(34_600_000, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -120,7 +120,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `471` // Estimated: `3675` // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(33_000_000, 3675) + Weight::from_parts(34_000_000, 3675) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -130,7 +130,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 10_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(11_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -156,7 +156,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 29_000_000 picoseconds. + // Minimum execution time: 28_000_000 picoseconds. Weight::from_parts(29_000_000, 3675) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -190,8 +190,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 3675) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(40_000_000, 3675) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -226,7 +226,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 6044) + Weight::from_parts(10_000_000, 6044) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -235,7 +235,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -245,7 +245,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(T::DbWeight::get().reads(1_u64)) } @@ -266,7 +266,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `139` // Estimated: `3675` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(4_000_000, 3675) .saturating_add(T::DbWeight::get().reads(1_u64)) } } @@ -286,7 +286,7 @@ impl WeightInfo for () { // Measured: `781` // Estimated: `6208` // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(49_000_000, 6208) + Weight::from_parts(47_000_000, 6208) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -304,8 +304,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `951` // Estimated: `6208` - // Minimum execution time: 68_000_000 picoseconds. - Weight::from_parts(69_000_000, 6208) + // Minimum execution time: 67_000_000 picoseconds. + Weight::from_parts(68_000_000, 6208) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -322,11 +322,11 @@ impl WeightInfo for () { // Measured: `699 + c * (140 ±0)` // Estimated: `3675` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(7_862_244, 3675) - // Standard Error: 43_634 - .saturating_add(Weight::from_parts(20_137_755, 0).saturating_mul(a.into())) - // Standard Error: 43_634 - .saturating_add(Weight::from_parts(35_150_000, 0).saturating_mul(c.into())) + Weight::from_parts(8_044_897, 3675) + // Standard Error: 78_152 + .saturating_add(Weight::from_parts(19_955_102, 0).saturating_mul(a.into())) + // Standard Error: 78_152 + .saturating_add(Weight::from_parts(34_600_000, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -341,7 +341,7 @@ impl WeightInfo for () { // Measured: `471` // Estimated: `3675` // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(33_000_000, 3675) + Weight::from_parts(34_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -351,7 +351,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3675` - // Minimum execution time: 10_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(11_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -377,7 +377,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `645` // Estimated: `3675` - // Minimum execution time: 29_000_000 picoseconds. + // Minimum execution time: 28_000_000 picoseconds. Weight::from_parts(29_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -411,8 +411,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `3675` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 3675) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(40_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -447,7 +447,7 @@ impl WeightInfo for () { // Measured: `291` // Estimated: `6044` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 6044) + Weight::from_parts(10_000_000, 6044) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Assets::Metadata` (r:1 w:0) @@ -456,7 +456,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -466,7 +466,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `267` // Estimated: `3605` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 3605) .saturating_add(RocksDbWeight::get().reads(1_u64)) } @@ -487,7 +487,7 @@ impl WeightInfo for () { // Measured: `139` // Estimated: `3675` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(5_000_000, 3675) + Weight::from_parts(4_000_000, 3675) .saturating_add(RocksDbWeight::get().reads(1_u64)) } } From 63dd8b862db389413bd94242629e12a4efcecc89 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 16:55:10 +0100 Subject: [PATCH 113/162] refactor(api/fungibles): refund appropriate burn weight on failure --- .../api-vnext/src/fungibles/precompiles/mod.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index fc7dbdb70..d3cd8937d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -222,15 +222,24 @@ where Ok(mintCall::abi_encode_returns(&mintReturn {})) }, IFungiblesCalls::burn(burnCall { token, account, value }) => { - env.charge(>::WeightInfo::burn())?; + let charged = env.charge(>::WeightInfo::burn())?; self::burn::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*account.0).into()), value.saturating_to(), - ) // TODO: adjust weight - .map_err(|e| e.error)?; + ) + .map_err(|e| { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + e.error + })?; let from = account; let to = Address::default(); From 187d2f4461a420b38591d1c763b91db532732c3d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 17:00:11 +0100 Subject: [PATCH 114/162] style(api/fungibles): formatting --- .../src/fungibles/precompiles/mod.rs | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index d3cd8937d..39f133a51 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -59,11 +59,8 @@ where value.saturating_to(), )?; - deposit_event( - env, - address, - Transfer { token: *token, from, to: *to, value: *value }, - ); + let event = Transfer { token: *token, from, to: *to, value: *value }; + deposit_event(env, address, event); Ok(transferCall::abi_encode_returns(&transferReturn {})) }, IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { @@ -100,12 +97,8 @@ where .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); } - let spender = *spender; - deposit_event( - env, - address, - Approval { token: *token, owner, spender, value: *value }, - ); + let event = Approval { token: *token, owner, spender: *spender, value: *value }; + deposit_event(env, address, event); Ok(approveCall::abi_encode_returns(&approveReturn {})) }, IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { @@ -187,11 +180,14 @@ where }, IFungiblesCalls::startDestroy(startDestroyCall { token }) => { env.charge(>::WeightInfo::start_destroy())?; + start_destroy::(to_runtime_origin(env.caller()), (*token).into())?; + Ok(startDestroyCall::abi_encode_returns(&startDestroyReturn {})) }, IFungiblesCalls::setMetadata(setMetadataCall { token, name, symbol, decimals }) => { env.charge(>::WeightInfo::set_metadata())?; + set_metadata::( to_runtime_origin(env.caller()), (*token).into(), @@ -199,10 +195,12 @@ where symbol.as_bytes().to_vec(), *decimals, )?; + Ok(setMetadataCall::abi_encode_returns(&setMetadataReturn {})) }, IFungiblesCalls::clearMetadata(clearMetadataCall { token }) => { env.charge(>::WeightInfo::clear_metadata())?; + clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn {})) }, @@ -241,56 +239,66 @@ where e.error })?; - let from = account; let to = Address::default(); - deposit_event( - env, - address, - Transfer { token: *token, from: *from, to, value: *value }, - ); + let event = Transfer { token: *token, from: *account, to, value: *value }; + deposit_event(env, address, event); Ok(burnCall::abi_encode_returns(&burnReturn {})) }, IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { env.charge(>::WeightInfo::total_supply())?; + let total_supply = U256::saturating_from(>::total_supply((*token).into())); + Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, IFungiblesCalls::balanceOf(balanceOfCall { token, owner }) => { env.charge(>::WeightInfo::balance_of())?; + let account = env.to_account_id(&(*owner.0).into()); let balance = U256::saturating_from(>::balance((*token).into(), account)); + Ok(balanceOfCall::abi_encode_returns(&balance)) }, IFungiblesCalls::allowance(allowanceCall { token, owner, spender }) => { env.charge(>::WeightInfo::allowance())?; + let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); let allowance = >::allowance((*token).into(), &owner, &spender); let remaining = U256::saturating_from(allowance); + Ok(allowanceCall::abi_encode_returns(&remaining)) }, IFungiblesCalls::name(nameCall { token }) => { env.charge(>::WeightInfo::metadata_name())?; + let result = >::name((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::symbol(symbolCall { token }) => { env.charge(>::WeightInfo::metadata_symbol())?; + let result = >::symbol((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, IFungiblesCalls::decimals(decimalsCall { token }) => { env.charge(>::WeightInfo::metadata_decimals())?; + let result = >::decimals((*token).into()); + Ok(decimalsCall::abi_encode_returns(&result)) }, IFungiblesCalls::exists(existsCall { token }) => { env.charge(>::WeightInfo::exists())?; + let result = self::exists::((*token).into()); + Ok(existsCall::abi_encode_returns(&result)) }, } From a54a161a560fcdc7a46478e23c925978c31bd570 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 25 Jun 2025 17:10:17 +0100 Subject: [PATCH 115/162] refactor(api/fungibles/erc20): charge benchmarked weight Uses benchmarks from the fungibles precompile which should be exactly the same for these functions. --- .../src/fungibles/precompiles/erc20.rs | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 9476bba1c..656b77745 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -5,13 +5,14 @@ use frame_support::{ traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, }; use pallet_assets::precompiles::{AssetIdExtractor, InlineAssetIdExtractor}; -use pallet_revive::AddressMapper as _; +use pallet_revive::{precompiles::RuntimeCosts, AddressMapper as _}; use AddressMatcher::Prefix; use IERC20::*; use super::{ - deposit_event, prefixed_address, sol, to_runtime_origin, AddressMapper, AddressMatcher, Assets, - Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, UintTryFrom, UintTryTo, U256, + deposit_event, prefixed_address, sol, to_runtime_origin, weights::WeightInfo, AddressMapper, + AddressMatcher, Assets, Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, + UintTryFrom, UintTryTo, U256, }; sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); @@ -48,18 +49,22 @@ where match input { // IERC20 totalSupply(_) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::total_supply())?; + let total_supply = U256::saturating_from(>::total_supply(token)); + Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, balanceOf(balanceOfCall { account }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::balance_of())?; + let account = env.to_account_id(&(*account.0).into()); let balance = U256::saturating_from(>::balance(token, account)); + Ok(balanceOfCall::abi_encode_returns(&balance)) }, transfer(transferCall { to, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::transfer())?; let from = >::to_address(env.caller().account_id()?).0.into(); super::transfer::( @@ -73,18 +78,20 @@ where Ok(transferCall::abi_encode_returns(&true)) }, allowance(allowanceCall { owner, spender }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::allowance())?; + let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); let remaining = U256::saturating_from(>::allowance(token, &owner, &spender)); + Ok(allowanceCall::abi_encode_returns(&remaining)) }, approve(approveCall { spender, value }) => { - // TODO: charge based on benchmarked weight + let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - super::approve::( + let result = super::approve::( to_runtime_origin(env.caller()), token, env.to_account_id(&(*spender.0).into()), @@ -92,12 +99,19 @@ where ) // TODO: adjust weight .map_err(|e| e.error)?; + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + let event = Approval { owner, spender: *spender, value: *value }; deposit_event(env, address, event); Ok(approveCall::abi_encode_returns(&true)) }, transferFrom(transferFromCall { from, to, value }) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::transfer_from())?; super::transfer_from::( to_runtime_origin(env.caller()), @@ -112,20 +126,26 @@ where }, // IERC20Metadata name(_) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::metadata_name())?; + let result = >::name(token); let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(nameCall::abi_encode_returns(&result)) }, symbol(_) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::metadata_symbol())?; + let result = >::symbol(token); let result = String::from_utf8_lossy(result.as_slice()).into(); + Ok(symbolCall::abi_encode_returns(&result)) }, decimals(_) => { - // TODO: charge based on benchmarked weight + env.charge(>::WeightInfo::metadata_decimals())?; + let result = >::decimals(token); + Ok(decimalsCall::abi_encode_returns(&result)) }, } From 9d6e22fefb4941e513cf7f3f9891333e51ee71db Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 07:32:41 +0100 Subject: [PATCH 116/162] chore(api): add cargo.lock --- pop-api-vnext/Cargo.lock | 6225 ++++++++++++++++ .../contracts/fungibles/Cargo.lock | 6233 +++++++++++++++++ 2 files changed, 12458 insertions(+) create mode 100644 pop-api-vnext/Cargo.lock create mode 100644 pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock diff --git a/pop-api-vnext/Cargo.lock b/pop-api-vnext/Cargo.lock new file mode 100644 index 000000000..d024ae0fb --- /dev/null +++ b/pop-api-vnext/Cargo.lock @@ -0,0 +1,6225 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy-core" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8bcce99ad10fe02640cfaec1c6bc809b837c783c1d52906aa5af66e2a196f6" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-rlp", + "alloy-sol-types 0.8.25", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "alloy-sol-types 0.8.25", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" +dependencies = [ + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-abi" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15516116086325c157c18261d768a20677f0f699348000ed391d4ad0dcb82530" +dependencies = [ + "alloy-primitives 1.2.1", + "alloy-sol-type-parser 1.2.1", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.4", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6177ed26655d4e84e00b65cb494d4e0b8830e7cae7ef5d63087d445a2600fb55" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.4", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.1", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" +dependencies = [ + "alloy-sol-macro-expander 0.8.25", + "alloy-sol-macro-input 0.8.25", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a14f21d053aea4c6630687c2f4ad614bed4c81e14737a9b904798b24f30ea849" +dependencies = [ + "alloy-sol-macro-expander 1.2.1", + "alloy-sol-macro-input 1.2.1", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" +dependencies = [ + "alloy-sol-macro-input 0.8.25", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 0.8.25", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d99282e7c9ef14eb62727981a985a01869e586d1dec729d3bb33679094c100" +dependencies = [ + "alloy-sol-macro-input 1.2.1", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 1.2.1", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 0.8.25", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda029f955b78e493360ee1d7bd11e1ab9f2a220a5715449babc79d6d0a01105" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 1.2.1", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d162f8524adfdfb0e4bd0505c734c985f3e2474eb022af32eef0d52a4f3935c" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10db1bd7baa35bc8d4a1b07efbf734e73e5ba09f2580fb8cee3483a36087ceb2" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-macro 0.8.25", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58377025a47d8b8426b3e4846a251f2c1991033b27f517aade368146f6ab1dfe" +dependencies = [ + "alloy-json-abi 1.2.1", + "alloy-primitives 1.2.1", + "alloy-sol-macro 1.2.1", + "serde", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", +] + +[[package]] +name = "array-bytes" +version = "6.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" + +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "binary-merkle-tree" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181f5380e435b8ba6d901f8b16fc8908c6f0f8bea8973113d1c8718d89bb1809" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", +] + +[[package]] +name = "bip32" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" +dependencies = [ + "bs58", + "hmac 0.12.1", + "k256", + "rand_core 0.6.4", + "ripemd", + "secp256k1 0.27.0", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "bip39" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bounded-collections" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2 0.10.9", + "tinyvec", +] + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.26", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + +[[package]] +name = "const-hex" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.16", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "const_env" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9e4f72c6e3398ca6da372abd9affd8f89781fe728869bbf986206e9af9627e" +dependencies = [ + "const_env_impl", +] + +[[package]] +name = "const_env_impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f51209740b5e1589e702b3044cdd4562cef41b6da404904192ffffb852d62" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.104", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive-where" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510c292c8cf384b1a340b816a9a6cf2599eb8f566a44949024af88418000c50b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.104", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docify" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.104", + "termcolor", + "toml", + "walkdir", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clonable" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core 0.6.4", + "sha2 0.10.9", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "ethabi-decode" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52029c4087f9f01108f851d0d02df9c21feb5660a19713466724b7f95bd2d773" +dependencies = [ + "ethereum-types", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde", + "primitive-types 0.13.1", + "scale-info", + "uint 0.10.0", +] + +[[package]] +name = "expander" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" +dependencies = [ + "blake2", + "file-guard", + "fs-err", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-guard" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "frame-benchmarking" +version = "40.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9e5fcdb30bb83b2d97d7e718127230e0fbbad82b9c32dedf63971f08709def" +dependencies = [ + "frame-support", + "frame-support-procedural", + "frame-system", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-storage", + "static_assertions", +] + +[[package]] +name = "frame-decode" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6027a409bac4fe95b4d107f965fcdbc252fc89d884a360d076b3070b6128c094" +dependencies = [ + "frame-metadata 17.0.0", + "parity-scale-codec", + "scale-decode 0.14.0", + "scale-info", + "scale-type-resolver", + "sp-crypto-hashing", +] + +[[package]] +name = "frame-metadata" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701bac17e9b55e0f95067c428ebcb46496587f08e8cf4ccc0fe5903bea10dbb8" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" +dependencies = [ + "aquamarine", + "array-bytes", + "binary-merkle-tree", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata 20.0.0", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-metadata-ir", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "33.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "docify", + "expander", + "frame-support-procedural-tools", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.104", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "13.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "frame-system" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc20d95c35bad22eb8b8d7ef91197a439483458237b176e621d9210f2fbff15" +dependencies = [ + "cfg-if", + "docify", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-version", + "sp-weights", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand 0.8.5", + "rand_core 0.6.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "foldhash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + +[[package]] +name = "impl-rlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" +dependencies = [ + "rlp 0.6.1", +] + +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.4", + "serde", +] + +[[package]] +name = "ink" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "const_format", + "deranged", + "derive_more 2.0.1", + "ink_env", + "ink_macro", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "keccak-const", + "linkme", + "pallet-revive-uapi", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-info", + "sp-io", + "sp-runtime-interface", + "staging-xcm", +] + +[[package]] +name = "ink_allocator" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_codegen" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "derive_more 2.0.1", + "either", + "heck", + "impl-serde", + "ink_ir", + "ink_primitives", + "itertools 0.14.0", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.104", +] + +[[package]] +name = "ink_engine" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_primitives", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", +] + +[[package]] +name = "ink_env" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "cfg-if", + "const_env", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_allocator", + "ink_engine", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "num-traits", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "schnorrkel", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", + "sp-io", + "sp-runtime-interface", + "staging-xcm", + "static_assertions", +] + +[[package]] +name = "ink_ir" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "either", + "impl-serde", + "ink_prelude", + "itertools 0.14.0", + "proc-macro2", + "quote", + "sha3", + "syn 2.0.104", +] + +[[package]] +name = "ink_macro" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "ink_codegen", + "ink_ir", + "ink_primitives", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.104", + "synstructure", +] + +[[package]] +name = "ink_metadata" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "derive_more 2.0.1", + "impl-serde", + "ink_prelude", + "ink_primitives", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_primitives" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "alloy-sol-types 1.2.1", + "cfg-if", + "derive_more 2.0.1", + "impl-trait-for-tuples", + "ink_prelude", + "itertools 0.14.0", + "num-traits", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "paste", + "primitive-types 0.13.1", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime-interface", + "xxhash-rust", +] + +[[package]] +name = "ink_storage" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "array-init", + "cfg-if", + "derive_more 2.0.1", + "ink_env", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "pallet-revive-uapi", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_storage_traits" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "ink_metadata", + "ink_prelude", + "ink_primitives", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime-interface", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2 0.10.9", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "keccak-const" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" + +[[package]] +name = "keccak-hash" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" +dependencies = [ + "primitive-types 0.13.1", + "tiny-keccak", +] + +[[package]] +name = "konst" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330f0e13e6483b8c34885f7e6c9f19b1a7bd449c673fbb948a51c99d66ef74f4" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linkme" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b1703c00b2a6a70738920544aa51652532cacddfec2e162d2e29eae01e665c" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d55ca5d5a14363da83bf3c33874b8feaa34653e760d5216d7ef9829c88001a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "linregress" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9eda9dcf4f2a99787827661f312ac3219292549c2ee992bf9a6248ffb066bf7" +dependencies = [ + "nalgebra", +] + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "nalgebra" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" +dependencies = [ + "approx", + "matrixmultiply", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pallet-asset-conversion" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e063e39ad8ecd3c2b00c963f50cdf79e614c819a01e1c1ce9993287075b1b4d9" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-revive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "895fe6f50f621a69132697b8b43d29d1db4d9ff445eec410bf1fc98cd7e9412c" +dependencies = [ + "alloy-core", + "derive_more 0.99.20", + "environmental", + "ethabi-decode", + "ethereum-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "num-bigint", + "num-integer", + "num-traits", + "pallet-revive-fixtures", + "pallet-revive-proc-macro", + "pallet-revive-uapi", + "pallet-transaction-payment", + "parity-scale-codec", + "paste", + "polkavm", + "polkavm-common 0.21.0", + "rand 0.8.5", + "ripemd", + "rlp 0.6.1", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-io", + "sp-runtime", + "staging-xcm", + "staging-xcm-builder", + "substrate-bn", + "subxt-signer", +] + +[[package]] +name = "pallet-revive-fixtures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1df19ca809f036d6ddf1632039e9db312f92dbe8f9390e6722ad808cd95377" +dependencies = [ + "anyhow", + "cargo_metadata", + "pallet-revive-uapi", + "polkavm-linker", + "sp-core", + "sp-io", + "toml", +] + +[[package]] +name = "pallet-revive-proc-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c2dc2fc6961da23fefc54689ce81a8e006f6988bc465dcc9ab9db905d31766" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "pallet-revive-uapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb8f45102c6279f59f55e0051fc6c26b996619d7842800dfaf3a2583459a1c7" +dependencies = [ + "bitflags 1.3.2", + "pallet-revive-proc-macro", + "parity-scale-codec", + "polkavm-derive 0.21.0", + "scale-info", +] + +[[package]] +name = "pallet-transaction-payment" +version = "40.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ebd61b64848e39e5615832c964dc10b63bcebff26a9ec1cb867b4087240a03" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "bytes", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash", +] + +[[package]] +name = "pest" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "polkadot-core-primitives" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7c519ee804fd08d7464871bd2fe164e8f0683501ea59d2a10f5ef214dacb3b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "polkadot-parachain-primitives" +version = "16.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72943c0948c686b47bacb1a03e59baff63bfba2e16e208d77f0f8615827f8564" +dependencies = [ + "bounded-collections", + "derive_more 0.99.20", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb819108697967452fa6d8d96ab4c0d48cbaa423b3156499dcb24f1cf95d6775" +dependencies = [ + "sp-crypto-hashing", +] + +[[package]] +name = "polkavm" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd34e2f74206fff33482ae1718e275f11365ef8c4de7f0e69217f8845303867" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common 0.21.0", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f512bc80cb10439391a7c13a9eb2d37cf66b7305e7df0a06d662eff4f5b07625" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-common" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" + +[[package]] +name = "polkavm-common" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c16b809cfd398f861261c045a8745e6c78b71ea7e0d3ef6f7cc553eb27bc17e" +dependencies = [ + "blake3", + "log", + "polkavm-assembler", +] + +[[package]] +name = "polkavm-common" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538810ffdaa629113b9f436f43ba487a6cceacc04a769ac3cdcd32fcf87351cd" + +[[package]] +name = "polkavm-derive" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +dependencies = [ + "polkavm-derive-impl-macro 0.18.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47239245f87329541932c0d7fec750a66a75b13aa87dfe4fbfd637bab86ad387" +dependencies = [ + "polkavm-derive-impl-macro 0.21.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e819eaea986d6a3de2a08840f0cc188db3c318b30f9bb1deb416d8c4beb2ed14" +dependencies = [ + "polkavm-derive-impl-macro 0.22.0", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" +dependencies = [ + "polkavm-common 0.18.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fd6c6215450c3e57511df5c38a82eb4bde208de15ee15046ac33852f3c3eaa" +dependencies = [ + "polkavm-common 0.21.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414507a0a7c9451cc81336ef1f5ccbab8fa4aeda402668735aa28331867bd3ef" +dependencies = [ + "polkavm-common 0.22.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +dependencies = [ + "polkavm-derive-impl 0.18.1", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36837f6b7edfd6f4498f8d25d81da16cf03bd6992c3e56f3d477dfc90f4fefca" +dependencies = [ + "polkavm-derive-impl 0.21.0", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad6a5df4cc6466a219386b04d8bd267ba772f9458a8e9aa7539757ca5b11e2aa" +dependencies = [ + "polkavm-derive-impl 0.22.0", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-linker" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bc764986c4a63f9ab9890c3f4eb9b4c13b6ff80d79685bd48ade147234aab4" +dependencies = [ + "dirs", + "gimli", + "hashbrown 0.14.5", + "log", + "object", + "polkavm-common 0.21.0", + "regalloc2", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linux-raw" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be6cd1d48c5e7814d287a3e12a339386a5dfa2f3ac72f932335f4cf56467f1b3" + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "pop-api" +version = "0.1.0" +dependencies = [ + "alloy-sol-types 1.2.1", + "hex", + "ink", + "pop-primitives", +] + +[[package]] +name = "pop-primitives" +version = "0.0.0" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" +dependencies = [ + "proc-macro2", + "syn 2.0.104", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec 0.6.0", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.1", + "impl-num-traits", + "impl-rlp", + "impl-serde", + "scale-info", + "uint 0.10.0", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro-warning" +version = "1.84.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.9.1", + "lazy_static", + "num-traits", + "rand 0.9.1", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "serde", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", + "serde", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash 1.1.0", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.2", + "proptest", + "rand 0.8.5", + "rand 0.9.1", + "rlp 0.5.2", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-demangle" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scale-bits" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver", + "serde", +] + +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver", +] + +[[package]] +name = "scale-decode" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode-derive 0.14.0", + "scale-type-resolver", + "smallvec", +] + +[[package]] +name = "scale-decode" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +dependencies = [ + "parity-scale-codec", + "scale-bits 0.7.0", + "scale-decode-derive 0.16.0", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-decode-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed9401effa946b493f9f84dc03714cca98119b230497df6f3df6b84a2b03648" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-decode-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-encode" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-encode-derive 0.8.0", + "scale-type-resolver", + "smallvec", +] + +[[package]] +name = "scale-encode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +dependencies = [ + "parity-scale-codec", + "scale-encode-derive 0.10.0", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-encode-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102fbc6236de6c53906c0b262f12c7aa69c2bdc604862c12728f5f4d370bc137" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-encode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-info" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more 1.0.0", + "parity-scale-codec", + "scale-info-derive", + "schemars", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-value" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e0ef2a0ee1e02a69ada37feb87ea1616ce9808aca072befe2d3131bf28576e" +dependencies = [ + "derive_more 1.0.0", + "either", + "parity-scale-codec", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-type-resolver", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.104", +] + +[[package]] +name = "schnellru" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead", + "arrayref", + "arrayvec", + "curve25519-dalek", + "getrandom_or_panic", + "merlin", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "password-hash", + "pbkdf2", + "salsa20", + "sha2 0.10.9", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys 0.8.1", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.8.5", + "secp256k1-sys 0.10.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + +[[package]] +name = "slab" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "sp-api" +version = "36.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "541da427f47dfb97f3dd0556fa3272bdc5dfa0d4c1ad53a22670a9bae4db63d7" +dependencies = [ + "docify", + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-externalities", + "sp-metadata-ir", + "sp-runtime", + "sp-runtime-interface", + "sp-state-machine", + "sp-trie", + "sp-version", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-api-proc-macro" +version = "22.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cedafdeaf15c774433ad8f5b00883bdf7d86e7c8b8e050e3439d4ae422114096" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-application-crypto" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba375ab65a76f7413d1bfe48122fd347ce7bd2047e36ecbbd78f12f5adaed121" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", +] + +[[package]] +name = "sp-arithmetic" +version = "26.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4f3b3414e7620ad72d0000b520e0570dca38dc63e160c95164ff3f789020cc1" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b54310103ae4f0e3228e217e2a9ccaca0d7c3502d3aa276623febf4c722ca397" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc83d9e7b1d58e1d020c20d7208b00d21fa73dcf92721114eae432b9f01e62d5" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-timestamp", +] + +[[package]] +name = "sp-core" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" +dependencies = [ + "ark-vrf", + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types 0.13.1", + "rand 0.8.5", + "scale-info", + "schnorrkel", + "secp256k1 0.28.2", + "secrecy 0.8.0", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.9", + "sha3", + "twox-hash", +] + +[[package]] +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +dependencies = [ + "quote", + "sp-crypto-hashing", + "syn 2.0.104", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-externalities" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-inherents" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-io" +version = "40.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "rustversion", + "secp256k1 0.28.2", + "sp-core", + "sp-crypto-hashing", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d1db25e362edbf5531b427d4bdfc2562bec6a031c3eb2a9145c0a0a01a572d" +dependencies = [ + "frame-metadata 20.0.0", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "sp-panic-handler" +version = "13.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" +dependencies = [ + "backtrace", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "41.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" +dependencies = [ + "binary-merkle-tree", + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-trie", + "sp-weights", + "tracing", + "tuplex", +] + +[[package]] +name = "sp-runtime-interface" +version = "29.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "primitive-types 0.13.1", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-staking" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-state-machine" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-trie", + "thiserror 1.0.69", + "tracing", + "trie-db", +] + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" + +[[package]] +name = "sp-storage" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + +[[package]] +name = "sp-timestamp" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176c77326c15425a15e085261161a9435f9a3c0d4bf61dae6dccf05b957a51c6" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents", + "sp-runtime", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-tracing" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6147a5b8c98b9ed4bf99dc033fab97a468b4645515460974c8784daeb7c35433" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-trie" +version = "39.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" +dependencies = [ + "ahash", + "hash-db", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "scale-info", + "schnellru", + "sp-core", + "sp-externalities", + "thiserror 1.0.69", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-version-proc-macro" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" +dependencies = [ + "parity-scale-codec", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-wasm-interface" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + +[[package]] +name = "sp-weights" +version = "31.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-debug-derive", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "staging-xcm" +version = "16.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0126278d7fc6d7dec55e5a109f838bbf401dd084aecf2597e4e11ea07515a0a" +dependencies = [ + "array-bytes", + "bounded-collections", + "derive-where", + "environmental", + "frame-support", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-weights", + "xcm-procedural", +] + +[[package]] +name = "staging-xcm-builder" +version = "20.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f031952c1496cf7f86d19ab38e3264be9a54b7d8eecb25ba69f977cc7549d08" +dependencies = [ + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", + "tracing", +] + +[[package]] +name = "staging-xcm-executor" +version = "19.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9bc315e8c7018fcfe0371ce4b7e726fb699e37b2acc3e5effb87a7d131a3ff" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "tracing", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2", + "schnorrkel", + "sha2 0.10.9", + "zeroize", +] + +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "subxt-core" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7a1bc6c9c1724971636a66e3225a7253cdb35bb6efb81524a6c71c04f08c59" +dependencies = [ + "base58", + "blake2", + "derive-where", + "frame-decode", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "hex", + "impl-serde", + "keccak-hash", + "parity-scale-codec", + "polkadot-sdk", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-value", + "serde", + "serde_json", + "subxt-metadata", + "tracing", +] + +[[package]] +name = "subxt-metadata" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacd4e7484fef58deaa2dcb32d94753a864b208a668c0dd0c28be1d8abeeadb2" +dependencies = [ + "frame-decode", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "parity-scale-codec", + "polkadot-sdk", + "scale-info", +] + +[[package]] +name = "subxt-signer" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d680352d04665b1e4eb6f9d2a54b800c4d8e1b20478e69be1b7d975b08d9fc34" +dependencies = [ + "base64", + "bip32", + "bip39", + "cfg-if", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "keccak-hash", + "parity-scale-codec", + "pbkdf2", + "polkadot-sdk", + "regex", + "schnorrkel", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "subxt-core", + "zeroize", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560533fbd6914b94a8fb5cc803ed6801c3455668db3b810702c57612bac9412" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "syn-solidity" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ac494e7266fcdd2ad80bf4375d55d27a117ea5c866c26d0e97fe5b3caeeb75" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "time", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trie-db" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "tuplex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "w3f-bls" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", + "arrayref", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.9", + "sha3", + "zeroize", +] + +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xcm-procedural" +version = "11.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d3d21c65cbf847ae0b1a8e6411b614d269d3108c6c649b039bffcf225e89aa4" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock new file mode 100644 index 000000000..dd91fd6df --- /dev/null +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock @@ -0,0 +1,6233 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy-core" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8bcce99ad10fe02640cfaec1c6bc809b837c783c1d52906aa5af66e2a196f6" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-rlp", + "alloy-sol-types 0.8.25", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "alloy-sol-types 0.8.25", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" +dependencies = [ + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-abi" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15516116086325c157c18261d768a20677f0f699348000ed391d4ad0dcb82530" +dependencies = [ + "alloy-primitives 1.2.1", + "alloy-sol-type-parser 1.2.1", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.4", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6177ed26655d4e84e00b65cb494d4e0b8830e7cae7ef5d63087d445a2600fb55" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.4", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.1", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" +dependencies = [ + "alloy-sol-macro-expander 0.8.25", + "alloy-sol-macro-input 0.8.25", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a14f21d053aea4c6630687c2f4ad614bed4c81e14737a9b904798b24f30ea849" +dependencies = [ + "alloy-sol-macro-expander 1.2.1", + "alloy-sol-macro-input 1.2.1", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" +dependencies = [ + "alloy-sol-macro-input 0.8.25", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 0.8.25", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d99282e7c9ef14eb62727981a985a01869e586d1dec729d3bb33679094c100" +dependencies = [ + "alloy-sol-macro-input 1.2.1", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 1.2.1", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 0.8.25", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda029f955b78e493360ee1d7bd11e1ab9f2a220a5715449babc79d6d0a01105" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity 1.2.1", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d162f8524adfdfb0e4bd0505c734c985f3e2474eb022af32eef0d52a4f3935c" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10db1bd7baa35bc8d4a1b07efbf734e73e5ba09f2580fb8cee3483a36087ceb2" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" +dependencies = [ + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-macro 0.8.25", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58377025a47d8b8426b3e4846a251f2c1991033b27f517aade368146f6ab1dfe" +dependencies = [ + "alloy-json-abi 1.2.1", + "alloy-primitives 1.2.1", + "alloy-sol-macro 1.2.1", + "serde", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", +] + +[[package]] +name = "array-bytes" +version = "6.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" + +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "binary-merkle-tree" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181f5380e435b8ba6d901f8b16fc8908c6f0f8bea8973113d1c8718d89bb1809" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", +] + +[[package]] +name = "bip32" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" +dependencies = [ + "bs58", + "hmac 0.12.1", + "k256", + "rand_core 0.6.4", + "ripemd", + "secp256k1 0.27.0", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "bip39" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bounded-collections" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2 0.10.9", + "tinyvec", +] + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] + +[[package]] +name = "camino" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.26", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + +[[package]] +name = "const-hex" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.16", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "const_env" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9e4f72c6e3398ca6da372abd9affd8f89781fe728869bbf986206e9af9627e" +dependencies = [ + "const_env_impl", +] + +[[package]] +name = "const_env_impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f51209740b5e1589e702b3044cdd4562cef41b6da404904192ffffb852d62" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.104", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive-where" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510c292c8cf384b1a340b816a9a6cf2599eb8f566a44949024af88418000c50b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.104", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "docify" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.104", + "termcolor", + "toml", + "walkdir", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clonable" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core 0.6.4", + "sha2 0.10.9", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "ethabi-decode" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52029c4087f9f01108f851d0d02df9c21feb5660a19713466724b7f95bd2d773" +dependencies = [ + "ethereum-types", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde", + "primitive-types 0.13.1", + "scale-info", + "uint 0.10.0", +] + +[[package]] +name = "expander" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" +dependencies = [ + "blake2", + "file-guard", + "fs-err", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-guard" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "frame-benchmarking" +version = "40.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9e5fcdb30bb83b2d97d7e718127230e0fbbad82b9c32dedf63971f08709def" +dependencies = [ + "frame-support", + "frame-support-procedural", + "frame-system", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-storage", + "static_assertions", +] + +[[package]] +name = "frame-decode" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6027a409bac4fe95b4d107f965fcdbc252fc89d884a360d076b3070b6128c094" +dependencies = [ + "frame-metadata 17.0.0", + "parity-scale-codec", + "scale-decode 0.14.0", + "scale-info", + "scale-type-resolver", + "sp-crypto-hashing", +] + +[[package]] +name = "frame-metadata" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701bac17e9b55e0f95067c428ebcb46496587f08e8cf4ccc0fe5903bea10dbb8" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" +dependencies = [ + "aquamarine", + "array-bytes", + "binary-merkle-tree", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata 20.0.0", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-metadata-ir", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "33.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "docify", + "expander", + "frame-support-procedural-tools", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.104", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "13.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "frame-system" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc20d95c35bad22eb8b8d7ef91197a439483458237b176e621d9210f2fbff15" +dependencies = [ + "cfg-if", + "docify", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-version", + "sp-weights", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "fungibles" +version = "0.1.0" +dependencies = [ + "ink", + "pop-api", + "scale-info", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand 0.8.5", + "rand_core 0.6.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "foldhash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + +[[package]] +name = "impl-rlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" +dependencies = [ + "rlp 0.6.1", +] + +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.4", + "serde", +] + +[[package]] +name = "ink" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "const_format", + "deranged", + "derive_more 2.0.1", + "ink_env", + "ink_macro", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "keccak-const", + "linkme", + "pallet-revive-uapi", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-info", + "sp-io", + "sp-runtime-interface", + "staging-xcm", +] + +[[package]] +name = "ink_allocator" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_codegen" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "derive_more 2.0.1", + "either", + "heck", + "impl-serde", + "ink_ir", + "ink_primitives", + "itertools 0.14.0", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.104", +] + +[[package]] +name = "ink_engine" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_primitives", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", +] + +[[package]] +name = "ink_env" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "cfg-if", + "const_env", + "derive_more 2.0.1", + "hex-literal 1.0.0", + "ink_allocator", + "ink_engine", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "num-traits", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "polkavm-derive 0.22.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "schnorrkel", + "secp256k1 0.30.0", + "sha2 0.10.9", + "sha3", + "sp-io", + "sp-runtime-interface", + "staging-xcm", + "static_assertions", +] + +[[package]] +name = "ink_ir" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "blake2", + "either", + "impl-serde", + "ink_prelude", + "itertools 0.14.0", + "proc-macro2", + "quote", + "sha3", + "syn 2.0.104", +] + +[[package]] +name = "ink_macro" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "ink_codegen", + "ink_ir", + "ink_primitives", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.104", + "synstructure", +] + +[[package]] +name = "ink_metadata" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "derive_more 2.0.1", + "impl-serde", + "ink_prelude", + "ink_primitives", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_primitives" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "alloy-sol-types 1.2.1", + "cfg-if", + "derive_more 2.0.1", + "impl-trait-for-tuples", + "ink_prelude", + "itertools 0.14.0", + "num-traits", + "pallet-revive", + "pallet-revive-uapi", + "parity-scale-codec", + "paste", + "primitive-types 0.13.1", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime-interface", + "xxhash-rust", +] + +[[package]] +name = "ink_storage" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "array-init", + "cfg-if", + "derive_more 2.0.1", + "ink_env", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "pallet-revive-uapi", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_storage_traits" +version = "6.0.0-alpha" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +dependencies = [ + "ink_metadata", + "ink_prelude", + "ink_primitives", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime-interface", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2 0.10.9", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "keccak-const" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" + +[[package]] +name = "keccak-hash" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" +dependencies = [ + "primitive-types 0.13.1", + "tiny-keccak", +] + +[[package]] +name = "konst" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330f0e13e6483b8c34885f7e6c9f19b1a7bd449c673fbb948a51c99d66ef74f4" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linkme" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b1703c00b2a6a70738920544aa51652532cacddfec2e162d2e29eae01e665c" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d55ca5d5a14363da83bf3c33874b8feaa34653e760d5216d7ef9829c88001a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "linregress" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9eda9dcf4f2a99787827661f312ac3219292549c2ee992bf9a6248ffb066bf7" +dependencies = [ + "nalgebra", +] + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "macro_magic_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "nalgebra" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" +dependencies = [ + "approx", + "matrixmultiply", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pallet-asset-conversion" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e063e39ad8ecd3c2b00c963f50cdf79e614c819a01e1c1ce9993287075b1b4d9" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-revive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "895fe6f50f621a69132697b8b43d29d1db4d9ff445eec410bf1fc98cd7e9412c" +dependencies = [ + "alloy-core", + "derive_more 0.99.20", + "environmental", + "ethabi-decode", + "ethereum-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "num-bigint", + "num-integer", + "num-traits", + "pallet-revive-fixtures", + "pallet-revive-proc-macro", + "pallet-revive-uapi", + "pallet-transaction-payment", + "parity-scale-codec", + "paste", + "polkavm", + "polkavm-common 0.21.0", + "rand 0.8.5", + "ripemd", + "rlp 0.6.1", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-io", + "sp-runtime", + "staging-xcm", + "staging-xcm-builder", + "substrate-bn", + "subxt-signer", +] + +[[package]] +name = "pallet-revive-fixtures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1df19ca809f036d6ddf1632039e9db312f92dbe8f9390e6722ad808cd95377" +dependencies = [ + "anyhow", + "cargo_metadata", + "pallet-revive-uapi", + "polkavm-linker", + "sp-core", + "sp-io", + "toml", +] + +[[package]] +name = "pallet-revive-proc-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c2dc2fc6961da23fefc54689ce81a8e006f6988bc465dcc9ab9db905d31766" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "pallet-revive-uapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb8f45102c6279f59f55e0051fc6c26b996619d7842800dfaf3a2583459a1c7" +dependencies = [ + "bitflags 1.3.2", + "pallet-revive-proc-macro", + "parity-scale-codec", + "polkavm-derive 0.21.0", + "scale-info", +] + +[[package]] +name = "pallet-transaction-payment" +version = "40.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ebd61b64848e39e5615832c964dc10b63bcebff26a9ec1cb867b4087240a03" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "bytes", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash", +] + +[[package]] +name = "pest" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "polkadot-core-primitives" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7c519ee804fd08d7464871bd2fe164e8f0683501ea59d2a10f5ef214dacb3b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "polkadot-parachain-primitives" +version = "16.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72943c0948c686b47bacb1a03e59baff63bfba2e16e208d77f0f8615827f8564" +dependencies = [ + "bounded-collections", + "derive_more 0.99.20", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb819108697967452fa6d8d96ab4c0d48cbaa423b3156499dcb24f1cf95d6775" +dependencies = [ + "sp-crypto-hashing", +] + +[[package]] +name = "polkavm" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd34e2f74206fff33482ae1718e275f11365ef8c4de7f0e69217f8845303867" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common 0.21.0", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f512bc80cb10439391a7c13a9eb2d37cf66b7305e7df0a06d662eff4f5b07625" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-common" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" + +[[package]] +name = "polkavm-common" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c16b809cfd398f861261c045a8745e6c78b71ea7e0d3ef6f7cc553eb27bc17e" +dependencies = [ + "blake3", + "log", + "polkavm-assembler", +] + +[[package]] +name = "polkavm-common" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538810ffdaa629113b9f436f43ba487a6cceacc04a769ac3cdcd32fcf87351cd" + +[[package]] +name = "polkavm-derive" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +dependencies = [ + "polkavm-derive-impl-macro 0.18.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47239245f87329541932c0d7fec750a66a75b13aa87dfe4fbfd637bab86ad387" +dependencies = [ + "polkavm-derive-impl-macro 0.21.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e819eaea986d6a3de2a08840f0cc188db3c318b30f9bb1deb416d8c4beb2ed14" +dependencies = [ + "polkavm-derive-impl-macro 0.22.0", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" +dependencies = [ + "polkavm-common 0.18.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fd6c6215450c3e57511df5c38a82eb4bde208de15ee15046ac33852f3c3eaa" +dependencies = [ + "polkavm-common 0.21.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414507a0a7c9451cc81336ef1f5ccbab8fa4aeda402668735aa28331867bd3ef" +dependencies = [ + "polkavm-common 0.22.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +dependencies = [ + "polkavm-derive-impl 0.18.1", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36837f6b7edfd6f4498f8d25d81da16cf03bd6992c3e56f3d477dfc90f4fefca" +dependencies = [ + "polkavm-derive-impl 0.21.0", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad6a5df4cc6466a219386b04d8bd267ba772f9458a8e9aa7539757ca5b11e2aa" +dependencies = [ + "polkavm-derive-impl 0.22.0", + "syn 2.0.104", +] + +[[package]] +name = "polkavm-linker" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bc764986c4a63f9ab9890c3f4eb9b4c13b6ff80d79685bd48ade147234aab4" +dependencies = [ + "dirs", + "gimli", + "hashbrown 0.14.5", + "log", + "object", + "polkavm-common 0.21.0", + "regalloc2", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linux-raw" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be6cd1d48c5e7814d287a3e12a339386a5dfa2f3ac72f932335f4cf56467f1b3" + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "pop-api" +version = "0.1.0" +dependencies = [ + "alloy-sol-types 1.2.1", + "ink", + "pop-primitives", +] + +[[package]] +name = "pop-primitives" +version = "0.0.0" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" +dependencies = [ + "proc-macro2", + "syn 2.0.104", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec 0.6.0", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.1", + "impl-num-traits", + "impl-rlp", + "impl-serde", + "scale-info", + "uint 0.10.0", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro-warning" +version = "1.84.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.9.1", + "lazy_static", + "num-traits", + "rand 0.9.1", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "serde", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", + "serde", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash 1.1.0", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.2", + "proptest", + "rand 0.8.5", + "rand 0.9.1", + "rlp 0.5.2", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-demangle" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scale-bits" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver", + "serde", +] + +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver", +] + +[[package]] +name = "scale-decode" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode-derive 0.14.0", + "scale-type-resolver", + "smallvec", +] + +[[package]] +name = "scale-decode" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +dependencies = [ + "parity-scale-codec", + "scale-bits 0.7.0", + "scale-decode-derive 0.16.0", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-decode-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed9401effa946b493f9f84dc03714cca98119b230497df6f3df6b84a2b03648" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-decode-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-encode" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-encode-derive 0.8.0", + "scale-type-resolver", + "smallvec", +] + +[[package]] +name = "scale-encode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +dependencies = [ + "parity-scale-codec", + "scale-encode-derive 0.10.0", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-encode-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102fbc6236de6c53906c0b262f12c7aa69c2bdc604862c12728f5f4d370bc137" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-encode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-info" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more 1.0.0", + "parity-scale-codec", + "scale-info-derive", + "schemars", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-value" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e0ef2a0ee1e02a69ada37feb87ea1616ce9808aca072befe2d3131bf28576e" +dependencies = [ + "derive_more 1.0.0", + "either", + "parity-scale-codec", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-type-resolver", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.104", +] + +[[package]] +name = "schnellru" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead", + "arrayref", + "arrayvec", + "curve25519-dalek", + "getrandom_or_panic", + "merlin", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "password-hash", + "pbkdf2", + "salsa20", + "sha2 0.10.9", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys 0.8.1", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.8.5", + "secp256k1-sys 0.10.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + +[[package]] +name = "slab" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "sp-api" +version = "36.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "541da427f47dfb97f3dd0556fa3272bdc5dfa0d4c1ad53a22670a9bae4db63d7" +dependencies = [ + "docify", + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-externalities", + "sp-metadata-ir", + "sp-runtime", + "sp-runtime-interface", + "sp-state-machine", + "sp-trie", + "sp-version", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-api-proc-macro" +version = "22.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cedafdeaf15c774433ad8f5b00883bdf7d86e7c8b8e050e3439d4ae422114096" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-application-crypto" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba375ab65a76f7413d1bfe48122fd347ce7bd2047e36ecbbd78f12f5adaed121" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", +] + +[[package]] +name = "sp-arithmetic" +version = "26.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4f3b3414e7620ad72d0000b520e0570dca38dc63e160c95164ff3f789020cc1" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b54310103ae4f0e3228e217e2a9ccaca0d7c3502d3aa276623febf4c722ca397" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc83d9e7b1d58e1d020c20d7208b00d21fa73dcf92721114eae432b9f01e62d5" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-timestamp", +] + +[[package]] +name = "sp-core" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" +dependencies = [ + "ark-vrf", + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types 0.13.1", + "rand 0.8.5", + "scale-info", + "schnorrkel", + "secp256k1 0.28.2", + "secrecy 0.8.0", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.9", + "sha3", + "twox-hash", +] + +[[package]] +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +dependencies = [ + "quote", + "sp-crypto-hashing", + "syn 2.0.104", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-externalities" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-inherents" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-io" +version = "40.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "rustversion", + "secp256k1 0.28.2", + "sp-core", + "sp-crypto-hashing", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d1db25e362edbf5531b427d4bdfc2562bec6a031c3eb2a9145c0a0a01a572d" +dependencies = [ + "frame-metadata 20.0.0", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "sp-panic-handler" +version = "13.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" +dependencies = [ + "backtrace", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "41.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" +dependencies = [ + "binary-merkle-tree", + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-trie", + "sp-weights", + "tracing", + "tuplex", +] + +[[package]] +name = "sp-runtime-interface" +version = "29.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "primitive-types 0.13.1", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-staking" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-state-machine" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-trie", + "thiserror 1.0.69", + "tracing", + "trie-db", +] + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" + +[[package]] +name = "sp-storage" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + +[[package]] +name = "sp-timestamp" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176c77326c15425a15e085261161a9435f9a3c0d4bf61dae6dccf05b957a51c6" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents", + "sp-runtime", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-tracing" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6147a5b8c98b9ed4bf99dc033fab97a468b4645515460974c8784daeb7c35433" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-trie" +version = "39.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" +dependencies = [ + "ahash", + "hash-db", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "scale-info", + "schnellru", + "sp-core", + "sp-externalities", + "thiserror 1.0.69", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-version-proc-macro" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" +dependencies = [ + "parity-scale-codec", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "sp-wasm-interface" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + +[[package]] +name = "sp-weights" +version = "31.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-debug-derive", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "staging-xcm" +version = "16.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0126278d7fc6d7dec55e5a109f838bbf401dd084aecf2597e4e11ea07515a0a" +dependencies = [ + "array-bytes", + "bounded-collections", + "derive-where", + "environmental", + "frame-support", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-weights", + "xcm-procedural", +] + +[[package]] +name = "staging-xcm-builder" +version = "20.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f031952c1496cf7f86d19ab38e3264be9a54b7d8eecb25ba69f977cc7549d08" +dependencies = [ + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", + "tracing", +] + +[[package]] +name = "staging-xcm-executor" +version = "19.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9bc315e8c7018fcfe0371ce4b7e726fb699e37b2acc3e5effb87a7d131a3ff" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "tracing", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2", + "schnorrkel", + "sha2 0.10.9", + "zeroize", +] + +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "subxt-core" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7a1bc6c9c1724971636a66e3225a7253cdb35bb6efb81524a6c71c04f08c59" +dependencies = [ + "base58", + "blake2", + "derive-where", + "frame-decode", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "hex", + "impl-serde", + "keccak-hash", + "parity-scale-codec", + "polkadot-sdk", + "primitive-types 0.13.1", + "scale-bits 0.6.0", + "scale-decode 0.14.0", + "scale-encode 0.8.0", + "scale-info", + "scale-value", + "serde", + "serde_json", + "subxt-metadata", + "tracing", +] + +[[package]] +name = "subxt-metadata" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacd4e7484fef58deaa2dcb32d94753a864b208a668c0dd0c28be1d8abeeadb2" +dependencies = [ + "frame-decode", + "frame-metadata 17.0.0", + "hashbrown 0.14.5", + "parity-scale-codec", + "polkadot-sdk", + "scale-info", +] + +[[package]] +name = "subxt-signer" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d680352d04665b1e4eb6f9d2a54b800c4d8e1b20478e69be1b7d975b08d9fc34" +dependencies = [ + "base64", + "bip32", + "bip39", + "cfg-if", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "keccak-hash", + "parity-scale-codec", + "pbkdf2", + "polkadot-sdk", + "regex", + "schnorrkel", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "subxt-core", + "zeroize", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560533fbd6914b94a8fb5cc803ed6801c3455668db3b810702c57612bac9412" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "syn-solidity" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ac494e7266fcdd2ad80bf4375d55d27a117ea5c866c26d0e97fe5b3caeeb75" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "time", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trie-db" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "tuplex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "w3f-bls" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", + "arrayref", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.9", + "sha3", + "zeroize", +] + +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xcm-procedural" +version = "11.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d3d21c65cbf847ae0b1a8e6411b614d269d3108c6c649b039bffcf225e89aa4" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] From fcb9a991302803cbd3f71621d4e75586de71dd32 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 07:36:20 +0100 Subject: [PATCH 117/162] style: formatting after rebase --- runtime/devnet/src/config/contracts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 8c20263f1..2c38b3e8d 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -9,8 +9,8 @@ use pop_runtime_common::{DepositPerByte, DepositPerItem, UNIT}; use super::api::{self, Config}; use crate::{ - config::assets::TrustBackedAssetsInstance, deposit, Balance, Balances, Perbill, PolkadotXcm, - Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, TransactionPayment, + config::assets::TrustBackedAssetsInstance, deposit, Balance, Balances, Perbill, PolkadotXcm, + Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, TransactionPayment, }; type Erc20 = pallet_api_vnext::Erc20; From 2a85f1276e7c52772869f3fe7d868146ffb2527e Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 10:02:56 +0100 Subject: [PATCH 118/162] test(devnet): set gas limit now that precompiles charge weight --- runtime/devnet/src/config/contracts.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 2c38b3e8d..261841cc7 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -188,6 +188,7 @@ mod tests { let fungibles_addr: H160 = Fungibles::<100, TrustBackedAssetsInstance>::address().into(); let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(token).into(); let total_supply: Balance = 10_000; + let gas_limit = Weight::from_parts(600_000_000, 10_000); new_test_ext().execute_with(|| { assert_ok!(Revive::map_account(origin.clone())); assert_ok!(Revive::map_account(RuntimeOrigin::signed(Bob.to_account_id()))); @@ -198,7 +199,7 @@ mod tests { createCall { admin: origin_addr.0.into(), minBalance: primitives::U256::from(1) } .abi_encode(); println!("IFungibles.create: {}", to_hex(&call, false)); - assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); + assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, gas_limit, 0, call)); let asset_details = Asset::get(token).unwrap(); assert_eq!(asset_details.owner, caller); assert_eq!(asset_details.admin, caller); @@ -211,7 +212,7 @@ mod tests { } .abi_encode(); println!("IFungibles.mint: {}", to_hex(&call, false)); - assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, Weight::zero(), 0, call)); + assert_ok!(Revive::call(origin.clone(), fungibles_addr, 0, gas_limit, 0, call)); // Transfer via erc20 precompile println!("IERC20 precompile: {}", to_hex(&erc20_addr.0, false)); @@ -221,7 +222,7 @@ mod tests { } .abi_encode(); println!("IERC20.transfer: {}", to_hex(&call, false)); - assert_ok!(Revive::call(origin.clone(), erc20_addr, 0, Weight::zero(), 0, call)); + assert_ok!(Revive::call(origin.clone(), erc20_addr, 0, gas_limit, 0, call)); assert_eq!(Assets::balance(token, &Bob.to_account_id()), total_supply / 2); }) } From 55bc37a2996a5f185613a691b436165e86de9198 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 10:14:22 +0100 Subject: [PATCH 119/162] test(devnet): remove contract and selector integration tests as available elsewhere now --- runtime/devnet/Cargo.toml | 1 - runtime/devnet/src/config/contracts.rs | 123 +------------------------ 2 files changed, 3 insertions(+), 121 deletions(-) diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 4931aa5ba..1262c52f4 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -106,7 +106,6 @@ pallet-ismp-runtime-api.workspace = true [dev-dependencies] enumflags2.workspace = true env_logger.workspace = true -hex.workspace = true sp-keyring.workspace = true [features] diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index 261841cc7..d6c0f7bbf 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -146,18 +146,13 @@ fn contracts_prevents_runtime_calls() { #[cfg(test)] mod tests { - use codec::Encode; use frame_support::{assert_ok, traits::fungible::Mutate}; - use frame_system::pallet_prelude::OriginFor; use pallet_api_vnext::fungibles::precompiles::{IFungibles::*, IERC20}; use pallet_revive::{ - precompiles::alloy::{ - primitives, - sol_types::{SolCall, SolType, SolValue}, - }, - AddressMapper, Code, DepositLimit, + precompiles::alloy::{primitives, sol_types::SolCall}, + AddressMapper, }; - use sp_core::{bytes::to_hex, H160, U256}; + use sp_core::{bytes::to_hex, H160}; use sp_keyring::Sr25519Keyring::{Alice, Bob}; use sp_runtime::Weight; @@ -226,116 +221,4 @@ mod tests { assert_eq!(Assets::balance(token, &Bob.to_account_id()), total_supply / 2); }) } - - // #[test] - // fn fungibles_precompiles_via_contract_works() { - // let contract = include_bytes!( - // "../../../../pop-api-vnext/examples/fungibles/target/ink/fungibles.polkavm" - // ); - // let caller = Alice.to_account_id(); - // let origin = RuntimeOrigin::signed(caller.clone()); - // let recipient = Bob.to_account_id(); - // let recipient_addr = primitives::Address::new(AccountId32Mapper::to_address(&recipient).0); - // let minimum_value = U256::from(1); - // let endowment = primitives::U256::from(10_000); - // new_test_ext().execute_with(|| { - // assert_ok!(Revive::map_account(origin.clone())); - // assert_ok!(Revive::map_account(RuntimeOrigin::signed(recipient))); - - // // Instantiate contract with some value, required to create underlying asset - // let result = Revive::bare_instantiate( - // origin.clone(), - // 10 * UNIT, - // Weight::MAX, - // DepositLimit::Balance(u128::MAX), - // Code::Upload(contract.to_vec()), - // // Constructors are not yet using Solidity encoding - // [blake_selector("new"), ("Name", "SYMBOL", minimum_value, 10u8).encode()].concat(), - // None, - // ) - // .result - // .unwrap(); - // assert!(!result.result.did_revert()); - // let contract = primitives::Address::new(result.addr.0); - - // // Mint some tokens to the contract - // call::<()>( - // origin.clone(), - // result.addr, - // [keccak_selector("mint(address,uint256)"), (contract, endowment).abi_encode()] - // .concat(), - // ); - - // // Interact with contract as Erc20 - // let total_supply = call::( - // origin.clone(), - // result.addr, - // keccak_selector("totalSupply()"), - // ); - // assert_eq!(total_supply, endowment); - - // let balance_of = call::( - // origin.clone(), - // result.addr, - // [keccak_selector("balanceOf(address)"), (contract,).abi_encode()].concat(), - // ); - // assert_eq!(balance_of, endowment); - - // // Transfer tokens from contract to recipient - // let value = endowment / primitives::U256::from(2); - // assert!(call::( - // origin.clone(), - // result.addr, - // [ - // keccak_selector("transfer(address,uint256)"), - // (recipient_addr, value).abi_encode(), - // ] - // .concat(), - // )); - // let balance_of = call::( - // origin.clone(), - // result.addr, - // [keccak_selector("balanceOf(address)"), (recipient_addr,).abi_encode()].concat(), - // ); - // assert_eq!(balance_of, value); - // }); - - // fn call::RustType>>( - // origin: OriginFor, - // contract: H160, - // data: Vec, - // ) -> T { - // let result = Revive::bare_call( - // origin, - // contract, - // 0, - // Weight::MAX, - // DepositLimit::Balance(u128::MAX), - // data, - // ) - // .result - // .unwrap(); - // assert!(!result.did_revert()); - // T::abi_decode(&result.data).unwrap() - // } - // } - - fn blake_selector(name: &str) -> Vec { - sp_io::hashing::blake2_256(name.as_bytes())[0..4].to_vec() - } - - fn keccak_selector(name: &str) -> Vec { - sp_io::hashing::keccak_256(name.as_bytes())[0..4].to_vec() - } - - #[test] - fn selectors_work() { - // Constructors currently still use blake encoding - assert_eq!(hex::encode(blake_selector("new")), "9bae9d5e"); - - // Erc20 selectors - assert_eq!(hex::encode(keccak_selector("exists()")), "267c4ae4"); - assert_eq!(hex::encode(keccak_selector("totalSupply()")), "18160ddd"); - assert_eq!(hex::encode(keccak_selector("balanceOf(address)")), "70a08231"); - } } From 6f0f374da4a04e853b468bc3b809a6b4b81bdbf2 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 10:23:32 +0100 Subject: [PATCH 120/162] test(api): add selectors test --- pop-api-vnext/integration-tests/Cargo.toml | 1 + pop-api-vnext/integration-tests/src/lib.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/pop-api-vnext/integration-tests/Cargo.toml b/pop-api-vnext/integration-tests/Cargo.toml index 7b872b734..ec26838bd 100644 --- a/pop-api-vnext/integration-tests/Cargo.toml +++ b/pop-api-vnext/integration-tests/Cargo.toml @@ -15,6 +15,7 @@ codec.workspace = true env_logger.workspace = true frame-support = { workspace = true, default-features = false } frame-system = { workspace = true, default-features = false } +hex.workspace = true log.workspace = true pallet-api-vnext = { workspace = true, default-features = false, features = [ "fungibles" ] } pallet-assets = { workspace = true, default-features = false } diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index b9671c3fa..435a8bc73 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -172,3 +172,14 @@ impl ExtBuilder { ext } } + +#[test] +fn selectors_work() { + // Constructors currently still use blake encoding + assert_eq!(hex::encode(blake_selector("new")), "9bae9d5e"); + + // Erc20 selectors + assert_eq!(hex::encode(keccak_selector("exists()")), "267c4ae4"); + assert_eq!(hex::encode(keccak_selector("totalSupply()")), "18160ddd"); + assert_eq!(hex::encode(keccak_selector("balanceOf(address)")), "70a08231"); +} From 58daa4e54a5259c977ab0c95beb6bb4609c06423 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 10:25:10 +0100 Subject: [PATCH 121/162] chore: update cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1da780009..52f8a1449 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15037,6 +15037,7 @@ dependencies = [ "env_logger 0.11.8", "frame-support 28.0.0", "frame-system 28.0.0", + "hex", "log", "pallet-api-vnext", "pallet-assets 29.1.0", @@ -15227,7 +15228,6 @@ dependencies = [ "frame-system-benchmarking 28.0.0", "frame-system-rpc-runtime-api 26.0.0", "frame-try-runtime 0.34.0", - "hex", "hex-literal 0.4.1", "ismp", "ismp-parachain", From 95c36a64af9cc0b9b19d195fa2b47d65e49fcda5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:11:23 +0100 Subject: [PATCH 122/162] test(api): add initial tests --- pallets/api-vnext/src/fungibles/mod.rs | 2 + pallets/api-vnext/src/fungibles/tests.rs | 189 +++++++++++++++++++++++ pallets/api-vnext/src/mock.rs | 64 +++++--- 3 files changed, 237 insertions(+), 18 deletions(-) create mode 100644 pallets/api-vnext/src/fungibles/tests.rs diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index 86403a76d..c43a6dd67 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -26,6 +26,8 @@ use super::*; mod benchmarking; /// The fungibles precompiles offer a streamlined interface for interacting with fungible tokens. pub mod precompiles; +#[cfg(test)] +mod tests; pub mod weights; type AssetIdOf = >::AssetId; diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs new file mode 100644 index 000000000..d700f0802 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -0,0 +1,189 @@ +use frame_support::{ + assert_noop, assert_ok, + sp_runtime::DispatchError::BadOrigin, + traits::{fungibles::approvals::Mutate, Get}, +}; + +use super::*; +use crate::mock::{Assets, *}; + +type AssetsError = pallet_assets::Error; +type ED = ExistentialDeposit; +type WeightInfo = ::WeightInfo; + +#[test] +fn transfer_works() { + let token = 1; + let value = 100 * UNIT; + let from = ALICE; + let to = BOB; + ExtBuilder::new() + .with_balances(vec![(from.clone(), ED::get()), (to.clone(), ED::get())]) + .with_assets(vec![(token, from.clone(), false, 1)]) + .with_asset_balances(vec![(token, from.clone(), value)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!(transfer::(origin, 0, to.clone(), value), BadOrigin); + } + // Check error works for `Assets::transfer_keep_alive()`. + assert_noop!( + transfer::(signed(from.clone()), TokenId::MAX, to.clone(), value), + AssetsError::Unknown + ); + let balance_before_transfer = Assets::balance(token, &to); + assert_ok!(transfer::(signed(from), token, to.clone(), value)); + let balance_after_transfer = Assets::balance(token, &to); + assert_eq!(balance_after_transfer, balance_before_transfer + value); + }); +} + +#[test] +fn transfer_from_works() { + let token = 1; + let value = 100 * UNIT; + let from = ALICE; + let to = BOB; + let spender = CHARLIE; + ExtBuilder::new() + .with_balances(vec![(from.clone(), UNIT), (to.clone(), ED::get())]) + .with_assets(vec![(token, from.clone(), false, 1)]) + .with_asset_balances(vec![(token, from.clone(), value * 2)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!( + transfer_from::(origin, token, from.clone(), to.clone(), value), + BadOrigin + ); + } + // Check error works for `Assets::transfer_approved()`. + assert_noop!( + transfer_from::( + signed(spender.clone()), + TokenId::MAX, + from.clone(), + to.clone(), + value + ), + AssetsError::Unknown + ); + // Approve `spender` to transfer up to `value`. + approve(token, &from, &spender, value); + // Successfully call transfer from. + let from_balance_before_transfer = Assets::balance(token, &from); + let to_balance_before_transfer = Assets::balance(token, &to); + assert_ok!(transfer_from::( + signed(spender), + token, + from.clone(), + to.clone(), + value + )); + let from_balance_after_transfer = Assets::balance(token, &from); + let to_balance_after_transfer = Assets::balance(token, &to); + // Check that `to` has received the `value` tokens from `from`. + assert_eq!(to_balance_after_transfer, to_balance_before_transfer + value); + assert_eq!(from_balance_after_transfer, from_balance_before_transfer - value); + }); +} + +mod approve { + use super::*; + use crate::fungibles::{approve, weights::WeightInfo as _}; + + #[test] + fn ensure_signed_works() { + let token = 1; + let value = 100 * UNIT; + let spender = BOB; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!( + approve::(origin, token, spender.clone(), value), + BadOrigin.with_weight(WeightInfo::approve(0, 0)) + ); + } + }); + } + + #[test] + fn ensure_error_cases_from_pallet_assets_work() { + let token = 1; + let value = 100 * UNIT; + let owner = ALICE; + let spender = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT), (spender.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + // Check error works for `Assets::approve_transfer()` in `Greater` match arm. + assert_noop!( + approve::( + signed(owner.clone()), + TokenId::MAX, + spender.clone(), + value + ), + AssetsError::Unknown.with_weight(WeightInfo::approve(1, 0)) + ); + super::approve(token, &owner, &spender, value); + // Check error works for `Assets::cancel_approval()` in `Less` match arm. + assert_ok!(Assets::freeze_asset(signed(owner.clone()), token.into())); + assert_noop!( + approve::(signed(owner.clone()), token, spender, value / 2), + AssetsError::AssetNotLive.with_weight(WeightInfo::approve(0, 1)) + ); + assert_ok!(Assets::thaw_asset(signed(owner), token.into())); + // No error test for `approve_transfer` in `Less` arm because it is not possible. + }); + } + + // Non-additive, sets new value. + #[test] + fn approve_works() { + let token = 1; + let value: Balance = 100 * UNIT; + let owner = ALICE; + let spender = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT), (spender.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + // Approves a value to spend that is higher than the current allowance. + assert_eq!(Assets::allowance(token, &owner, &spender), 0); + assert_eq!( + approve::(signed(owner.clone()), token, spender.clone(), value), + Ok(Some(WeightInfo::approve(1, 0)).into()) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), value); + // Approves a value to spend that is lower than the current allowance. + assert_eq!( + approve::(signed(owner.clone()), token, spender.clone(), value / 2), + Ok(Some(WeightInfo::approve(1, 1)).into()) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), value / 2); + // Approves a value to spend that is equal to the current allowance. + assert_eq!( + approve::(signed(owner.clone()), token, spender.clone(), value / 2), + Ok(Some(WeightInfo::approve(0, 0)).into()) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), value / 2); + // Sets allowance to zero. + assert_eq!( + approve::(signed(owner.clone()), token, spender.clone(), 0), + Ok(Some(WeightInfo::approve(0, 1)).into()) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), 0); + }); + } +} + +fn approve(token: TokenId, owner: &AccountId, spender: &AccountId, amount: Balance) { + assert_ok!(Assets::approve(token, owner, spender, amount)); +} diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 80bdce74d..81c22ba84 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -2,19 +2,24 @@ use codec::Compact; use frame_support::{ derive_impl, sp_runtime::{traits::AccountIdLookup, AccountId32, BuildStorage}, - traits::AsEnsureOriginWithArg, + traits::{AsEnsureOriginWithArg, Get}, }; use frame_system::{EnsureRoot, EnsureSigned}; use pallet_assets::AutoIncAssetId; -pub(crate) use pallet_revive::test_utils::ALICE; +pub(crate) use pallet_revive::test_utils::{ALICE, BOB, CHARLIE}; use super::fungibles; +pub(crate) type AccountId = AccountId32; pub(crate) type Balance = u128; type Block = frame_system::mocking::MockBlock; +pub(crate) type ExistentialDeposit = ::ExistentialDeposit; +// For terminology in tests. +pub(crate) type TokenId = u32; pub(crate) const ERC20: u16 = 2; pub(crate) const FUNGIBLES: u16 = 1; +pub(crate) const UNIT: Balance = 10_000_000_000; #[frame_support::runtime] mod runtime { @@ -49,12 +54,12 @@ mod runtime { #[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Test { - type AssetIdParameter = Compact; + type AssetIdParameter = Compact; type Balance = Balance; type CallbackHandle = AutoIncAssetId; type CreateOrigin = AsEnsureOriginWithArg>; type Currency = Balances; - type ForceOrigin = EnsureRoot; + type ForceOrigin = EnsureRoot; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -76,7 +81,7 @@ impl pallet_revive::Config for Test { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; - type AccountId = AccountId32; + type AccountId = AccountId; type Block = Block; type Lookup = AccountIdLookup; } @@ -89,42 +94,53 @@ impl fungibles::Config for Test { } pub(crate) struct ExtBuilder { - assets: Option>, - asset_accounts: Option>, - asset_metadata: Option, Vec, u8)>>, + assets: Option>, + asset_accounts: Option>, + asset_metadata: Option, Vec, u8)>>, + balances: Vec<(AccountId, Balance)>, } impl ExtBuilder { pub(crate) fn new() -> Self { - Self { assets: None, asset_accounts: None, asset_metadata: None } + Self { + assets: None, + asset_accounts: None, + asset_metadata: None, + balances: vec![(ALICE, ExistentialDeposit::get())], + } } - pub(crate) fn with_assets(mut self, assets: Vec<(u32, AccountId32, bool, u128)>) -> Self { + pub(crate) fn with_assets(mut self, assets: Vec<(TokenId, AccountId, bool, Balance)>) -> Self { self.assets = Some(assets); self } - pub(crate) fn with_asset_balances(mut self, accounts: Vec<(u32, AccountId32, u128)>) -> Self { + pub(crate) fn with_asset_balances( + mut self, + accounts: Vec<(TokenId, AccountId, Balance)>, + ) -> Self { self.asset_accounts = Some(accounts); self } pub(crate) fn with_asset_metadata( mut self, - metadata: Vec<(u32, Vec, Vec, u8)>, + metadata: Vec<(TokenId, Vec, Vec, u8)>, ) -> Self { self.asset_metadata = Some(metadata); self } + pub(crate) fn with_balances(mut self, balances: Vec<(AccountId, Balance)>) -> Self { + self.balances = balances; + self + } + pub(crate) fn build(mut self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); - pallet_balances::GenesisConfig:: { - balances: vec![(ALICE, 10_000_000_000)], - ..Default::default() - } - .assimilate_storage(&mut t) - .unwrap(); + pallet_balances::GenesisConfig:: { balances: self.balances, ..Default::default() } + .assimilate_storage(&mut t) + .unwrap(); pallet_assets::GenesisConfig:: { assets: self.assets.take().unwrap_or_default(), @@ -152,3 +168,15 @@ impl ExtBuilder { }) } } + +pub(crate) fn signed(account: AccountId) -> RuntimeOrigin { + RuntimeOrigin::signed(account) +} + +pub(crate) fn root() -> RuntimeOrigin { + RuntimeOrigin::root() +} + +pub(crate) fn none() -> RuntimeOrigin { + RuntimeOrigin::none() +} From 91f1861d140e4df2b93d72a34d3ec54f872ceec5 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:15:34 +0100 Subject: [PATCH 123/162] test(api): remove unnecessary helper --- pallets/api-vnext/src/fungibles/tests.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index d700f0802..ecd6fa4a8 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -69,7 +69,7 @@ fn transfer_from_works() { AssetsError::Unknown ); // Approve `spender` to transfer up to `value`. - approve(token, &from, &spender, value); + assert_ok!(Assets::approve(token, &from, &spender, value)); // Successfully call transfer from. let from_balance_before_transfer = Assets::balance(token, &from); let to_balance_before_transfer = Assets::balance(token, &to); @@ -131,7 +131,7 @@ mod approve { ), AssetsError::Unknown.with_weight(WeightInfo::approve(1, 0)) ); - super::approve(token, &owner, &spender, value); + assert_ok!(Assets::approve(token, &owner, &spender, value)); // Check error works for `Assets::cancel_approval()` in `Less` match arm. assert_ok!(Assets::freeze_asset(signed(owner.clone()), token.into())); assert_noop!( @@ -183,7 +183,3 @@ mod approve { }); } } - -fn approve(token: TokenId, owner: &AccountId, spender: &AccountId, amount: Balance) { - assert_ok!(Assets::approve(token, owner, spender, amount)); -} From cbba69b8bd312dc8d925c40e674b68566043726f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:29:42 +0100 Subject: [PATCH 124/162] test(api): add increase/decrease tests --- pallets/api-vnext/src/fungibles/tests.rs | 115 ++++++++++++++++++++++- 1 file changed, 113 insertions(+), 2 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index ecd6fa4a8..491c1834e 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -3,11 +3,13 @@ use frame_support::{ sp_runtime::DispatchError::BadOrigin, traits::{fungibles::approvals::Mutate, Get}, }; +use pallet_assets::WeightInfo as _; -use super::*; +use super::{weights::WeightInfo as _, *}; use crate::mock::{Assets, *}; type AssetsError = pallet_assets::Error; +type AssetsWeightInfo = ::WeightInfo; type ED = ExistentialDeposit; type WeightInfo = ::WeightInfo; @@ -90,7 +92,7 @@ fn transfer_from_works() { mod approve { use super::*; - use crate::fungibles::{approve, weights::WeightInfo as _}; + use crate::fungibles::approve; #[test] fn ensure_signed_works() { @@ -183,3 +185,112 @@ mod approve { }); } } + +#[test] +fn increase_allowance_works() { + let token = 1; + let value: Balance = 100 * UNIT; + let owner = ALICE; + let spender = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT), (spender.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!( + increase_allowance::(origin, token, spender.clone(), value), + BadOrigin.with_weight(WeightInfo::approve(0, 0)) + ); + } + // Check error works for `Assets::approve_transfer()`. + assert_noop!( + increase_allowance::( + signed(owner.clone()), + TokenId::MAX, + spender.clone(), + value + ), + AssetsError::Unknown.with_weight(AssetsWeightInfo::approve_transfer()) + ); + assert_eq!(0, Assets::allowance(token, &owner, &spender)); + assert_ok!(increase_allowance::( + signed(owner.clone()), + token, + spender.clone(), + value + )); + assert_eq!(Assets::allowance(token, &owner, &spender), value); + // Additive. + assert_ok!(increase_allowance::( + signed(owner.clone()), + token, + spender.clone(), + value + )); + assert_eq!(Assets::allowance(token, &owner, &spender), value * 2); + }); +} + +#[test] +fn decrease_allowance_works() { + let token = 1; + let value: Balance = 100 * UNIT; + let owner = ALICE; + let spender = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT), (spender.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!( + decrease_allowance::(origin, token, spender.clone(), 0), + BadOrigin.with_weight(WeightInfo::approve(0, 0)) + ); + } + assert_ok!(Assets::approve(token, &owner, &spender, value)); + assert_eq!(Assets::allowance(token, &owner, &spender), value); + // Check error works for `Assets::cancel_approval()`. No error test for + // `approve_transfer` because it is not possible. + assert_ok!(Assets::freeze_asset(signed(owner.clone()), token.into())); + assert_noop!( + decrease_allowance::( + signed(owner.clone()), + token, + spender.clone(), + value / 2 + ), + AssetsError::AssetNotLive.with_weight(WeightInfo::approve(0, 1)) + ); + assert_ok!(Assets::thaw_asset(signed(owner.clone()), token.into())); + // Owner balance is not changed if decreased by zero. + assert_eq!( + decrease_allowance::(signed(owner.clone()), token, spender.clone(), 0), + Ok((0, Some(WeightInfo::approve(0, 0)).into())) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), value); + // "Unapproved" error is returned if the current allowance is less than amount to + // decrease with. + assert_noop!( + decrease_allowance::( + signed(owner.clone()), + token, + spender.clone(), + value * 2 + ), + AssetsError::Unapproved + ); + // Decrease allowance successfully. + assert_eq!( + decrease_allowance::( + signed(owner.clone()), + token, + spender.clone(), + value / 2 + ), + Ok((value / 2, Some(WeightInfo::approve(1, 1)).into())) + ); + assert_eq!(Assets::allowance(token, &owner, &spender), value / 2); + }); +} From 78ab2abe3a748c1ae3ab87fc73ea419f92e9922a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:34:53 +0100 Subject: [PATCH 125/162] test(api): add create test --- pallets/api-vnext/src/fungibles/tests.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 491c1834e..47b383fb5 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -294,3 +294,22 @@ fn decrease_allowance_works() { assert_eq!(Assets::allowance(token, &owner, &spender), value / 2); }); } + +#[test] +fn create_works() { + let creator = ALICE; + let admin = BOB; + let min_balance = 100; + ExtBuilder::new() + .with_balances(vec![(creator.clone(), UNIT)]) + .build() + .execute_with(|| { + for origin in vec![root(), none()] { + assert_noop!(create::(origin, admin.clone(), min_balance), BadOrigin); + } + let id = NextAssetId::::get().unwrap_or_default(); + assert!(!Assets::asset_exists(id)); + assert_ok!(create::(signed(creator), admin, min_balance)); + assert!(Assets::asset_exists(id)); + }); +} From 5ab8e729680b73d21bf478fa3c933c15c9a8da71 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:39:54 +0100 Subject: [PATCH 126/162] test(api): add start_destroy test --- pallets/api-vnext/src/fungibles/tests.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 47b383fb5..ad8774532 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -1,6 +1,6 @@ use frame_support::{ assert_noop, assert_ok, - sp_runtime::DispatchError::BadOrigin, + sp_runtime::{DispatchError::BadOrigin, TokenError}, traits::{fungibles::approvals::Mutate, Get}, }; use pallet_assets::WeightInfo as _; @@ -313,3 +313,25 @@ fn create_works() { assert!(Assets::asset_exists(id)); }); } + +#[test] +fn start_destroy_works() { + let token = 1; + let creator = ALICE; + ExtBuilder::new() + .with_assets(vec![(token, creator.clone(), false, 1)]) + .build() + .execute_with(|| { + // Check error works for `Assets::start_destroy()`. + assert_noop!( + start_destroy::(signed(creator.clone()), TokenId::MAX), + AssetsError::Unknown + ); + assert_ok!(start_destroy::(signed(creator.clone()), token)); + // Check that the token is not live after starting the destroy process. + assert_noop!( + Assets::mint(signed(creator.clone()), token.into(), creator.into(), 10 * UNIT), + TokenError::UnknownAsset + ); + }); +} From 964e78cb4bc3a5a1101be2e4550fe410826117ac Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:44:05 +0100 Subject: [PATCH 127/162] test(api): add set_metadata test --- pallets/api-vnext/src/fungibles/tests.rs | 41 +++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index ad8774532..35005d05f 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -1,7 +1,10 @@ use frame_support::{ assert_noop, assert_ok, sp_runtime::{DispatchError::BadOrigin, TokenError}, - traits::{fungibles::approvals::Mutate, Get}, + traits::{ + fungibles::{approvals::Mutate, metadata::Inspect}, + Get, + }, }; use pallet_assets::WeightInfo as _; @@ -335,3 +338,39 @@ fn start_destroy_works() { ); }); } + +#[test] +fn set_metadata_works() { + let token = 1; + let creator = ALICE; + let name = vec![42]; + let symbol = vec![42]; + let decimals = 42; + ExtBuilder::new() + .with_balances(vec![(creator.clone(), UNIT)]) + .with_assets(vec![(token, creator.clone(), false, 1)]) + .build() + .execute_with(|| { + // Check error works for `Assets::set_metadata()`. + assert_noop!( + set_metadata::( + signed(creator.clone()), + TokenId::MAX, + name.clone(), + symbol.clone(), + decimals + ), + AssetsError::Unknown + ); + assert_ok!(set_metadata::( + signed(creator), + token, + name.clone(), + symbol.clone(), + decimals + )); + assert_eq!(Assets::name(token), name); + assert_eq!(Assets::symbol(token), symbol); + assert_eq!(Assets::decimals(token), decimals); + }); +} From 6c57aa63c6d80fdef835a993d83f67ca3ad1543d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:48:22 +0100 Subject: [PATCH 128/162] test(api): add clear_metadata test --- pallets/api-vnext/src/fungibles/tests.rs | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 35005d05f..b25d30272 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -343,8 +343,8 @@ fn start_destroy_works() { fn set_metadata_works() { let token = 1; let creator = ALICE; - let name = vec![42]; - let symbol = vec![42]; + let name = b"name".to_vec(); + let symbol = b"symbol".to_vec(); let decimals = 42; ExtBuilder::new() .with_balances(vec![(creator.clone(), UNIT)]) @@ -374,3 +374,24 @@ fn set_metadata_works() { assert_eq!(Assets::decimals(token), decimals); }); } + +#[test] +fn clear_metadata_works() { + let token = 1; + let creator = ALICE; + ExtBuilder::new() + .with_assets(vec![(token, creator.clone(), false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), 42)]) + .build() + .execute_with(|| { + // Check error works for `Assets::clear_metadata()`. + assert_noop!( + clear_metadata::(signed(creator.clone()), TokenId::MAX), + AssetsError::Unknown + ); + assert_ok!(clear_metadata::(signed(creator), token)); + assert!(Assets::name(token).is_empty()); + assert!(Assets::symbol(token).is_empty()); + assert!(Assets::decimals(token).is_zero()); + }); +} From a3a4bfe95f504390413800a42ca8a49449e98958 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:52:08 +0100 Subject: [PATCH 129/162] test(api): add mint test --- pallets/api-vnext/src/fungibles/tests.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index b25d30272..7f3487ac8 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -395,3 +395,26 @@ fn clear_metadata_works() { assert!(Assets::decimals(token).is_zero()); }); } + +#[test] +fn mint_works() { + let token = 1; + let value: Balance = 100 * UNIT; + let from = ALICE; + let to = BOB; + ExtBuilder::new() + .with_balances(vec![(from.clone(), ED::get()), (to.clone(), ED::get())]) + .with_assets(vec![(token, from.clone(), false, 1)]) + .build() + .execute_with(|| { + // Check error works for `Assets::mint()`. + assert_noop!( + mint::(signed(from.clone()), TokenId::MAX, to.clone(), value), + TokenError::UnknownAsset + ); + let balance_before_mint = Assets::balance(token, &to); + assert_ok!(mint::(signed(from), token, to.clone(), value)); + let balance_after_mint = Assets::balance(token, &to); + assert_eq!(balance_after_mint, balance_before_mint + value); + }); +} From 5a03f67a7b16c631c3ec2dcbdca99a313ac90272 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 12:58:49 +0100 Subject: [PATCH 130/162] test(api): add burn test --- pallets/api-vnext/src/fungibles/tests.rs | 41 +++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 7f3487ac8..e84299828 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -399,7 +399,7 @@ fn clear_metadata_works() { #[test] fn mint_works() { let token = 1; - let value: Balance = 100 * UNIT; + let value = 100 * UNIT; let from = ALICE; let to = BOB; ExtBuilder::new() @@ -418,3 +418,42 @@ fn mint_works() { assert_eq!(balance_after_mint, balance_before_mint + value); }); } + +#[test] +fn burn_works() { + let token = 1; + let value = 100 * UNIT; + let owner = ALICE; + let from = BOB; + let total_supply = value * 2; + ExtBuilder::new() + .with_balances(vec![(from.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_balances(vec![(token, from.clone(), total_supply)]) + .build() + .execute_with(|| { + // "BalanceLow" error is returned if token is not created. + assert_noop!( + burn::(signed(owner.clone()), TokenId::MAX, from.clone(), value), + AssetsError::BalanceLow.with_weight(WeightInfo::balance_of()) + ); + assert_eq!(Assets::total_supply(token), total_supply); + // Check error works for `Assets::burn()`. + assert_ok!(Assets::freeze_asset(signed(owner.clone()), token.into())); + assert_noop!( + burn::(signed(owner.clone()), token, from.clone(), value), + AssetsError::AssetNotLive + ); + assert_ok!(Assets::thaw_asset(signed(owner.clone()), token.into())); + // "BalanceLow" error is returned if the balance is less than amount to burn. + assert_noop!( + burn::(signed(owner.clone()), token, from.clone(), total_supply * 2), + AssetsError::BalanceLow.with_weight(WeightInfo::balance_of()) + ); + let balance_before_burn = Assets::balance(token, &from); + assert_ok!(burn::(signed(owner), token, from.clone(), value)); + assert_eq!(Assets::total_supply(token), total_supply - value); + let balance_after_burn = Assets::balance(token, &from); + assert_eq!(balance_after_burn, balance_before_burn - value); + }); +} From 68e977f9c5dfca2fb477376fe3157b9dc7d4048d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:04:13 +0100 Subject: [PATCH 131/162] test(api): add exists test --- pallets/api-vnext/src/fungibles/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index e84299828..258e7b961 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -457,3 +457,16 @@ fn burn_works() { assert_eq!(balance_after_burn, balance_before_burn - value); }); } + +#[test] +fn exists_works() { + let token = 1; + let owner = ALICE; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + assert_eq!(exists::(TokenId::MAX), false); + assert_eq!(exists::(token), true); + }); +} From 1551f5becd57399085e69348a5343bc4daba5b5b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:21:14 +0100 Subject: [PATCH 132/162] refactor(api): share total_supply implementation --- pallets/api-vnext/src/fungibles/mod.rs | 4 ++++ .../api-vnext/src/fungibles/precompiles/erc20.rs | 2 +- pallets/api-vnext/src/fungibles/precompiles/mod.rs | 3 +-- pallets/api-vnext/src/fungibles/tests.rs | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index c43a6dd67..c272ba954 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -208,6 +208,10 @@ fn start_destroy, I>( >::start_destroy(origin, asset.into()) } +fn total_supply, I>(asset: AssetIdOf) -> T::Balance { + >::total_supply(asset) +} + fn transfer, I>( origin: OriginFor, asset: AssetIdOf, diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 656b77745..ad047f284 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -51,7 +51,7 @@ where totalSupply(_) => { env.charge(>::WeightInfo::total_supply())?; - let total_supply = U256::saturating_from(>::total_supply(token)); + let total_supply = U256::saturating_from(super::total_supply::(token)); Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 39f133a51..e5c34110e 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -247,8 +247,7 @@ where IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { env.charge(>::WeightInfo::total_supply())?; - let total_supply = - U256::saturating_from(>::total_supply((*token).into())); + let total_supply = U256::saturating_from(total_supply::((*token).into())); Ok(totalSupplyCall::abi_encode_returns(&total_supply)) }, diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 258e7b961..f4607a5ef 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -458,6 +458,20 @@ fn burn_works() { }); } +#[test] +fn total_supply_works() { + let token = 1; + let total_supply = 100 * UNIT; + ExtBuilder::new() + .with_assets(vec![(token, ALICE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, total_supply)]) + .build() + .execute_with(|| { + assert_eq!(super::total_supply::(TokenId::MAX), 0); + assert_eq!(super::total_supply::(token), total_supply); + }); +} + #[test] fn exists_works() { let token = 1; From ed72517fa11093640df1b6c5aa09e3ad34d52831 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:27:47 +0100 Subject: [PATCH 133/162] refactor(api): share balance implementation --- pallets/api-vnext/src/fungibles/mod.rs | 7 +++++++ .../api-vnext/src/fungibles/precompiles/erc20.rs | 2 +- .../api-vnext/src/fungibles/precompiles/mod.rs | 3 +-- pallets/api-vnext/src/fungibles/tests.rs | 15 +++++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index c272ba954..dd4239eff 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -94,6 +94,13 @@ fn approve + pallet_assets::Config, I>( Ok(Some(weight).into()) } +fn balance, I>( + asset: AssetIdOf, + account: &T::AccountId, +) -> T::Balance { + >::balance(asset, account) +} + fn burn + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index ad047f284..a8a66c394 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -59,7 +59,7 @@ where env.charge(>::WeightInfo::balance_of())?; let account = env.to_account_id(&(*account.0).into()); - let balance = U256::saturating_from(>::balance(token, account)); + let balance = U256::saturating_from(super::balance::(token, &account)); Ok(balanceOfCall::abi_encode_returns(&balance)) }, diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index e5c34110e..b832126a5 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -255,8 +255,7 @@ where env.charge(>::WeightInfo::balance_of())?; let account = env.to_account_id(&(*owner.0).into()); - let balance = - U256::saturating_from(>::balance((*token).into(), account)); + let balance = U256::saturating_from(balance::((*token).into(), &account)); Ok(balanceOfCall::abi_encode_returns(&balance)) }, diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index f4607a5ef..765a09999 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -472,6 +472,21 @@ fn total_supply_works() { }); } +#[test] +fn balance_of_works() { + let token = 1; + let owner = ALICE; + let value = 100 * UNIT; + ExtBuilder::new() + .with_assets(vec![(token, owner.clone(), false, 1)]) + .with_asset_balances(vec![(token, owner.clone(), value)]) + .build() + .execute_with(|| { + assert_eq!(balance::(TokenId::MAX, &owner), 0); + assert_eq!(balance::(token, &owner), value); + }); +} + #[test] fn exists_works() { let token = 1; From a856e3c0973c75e1389143716bd2fcb31a533a09 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:36:04 +0100 Subject: [PATCH 134/162] refactor(api): share allowance implementation --- pallets/api-vnext/src/fungibles/mod.rs | 8 ++++++++ .../src/fungibles/precompiles/erc20.rs | 2 +- .../src/fungibles/precompiles/mod.rs | 19 ++++++++++--------- pallets/api-vnext/src/fungibles/tests.rs | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index dd4239eff..fd6497f38 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -94,6 +94,14 @@ fn approve + pallet_assets::Config, I>( Ok(Some(weight).into()) } +fn allowance, I>( + asset: AssetIdOf, + owner: &T::AccountId, + spender: &T::AccountId, +) -> T::Balance { + >::allowance(asset, owner, spender) +} + fn balance, I>( asset: AssetIdOf, account: &T::AccountId, diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index a8a66c394..59e3b2350 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -83,7 +83,7 @@ where let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); let remaining = - U256::saturating_from(>::allowance(token, &owner, &spender)); + U256::saturating_from(super::allowance::(token, &owner, &spender)); Ok(allowanceCall::abi_encode_returns(&remaining)) }, diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index b832126a5..8564e50e5 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -52,7 +52,7 @@ where env.charge(>::WeightInfo::transfer())?; let from = >::to_address(env.caller().account_id()?).0.into(); - self::transfer::( + transfer::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*to.0).into()), @@ -82,7 +82,7 @@ where let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - let result = self::approve::( + let result = approve::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), @@ -106,7 +106,7 @@ where let owner = >::to_address(env.caller().account_id()?).0.into(); let value = U256::saturating_from( - self::increase_allowance::( + increase_allowance::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), @@ -132,7 +132,7 @@ where let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - let value = match self::decrease_allowance::( + let value = match decrease_allowance::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), @@ -168,7 +168,7 @@ where env.charge(>::WeightInfo::create())?; let creator = >::to_address(env.caller().account_id()?).0.into(); - let id = self::create::( + let id = create::( to_runtime_origin(env.caller()), env.to_account_id(&(*admin.0).into()), minBalance.saturating_to(), @@ -202,12 +202,13 @@ where env.charge(>::WeightInfo::clear_metadata())?; clear_metadata::(to_runtime_origin(env.caller()), (*token).into())?; + Ok(clearMetadataCall::abi_encode_returns(&clearMetadataReturn {})) }, IFungiblesCalls::mint(mintCall { token, account, value }) => { env.charge(>::WeightInfo::mint())?; - self::mint::( + mint::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*account.0).into()), @@ -222,7 +223,7 @@ where IFungiblesCalls::burn(burnCall { token, account, value }) => { let charged = env.charge(>::WeightInfo::burn())?; - self::burn::( + burn::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*account.0).into()), @@ -264,7 +265,7 @@ where let owner = env.to_account_id(&(*owner.0).into()); let spender = env.to_account_id(&(*spender.0).into()); - let allowance = >::allowance((*token).into(), &owner, &spender); + let allowance = allowance::((*token).into(), &owner, &spender); let remaining = U256::saturating_from(allowance); Ok(allowanceCall::abi_encode_returns(&remaining)) @@ -295,7 +296,7 @@ where IFungiblesCalls::exists(existsCall { token }) => { env.charge(>::WeightInfo::exists())?; - let result = self::exists::((*token).into()); + let result = exists::((*token).into()); Ok(existsCall::abi_encode_returns(&result)) }, diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 765a09999..2d6fb158b 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -487,6 +487,23 @@ fn balance_of_works() { }); } +#[test] +fn allowance_works() { + let token = 1; + let value: Balance = 100 * UNIT; + let owner = ALICE; + let spender = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT), (spender.clone(), ED::get())]) + .with_assets(vec![(token, owner.clone(), false, 1)]) + .build() + .execute_with(|| { + assert_eq!(allowance::(token, &owner, &spender), 0); + assert_ok!(Assets::approve(token, &owner, &spender, value)); + assert_eq!(allowance::(token, &owner, &spender), value); + }); +} + #[test] fn exists_works() { let token = 1; From 024a5977d87614b8360e199248edd7b89e7b8077 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:47:35 +0100 Subject: [PATCH 135/162] refactor(api): share metadata implementation --- pallets/api-vnext/src/fungibles/mod.rs | 14 ++++++++++- .../src/fungibles/precompiles/erc20.rs | 16 ++++++------- .../src/fungibles/precompiles/mod.rs | 7 +++--- pallets/api-vnext/src/fungibles/tests.rs | 23 +++++++++++++++++++ 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles/mod.rs index fd6497f38..8a54ce770 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles/mod.rs @@ -10,7 +10,7 @@ use frame_support::{ }, pallet_prelude::{CheckedSub, DispatchError, Zero}, sp_runtime::Saturating, - traits::fungibles::{approvals::Inspect as _, Inspect as _}, + traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _, Inspect as _}, weights::Weight, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; @@ -141,6 +141,10 @@ fn create, I>( Ok(id) } +fn decimals, I>(asset: AssetIdOf) -> u8 { + >::decimals(asset) +} + fn decrease_allowance + pallet_assets::Config, I>( origin: OriginFor, asset: AssetIdOf, @@ -206,6 +210,10 @@ fn mint, I>( >::mint(origin, asset.into(), T::Lookup::unlookup(account), value) } +fn name, I>(asset: AssetIdOf) -> Vec { + >::name(asset) +} + fn set_metadata, I>( origin: OriginFor, asset: AssetIdOf, @@ -223,6 +231,10 @@ fn start_destroy, I>( >::start_destroy(origin, asset.into()) } +fn symbol, I>(asset: AssetIdOf) -> Vec { + >::symbol(asset) +} + fn total_supply, I>(asset: AssetIdOf) -> T::Balance { >::total_supply(asset) } diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 59e3b2350..9afe3ab03 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -1,9 +1,6 @@ use alloc::{string::String, vec::Vec}; -use frame_support::{ - sp_runtime::traits::AtLeast32Bit, - traits::fungibles::{approvals::Inspect as _, metadata::Inspect as _}, -}; +use frame_support::sp_runtime::traits::AtLeast32Bit; use pallet_assets::precompiles::{AssetIdExtractor, InlineAssetIdExtractor}; use pallet_revive::{precompiles::RuntimeCosts, AddressMapper as _}; use AddressMatcher::Prefix; @@ -11,8 +8,8 @@ use IERC20::*; use super::{ deposit_event, prefixed_address, sol, to_runtime_origin, weights::WeightInfo, AddressMapper, - AddressMatcher, Assets, Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, - UintTryFrom, UintTryTo, U256, + AddressMatcher, Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, UintTryFrom, + UintTryTo, U256, }; sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); @@ -128,7 +125,7 @@ where name(_) => { env.charge(>::WeightInfo::metadata_name())?; - let result = >::name(token); + let result = super::name::(token); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) @@ -136,7 +133,7 @@ where symbol(_) => { env.charge(>::WeightInfo::metadata_symbol())?; - let result = >::symbol(token); + let result = super::symbol::(token); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(symbolCall::abi_encode_returns(&result)) @@ -144,7 +141,7 @@ where decimals(_) => { env.charge(>::WeightInfo::metadata_decimals())?; - let result = >::decimals(token); + let result = super::decimals::(token); Ok(decimalsCall::abi_encode_returns(&result)) }, @@ -164,6 +161,7 @@ mod tests { use frame_support::{ assert_ok, sp_runtime::{app_crypto::sp_core::bytes::to_hex, DispatchError}, + traits::fungibles::approvals::Inspect, }; use pallet_revive::{ precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 8564e50e5..1a33e933e 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -1,7 +1,6 @@ use alloc::string::String; pub use erc20::{Erc20, IERC20}; -use frame_support::traits::fungibles::metadata::Inspect as _; pub(super) use pallet_revive::precompiles::alloy::{ primitives::{ ruint::{UintTryFrom, UintTryTo}, @@ -273,7 +272,7 @@ where IFungiblesCalls::name(nameCall { token }) => { env.charge(>::WeightInfo::metadata_name())?; - let result = >::name((*token).into()); + let result = name::((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) @@ -281,7 +280,7 @@ where IFungiblesCalls::symbol(symbolCall { token }) => { env.charge(>::WeightInfo::metadata_symbol())?; - let result = >::symbol((*token).into()); + let result = symbol::((*token).into()); let result = String::from_utf8_lossy(result.as_slice()).into(); Ok(nameCall::abi_encode_returns(&result)) @@ -289,7 +288,7 @@ where IFungiblesCalls::decimals(decimalsCall { token }) => { env.charge(>::WeightInfo::metadata_decimals())?; - let result = >::decimals((*token).into()); + let result = decimals::((*token).into()); Ok(decimalsCall::abi_encode_returns(&result)) }, diff --git a/pallets/api-vnext/src/fungibles/tests.rs b/pallets/api-vnext/src/fungibles/tests.rs index 2d6fb158b..5c74498e4 100644 --- a/pallets/api-vnext/src/fungibles/tests.rs +++ b/pallets/api-vnext/src/fungibles/tests.rs @@ -504,6 +504,29 @@ fn allowance_works() { }); } +#[test] +fn metadata_works() { + let token = 1; + let creator = ALICE; + let name = b"name".to_vec(); + let symbol = b"symbol".to_vec(); + let decimals = 42; + ExtBuilder::new() + .with_balances(vec![(creator.clone(), UNIT)]) + .with_assets(vec![(token, creator.clone(), false, 1)]) + .with_asset_metadata(vec![(token, name.clone(), symbol.clone(), decimals)]) + .build() + .execute_with(|| { + assert!(super::name::(TokenId::MAX).is_empty()); + assert!(super::symbol::(TokenId::MAX).is_empty()); + assert_eq!(super::decimals::(TokenId::MAX), 0); + + assert_eq!(super::name::(token), name); + assert_eq!(super::symbol::(token), symbol); + assert_eq!(super::decimals::(token), decimals); + }); +} + #[test] fn exists_works() { let token = 1; From 4110d6ec58f806f7ce0a8745defe666330028139 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 13:56:47 +0100 Subject: [PATCH 136/162] test(api): explicitly endow when more than ed required --- .../src/fungibles/precompiles/erc20.rs | 5 +- .../src/fungibles/precompiles/mod.rs | 83 ++++++++++--------- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 9afe3ab03..42e734154 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -174,7 +174,7 @@ mod tests { use crate::{ assert_last_event, bare_call, fungibles::approve, - mock::{Assets, ExtBuilder, RuntimeOrigin, Test, ERC20}, + mock::{Assets, ExtBuilder, RuntimeOrigin, Test, ERC20, UNIT}, to_address, DepositLimit, Weight, }; @@ -260,6 +260,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { @@ -292,6 +293,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { @@ -324,6 +326,7 @@ mod tests { let to = CHARLIE; let value = endowment / 2; ExtBuilder::new() + .with_balances(vec![(from.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, true, 1)]) .with_asset_balances(vec![(token, from.clone(), endowment)]) .build() diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/mod.rs index 1a33e933e..f2e0f082c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/mod.rs @@ -377,6 +377,7 @@ mod tests { let to = CHARLIE; let value = endowment / 2; ExtBuilder::new() + .with_balances(vec![(from.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, true, 1)]) .with_asset_balances(vec![(token, from.clone(), endowment)]) .build() @@ -416,6 +417,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { @@ -445,6 +447,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { @@ -483,6 +486,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { @@ -520,45 +524,48 @@ mod tests { let origin = ALICE; let admin = BOB; let min_balance = 1; - ExtBuilder::new().build().execute_with(|| { - assert!(!Assets::asset_exists(token)); + ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) + .build() + .execute_with(|| { + assert!(!Assets::asset_exists(token)); - assert_eq!( - call_precompile::( - &origin, - &IFungiblesCalls::create(createCall { - admin: to_address(&admin).0.into(), - minBalance: U256::from(min_balance), - }), - ) - .unwrap(), - token - ); - - assert!(Assets::asset_exists(token)); - assert_eq!( - Asset::get(token).unwrap(), - AssetDetails { - owner: origin.clone(), - issuer: admin.clone(), - admin: admin.clone(), - freezer: admin.clone(), - supply: 0, - deposit: min_balance, - min_balance, - is_sufficient: false, - accounts: 0, - sufficients: 0, - approvals: 0, - status: AssetStatus::Live, - } - ); + assert_eq!( + call_precompile::( + &origin, + &IFungiblesCalls::create(createCall { + admin: to_address(&admin).0.into(), + minBalance: U256::from(min_balance), + }), + ) + .unwrap(), + token + ); - let creator = to_address(&origin).0.into(); - let admin = to_address(&admin).0.into(); - let event = Created { id: token, creator, admin }; - assert_last_event(ADDRESS, event); - }); + assert!(Assets::asset_exists(token)); + assert_eq!( + Asset::get(token).unwrap(), + AssetDetails { + owner: origin.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), + supply: 0, + deposit: min_balance, + min_balance, + is_sufficient: false, + accounts: 0, + sufficients: 0, + approvals: 0, + status: AssetStatus::Live, + } + ); + + let creator = to_address(&origin).0.into(); + let admin = to_address(&admin).0.into(); + let event = Created { id: token, creator, admin }; + assert_last_event(ADDRESS, event); + }); } #[test] @@ -588,6 +595,7 @@ mod tests { let symbol = "symbol".to_string(); let decimals = u8::MAX; ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) .with_assets(vec![(token, origin.clone(), false, 1)]) .build() .execute_with(|| { @@ -758,6 +766,7 @@ mod tests { let spender = BOB; let value = 10_000_000; ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT)]) .with_assets(vec![(token, CHARLIE, false, 1)]) .build() .execute_with(|| { From 0576f765853b838966752e436d27dd04b5de061b Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 16:54:11 +0100 Subject: [PATCH 137/162] refactor(api): reorganize for versioning --- .../src/{fungibles/mod.rs => fungibles.rs} | 1 - .../api-vnext/src/fungibles/benchmarking.rs | 7 +- .../api-vnext/src/fungibles/precompiles.rs | 19 + .../src/fungibles/precompiles/erc20.rs | 438 +---------------- .../src/fungibles/precompiles/erc20/v0.rs | 432 +++++++++++++++++ .../interfaces/{ => v0}/IERC20.sol | 0 .../interfaces/{ => v0}/IFungibles.sol | 0 .../fungibles/precompiles/{mod.rs => v0.rs} | 27 +- pallets/api-vnext/src/lib.rs | 2 - pallets/api-vnext/src/mock.rs | 5 +- pop-api-vnext/examples/fungibles/lib.rs | 2 +- .../contracts/fungibles/lib.rs | 2 +- pop-api-vnext/integration-tests/src/lib.rs | 14 +- pop-api-vnext/src/fungibles.rs | 17 + pop-api-vnext/src/fungibles/erc20.rs | 446 +----------------- pop-api-vnext/src/fungibles/erc20/v0.rs | 180 +++++++ .../src/fungibles/erc20/v0/errors.rs | 236 +++++++++ .../src/fungibles/erc20/v0/events.rs | 32 ++ pop-api-vnext/src/fungibles/{mod.rs => v0.rs} | 31 +- .../src/fungibles/{ => v0}/errors.rs | 0 .../src/fungibles/{ => v0}/events.rs | 2 +- pop-api-vnext/src/lib.rs | 13 +- pop-api-vnext/src/sol.rs | 14 + runtime/devnet/src/config/contracts.rs | 20 +- 24 files changed, 987 insertions(+), 953 deletions(-) rename pallets/api-vnext/src/{fungibles/mod.rs => fungibles.rs} (99%) create mode 100644 pallets/api-vnext/src/fungibles/precompiles.rs create mode 100644 pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs rename pallets/api-vnext/src/fungibles/precompiles/interfaces/{ => v0}/IERC20.sol (100%) rename pallets/api-vnext/src/fungibles/precompiles/interfaces/{ => v0}/IFungibles.sol (100%) rename pallets/api-vnext/src/fungibles/precompiles/{mod.rs => v0.rs} (97%) create mode 100644 pop-api-vnext/src/fungibles.rs create mode 100644 pop-api-vnext/src/fungibles/erc20/v0.rs create mode 100644 pop-api-vnext/src/fungibles/erc20/v0/errors.rs create mode 100644 pop-api-vnext/src/fungibles/erc20/v0/events.rs rename pop-api-vnext/src/fungibles/{mod.rs => v0.rs} (96%) rename pop-api-vnext/src/fungibles/{ => v0}/errors.rs (100%) rename pop-api-vnext/src/fungibles/{ => v0}/events.rs (97%) create mode 100644 pop-api-vnext/src/sol.rs diff --git a/pallets/api-vnext/src/fungibles/mod.rs b/pallets/api-vnext/src/fungibles.rs similarity index 99% rename from pallets/api-vnext/src/fungibles/mod.rs rename to pallets/api-vnext/src/fungibles.rs index 8a54ce770..0947bc972 100644 --- a/pallets/api-vnext/src/fungibles/mod.rs +++ b/pallets/api-vnext/src/fungibles.rs @@ -16,7 +16,6 @@ use frame_support::{ use frame_system::{ensure_signed, pallet_prelude::OriginFor}; pub use pallet::*; use pallet_assets::NextAssetId; -pub use precompiles::{Erc20, Fungibles}; use weights::WeightInfo; use AddressMatcher::Fixed; diff --git a/pallets/api-vnext/src/fungibles/benchmarking.rs b/pallets/api-vnext/src/fungibles/benchmarking.rs index a3425e6d7..73bbcddeb 100644 --- a/pallets/api-vnext/src/fungibles/benchmarking.rs +++ b/pallets/api-vnext/src/fungibles/benchmarking.rs @@ -30,7 +30,10 @@ use pallet_revive::{ }; use super::{ - precompiles::{IFungibles, IFungiblesCalls, UintTryFrom, UintTryTo}, + precompiles::{ + v0::{IFungibles, IFungiblesCalls}, + UintTryFrom, UintTryTo, + }, Config, NextAssetId, Pallet, }; #[cfg(test)] @@ -45,7 +48,7 @@ type Assets = pallet_assets::Pallet; type AssetsBalance = >::Balance; type AssetsStringLimit = >::StringLimit; type Balances = ::Currency; -type Fungibles = super::Fungibles; +type Fungibles = super::precompiles::v0::Fungibles; type TokenId = >::AssetId; #[instance_benchmarks( diff --git a/pallets/api-vnext/src/fungibles/precompiles.rs b/pallets/api-vnext/src/fungibles/precompiles.rs new file mode 100644 index 000000000..2ce954f78 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles.rs @@ -0,0 +1,19 @@ +use alloc::string::String; + +pub(super) use pallet_revive::precompiles::alloy::{ + primitives::{ + ruint::{UintTryFrom, UintTryTo}, + Address, U256, + }, + sol_types::SolCall, +}; +use pallet_revive::precompiles::RuntimeCosts; +use weights::WeightInfo; + +use super::*; + +/// APIs for fungible tokens conforming to the ERC20 standard. +pub mod erc20; + +/// The first version of the Fungibles API. +pub mod v0; diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs index 42e734154..43e23df9a 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20.rs @@ -1,436 +1,4 @@ -use alloc::{string::String, vec::Vec}; +use super::{SolCall, UintTryFrom, UintTryTo, U256}; -use frame_support::sp_runtime::traits::AtLeast32Bit; -use pallet_assets::precompiles::{AssetIdExtractor, InlineAssetIdExtractor}; -use pallet_revive::{precompiles::RuntimeCosts, AddressMapper as _}; -use AddressMatcher::Prefix; -use IERC20::*; - -use super::{ - deposit_event, prefixed_address, sol, to_runtime_origin, weights::WeightInfo, AddressMapper, - AddressMatcher, Config, Error, Ext, NonZero, PhantomData, Precompile, SolCall, UintTryFrom, - UintTryTo, U256, -}; - -sol!("src/fungibles/precompiles/interfaces/IERC20.sol"); - -/// Precompile providing an interface of the ERC-20 standard as defined in the ERC. -pub struct Erc20(PhantomData<(T, I)>); -impl< - const PREFIX: u16, - T: frame_system::Config - + pallet_assets::Config - + pallet_revive::Config - + Config, - I: 'static, - > Precompile for Erc20 -where - U256: UintTryFrom + UintTryTo, -{ - type Interface = IERC20Calls; - type T = T; - - const HAS_CONTRACT_INFO: bool = false; - const MATCHER: AddressMatcher = - Prefix(NonZero::new(PREFIX).expect("expected non-zero precompile address")); - - fn call( - address: &[u8; 20], - input: &Self::Interface, - env: &mut impl Ext, - ) -> Result, Error> { - use IERC20::{IERC20Calls::*, *}; - - let token = InlineAssetIdExtractor::asset_id_from_address(address)?.into(); - - match input { - // IERC20 - totalSupply(_) => { - env.charge(>::WeightInfo::total_supply())?; - - let total_supply = U256::saturating_from(super::total_supply::(token)); - - Ok(totalSupplyCall::abi_encode_returns(&total_supply)) - }, - balanceOf(balanceOfCall { account }) => { - env.charge(>::WeightInfo::balance_of())?; - - let account = env.to_account_id(&(*account.0).into()); - let balance = U256::saturating_from(super::balance::(token, &account)); - - Ok(balanceOfCall::abi_encode_returns(&balance)) - }, - transfer(transferCall { to, value }) => { - env.charge(>::WeightInfo::transfer())?; - let from = >::to_address(env.caller().account_id()?).0.into(); - - super::transfer::( - to_runtime_origin(env.caller()), - token, - env.to_account_id(&(*to.0).into()), - value.saturating_to(), - )?; - - deposit_event::(env, address, Transfer { from, to: *to, value: *value }); - Ok(transferCall::abi_encode_returns(&true)) - }, - allowance(allowanceCall { owner, spender }) => { - env.charge(>::WeightInfo::allowance())?; - - let owner = env.to_account_id(&(*owner.0).into()); - let spender = env.to_account_id(&(*spender.0).into()); - let remaining = - U256::saturating_from(super::allowance::(token, &owner, &spender)); - - Ok(allowanceCall::abi_encode_returns(&remaining)) - }, - approve(approveCall { spender, value }) => { - let charged = env.charge(>::WeightInfo::approve(1, 1))?; - let owner = >::to_address(env.caller().account_id()?).0.into(); - - let result = super::approve::( - to_runtime_origin(env.caller()), - token, - env.to_account_id(&(*spender.0).into()), - value.saturating_to(), - ) // TODO: adjust weight - .map_err(|e| e.error)?; - - // Adjust weight - if let Some(actual_weight) = result.actual_weight { - // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 lands - env.gas_meter_mut() - .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); - } - - let event = Approval { owner, spender: *spender, value: *value }; - deposit_event(env, address, event); - Ok(approveCall::abi_encode_returns(&true)) - }, - transferFrom(transferFromCall { from, to, value }) => { - env.charge(>::WeightInfo::transfer_from())?; - - super::transfer_from::( - to_runtime_origin(env.caller()), - token, - env.to_account_id(&(*from.0).into()), - env.to_account_id(&(*to.0).into()), - value.saturating_to(), - )?; - - deposit_event(env, address, Transfer { from: *from, to: *to, value: *value }); - Ok(transferFromCall::abi_encode_returns(&true)) - }, - // IERC20Metadata - name(_) => { - env.charge(>::WeightInfo::metadata_name())?; - - let result = super::name::(token); - let result = String::from_utf8_lossy(result.as_slice()).into(); - - Ok(nameCall::abi_encode_returns(&result)) - }, - symbol(_) => { - env.charge(>::WeightInfo::metadata_symbol())?; - - let result = super::symbol::(token); - let result = String::from_utf8_lossy(result.as_slice()).into(); - - Ok(symbolCall::abi_encode_returns(&result)) - }, - decimals(_) => { - env.charge(>::WeightInfo::metadata_decimals())?; - - let result = super::decimals::(token); - - Ok(decimalsCall::abi_encode_returns(&result)) - }, - } - } -} - -impl, I: 'static> Erc20 { - /// The address of the precompile. - pub fn address(id: u32) -> [u8; 20] { - prefixed_address(PREFIX, id) - } -} - -#[cfg(test)] -mod tests { - use frame_support::{ - assert_ok, - sp_runtime::{app_crypto::sp_core::bytes::to_hex, DispatchError}, - traits::fungibles::approvals::Inspect, - }; - use pallet_revive::{ - precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, - test_utils::{ALICE, BOB, CHARLIE}, - }; - use IERC20Calls::*; - use IERC20::{Approval, Transfer}; - - use super::*; - use crate::{ - assert_last_event, bare_call, - fungibles::approve, - mock::{Assets, ExtBuilder, RuntimeOrigin, Test, ERC20, UNIT}, - to_address, DepositLimit, Weight, - }; - - type AccountId = ::AccountId; - - #[test] - fn total_supply_works() { - let token = 1; - let total_supply = 10_000_000; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .with_asset_balances(vec![(token, ALICE, total_supply)]) - .build() - .execute_with(|| { - assert_eq!( - call_precompile::(&ALICE, token, &totalSupply(totalSupplyCall {})) - .unwrap(), - U256::from(total_supply) - ); - }); - } - - #[test] - fn balance_of_works() { - let token = 1; - let account = ALICE; - let endowment = 10_000_000; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .with_asset_balances(vec![(token, account.clone(), endowment)]) - .build() - .execute_with(|| { - assert_eq!( - call_precompile::( - &BOB, - token, - &balanceOf(balanceOfCall { account: to_address(&account).0.into() }) - ) - .unwrap(), - U256::from(endowment) - ); - }); - } - - #[test] - fn transfer_works() { - let token = 1; - let origin = ALICE; - let endowment = 10_000_000; - let to = BOB; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, true, 1)]) - .with_asset_balances(vec![(token, origin.clone(), endowment)]) - .build() - .execute_with(|| { - assert_eq!(Assets::balance(token, &origin), endowment); - assert_eq!(Assets::balance(token, &to), 0); - - let value = endowment / 2; - assert!(call_precompile::( - &origin, - token, - &IERC20Calls::transfer(IERC20::transferCall { - to: to_address(&to).0.into(), - value: U256::from(value) - }) - ) - .unwrap()); - - assert_eq!(Assets::balance(token, &origin), endowment - value); - assert_eq!(Assets::balance(token, &to), value); - let from = to_address(&origin).0.into(); - let to = to_address(&to).0.into(); - let event = Transfer { from, to, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, token), event); - }); - } - - #[test] - fn allowance_works() { - let token = 1; - let owner = ALICE; - let spender = BOB; - let value = 10_000_000; - ExtBuilder::new() - .with_balances(vec![(owner.clone(), UNIT)]) - .with_assets(vec![(token, CHARLIE, false, 1)]) - .build() - .execute_with(|| { - assert_ok!(approve::( - RuntimeOrigin::signed(owner.clone()), - token, - BOB, - value - )); - - assert_eq!( - call_precompile::( - &BOB, - token, - &allowance(allowanceCall { - owner: to_address(&owner).0.into(), - spender: to_address(&spender).0.into(), - }) - ) - .unwrap(), - U256::from(value) - ); - }); - } - - #[test] - fn approve_works() { - let token = 1; - let origin = ALICE; - let spender = BOB; - let value = 10_000_000; - ExtBuilder::new() - .with_balances(vec![(origin.clone(), UNIT)]) - .with_assets(vec![(token, CHARLIE, false, 1)]) - .build() - .execute_with(|| { - assert_eq!(Assets::allowance(token, &origin, &spender), 0); - - assert!(call_precompile::( - &origin, - token, - &IERC20Calls::approve(IERC20::approveCall { - spender: to_address(&spender).0.into(), - value: U256::from(value) - }) - ) - .unwrap()); - - assert_eq!(Assets::allowance(token, &origin, &spender), value); - let owner = to_address(&origin).0.into(); - let spender = to_address(&spender).0.into(); - let event = Approval { owner, spender, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, token), event); - }); - } - - #[test] - fn transfer_from_works() { - let token = 1; - let origin = BOB; - let from = ALICE; - let endowment = 10_000_000; - let to = CHARLIE; - let value = endowment / 2; - ExtBuilder::new() - .with_balances(vec![(from.clone(), UNIT)]) - .with_assets(vec![(token, CHARLIE, true, 1)]) - .with_asset_balances(vec![(token, from.clone(), endowment)]) - .build() - .execute_with(|| { - assert_eq!(Assets::balance(token, &from), endowment); - assert_eq!(Assets::balance(token, &to), 0); - assert_ok!(approve::( - RuntimeOrigin::signed(from.clone()), - token, - origin.clone(), - value - )); - - assert!(call_precompile::( - &origin, - token, - &transferFrom(IERC20::transferFromCall { - from: to_address(&from).0.into(), - to: to_address(&to).0.into(), - value: U256::from(value), - }) - ) - .unwrap()); - - assert_eq!(Assets::balance(token, &from), endowment - value); - assert_eq!(Assets::balance(token, &to), value); - let from = to_address(&from).0.into(); - let to = to_address(&to).0.into(); - let event = Transfer { from, to, value: U256::from(value) }; - assert_last_event(prefixed_address(ERC20, token), event); - }); - } - - #[test] - fn name_works() { - let token = 1; - let _name = "name"; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .with_asset_metadata(vec![(token, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) - .build() - .execute_with(|| { - assert_eq!( - call_precompile::(&ALICE, token, &name(nameCall {})).unwrap().as_str(), - _name - ); - }); - } - - #[test] - fn symbol_works() { - let token = 1; - let _symbol = "symbol"; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .with_asset_metadata(vec![(token, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) - .build() - .execute_with(|| { - assert_eq!( - call_precompile::(&ALICE, token, &symbol(symbolCall {})) - .unwrap() - .as_str(), - _symbol - ); - }); - } - - #[test] - fn decimals_works() { - let token = 1; - let _decimals = u8::MAX; - ExtBuilder::new() - .with_assets(vec![(token, CHARLIE, false, 1)]) - .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) - .build() - .execute_with(|| { - assert_eq!( - call_precompile::(&ALICE, token, &decimals(decimalsCall {})).unwrap() - as u8, - _decimals - ); - }); - } - - #[test] - fn selectors_match_standard() { - assert_eq!(to_hex(&decimalsCall::SELECTOR, false), "0x313ce567"); - assert_eq!(to_hex(&nameCall::SELECTOR, false), "0x06fdde03"); - assert_eq!(to_hex(&symbolCall::SELECTOR, false), "0x95d89b41"); - } - - fn call_precompile::RustType>>( - origin: &AccountId, - token: u32, - input: &IERC20Calls, - ) -> Result { - let address = prefixed_address(ERC20, token); - bare_call::( - RuntimeOrigin::signed(origin.clone()), - address.into(), - 0, - Weight::MAX, - DepositLimit::Balance(u128::MAX), - input.abi_encode(), - ) - } -} +/// The first version of the Erc20 API. +pub mod v0; diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs new file mode 100644 index 000000000..cb3476d02 --- /dev/null +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs @@ -0,0 +1,432 @@ +use alloc::{string::String, vec::Vec}; + +use frame_support::sp_runtime::traits::AtLeast32Bit; +use pallet_assets::precompiles::{AssetIdExtractor, InlineAssetIdExtractor}; +use pallet_revive::{precompiles::RuntimeCosts, AddressMapper as _}; +use AddressMatcher::Prefix; +use IERC20::*; + +use super::{super::super::*, U256, *}; + +sol!("src/fungibles/precompiles/interfaces/v0/IERC20.sol"); + +/// Precompile providing an interface of the ERC-20 standard as defined in the ERC. +pub struct Erc20(PhantomData<(T, I)>); +impl< + const PREFIX: u16, + T: frame_system::Config + + pallet_assets::Config + + pallet_revive::Config + + Config, + I: 'static, + > Precompile for Erc20 +where + U256: UintTryFrom + UintTryTo, +{ + type Interface = IERC20Calls; + type T = T; + + const HAS_CONTRACT_INFO: bool = false; + const MATCHER: AddressMatcher = + Prefix(NonZero::new(PREFIX).expect("expected non-zero precompile address")); + + fn call( + address: &[u8; 20], + input: &Self::Interface, + env: &mut impl Ext, + ) -> Result, Error> { + let token = InlineAssetIdExtractor::asset_id_from_address(address)?.into(); + + match input { + // IERC20 + IERC20Calls::totalSupply(_) => { + env.charge(>::WeightInfo::total_supply())?; + + let total_supply = U256::saturating_from(total_supply::(token)); + + Ok(totalSupplyCall::abi_encode_returns(&total_supply)) + }, + IERC20Calls::balanceOf(balanceOfCall { account }) => { + env.charge(>::WeightInfo::balance_of())?; + + let account = env.to_account_id(&(*account.0).into()); + let balance = U256::saturating_from(balance::(token, &account)); + + Ok(balanceOfCall::abi_encode_returns(&balance)) + }, + IERC20Calls::transfer(transferCall { to, value }) => { + env.charge(>::WeightInfo::transfer())?; + let from = >::to_address(env.caller().account_id()?).0.into(); + + transfer::( + to_runtime_origin(env.caller()), + token, + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + deposit_event::(env, address, Transfer { from, to: *to, value: *value }); + Ok(transferCall::abi_encode_returns(&true)) + }, + IERC20Calls::allowance(allowanceCall { owner, spender }) => { + env.charge(>::WeightInfo::allowance())?; + + let owner = env.to_account_id(&(*owner.0).into()); + let spender = env.to_account_id(&(*spender.0).into()); + let remaining = U256::saturating_from(allowance::(token, &owner, &spender)); + + Ok(allowanceCall::abi_encode_returns(&remaining)) + }, + IERC20Calls::approve(approveCall { spender, value }) => { + let charged = env.charge(>::WeightInfo::approve(1, 1))?; + let owner = >::to_address(env.caller().account_id()?).0.into(); + + let result = approve::( + to_runtime_origin(env.caller()), + token, + env.to_account_id(&(*spender.0).into()), + value.saturating_to(), + ) // TODO: adjust weight + .map_err(|e| e.error)?; + + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 + // lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + + let event = Approval { owner, spender: *spender, value: *value }; + deposit_event(env, address, event); + Ok(approveCall::abi_encode_returns(&true)) + }, + IERC20Calls::transferFrom(transferFromCall { from, to, value }) => { + env.charge(>::WeightInfo::transfer_from())?; + + transfer_from::( + to_runtime_origin(env.caller()), + token, + env.to_account_id(&(*from.0).into()), + env.to_account_id(&(*to.0).into()), + value.saturating_to(), + )?; + + deposit_event(env, address, Transfer { from: *from, to: *to, value: *value }); + Ok(transferFromCall::abi_encode_returns(&true)) + }, + // IERC20Metadata + IERC20Calls::name(_) => { + env.charge(>::WeightInfo::metadata_name())?; + + let result = name::(token); + let result = String::from_utf8_lossy(result.as_slice()).into(); + + Ok(nameCall::abi_encode_returns(&result)) + }, + IERC20Calls::symbol(_) => { + env.charge(>::WeightInfo::metadata_symbol())?; + + let result = symbol::(token); + let result = String::from_utf8_lossy(result.as_slice()).into(); + + Ok(symbolCall::abi_encode_returns(&result)) + }, + IERC20Calls::decimals(_) => { + env.charge(>::WeightInfo::metadata_decimals())?; + + let result = decimals::(token); + + Ok(decimalsCall::abi_encode_returns(&result)) + }, + } + } +} + +impl, I: 'static> Erc20 { + /// The address of the precompile. + pub fn address(id: u32) -> [u8; 20] { + prefixed_address(PREFIX, id) + } +} + +#[cfg(test)] +mod tests { + use frame_support::{ + assert_ok, + sp_runtime::{app_crypto::sp_core::bytes::to_hex, DispatchError}, + traits::fungibles::approvals::Inspect, + }; + use pallet_revive::{ + precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, + test_utils::{ALICE, BOB, CHARLIE}, + }; + use IERC20Calls::*; + use IERC20::{Approval, Transfer}; + + use super::*; + use crate::{ + assert_last_event, bare_call, + fungibles::approve, + mock::{Assets, ExtBuilder, RuntimeOrigin, Test, ERC20, UNIT}, + to_address, DepositLimit, Weight, + }; + + type AccountId = ::AccountId; + + #[test] + fn total_supply_works() { + let token = 1; + let total_supply = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_balances(vec![(token, ALICE, total_supply)]) + .build() + .execute_with(|| { + assert_eq!( + call_precompile::(&ALICE, token, &totalSupply(totalSupplyCall {})) + .unwrap(), + U256::from(total_supply) + ); + }); + } + + #[test] + fn balance_of_works() { + let token = 1; + let account = ALICE; + let endowment = 10_000_000; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_balances(vec![(token, account.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!( + call_precompile::( + &BOB, + token, + &balanceOf(balanceOfCall { account: to_address(&account).0.into() }) + ) + .unwrap(), + U256::from(endowment) + ); + }); + } + + #[test] + fn transfer_works() { + let token = 1; + let origin = ALICE; + let endowment = 10_000_000; + let to = BOB; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, origin.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &origin), endowment); + assert_eq!(Assets::balance(token, &to), 0); + + let value = endowment / 2; + assert!(call_precompile::( + &origin, + token, + &IERC20Calls::transfer(IERC20::transferCall { + to: to_address(&to).0.into(), + value: U256::from(value) + }) + ) + .unwrap()); + + assert_eq!(Assets::balance(token, &origin), endowment - value); + assert_eq!(Assets::balance(token, &to), value); + let from = to_address(&origin).0.into(); + let to = to_address(&to).0.into(); + let event = Transfer { from, to, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, token), event); + }); + } + + #[test] + fn allowance_works() { + let token = 1; + let owner = ALICE; + let spender = BOB; + let value = 10_000_000; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), UNIT)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { + assert_ok!(approve::( + RuntimeOrigin::signed(owner.clone()), + token, + BOB, + value + )); + + assert_eq!( + call_precompile::( + &BOB, + token, + &IERC20Calls::allowance(allowanceCall { + owner: to_address(&owner).0.into(), + spender: to_address(&spender).0.into(), + }) + ) + .unwrap(), + U256::from(value) + ); + }); + } + + #[test] + fn approve_works() { + let token = 1; + let origin = ALICE; + let spender = BOB; + let value = 10_000_000; + ExtBuilder::new() + .with_balances(vec![(origin.clone(), UNIT)]) + .with_assets(vec![(token, CHARLIE, false, 1)]) + .build() + .execute_with(|| { + assert_eq!(Assets::allowance(token, &origin, &spender), 0); + + assert!(call_precompile::( + &origin, + token, + &IERC20Calls::approve(IERC20::approveCall { + spender: to_address(&spender).0.into(), + value: U256::from(value) + }) + ) + .unwrap()); + + assert_eq!(Assets::allowance(token, &origin, &spender), value); + let owner = to_address(&origin).0.into(); + let spender = to_address(&spender).0.into(); + let event = Approval { owner, spender, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, token), event); + }); + } + + #[test] + fn transfer_from_works() { + let token = 1; + let origin = BOB; + let from = ALICE; + let endowment = 10_000_000; + let to = CHARLIE; + let value = endowment / 2; + ExtBuilder::new() + .with_balances(vec![(from.clone(), UNIT)]) + .with_assets(vec![(token, CHARLIE, true, 1)]) + .with_asset_balances(vec![(token, from.clone(), endowment)]) + .build() + .execute_with(|| { + assert_eq!(Assets::balance(token, &from), endowment); + assert_eq!(Assets::balance(token, &to), 0); + assert_ok!(approve::( + RuntimeOrigin::signed(from.clone()), + token, + origin.clone(), + value + )); + + assert!(call_precompile::( + &origin, + token, + &transferFrom(IERC20::transferFromCall { + from: to_address(&from).0.into(), + to: to_address(&to).0.into(), + value: U256::from(value), + }) + ) + .unwrap()); + + assert_eq!(Assets::balance(token, &from), endowment - value); + assert_eq!(Assets::balance(token, &to), value); + let from = to_address(&from).0.into(); + let to = to_address(&to).0.into(); + let event = Transfer { from, to, value: U256::from(value) }; + assert_last_event(prefixed_address(ERC20, token), event); + }); + } + + #[test] + fn name_works() { + let token = 1; + let _name = "name"; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_metadata(vec![(token, _name.as_bytes().to_vec(), b"symbol".to_vec(), 10)]) + .build() + .execute_with(|| { + assert_eq!( + call_precompile::(&ALICE, token, &IERC20Calls::name(nameCall {})) + .unwrap() + .as_str(), + _name + ); + }); + } + + #[test] + fn symbol_works() { + let token = 1; + let _symbol = "symbol"; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), _symbol.as_bytes().to_vec(), 10)]) + .build() + .execute_with(|| { + assert_eq!( + call_precompile::(&ALICE, token, &IERC20Calls::symbol(symbolCall {})) + .unwrap() + .as_str(), + _symbol + ); + }); + } + + #[test] + fn decimals_works() { + let token = 1; + let _decimals = u8::MAX; + ExtBuilder::new() + .with_assets(vec![(token, CHARLIE, false, 1)]) + .with_asset_metadata(vec![(token, b"name".to_vec(), b"symbol".to_vec(), _decimals)]) + .build() + .execute_with(|| { + assert_eq!( + call_precompile::(&ALICE, token, &IERC20Calls::decimals(decimalsCall {})) + .unwrap() as u8, + _decimals + ); + }); + } + + #[test] + fn selectors_match_standard() { + assert_eq!(to_hex(&decimalsCall::SELECTOR, false), "0x313ce567"); + assert_eq!(to_hex(&nameCall::SELECTOR, false), "0x06fdde03"); + assert_eq!(to_hex(&symbolCall::SELECTOR, false), "0x95d89b41"); + } + + fn call_precompile::RustType>>( + origin: &AccountId, + token: u32, + input: &IERC20Calls, + ) -> Result { + let address = prefixed_address(ERC20, token); + bare_call::( + RuntimeOrigin::signed(origin.clone()), + address.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + input.abi_encode(), + ) + } +} diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/v0/IERC20.sol similarity index 100% rename from pallets/api-vnext/src/fungibles/precompiles/interfaces/IERC20.sol rename to pallets/api-vnext/src/fungibles/precompiles/interfaces/v0/IERC20.sol diff --git a/pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol b/pallets/api-vnext/src/fungibles/precompiles/interfaces/v0/IFungibles.sol similarity index 100% rename from pallets/api-vnext/src/fungibles/precompiles/interfaces/IFungibles.sol rename to pallets/api-vnext/src/fungibles/precompiles/interfaces/v0/IFungibles.sol diff --git a/pallets/api-vnext/src/fungibles/precompiles/mod.rs b/pallets/api-vnext/src/fungibles/precompiles/v0.rs similarity index 97% rename from pallets/api-vnext/src/fungibles/precompiles/mod.rs rename to pallets/api-vnext/src/fungibles/precompiles/v0.rs index f2e0f082c..9768400af 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/mod.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/v0.rs @@ -1,26 +1,12 @@ -use alloc::string::String; - -pub use erc20::{Erc20, IERC20}; -pub(super) use pallet_revive::precompiles::alloy::{ - primitives::{ - ruint::{UintTryFrom, UintTryTo}, - Address, U256, - }, - sol_types::SolCall, -}; -use pallet_revive::precompiles::RuntimeCosts; -use weights::WeightInfo; -pub(super) use IFungibles::*; +pub(crate) use IFungibles::*; use super::*; -mod erc20; +sol!("src/fungibles/precompiles/interfaces/v0/IFungibles.sol"); -sol!("src/fungibles/precompiles/interfaces/IFungibles.sol"); - -/// The fungibles precompile offers a streamlined interface for interacting with fungible tokens. -/// The goal is to provide a simplified, consistent API that adheres to standards in the smart -/// contract space. +/// The fungibles precompile offers a streamlined interface for interacting with fungible +/// tokens. The goal is to provide a simplified, consistent API that adheres to standards in +/// the smart contract space. pub struct Fungibles(PhantomData<(T, I)>); impl< const FIXED: u16, @@ -91,7 +77,8 @@ where // Adjust weight if let Some(actual_weight) = result.actual_weight { - // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 lands + // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 + // lands env.gas_meter_mut() .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); } diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index 67dfc7b4b..6cd84ed2e 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -6,8 +6,6 @@ use alloc::vec::Vec; use core::{convert::Into, marker::PhantomData, num::NonZero}; use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; -#[cfg(feature = "fungibles")] -pub use fungibles::precompiles::{Erc20, Fungibles}; #[cfg(any(test, feature = "runtime-benchmarks"))] use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; use pallet_revive::{ diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 81c22ba84..1c8b74ef0 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -73,7 +73,10 @@ impl pallet_revive::Config for Test { type AddressMapper = pallet_revive::AccountId32Mapper; type Currency = Balances; type InstantiateOrigin = EnsureSigned; - type Precompiles = (fungibles::Fungibles, fungibles::Erc20); + type Precompiles = ( + fungibles::precompiles::v0::Fungibles, + fungibles::precompiles::erc20::v0::Erc20, + ); type Time = Timestamp; type UploadOrigin = EnsureSigned; } diff --git a/pop-api-vnext/examples/fungibles/lib.rs b/pop-api-vnext/examples/fungibles/lib.rs index 409503526..6e9a49fd9 100644 --- a/pop-api-vnext/examples/fungibles/lib.rs +++ b/pop-api-vnext/examples/fungibles/lib.rs @@ -5,7 +5,7 @@ use pop_api::{ fungibles::{ self as api, erc20::{extensions::Erc20Metadata, Erc20}, - Approval, InvalidRecipient, NoPermission, TokenId, Transfer, + *, }, revert, }; diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index df055b2ae..725f5a6dd 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] use ink::{prelude::string::String, U256}; -use pop_api::fungibles::{self as api, events::*, Fungibles, TokenId}; +use pop_api::fungibles::{self as api, *}; #[ink::contract] pub mod fungibles { diff --git a/pop-api-vnext/integration-tests/src/lib.rs b/pop-api-vnext/integration-tests/src/lib.rs index 435a8bc73..e55bb30bf 100644 --- a/pop-api-vnext/integration-tests/src/lib.rs +++ b/pop-api-vnext/integration-tests/src/lib.rs @@ -25,7 +25,7 @@ const INIT_AMOUNT: Balance = 100_000_000 * UNIT; const INIT_VALUE: Balance = 100 * UNIT; const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::Balance(Balance::MAX); -type AssetId = u32; +type TokenId = u32; // Get the last event from `pallet-revive`. fn last_contract_event(address: &H160) -> Vec { @@ -108,9 +108,9 @@ fn to_address(account: &AccountId) -> H160 { } pub(crate) struct ExtBuilder { - assets: Option>, - asset_accounts: Option>, - asset_metadata: Option, Vec, u8)>>, + assets: Option>, + asset_accounts: Option>, + asset_metadata: Option, Vec, u8)>>, } impl ExtBuilder { @@ -118,14 +118,14 @@ impl ExtBuilder { Self { assets: None, asset_accounts: None, asset_metadata: None } } - pub(crate) fn with_assets(mut self, assets: Vec<(AssetId, AccountId, bool, Balance)>) -> Self { + pub(crate) fn with_assets(mut self, assets: Vec<(TokenId, AccountId, bool, Balance)>) -> Self { self.assets = Some(assets); self } pub(crate) fn with_asset_balances( mut self, - accounts: Vec<(AssetId, AccountId, Balance)>, + accounts: Vec<(TokenId, AccountId, Balance)>, ) -> Self { self.asset_accounts = Some(accounts); self @@ -133,7 +133,7 @@ impl ExtBuilder { pub(crate) fn with_asset_metadata( mut self, - metadata: Vec<(AssetId, Vec, Vec, u8)>, + metadata: Vec<(TokenId, Vec, Vec, u8)>, ) -> Self { self.asset_metadata = Some(metadata); self diff --git a/pop-api-vnext/src/fungibles.rs b/pop-api-vnext/src/fungibles.rs new file mode 100644 index 000000000..79b5fab99 --- /dev/null +++ b/pop-api-vnext/src/fungibles.rs @@ -0,0 +1,17 @@ +use ink::{ + contract_ref, + prelude::{string::String, vec::Vec}, + U256, +}; +use sol::*; +pub use v0::*; + +use super::*; + +/// APIs for fungible tokens conforming to the ERC20 standard. +pub mod erc20; + +/// The first version of the Fungibles API. +pub mod v0; + +pub type TokenId = u32; diff --git a/pop-api-vnext/src/fungibles/erc20.rs b/pop-api-vnext/src/fungibles/erc20.rs index 909b2838c..0fba7fa41 100644 --- a/pop-api-vnext/src/fungibles/erc20.rs +++ b/pop-api-vnext/src/fungibles/erc20.rs @@ -1,4 +1,4 @@ -pub use errors::*; +pub use v0::*; use super::{ contract_ref, prefixed_address, Address, Pop, Sol, SolAddress, SolEncode, SolError, SolType, @@ -6,445 +6,5 @@ use super::{ }; use crate::ensure; -const PRECOMPILE: u16 = 101; - -/// Interface of the ERC-20 standard. -#[ink::trait_definition] -pub trait Erc20 { - /// Returns the value of tokens in existence. - #[ink(message)] - #[allow(non_snake_case)] - fn totalSupply(&self) -> U256; - - /// Returns the value of tokens owned by `account`. - #[ink(message)] - #[allow(non_snake_case)] - fn balanceOf(&self, account: Address) -> U256; - - /// Moves a `value` amount of tokens from the caller's account to `to`. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// Emits a [`Transfer`] event. - #[ink(message)] - fn transfer(&mut self, to: Address, value: U256) -> bool; - - /// Returns the remaining number of tokens that `spender` will be allowed to spend - /// on behalf of `owner` through [`transfer_from`]. This is zero by default. - /// - /// This value changes when `approve` or `[`transfer_from`] are called. - #[ink(message)] - fn allowance(&self, owner: Address, spender: Address) -> U256; - - /// Sets a `value` amount of tokens as the allowance of `spender` over the caller's - /// tokens. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// Emits an [`Approval`] event. - #[ink(message)] - fn approve(&mut self, spender: Address, value: U256) -> bool; - - /// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. - /// `value` is then deducted from the caller's allowance. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// Emits a [`Transfer`] event. - #[ink(message)] - #[allow(non_snake_case)] - fn transferFrom(&mut self, from: Address, to: Address, value: U256) -> bool; -} - -/// Emitted when the allowance of a `spender` for an `owner` is set by a call to -/// [`approve`]. `value` is the new allowance. -#[ink::event] -#[cfg_attr(feature = "std", derive(Debug))] -pub struct Approval { - /// The owner providing the allowance. - #[ink(topic)] - pub owner: Address, - /// The beneficiary of the allowance. - #[ink(topic)] - pub spender: Address, - /// The new allowance amount. - pub value: U256, -} - -/// Emitted when `value` tokens are moved from one account (`from`) to another (`to`). -/// -/// Note that `value` may be zero. -#[ink::event] -#[cfg_attr(feature = "std", derive(Debug))] -pub struct Transfer { - /// The source of the transfer. The zero address when minting. - #[ink(topic)] - pub from: Address, - /// The recipient of the transfer. The zero address when burning. - #[ink(topic)] - pub to: Address, - /// The amount transferred (or minted/burned). - pub value: U256, -} - -/// Returns the value of tokens in existence. -#[inline] -pub fn total_supply(token: TokenId) -> U256 { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - precompile.totalSupply() -} - -/// Returns the value of tokens owned by `account`. -#[inline] -pub fn balance_of(token: TokenId, account: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - precompile.balanceOf(account) -} - -/// Returns the value of tokens owned by `account`. -#[inline] -pub fn transfer(token: TokenId, to: Address, value: U256) -> Result { - ensure!(to != Address::zero(), ERC20InvalidSender(to)); - ensure!(value != U256::zero(), ERC20InsufficientValue); - - let address = prefixed_address(PRECOMPILE, token); - let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - Ok(precompile.transfer(to, value)) -} - -/// Returns the remaining number of tokens that `spender` will be allowed to spend -/// on behalf of `owner` through [`transfer_from`]. This is zero by default. -/// -/// This value changes when `approve` or [`transfer_from`] are called. -#[inline] -pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - precompile.allowance(owner, spender) -} - -/// Sets a `value` amount of tokens as the allowance of `spender` over the caller's -/// tokens. -/// -/// Returns a boolean value indicating whether the operation succeeded. -/// -/// Emits an [`Approval`] event. -#[inline] -pub fn approve(token: TokenId, spender: Address, value: U256) -> Result { - ensure!(spender != Address::zero(), ERC20InvalidApprover(spender)); - ensure!(value != U256::zero(), ERC20InsufficientValue); - - let address = prefixed_address(PRECOMPILE, token); - let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - Ok(precompile.approve(spender, value)) -} - -/// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. -/// `value` is then deducted from the caller's allowance. -/// -/// Returns a boolean value indicating whether the operation succeeded. -/// -/// Emits a [`Transfer`] event. -#[inline] -pub fn transfer_from( - token: TokenId, - from: Address, - to: Address, - value: U256, -) -> Result { - ensure!(from != Address::zero(), ERC20InvalidSender(from)); - ensure!(to != Address::zero() && to != from, ERC20InvalidReceiver(to)); - ensure!(value != U256::zero(), ERC20InsufficientValue); - - let address = prefixed_address(PRECOMPILE, token); - let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); - Ok(precompile.transferFrom(from, to, value)) -} - -/// Extensions to the ERC-20 standard. -pub mod extensions { - use super::*; - - /// Interface for the optional metadata functions from the ERC-20 standard. - #[ink::trait_definition] - pub trait Erc20Metadata { - /// Returns the name of the token. - #[ink(message)] - fn name(&self) -> String; - - /// Returns the symbol of the token. - #[ink(message)] - fn symbol(&self) -> String; - - /// Returns the decimals places of the token. - #[ink(message)] - fn decimals(&self) -> u8; - } - - /// Returns the name of the token. - #[inline] - pub fn name(token: TokenId) -> String { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); - precompile.name() - } - - /// Returns the symbol of the token. - #[inline] - pub fn symbol(token: TokenId) -> String { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); - precompile.symbol() - } - - /// Returns the decimals places of the token. - #[inline] - pub fn decimals(token: TokenId) -> u8 { - let address = prefixed_address(PRECOMPILE, token); - let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); - precompile.decimals() - } -} - -// NOTE: subject to change based on ink!'s support for solidity custom errors. -pub enum Error { - /// Indicates a failure with the `spender`’s `allowance`. - InsufficientAllowance(ERC20InsufficientAllowance), - /// Indicates an error related to the current `balance` of a `sender`. - InsufficientBalance(ERC20InsufficientBalance), - /// Indicates an error related to a specified `value`. - InsufficientValue(ERC20InsufficientValue), - /// Indicates a failure with the `approver` of a token to be approved. - InvalidApprover(ERC20InvalidApprover), - /// Indicates a failure with the token `receiver`. - InvalidReceiver(ERC20InvalidReceiver), - /// Indicates a failure with the token `sender`. - InvalidSender(ERC20InvalidSender), -} - -impl<'a> SolEncode<'a> for Error { - type SolType = (); - - fn encode(&'a self) -> Vec { - use Error::*; - match self { - InsufficientAllowance(e) => e.abi_encode(), - InsufficientBalance(e) => e.abi_encode(), - InsufficientValue(e) => e.abi_encode(), - InvalidApprover(e) => e.abi_encode(), - InvalidReceiver(e) => e.abi_encode(), - InvalidSender(e) => e.abi_encode(), - } - } - - fn to_sol_type(&'a self) -> Self::SolType { - () - } -} - -/// Standard ERC-20 errors. -// See https://eips.ethereum.org/EIPS/eip-6093 for more details. -mod errors { - use super::*; - - /// Indicates a failure with the `spender`’s `allowance`. - pub struct ERC20InsufficientAllowance(pub Address, pub U256, pub U256); - impl SolError for ERC20InsufficientAllowance { - type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [251, 143, 65, 178]; - const SIGNATURE: &'static str = "ERC20InsufficientAllowance(address,uint256,uint256)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self( - Address::from(*tuple.0 .0), - U256::from_little_endian(tuple.1.as_le_slice()), - U256::from_little_endian(tuple.2.as_le_slice()), - ) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - self.0.to_sol_type().tokenize(), - self.1.to_sol_type().tokenize(), - self.2.to_sol_type().tokenize(), - ) - } - } - - /// Indicates an error related to the current `balance` of a `sender`. - pub struct ERC20InsufficientBalance(pub Address, pub U256, pub U256); - impl SolError for ERC20InsufficientBalance { - type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [228, 80, 211, 140]; - const SIGNATURE: &'static str = "ERC20InsufficientBalance(address,uint256,uint256)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self( - Address::from(*tuple.0 .0), - U256::from_little_endian(tuple.1.as_le_slice()), - U256::from_little_endian(tuple.2.as_le_slice()), - ) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - self.0.to_sol_type().tokenize(), - self.1.to_sol_type().tokenize(), - self.2.to_sol_type().tokenize(), - ) - } - } - - /// Indicates an error related to a specified `value`. - pub struct ERC20InsufficientValue; - impl SolError for ERC20InsufficientValue { - type Parameters<'a> = (); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [191, 254, 152, 173]; - const SIGNATURE: &'static str = "ERC20InsufficientValue()"; - - #[inline] - fn new<'a>(_tuple: as SolType>::RustType) -> Self { - Self - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - } - impl From for Error { - fn from(value: ERC20InsufficientValue) -> Self { - Self::InsufficientValue(value) - } - } - - /// Indicates a failure with the `approver` of a token to be approved. - pub struct ERC20InvalidApprover(pub Address); - impl SolError for ERC20InvalidApprover { - type Parameters<'a> = (SolAddress,); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [230, 2, 223, 5]; - const SIGNATURE: &'static str = "ERC20InvalidApprover(address)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self((*tuple.0 .0).into()) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - (self.0.to_sol_type().tokenize(),) - } - } - impl From for Error { - fn from(value: ERC20InvalidApprover) -> Self { - Self::InvalidApprover(value) - } - } - - /// Indicates a failure with the token `sender`. - pub struct ERC20InvalidSender(pub Address); - impl SolError for ERC20InvalidSender { - type Parameters<'a> = (SolAddress,); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [150, 198, 253, 30]; - const SIGNATURE: &'static str = "ERC20InvalidSender(address)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self((*tuple.0 .0).into()) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - (self.0.to_sol_type().tokenize(),) - } - } - impl From for Error { - fn from(value: ERC20InvalidSender) -> Self { - Self::InvalidSender(value) - } - } - - /// Indicates a failure with the token `receiver`. - pub struct ERC20InvalidReceiver(pub Address); - impl SolError for ERC20InvalidReceiver { - type Parameters<'a> = (SolAddress,); - type Token<'a> = as SolType>::Token<'a>; - - const SELECTOR: [u8; 4] = [236u8, 68u8, 47u8, 5u8]; - const SIGNATURE: &'static str = "ERC20InvalidReceiver(address)"; - - #[inline] - fn new<'a>(tuple: as SolType>::RustType) -> Self { - Self((*tuple.0 .0).into()) - } - - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - (self.0.to_sol_type().tokenize(),) - } - } - - impl<'a> SolEncode<'a> for ERC20InvalidReceiver { - type SolType = (&'a Address,); - - #[inline] - fn encode(&'a self) -> Vec { - self.abi_encode() - } - - #[inline] - fn to_sol_type(&'a self) -> Self::SolType { - (&self.0,) - } - } - impl From for Error { - fn from(value: ERC20InvalidReceiver) -> Self { - Self::InvalidReceiver(value) - } - } - - #[test] - fn error_encoding_works() { - for (result, expected) in [ - ( - ERC20InsufficientAllowance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), - "fb8f41b2000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ), - ( - ERC20InsufficientBalance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), - "e450d38c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ), - (ERC20InsufficientValue.abi_encode(),"bffe98ad"), - ( - ERC20InvalidApprover([255u8; 20].into()).abi_encode(), - "e602df05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ), - ( - ERC20InvalidReceiver([255u8; 20].into()).abi_encode(), - "ec442f05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ), - ( - ERC20InvalidSender([255u8; 20].into()).abi_encode(), - "96c6fd1e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ), - ] { - assert_eq!(hex::encode(result), expected) - } - } -} +/// The first version of the Erc20 API. +pub mod v0; diff --git a/pop-api-vnext/src/fungibles/erc20/v0.rs b/pop-api-vnext/src/fungibles/erc20/v0.rs new file mode 100644 index 000000000..16c5a5402 --- /dev/null +++ b/pop-api-vnext/src/fungibles/erc20/v0.rs @@ -0,0 +1,180 @@ +pub use errors::*; +pub use events::*; + +use super::*; + +/// Standard ERC-20 errors. See https://eips.ethereum.org/EIPS/eip-6093 for more details. +mod errors; +mod events; + +// Precompile index within the runtime +const PRECOMPILE: u16 = 2; + +/// Interface of the ERC-20 standard. +#[ink::trait_definition] +pub trait Erc20 { + /// Returns the value of tokens in existence. + #[ink(message)] + #[allow(non_snake_case)] + fn totalSupply(&self) -> U256; + + /// Returns the value of tokens owned by `account`. + #[ink(message)] + #[allow(non_snake_case)] + fn balanceOf(&self, account: Address) -> U256; + + /// Moves a `value` amount of tokens from the caller's account to `to`. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a [`Transfer`] event. + #[ink(message)] + fn transfer(&mut self, to: Address, value: U256) -> bool; + + /// Returns the remaining number of tokens that `spender` will be allowed to spend + /// on behalf of `owner` through [`transfer_from`]. This is zero by default. + /// + /// This value changes when `approve` or `[`transfer_from`] are called. + #[ink(message)] + fn allowance(&self, owner: Address, spender: Address) -> U256; + + /// Sets a `value` amount of tokens as the allowance of `spender` over the caller's + /// tokens. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits an [`Approval`] event. + #[ink(message)] + fn approve(&mut self, spender: Address, value: U256) -> bool; + + /// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. + /// `value` is then deducted from the caller's allowance. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a [`Transfer`] event. + #[ink(message)] + #[allow(non_snake_case)] + fn transferFrom(&mut self, from: Address, to: Address, value: U256) -> bool; +} + +/// Returns the value of tokens in existence. +#[inline] +pub fn total_supply(token: TokenId) -> U256 { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + precompile.totalSupply() +} + +/// Returns the value of tokens owned by `account`. +#[inline] +pub fn balance_of(token: TokenId, account: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + precompile.balanceOf(account) +} + +/// Returns the value of tokens owned by `account`. +#[inline] +pub fn transfer(token: TokenId, to: Address, value: U256) -> Result { + ensure!(to != Address::zero(), ERC20InvalidSender(to)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, token); + let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + Ok(precompile.transfer(to, value)) +} + +/// Returns the remaining number of tokens that `spender` will be allowed to spend +/// on behalf of `owner` through [`transfer_from`]. This is zero by default. +/// +/// This value changes when `approve` or [`transfer_from`] are called. +#[inline] +pub fn allowance(token: TokenId, owner: Address, spender: Address) -> U256 { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + precompile.allowance(owner, spender) +} + +/// Sets a `value` amount of tokens as the allowance of `spender` over the caller's +/// tokens. +/// +/// Returns a boolean value indicating whether the operation succeeded. +/// +/// Emits an [`Approval`] event. +#[inline] +pub fn approve(token: TokenId, spender: Address, value: U256) -> Result { + ensure!(spender != Address::zero(), ERC20InvalidApprover(spender)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, token); + let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + Ok(precompile.approve(spender, value)) +} + +/// Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. +/// `value` is then deducted from the caller's allowance. +/// +/// Returns a boolean value indicating whether the operation succeeded. +/// +/// Emits a [`Transfer`] event. +#[inline] +pub fn transfer_from( + token: TokenId, + from: Address, + to: Address, + value: U256, +) -> Result { + ensure!(from != Address::zero(), ERC20InvalidSender(from)); + ensure!(to != Address::zero() && to != from, ERC20InvalidReceiver(to)); + ensure!(value != U256::zero(), ERC20InsufficientValue); + + let address = prefixed_address(PRECOMPILE, token); + let mut precompile: contract_ref!(Erc20, Pop, Sol) = address.into(); + Ok(precompile.transferFrom(from, to, value)) +} + +/// Extensions to the ERC-20 standard. +pub mod extensions { + use super::*; + + /// Interface for the optional metadata functions from the ERC-20 standard. + #[ink::trait_definition] + pub trait Erc20Metadata { + /// Returns the name of the token. + #[ink(message)] + fn name(&self) -> String; + + /// Returns the symbol of the token. + #[ink(message)] + fn symbol(&self) -> String; + + /// Returns the decimals places of the token. + #[ink(message)] + fn decimals(&self) -> u8; + } + + /// Returns the name of the token. + #[inline] + pub fn name(token: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); + precompile.name() + } + + /// Returns the symbol of the token. + #[inline] + pub fn symbol(token: TokenId) -> String { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); + precompile.symbol() + } + + /// Returns the decimals places of the token. + #[inline] + pub fn decimals(token: TokenId) -> u8 { + let address = prefixed_address(PRECOMPILE, token); + let precompile: contract_ref!(Erc20Metadata, Pop, Sol) = address.into(); + precompile.decimals() + } +} diff --git a/pop-api-vnext/src/fungibles/erc20/v0/errors.rs b/pop-api-vnext/src/fungibles/erc20/v0/errors.rs new file mode 100644 index 000000000..218697eb7 --- /dev/null +++ b/pop-api-vnext/src/fungibles/erc20/v0/errors.rs @@ -0,0 +1,236 @@ +use super::*; + +// NOTE: subject to change based on ink!'s support for solidity custom errors. +pub enum Error { + /// Indicates a failure with the `spender`’s `allowance`. + InsufficientAllowance(ERC20InsufficientAllowance), + /// Indicates an error related to the current `balance` of a `sender`. + InsufficientBalance(ERC20InsufficientBalance), + /// Indicates an error related to a specified `value`. + InsufficientValue(ERC20InsufficientValue), + /// Indicates a failure with the `approver` of a token to be approved. + InvalidApprover(ERC20InvalidApprover), + /// Indicates a failure with the token `receiver`. + InvalidReceiver(ERC20InvalidReceiver), + /// Indicates a failure with the token `sender`. + InvalidSender(ERC20InvalidSender), +} + +impl<'a> SolEncode<'a> for Error { + type SolType = (); + + fn encode(&'a self) -> Vec { + use Error::*; + match self { + InsufficientAllowance(e) => e.abi_encode(), + InsufficientBalance(e) => e.abi_encode(), + InsufficientValue(e) => e.abi_encode(), + InvalidApprover(e) => e.abi_encode(), + InvalidReceiver(e) => e.abi_encode(), + InvalidSender(e) => e.abi_encode(), + } + } + + fn to_sol_type(&'a self) -> Self::SolType { + () + } +} + +/// Indicates a failure with the `spender`’s `allowance`. +pub struct ERC20InsufficientAllowance(pub Address, pub U256, pub U256); +impl SolError for ERC20InsufficientAllowance { + type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [251, 143, 65, 178]; + const SIGNATURE: &'static str = "ERC20InsufficientAllowance(address,uint256,uint256)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self( + Address::from(*tuple.0 .0), + U256::from_little_endian(tuple.1.as_le_slice()), + U256::from_little_endian(tuple.2.as_le_slice()), + ) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + self.0.to_sol_type().tokenize(), + self.1.to_sol_type().tokenize(), + self.2.to_sol_type().tokenize(), + ) + } +} + +/// Indicates an error related to the current `balance` of a `sender`. +pub struct ERC20InsufficientBalance(pub Address, pub U256, pub U256); +impl SolError for ERC20InsufficientBalance { + type Parameters<'a> = (SolAddress, Uint<256>, Uint<256>); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [228, 80, 211, 140]; + const SIGNATURE: &'static str = "ERC20InsufficientBalance(address,uint256,uint256)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self( + Address::from(*tuple.0 .0), + U256::from_little_endian(tuple.1.as_le_slice()), + U256::from_little_endian(tuple.2.as_le_slice()), + ) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + self.0.to_sol_type().tokenize(), + self.1.to_sol_type().tokenize(), + self.2.to_sol_type().tokenize(), + ) + } +} + +/// Indicates an error related to a specified `value`. +pub struct ERC20InsufficientValue; +impl SolError for ERC20InsufficientValue { + type Parameters<'a> = (); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [191, 254, 152, 173]; + const SIGNATURE: &'static str = "ERC20InsufficientValue()"; + + #[inline] + fn new<'a>(_tuple: as SolType>::RustType) -> Self { + Self + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } +} +impl From for Error { + fn from(value: ERC20InsufficientValue) -> Self { + Self::InsufficientValue(value) + } +} + +/// Indicates a failure with the `approver` of a token to be approved. +pub struct ERC20InvalidApprover(pub Address); +impl SolError for ERC20InvalidApprover { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [230, 2, 223, 5]; + const SIGNATURE: &'static str = "ERC20InvalidApprover(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } +} +impl From for Error { + fn from(value: ERC20InvalidApprover) -> Self { + Self::InvalidApprover(value) + } +} + +/// Indicates a failure with the token `sender`. +pub struct ERC20InvalidSender(pub Address); +impl SolError for ERC20InvalidSender { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [150, 198, 253, 30]; + const SIGNATURE: &'static str = "ERC20InvalidSender(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } +} +impl From for Error { + fn from(value: ERC20InvalidSender) -> Self { + Self::InvalidSender(value) + } +} + +/// Indicates a failure with the token `receiver`. +pub struct ERC20InvalidReceiver(pub Address); +impl SolError for ERC20InvalidReceiver { + type Parameters<'a> = (SolAddress,); + type Token<'a> = as SolType>::Token<'a>; + + const SELECTOR: [u8; 4] = [236u8, 68u8, 47u8, 5u8]; + const SIGNATURE: &'static str = "ERC20InvalidReceiver(address)"; + + #[inline] + fn new<'a>(tuple: as SolType>::RustType) -> Self { + Self((*tuple.0 .0).into()) + } + + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + (self.0.to_sol_type().tokenize(),) + } +} + +impl<'a> SolEncode<'a> for ERC20InvalidReceiver { + type SolType = (&'a Address,); + + #[inline] + fn encode(&'a self) -> Vec { + self.abi_encode() + } + + #[inline] + fn to_sol_type(&'a self) -> Self::SolType { + (&self.0,) + } +} +impl From for Error { + fn from(value: ERC20InvalidReceiver) -> Self { + Self::InvalidReceiver(value) + } +} + +#[test] +fn error_encoding_works() { + for (result, expected) in [ + ( + ERC20InsufficientAllowance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), + "fb8f41b2000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InsufficientBalance([255u8; 20].into(), U256::MAX, U256::MAX).abi_encode(), + "e450d38c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + ), + (ERC20InsufficientValue.abi_encode(),"bffe98ad"), + ( + ERC20InvalidApprover([255u8; 20].into()).abi_encode(), + "e602df05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InvalidReceiver([255u8; 20].into()).abi_encode(), + "ec442f05000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ( + ERC20InvalidSender([255u8; 20].into()).abi_encode(), + "96c6fd1e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ), + ] { + assert_eq!(hex::encode(result), expected) + } +} diff --git a/pop-api-vnext/src/fungibles/erc20/v0/events.rs b/pop-api-vnext/src/fungibles/erc20/v0/events.rs new file mode 100644 index 000000000..df94f64bc --- /dev/null +++ b/pop-api-vnext/src/fungibles/erc20/v0/events.rs @@ -0,0 +1,32 @@ +use super::*; + +/// Emitted when the allowance of a `spender` for an `owner` is set by a call to +/// [`approve`]. `value` is the new allowance. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct Approval { + /// The owner providing the allowance. + #[ink(topic)] + pub owner: Address, + /// The beneficiary of the allowance. + #[ink(topic)] + pub spender: Address, + /// The new allowance amount. + pub value: U256, +} + +/// Emitted when `value` tokens are moved from one account (`from`) to another (`to`). +/// +/// Note that `value` may be zero. +#[ink::event] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct Transfer { + /// The source of the transfer. The zero address when minting. + #[ink(topic)] + pub from: Address, + /// The recipient of the transfer. The zero address when burning. + #[ink(topic)] + pub to: Address, + /// The amount transferred (or minted/burned). + pub value: U256, +} diff --git a/pop-api-vnext/src/fungibles/mod.rs b/pop-api-vnext/src/fungibles/v0.rs similarity index 96% rename from pop-api-vnext/src/fungibles/mod.rs rename to pop-api-vnext/src/fungibles/v0.rs index b04270cf0..87817ef0b 100644 --- a/pop-api-vnext/src/fungibles/mod.rs +++ b/pop-api-vnext/src/fungibles/v0.rs @@ -1,30 +1,17 @@ -use alloy_sol_types::{ - sol_data::{Address as SolAddress, Uint}, - SolError, SolType, -}; -pub use erc20::{Approval, Transfer}; pub use errors::*; -use ink::{ - abi::Sol, - contract_ref, - prelude::{string::String, vec::Vec}, - primitives::sol::SolTypeEncode, - U256, -}; +pub use events::*; -pub use super::revert; -use super::*; - -/// APIs for fungible tokens conforming to the ERC20 standard. -pub mod erc20; -pub mod errors; -pub mod events; +use super::{ + contract_ref, ensure, erc20::v0 as erc20, fixed_address, Address, Pop, Sol, SolAddress, + SolEncode, SolError, SolType, SolTypeEncode, String, TokenId, Vec, U256, +}; -const PRECOMPILE: u16 = 100; +mod errors; +mod events; -pub type TokenId = u32; +const PRECOMPILE: u16 = 1; -/// The fungibles precompile offers a streamlined interface for interacting with fungible +/// The fungibles API offers a streamlined interface for interacting with fungible /// tokens. The goal is to provide a simplified, consistent API that adheres to standards in /// the smart contract space. #[ink::trait_definition] diff --git a/pop-api-vnext/src/fungibles/errors.rs b/pop-api-vnext/src/fungibles/v0/errors.rs similarity index 100% rename from pop-api-vnext/src/fungibles/errors.rs rename to pop-api-vnext/src/fungibles/v0/errors.rs diff --git a/pop-api-vnext/src/fungibles/events.rs b/pop-api-vnext/src/fungibles/v0/events.rs similarity index 97% rename from pop-api-vnext/src/fungibles/events.rs rename to pop-api-vnext/src/fungibles/v0/events.rs index b49f9011b..b652fc4c3 100644 --- a/pop-api-vnext/src/fungibles/events.rs +++ b/pop-api-vnext/src/fungibles/v0/events.rs @@ -8,7 +8,7 @@ //! //! For more details, refer to [ink! events](https://use.ink/basics/events). -pub use erc20::{Approval, Transfer}; +pub use super::erc20::{Approval, Transfer}; use super::*; diff --git a/pop-api-vnext/src/lib.rs b/pop-api-vnext/src/lib.rs index d78785777..c69e009e2 100644 --- a/pop-api-vnext/src/lib.rs +++ b/pop-api-vnext/src/lib.rs @@ -1,12 +1,14 @@ #![cfg_attr(not(feature = "std"), no_std, no_main)] -use ink::{Address, SolEncode}; +use ink::Address; +pub use sol::revert; type Pop = ink::env::DefaultEnvironment; /// APIs for fungible tokens. #[cfg(feature = "fungibles")] pub mod fungibles; +mod sol; #[macro_export] macro_rules! ensure { @@ -40,15 +42,6 @@ fn prefixed_address(n: u16, prefix: u32) -> Address { address } -/// Reverts the current contract execution, rolling back any changes and returning the specified -/// `error`. -// Helper until Solidity support added for Rust errors for automatic reversion based on returning an -// error. -pub fn revert(error: &impl for<'a> SolEncode<'a>) -> ! { - use ink::env::{return_value_solidity, ReturnFlags}; - return_value_solidity(ReturnFlags::REVERT, error) -} - #[test] fn fixed_address_works() { assert_eq!(hex::encode(fixed_address(100)), "0000000000000000000000000000000000640000") diff --git a/pop-api-vnext/src/sol.rs b/pop-api-vnext/src/sol.rs new file mode 100644 index 000000000..215c891c3 --- /dev/null +++ b/pop-api-vnext/src/sol.rs @@ -0,0 +1,14 @@ +pub use alloy_sol_types::{ + sol_data::{Address as SolAddress, Uint}, + SolError, SolType, +}; +pub use ink::{abi::Sol, primitives::sol::SolTypeEncode, SolEncode}; + +/// Reverts the current contract execution, rolling back any changes and returning the specified +/// `error`. +// Helper until Solidity support added for Rust errors for automatic reversion based on returning an +// error. +pub fn revert(error: &impl for<'a> SolEncode<'a>) -> ! { + use ink::env::{return_value_solidity, ReturnFlags}; + return_value_solidity(ReturnFlags::REVERT, error) +} diff --git a/runtime/devnet/src/config/contracts.rs b/runtime/devnet/src/config/contracts.rs index d6c0f7bbf..15c0c905f 100644 --- a/runtime/devnet/src/config/contracts.rs +++ b/runtime/devnet/src/config/contracts.rs @@ -13,8 +13,10 @@ use crate::{ Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, Timestamp, TransactionPayment, }; -type Erc20 = pallet_api_vnext::Erc20; -type Fungibles = pallet_api_vnext::Fungibles; +type Erc20 = + pallet_api_vnext::fungibles::precompiles::erc20::v0::Erc20; +type Fungibles = + pallet_api_vnext::fungibles::precompiles::v0::Fungibles; fn schedule() -> pallet_contracts::Schedule { pallet_contracts::Schedule { @@ -107,8 +109,12 @@ impl pallet_revive::Config for Runtime { type NativeToEthRatio = NativeToEthRatio; // 512 MB. Used in an integrity test that verifies the runtime has enough memory. type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; - type Precompiles = - (Fungibles<100, TrustBackedAssetsInstance>, Erc20<101, TrustBackedAssetsInstance>); + type Precompiles = ( + // 1: `Fungibles` precompile v0 using `TrustBackedAssetsInstance` instances + Fungibles<1, TrustBackedAssetsInstance>, + // 2: `Erc20` precompile v0 using `TrustBackedAssetsInstance` instances + Erc20<2, TrustBackedAssetsInstance>, + ); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -147,7 +153,7 @@ fn contracts_prevents_runtime_calls() { #[cfg(test)] mod tests { use frame_support::{assert_ok, traits::fungible::Mutate}; - use pallet_api_vnext::fungibles::precompiles::{IFungibles::*, IERC20}; + use pallet_api_vnext::fungibles::precompiles::{erc20::v0::IERC20, v0::IFungibles::*}; use pallet_revive::{ precompiles::alloy::{primitives, sol_types::SolCall}, AddressMapper, @@ -180,8 +186,8 @@ mod tests { let origin = RuntimeOrigin::signed(caller.clone()); let origin_addr = AccountId32Mapper::to_address(&caller); let token = 1; - let fungibles_addr: H160 = Fungibles::<100, TrustBackedAssetsInstance>::address().into(); - let erc20_addr: H160 = Erc20::<101, TrustBackedAssetsInstance>::address(token).into(); + let fungibles_addr: H160 = Fungibles::<1, TrustBackedAssetsInstance>::address().into(); + let erc20_addr: H160 = Erc20::<2, TrustBackedAssetsInstance>::address(token).into(); let total_supply: Balance = 10_000; let gas_limit = Weight::from_parts(600_000_000, 10_000); new_test_ext().execute_with(|| { From c939eff2914a542d3a3cd585b08db61008ddb194 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 17:04:22 +0100 Subject: [PATCH 138/162] style: formatting --- pop-api-vnext/src/fungibles/v0/events.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pop-api-vnext/src/fungibles/v0/events.rs b/pop-api-vnext/src/fungibles/v0/events.rs index b652fc4c3..266121196 100644 --- a/pop-api-vnext/src/fungibles/v0/events.rs +++ b/pop-api-vnext/src/fungibles/v0/events.rs @@ -9,7 +9,6 @@ //! For more details, refer to [ink! events](https://use.ink/basics/events). pub use super::erc20::{Approval, Transfer}; - use super::*; /// Event emitted when a token is created. From a5a7599cf3bbaa00cbcd198030ea7e50e856896d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 17:09:57 +0100 Subject: [PATCH 139/162] build(deps): update ink after sol-abi improvements merged --- Cargo.lock | 60 +++++++++---------- pop-api-vnext/Cargo.toml | 4 +- pop-api-vnext/examples/fungibles/Cargo.toml | 2 +- .../contracts/fungibles/Cargo.lock | 24 ++++---- .../contracts/fungibles/Cargo.toml | 2 +- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52f8a1449..8768d7d08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7235,16 +7235,16 @@ dependencies = [ [[package]] name = "ink" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "const_format", "deranged", "derive_more 2.0.1", "ink_env 6.0.0-alpha", "ink_macro 6.0.0-alpha", - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "ink_storage 6.0.0-alpha", "keccak-const", "linkme", @@ -7269,7 +7269,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "cfg-if", ] @@ -7299,7 +7299,7 @@ dependencies = [ [[package]] name = "ink_codegen" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2 0.10.6", "derive_more 2.0.1", @@ -7307,7 +7307,7 @@ dependencies = [ "heck 0.5.0", "impl-serde 0.5.0", "ink_ir 6.0.0-alpha", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "itertools 0.14.0", "parity-scale-codec", "polkavm-derive 0.22.0", @@ -7337,12 +7337,12 @@ dependencies = [ [[package]] name = "ink_engine" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2 0.10.6", "derive_more 2.0.1", "hex-literal 1.0.0", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "pallet-revive 0.5.0", "pallet-revive-uapi 0.4.0", "parity-scale-codec", @@ -7385,7 +7385,7 @@ dependencies = [ [[package]] name = "ink_env" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2 0.10.6", "cfg-if", @@ -7394,8 +7394,8 @@ dependencies = [ "hex-literal 1.0.0", "ink_allocator 6.0.0-alpha", "ink_engine 6.0.0-alpha", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "ink_storage_traits 6.0.0-alpha", "num-traits", "pallet-revive 0.5.0", @@ -7434,12 +7434,12 @@ dependencies = [ [[package]] name = "ink_ir" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2 0.10.6", "either", "impl-serde 0.5.0", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", "itertools 0.14.0", "proc-macro2", "quote", @@ -7466,11 +7466,11 @@ dependencies = [ [[package]] name = "ink_macro" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "ink_codegen 6.0.0-alpha", "ink_ir 6.0.0-alpha", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "parity-scale-codec", "proc-macro2", "quote", @@ -7513,12 +7513,12 @@ dependencies = [ [[package]] name = "ink_metadata" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "derive_more 2.0.1", "impl-serde 0.5.0", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "parity-scale-codec", "scale-info", "schemars", @@ -7545,7 +7545,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "cfg-if", ] @@ -7595,13 +7595,13 @@ dependencies = [ [[package]] name = "ink_primitives" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "alloy-sol-types 1.2.0", "cfg-if", "derive_more 2.0.1", "impl-trait-for-tuples", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", "itertools 0.14.0", "num-traits", "pallet-revive 0.5.0", @@ -7641,15 +7641,15 @@ dependencies = [ [[package]] name = "ink_storage" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "array-init", "cfg-if", "derive_more 2.0.1", "ink_env 6.0.0-alpha", - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "ink_storage_traits 6.0.0-alpha", "pallet-revive-uapi 0.4.0", "parity-scale-codec", @@ -7672,11 +7672,11 @@ dependencies = [ [[package]] name = "ink_storage_traits" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#c46014d79dab808438f9a61b84b8341c97a6dd26" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", "parity-scale-codec", "scale-info", "sp-io 40.0.1", diff --git a/pop-api-vnext/Cargo.toml b/pop-api-vnext/Cargo.toml index 50c407f31..232d60099 100644 --- a/pop-api-vnext/Cargo.toml +++ b/pop-api-vnext/Cargo.toml @@ -6,8 +6,8 @@ name = "pop-api" version = "0.1.0" [dependencies] -alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support -ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } +alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support +ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } pop-primitives = { path = "../primitives", default-features = false } [dev-dependencies] diff --git a/pop-api-vnext/examples/fungibles/Cargo.toml b/pop-api-vnext/examples/fungibles/Cargo.toml index 03f9e0bd2..9f89d7e4e 100644 --- a/pop-api-vnext/examples/fungibles/Cargo.toml +++ b/pop-api-vnext/examples/fungibles/Cargo.toml @@ -11,7 +11,7 @@ abi = "sol" path = "lib.rs" [dependencies] -ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } +ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } pop-api = { path = "../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } [dev-dependencies] diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock index dd91fd6df..7c5709829 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "ink" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "const_format", "deranged", @@ -2379,7 +2379,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "cfg-if", ] @@ -2387,7 +2387,7 @@ dependencies = [ [[package]] name = "ink_codegen" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2", "derive_more 2.0.1", @@ -2409,7 +2409,7 @@ dependencies = [ [[package]] name = "ink_engine" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2", "derive_more 2.0.1", @@ -2426,7 +2426,7 @@ dependencies = [ [[package]] name = "ink_env" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2", "cfg-if", @@ -2459,7 +2459,7 @@ dependencies = [ [[package]] name = "ink_ir" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "blake2", "either", @@ -2475,7 +2475,7 @@ dependencies = [ [[package]] name = "ink_macro" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "ink_codegen", "ink_ir", @@ -2490,7 +2490,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "derive_more 2.0.1", "impl-serde", @@ -2505,7 +2505,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "cfg-if", ] @@ -2513,7 +2513,7 @@ dependencies = [ [[package]] name = "ink_primitives" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "alloy-sol-types 1.2.1", "cfg-if", @@ -2540,7 +2540,7 @@ dependencies = [ [[package]] name = "ink_storage" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "array-init", "cfg-if", @@ -2558,7 +2558,7 @@ dependencies = [ [[package]] name = "ink_storage_traits" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-abi#3ac568305e0f0e872cc772933a487ecf640d7950" +source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" dependencies = [ "ink_metadata", "ink_prelude", diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml index da78763da..d5b9801e1 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml @@ -10,7 +10,7 @@ abi = "sol" [workspace] [dependencies] -ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-abi", default-features = false, features = [ "unstable-hostfn" ] } +ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } pop-api = { path = "../../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } [dev-dependencies] From 8edb679a5abfa680b8cac01ccf24b7edb54a9676 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Thu, 26 Jun 2025 17:28:33 +0100 Subject: [PATCH 140/162] ci: explicitly cache pallet-revive-fixtures output --- .github/actions/init/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index e4b0af65b..f7ce6b833 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -29,4 +29,6 @@ runs: with: cache-on-failure: true cache-all-crates: true - key: ${{ inputs.cache-key }} \ No newline at end of file + cache-directors: | + target/pallet-revive-fixtures + key: ${{ inputs.cache-key }} From a6fd14480afb79043e09d06fcb8a37a0cb759c6f Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 10:37:50 +0100 Subject: [PATCH 141/162] test(api/integration-tests): fix imports after refactor --- pop-api-vnext/integration-tests/src/fungibles.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index ddb1764b9..27345a264 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -4,12 +4,12 @@ use frame_support::{ approvals::Inspect as _, metadata::Inspect as _, roles::Inspect as _, Inspect as _, }, }; -use pallet_api_vnext::fungibles::precompiles::IFungibles::{ +use pallet_api_vnext::fungibles::precompiles::v0::IFungibles::{ allowanceCall, approveCall, balanceOfCall, burnCall, clearMetadataCall, createCall, decimalsCall, decreaseAllowanceCall, existsCall, increaseAllowanceCall, mintCall, nameCall, setMetadataCall, startDestroyCall, symbolCall, totalSupplyCall, transferCall, transferFromCall, }; -use pop_api::fungibles::events::*; +use pop_api::fungibles::*; use pop_primitives::TokenId; use sp_io::hashing::twox_256; From 543c9d4d5c1842126b03c470e7fd6e4c7283c600 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 10:46:01 +0100 Subject: [PATCH 142/162] ci: remove cached pallet-revive fixtures --- .github/actions/init/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index f7ce6b833..6c8677e00 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -29,6 +29,10 @@ runs: with: cache-on-failure: true cache-all-crates: true - cache-directors: | - target/pallet-revive-fixtures key: ${{ inputs.cache-key }} + + - name: Remove cached pallet-revive fixtures + shell: bash + run: | + ls target/pallet-revive-fixtures + rm -rf target/pallet-revive-fixtures From cc4068490c5aa47f5420c10b5814746288102ec4 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 10:52:28 +0100 Subject: [PATCH 143/162] ci: only list if directory exists --- .github/actions/init/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 6c8677e00..fc3d1de7c 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -34,5 +34,5 @@ runs: - name: Remove cached pallet-revive fixtures shell: bash run: | - ls target/pallet-revive-fixtures + [ -d target/pallet-revive-fixtures ] && ls target/pallet-revive-fixtures rm -rf target/pallet-revive-fixtures From f0e62ef8acd45c010b4a83d7f86b8b0af56d6bad Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 11:30:19 +0100 Subject: [PATCH 144/162] ci(init): make crate caching configurable --- .github/actions/init/action.yml | 23 +++++++++++++---------- .github/workflows/ci.yml | 9 +++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index fc3d1de7c..eee75096d 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -1,8 +1,16 @@ name: Initialize description: This action initializes a runner for use in other actions. inputs: + cache-all-crates: + description: Whether all crates should be cached, or only dependent crates. Defaults to true. + default: "true" + cache-directories: + description: Additional non-workspace directories to be cached, separated by newlines. + cache-on-failure: + description: Cache even if the build fails. Defaults to false. + default: "true" cache-key: - description: "The key to be used for the cache" + description: An additional optional key to be added. Useful for jobs utilizing a matrix. runs: using: "composite" @@ -25,14 +33,9 @@ runs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.8 + uses: Swatinem/rust-cache@v2.8 with: - cache-on-failure: true - cache-all-crates: true + cache-all-crates: ${{ inputs.cache-all-crates }} + cache-directories: ${{ inputs.cache-directories }} + cache-on-failure: ${{ inputs.cache-on-failure }} key: ${{ inputs.cache-key }} - - - name: Remove cached pallet-revive fixtures - shell: bash - run: | - [ -d target/pallet-revive-fixtures ] && ls target/pallet-revive-fixtures - rm -rf target/pallet-revive-fixtures diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7c60558b..a22d12208 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,9 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/init" + with: + # TODO: remove once pallet-revive-fixtures build cache issue resolved + cache-all-crates: false - name: Check Build run: | @@ -62,6 +65,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: "./.github/actions/init" + with: + # TODO: remove once pallet-revive-fixtures build cache issue resolved + cache-all-crates: false - name: Check Build with ISMP run: | cargo check --release --locked --workspace --exclude integration-tests --features=ismp,runtime-benchmarks,try-runtime @@ -202,6 +208,9 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/init" + with: + # TODO: remove once pallet-revive-fixtures build cache issue resolved + cache-all-crates: false - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov From 5adb0110fc6edc938534c381fb402b16f0cb5fd3 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 11:32:27 +0100 Subject: [PATCH 145/162] ci(init): bump rust-cache version --- .github/actions/init/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index eee75096d..00e111ce6 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -33,7 +33,7 @@ runs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Rust Cache - uses: Swatinem/rust-cache@v2.8 + uses: Swatinem/rust-cache@v2.8.0 with: cache-all-crates: ${{ inputs.cache-all-crates }} cache-directories: ${{ inputs.cache-directories }} From ccc287800f9e19cceba47ea1a37fa945577bb121 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 12:45:17 +0100 Subject: [PATCH 146/162] refactor(pallets/api): address clippy warning --- pallets/api-vnext/src/fungibles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/api-vnext/src/fungibles.rs b/pallets/api-vnext/src/fungibles.rs index 0947bc972..829096bcf 100644 --- a/pallets/api-vnext/src/fungibles.rs +++ b/pallets/api-vnext/src/fungibles.rs @@ -171,7 +171,7 @@ fn decrease_allowance + pallet_assets::Config, I>( >::approve_transfer(origin, asset_param, spender_source, new_allowance)?; >::approve(1, 1) }; - Ok((new_allowance, Some(weight).into())) + Ok((new_allowance, Some(weight))) } fn exists, I>(asset: AssetIdOf) -> bool { From a3a81d04bd40c77438b94fa91fa0c7820c4a951d Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 12:49:58 +0100 Subject: [PATCH 147/162] docs(api): add missing precompile index comment --- pop-api-vnext/src/fungibles/v0.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pop-api-vnext/src/fungibles/v0.rs b/pop-api-vnext/src/fungibles/v0.rs index 87817ef0b..3247d026e 100644 --- a/pop-api-vnext/src/fungibles/v0.rs +++ b/pop-api-vnext/src/fungibles/v0.rs @@ -9,6 +9,7 @@ use super::{ mod errors; mod events; +// Precompile index within the runtime const PRECOMPILE: u16 = 1; /// The fungibles API offers a streamlined interface for interacting with fungible From d4c546dfb3b6714f014635b5fe5fa144f3a68c66 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 13:11:36 +0100 Subject: [PATCH 148/162] refactor(pallets/api): ensure weight charge updated on both approve success and failure --- .../src/fungibles/precompiles/erc20/v0.rs | 33 ++++++++++++------- .../api-vnext/src/fungibles/precompiles/v0.rs | 33 ++++++++++++------- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs index cb3476d02..c10e4e2ce 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs @@ -81,21 +81,32 @@ where let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - let result = approve::( + match approve::( to_runtime_origin(env.caller()), token, env.to_account_id(&(*spender.0).into()), value.saturating_to(), - ) // TODO: adjust weight - .map_err(|e| e.error)?; - - // Adjust weight - if let Some(actual_weight) = result.actual_weight { - // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 - // lands - env.gas_meter_mut() - .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); - } + ) { + Ok(result) => { + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + }, + Err(e) => { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + return Err(e.error.into()) + }, + }; let event = Approval { owner, spender: *spender, value: *value }; deposit_event(env, address, event); diff --git a/pallets/api-vnext/src/fungibles/precompiles/v0.rs b/pallets/api-vnext/src/fungibles/precompiles/v0.rs index 9768400af..6949ef30c 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/v0.rs @@ -67,21 +67,32 @@ where let charged = env.charge(>::WeightInfo::approve(1, 1))?; let owner = >::to_address(env.caller().account_id()?).0.into(); - let result = approve::( + match approve::( to_runtime_origin(env.caller()), (*token).into(), env.to_account_id(&(*spender.0).into()), value.saturating_to(), - ) - .map_err(|e| e.error)?; - - // Adjust weight - if let Some(actual_weight) = result.actual_weight { - // TODO: replace with `env.adjust_gas(charged, result.weight);` once #8693 - // lands - env.gas_meter_mut() - .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); - } + ) { + Ok(result) => { + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + }, + Err(e) => { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + return Err(e.error.into()) + }, + }; let event = Approval { token: *token, owner, spender: *spender, value: *value }; deposit_event(env, address, event); From 4f6fe4b9cd9f781e69a927dbf236bf64b0cf72db Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 13:43:14 +0100 Subject: [PATCH 149/162] refactor(pallets-api): update event handling based on reference implementation --- .../src/fungibles/precompiles/erc20/v0.rs | 7 ++-- .../api-vnext/src/fungibles/precompiles/v0.rs | 19 +++++------ pallets/api-vnext/src/lib.rs | 33 +++++++++---------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs index c10e4e2ce..80180b153 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/erc20/v0.rs @@ -65,7 +65,7 @@ where value.saturating_to(), )?; - deposit_event::(env, address, Transfer { from, to: *to, value: *value }); + deposit_event(env, Transfer { from, to: *to, value: *value })?; Ok(transferCall::abi_encode_returns(&true)) }, IERC20Calls::allowance(allowanceCall { owner, spender }) => { @@ -108,8 +108,7 @@ where }, }; - let event = Approval { owner, spender: *spender, value: *value }; - deposit_event(env, address, event); + deposit_event(env, Approval { owner, spender: *spender, value: *value })?; Ok(approveCall::abi_encode_returns(&true)) }, IERC20Calls::transferFrom(transferFromCall { from, to, value }) => { @@ -123,7 +122,7 @@ where value.saturating_to(), )?; - deposit_event(env, address, Transfer { from: *from, to: *to, value: *value }); + deposit_event(env, Transfer { from: *from, to: *to, value: *value })?; Ok(transferFromCall::abi_encode_returns(&true)) }, // IERC20Metadata diff --git a/pallets/api-vnext/src/fungibles/precompiles/v0.rs b/pallets/api-vnext/src/fungibles/precompiles/v0.rs index 6949ef30c..15ef1515d 100644 --- a/pallets/api-vnext/src/fungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/fungibles/precompiles/v0.rs @@ -28,7 +28,7 @@ where Fixed(NonZero::new(FIXED).expect("expected non-zero precompile address")); fn call( - address: &[u8; 20], + _address: &[u8; 20], input: &Self::Interface, env: &mut impl Ext, ) -> Result, Error> { @@ -44,8 +44,7 @@ where value.saturating_to(), )?; - let event = Transfer { token: *token, from, to: *to, value: *value }; - deposit_event(env, address, event); + deposit_event(env, Transfer { token: *token, from, to: *to, value: *value })?; Ok(transferCall::abi_encode_returns(&transferReturn {})) }, IFungiblesCalls::transferFrom(transferFromCall { token, from, to, value }) => { @@ -60,7 +59,7 @@ where )?; let event = Transfer { token: *token, from: *from, to: *to, value: *value }; - deposit_event(env, address, event); + deposit_event(env, event)?; Ok(transferFromCall::abi_encode_returns(&transferFromReturn {})) }, IFungiblesCalls::approve(approveCall { token, spender, value }) => { @@ -95,7 +94,7 @@ where }; let event = Approval { token: *token, owner, spender: *spender, value: *value }; - deposit_event(env, address, event); + deposit_event(env, event)?; Ok(approveCall::abi_encode_returns(&approveReturn {})) }, IFungiblesCalls::increaseAllowance(increaseAllowanceCall { token, spender, value }) => { @@ -122,7 +121,7 @@ where ); let spender = *spender; - deposit_event(env, address, Approval { token: *token, owner, spender, value }); + deposit_event(env, Approval { token: *token, owner, spender, value })?; Ok(increaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::decreaseAllowance(decreaseAllowanceCall { token, spender, value }) => { @@ -158,7 +157,7 @@ where }; let spender = *spender; - deposit_event(env, address, Approval { token: *token, owner, spender, value }); + deposit_event(env, Approval { token: *token, owner, spender, value })?; Ok(decreaseAllowanceCall::abi_encode_returns(&value)) }, IFungiblesCalls::create(createCall { admin, minBalance }) => { @@ -172,7 +171,7 @@ where )? .into(); - deposit_event(env, address, Created { id, creator, admin: *admin }); + deposit_event(env, Created { id, creator, admin: *admin })?; Ok(createCall::abi_encode_returns(&id)) }, IFungiblesCalls::startDestroy(startDestroyCall { token }) => { @@ -214,7 +213,7 @@ where let from = Address::default(); let to = *account; - deposit_event(env, address, Transfer { token: *token, from, to, value: *value }); + deposit_event(env, Transfer { token: *token, from, to, value: *value })?; Ok(mintCall::abi_encode_returns(&mintReturn {})) }, IFungiblesCalls::burn(burnCall { token, account, value }) => { @@ -239,7 +238,7 @@ where let to = Address::default(); let event = Transfer { token: *token, from: *account, to, value: *value }; - deposit_event(env, address, event); + deposit_event(env, event)?; Ok(burnCall::abi_encode_returns(&burnReturn {})) }, IFungiblesCalls::totalSupply(totalSupplyCall { token }) => { diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index 6cd84ed2e..e59aa4cbb 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -10,7 +10,7 @@ use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; use pallet_revive::{ precompiles::{ - alloy::{sol, sol_types::SolEvent}, + alloy::{primitives::IntoLogData, sol, sol_types::SolEvent}, AddressMatcher, Error, Ext, Precompile, }, AddressMapper as _, Origin, H160, H256, U256, @@ -96,22 +96,19 @@ fn decode::RustType>>(data: &[u8]) -> } fn deposit_event( - _env: &mut impl Ext, - address: impl Into, - event: impl SolEvent, -) { - // TODO: ensure that env.deposit_event impl is correct - let topics = topics(&event); - let data = event.encode_data(); - // env.deposit_event(topics, data); - // TODO: charge gas - // Workaround to emit events explicitly as precompile, as env.deposit uses derived address of - // dummy contract when using `CallSetup` within tests - let revive_event = - pallet_revive::Event::ContractEmitted { contract: address.into(), data, topics }; - >::deposit_event(::RuntimeEvent::from( - revive_event, - )) + env: &mut impl Ext, + event: impl SolEvent + IntoLogData, +) -> Result<(), Error> { + // Source: https://github.com/paritytech/polkadot-sdk/blob/e1026d7ee22a593cf566a99484eee02a03ecc236/substrate/frame/assets/src/precompiles.rs#L152 + let (topics, data) = event.into_log_data().split(); + let topics = topics.into_iter().map(|v| H256(v.0)).collect::>(); + env.gas_meter_mut() + .charge(pallet_revive::precompiles::RuntimeCosts::DepositEvent { + num_topic: topics.len() as u32, + len: topics.len() as u32, + })?; + env.deposit_event(topics, data.to_vec()); + Ok(()) } #[cfg(test)] @@ -141,7 +138,7 @@ fn to_address(account: &::AccountId) -> H160 pallet_revive::AccountId32Mapper::::to_address(account) } -// TODO: verify +#[cfg(test)] fn topics(event: &impl SolEvent) -> Vec { event.encode_topics().into_iter().map(|t| (*t.0).into()).collect() } From ef7a1b96f6db471daf2c3a2c5222b29f1a198c21 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Fri, 27 Jun 2025 13:45:28 +0100 Subject: [PATCH 150/162] docs: remove todo comment --- pallets/api-vnext/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index e59aa4cbb..6d8b8621a 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -144,7 +144,6 @@ fn topics(event: &impl SolEvent) -> Vec { } /// Creates a new `RuntimeOrigin` from an ['Origin']. -// TODO: upstream? pub fn to_runtime_origin(o: Origin) -> T::RuntimeOrigin { match o { Origin::Root => RawOrigin::Root.into(), From d8e4a312cca34fe1802f89340d62abc87b432e18 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Mon, 30 Jun 2025 21:22:00 +0100 Subject: [PATCH 151/162] test(api/integration-tests): constructor encoding Uses `all` encoding to support multiple constructors after solidity constructor support added. --- .github/workflows/ci.yml | 2 +- Cargo.lock | 60 +++++++++---------- pop-api-vnext/Cargo.toml | 4 +- pop-api-vnext/examples/fungibles/Cargo.toml | 2 +- pop-api-vnext/integration-tests/Cargo.toml | 2 +- .../contracts/fungibles/Cargo.lock | 32 +++++----- .../contracts/fungibles/Cargo.toml | 5 +- .../contracts/fungibles/lib.rs | 2 +- .../integration-tests/src/fungibles.rs | 4 +- 9 files changed, 57 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a22d12208..9facc8ab7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: needs: lint runs-on: ubuntu-latest env: - RUSTFLAGS: '--cfg ink_abi="sol"' + RUSTFLAGS: '--cfg ink_abi="all"' steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index 8768d7d08..adae3a2c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7235,16 +7235,16 @@ dependencies = [ [[package]] name = "ink" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "const_format", "deranged", "derive_more 2.0.1", "ink_env 6.0.0-alpha", "ink_macro 6.0.0-alpha", - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "ink_storage 6.0.0-alpha", "keccak-const", "linkme", @@ -7269,7 +7269,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "cfg-if", ] @@ -7299,7 +7299,7 @@ dependencies = [ [[package]] name = "ink_codegen" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2 0.10.6", "derive_more 2.0.1", @@ -7307,7 +7307,7 @@ dependencies = [ "heck 0.5.0", "impl-serde 0.5.0", "ink_ir 6.0.0-alpha", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "itertools 0.14.0", "parity-scale-codec", "polkavm-derive 0.22.0", @@ -7337,12 +7337,12 @@ dependencies = [ [[package]] name = "ink_engine" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2 0.10.6", "derive_more 2.0.1", "hex-literal 1.0.0", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "pallet-revive 0.5.0", "pallet-revive-uapi 0.4.0", "parity-scale-codec", @@ -7385,7 +7385,7 @@ dependencies = [ [[package]] name = "ink_env" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2 0.10.6", "cfg-if", @@ -7394,8 +7394,8 @@ dependencies = [ "hex-literal 1.0.0", "ink_allocator 6.0.0-alpha", "ink_engine 6.0.0-alpha", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "ink_storage_traits 6.0.0-alpha", "num-traits", "pallet-revive 0.5.0", @@ -7434,12 +7434,12 @@ dependencies = [ [[package]] name = "ink_ir" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2 0.10.6", "either", "impl-serde 0.5.0", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "itertools 0.14.0", "proc-macro2", "quote", @@ -7466,11 +7466,11 @@ dependencies = [ [[package]] name = "ink_macro" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "ink_codegen 6.0.0-alpha", "ink_ir 6.0.0-alpha", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "parity-scale-codec", "proc-macro2", "quote", @@ -7513,12 +7513,12 @@ dependencies = [ [[package]] name = "ink_metadata" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "derive_more 2.0.1", "impl-serde 0.5.0", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "parity-scale-codec", "scale-info", "schemars", @@ -7545,7 +7545,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "cfg-if", ] @@ -7595,13 +7595,13 @@ dependencies = [ [[package]] name = "ink_primitives" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "alloy-sol-types 1.2.0", "cfg-if", "derive_more 2.0.1", "impl-trait-for-tuples", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "itertools 0.14.0", "num-traits", "pallet-revive 0.5.0", @@ -7641,15 +7641,15 @@ dependencies = [ [[package]] name = "ink_storage" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "array-init", "cfg-if", "derive_more 2.0.1", "ink_env 6.0.0-alpha", - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "ink_storage_traits 6.0.0-alpha", "pallet-revive-uapi 0.4.0", "parity-scale-codec", @@ -7672,11 +7672,11 @@ dependencies = [ [[package]] name = "ink_storage_traits" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ - "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink)", - "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink)", + "ink_metadata 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_prelude 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", + "ink_primitives 6.0.0-alpha (git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor)", "parity-scale-codec", "scale-info", "sp-io 40.0.1", diff --git a/pop-api-vnext/Cargo.toml b/pop-api-vnext/Cargo.toml index 232d60099..c6c5cbcd8 100644 --- a/pop-api-vnext/Cargo.toml +++ b/pop-api-vnext/Cargo.toml @@ -6,8 +6,8 @@ name = "pop-api" version = "0.1.0" [dependencies] -alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support -ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +alloy-sol-types = { version = "1.0.0", default-features = false } # Required until ink implements sol error support +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-ctor", default-features = false, features = [ "unstable-hostfn" ] } pop-primitives = { path = "../primitives", default-features = false } [dev-dependencies] diff --git a/pop-api-vnext/examples/fungibles/Cargo.toml b/pop-api-vnext/examples/fungibles/Cargo.toml index 9f89d7e4e..e70a97772 100644 --- a/pop-api-vnext/examples/fungibles/Cargo.toml +++ b/pop-api-vnext/examples/fungibles/Cargo.toml @@ -11,7 +11,7 @@ abi = "sol" path = "lib.rs" [dependencies] -ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-ctor", default-features = false, features = [ "unstable-hostfn" ] } pop-api = { path = "../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } [dev-dependencies] diff --git a/pop-api-vnext/integration-tests/Cargo.toml b/pop-api-vnext/integration-tests/Cargo.toml index ec26838bd..df6e98d7c 100644 --- a/pop-api-vnext/integration-tests/Cargo.toml +++ b/pop-api-vnext/integration-tests/Cargo.toml @@ -5,7 +5,7 @@ name = "pop-api-vnext-integration-tests" version = "0.1.0" [package.metadata.ink-lang] -abi = "sol" +abi = "all" [build-dependencies] contract-build = { git = "https://github.com/use-ink/cargo-contract" } diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock index 7c5709829..5b6f22299 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.lock @@ -2342,9 +2342,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.4", @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "ink" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "const_format", "deranged", @@ -2379,7 +2379,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "cfg-if", ] @@ -2387,7 +2387,7 @@ dependencies = [ [[package]] name = "ink_codegen" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2", "derive_more 2.0.1", @@ -2409,7 +2409,7 @@ dependencies = [ [[package]] name = "ink_engine" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2", "derive_more 2.0.1", @@ -2426,7 +2426,7 @@ dependencies = [ [[package]] name = "ink_env" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2", "cfg-if", @@ -2459,7 +2459,7 @@ dependencies = [ [[package]] name = "ink_ir" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "blake2", "either", @@ -2475,7 +2475,7 @@ dependencies = [ [[package]] name = "ink_macro" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "ink_codegen", "ink_ir", @@ -2490,7 +2490,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "derive_more 2.0.1", "impl-serde", @@ -2505,7 +2505,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "cfg-if", ] @@ -2513,7 +2513,7 @@ dependencies = [ [[package]] name = "ink_primitives" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "alloy-sol-types 1.2.1", "cfg-if", @@ -2540,7 +2540,7 @@ dependencies = [ [[package]] name = "ink_storage" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "array-init", "cfg-if", @@ -2558,7 +2558,7 @@ dependencies = [ [[package]] name = "ink_storage_traits" version = "6.0.0-alpha" -source = "git+https://github.com/use-ink/ink#717b4985e8dec31b4eceb2d47ebe643e3b4c02e8" +source = "git+https://github.com/use-ink/ink?branch=semakula%2Fsol-ctor#cf61cb8296ca6a6f33c05311a2387d8f3074f4b1" dependencies = [ "ink_metadata", "ink_prelude", @@ -3144,9 +3144,9 @@ dependencies = [ [[package]] name = "pallet-revive-fixtures" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1df19ca809f036d6ddf1632039e9db312f92dbe8f9390e6722ad808cd95377" +checksum = "279282bb5f8e1da5a22f0e74aabbe31d62e158b7700e102fd9447a971f90d383" dependencies = [ "anyhow", "cargo_metadata", diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml index d5b9801e1..3008d59d8 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml +++ b/pop-api-vnext/integration-tests/contracts/fungibles/Cargo.toml @@ -4,13 +4,14 @@ edition = "2021" name = "fungibles" version = "0.1.0" +# ink! abi required for multiple constructors (fungibles) [package.metadata.ink-lang] -abi = "sol" +abi = "all" [workspace] [dependencies] -ink = { git = "https://github.com/use-ink/ink", default-features = false, features = [ "unstable-hostfn" ] } +ink = { git = "https://github.com/use-ink/ink", branch = "semakula/sol-ctor", default-features = false, features = [ "unstable-hostfn" ] } pop-api = { path = "../../../../pop-api-vnext", default-features = false, features = [ "fungibles" ] } [dev-dependencies] diff --git a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs index 725f5a6dd..358d4b924 100644 --- a/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs +++ b/pop-api-vnext/integration-tests/contracts/fungibles/lib.rs @@ -14,7 +14,7 @@ pub mod fungibles { pub struct Fungible; impl Fungible { - #[ink(constructor, payable)] + #[ink(constructor, default, payable)] #[allow(clippy::new_without_default)] pub fn new() -> Self { Self {} diff --git a/pop-api-vnext/integration-tests/src/fungibles.rs b/pop-api-vnext/integration-tests/src/fungibles.rs index 27345a264..5810d19af 100644 --- a/pop-api-vnext/integration-tests/src/fungibles.rs +++ b/pop-api-vnext/integration-tests/src/fungibles.rs @@ -702,7 +702,7 @@ struct Contract { impl Contract { // Create a new instance of the contract through on-chain instantiation. fn new(origin: &AccountId, value: Balance) -> Self { - let data = blake_selector("new").to_vec(); + let data = vec![]; // Default solidity constructor let salt = twox_256(&value.to_le_bytes()); let address = @@ -712,7 +712,7 @@ impl Contract { // Create a new instance of the contract through on-chain instantiation. fn new_with_create(origin: &AccountId, value: Balance, min_balance: U256) -> Self { - let data = [blake_selector("create").to_vec(), min_balance.encode()].concat(); + let data = [blake_selector("create").to_vec(), min_balance.encode()].concat(); // Additional constructor via ink abi let salt = twox_256(&value.to_le_bytes()); let address = instantiate(RuntimeOrigin::signed(origin.clone()), CONTRACT, value, data, Some(salt)); From 78ba23ec733e2f7e34acae4a99bd56ff905fcb0a Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 1 Jul 2025 11:13:01 +0100 Subject: [PATCH 152/162] docs(api): fix transfer comment --- pop-api-vnext/src/fungibles/erc20/v0.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pop-api-vnext/src/fungibles/erc20/v0.rs b/pop-api-vnext/src/fungibles/erc20/v0.rs index 16c5a5402..b7255d9a2 100644 --- a/pop-api-vnext/src/fungibles/erc20/v0.rs +++ b/pop-api-vnext/src/fungibles/erc20/v0.rs @@ -74,7 +74,11 @@ pub fn balance_of(token: TokenId, account: Address) -> U256 { precompile.balanceOf(account) } -/// Returns the value of tokens owned by `account`. +/// Moves a `value` amount of tokens from the caller's account to `to`. +/// +/// Returns a boolean value indicating whether the operation succeeded. +/// +/// Emits a [`Transfer`] event. #[inline] pub fn transfer(token: TokenId, to: Address, value: U256) -> Result { ensure!(to != Address::zero(), ERC20InvalidSender(to)); From 49992fbee3337f4dcdd18488eb69a4f600d1b6d6 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Tue, 1 Jul 2025 11:31:48 +0100 Subject: [PATCH 153/162] docs(api): port readmes --- pop-api-vnext/README.md | 63 ++++++++++++++++++++++ pop-api-vnext/examples/fungibles/README.md | 42 +++++++++++++++ pop-api-vnext/src/fungibles/README.md | 18 +++++++ 3 files changed, 123 insertions(+) create mode 100644 pop-api-vnext/README.md create mode 100644 pop-api-vnext/examples/fungibles/README.md create mode 100644 pop-api-vnext/src/fungibles/README.md diff --git a/pop-api-vnext/README.md b/pop-api-vnext/README.md new file mode 100644 index 000000000..28b25fabe --- /dev/null +++ b/pop-api-vnext/README.md @@ -0,0 +1,63 @@ +## Pop API + +The `pop-api` crate provides a high-level interface that allows smart contracts to seamlessly interact with Pop, a +blockchain built to power innovative and impactful solutions on Polkadot. Designed for stability, simplicity, and +efficiency, the API abstracts away the complexities of the runtime, enabling developers to focus on building powerful +applications rather than managing intricate blockchain details. + +### Design Goals + +- **Simple**: enhance the developer experience by abstracting away the complexities of runtime functionality, making it + easy for developers to build advanced applications. +- **Versioned**: offer a stable, versioned interface that ensures smart contracts stay compatible as the runtime + evolves, enabling seamless integration of new features without disrupting existing contracts. +- **Efficient**: optimise for minimal contract size, having the lowest possible deployment and execution costs. + +### Key Features + +- **Versioned Interface**: Provides backward compatibility, ensuring that existing contract functionality remains stable + as new features are added to the runtime. +- **Error Handling**: Supports rich, versioned error types, enabling contracts to receive and interpret any runtime + error, making troubleshooting and development easier. +- **Use Cases**: + - [Fungibles](./src/fungibles/README.md): Interacting and managing fungible tokens. + - In development: + - Non-Fungibles: Interacting and managing non fungible tokens. + - Messaging: Cross chain rails for interaction with other chains using ISMP & XCM. + - Sponsorship: Allowing smart contracts to sponsor transactions. + - Incentives: Incentivise smart contracts by sharing chain revenue. + +### Getting Started + +Using the API in your ink! smart contract is as easy as adding the `pop-api` crate in your `Cargo.toml`: + +```toml +pop-api = { git = "https://github.com/r0gue-io/pop-node", default-features = false } +``` + +and importing it within the contract source: + +```rust +use pop_api::*; +``` + +Check out the ink! smart contract [examples](./example) using the API. + +### Learn more + +The true strength of the API lies in the Pop runtime, where powerful precompiles provide flexible and +efficient access to all runtime features, while specialized API modules deliver stable, intuitive interfaces for +developers. Together, these elements make the API a powerful tool for creating decentralized applications on Polkadot. + +Want to explore how it all works? Check out: + +- [API Modules](../pallets/api-vnext) + +### Support + +Be part of our passionate community of Web3 builders. [Join our Telegram](https://t.me/onpopio)! + +Feel free to raise issues if anything is unclear, if you have ideas or want to contribute to Pop! + +For any questions related to ink! you can also go to [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) or +ask the [ink! community](https://t.me/inkathon/). diff --git a/pop-api-vnext/examples/fungibles/README.md b/pop-api-vnext/examples/fungibles/README.md new file mode 100644 index 000000000..c66d61eb9 --- /dev/null +++ b/pop-api-vnext/examples/fungibles/README.md @@ -0,0 +1,42 @@ +# Erc20 Fungible Token with Pop API + +This [ink!][ink] contract implements a [ERC20-compliant][erc-20] fungible token by leveraging the [Fungibles API][pop-api-fungibles]. Unlike typical token contracts, where the contract itself manages the token, tokens created by this contract are managed directly by Pop. This enables seamless integration and interoperability of the token across the Polkadot ecosystem and its applications. + +As the creator of the token, the contract has permissions to mint and burn tokens, but it can only transfer and approve tokens on its own behalf and requires explicit approval to transfer tokens for other accounts. Instead of users interacting with the contract to handle their token approvals, they interact primarily with Pop’s runtime or the corresponding ERC-20 precompile. + +## Key benefits of using the Pop API + +- The token operates live on the Pop Network, beyond just within the contract. +- Simplify token management with high-level interfaces to significantly reduce contract size and complexity. + +[Learn more how Pop API works.](pop-api) + +## Use Cases + +This contract can serve a variety of purposes where owner-controlled token management is essential. Example use cases include: +- **DAO Token**: A DAO can use this contract to manage a governance token, with the DAO overseeing token issuance and removal based on governance decisions. +- **Staking and Rewards**: This contract supports minting tokens specifically for reward distribution. +- **Loyalty Programs**: Businesses or platforms can use this contract to issue loyalty points, with the owner managing token balances for users based on participation or purchases. + +## Test with Pop Drink + +Since this contract interacts directly with Pop’s runtime through the Pop API, it requires [Pop Drink](https://github.com/r0gue-io/pop-drink) for testing. See how the contract is tested in [tests](./tests.rs). + +## Potential Improvements + +- **Multiple owner management**: Instead of restricting ownership to a single `owner`, the contract could be designed to accommodate multiple owners. + +## Support + +Be part of our passionate community of Web3 builders. [Join our Telegram](https://t.me/onpopio)! + +Feel free to raise issues if anything is unclear, you have ideas or want to contribute to Pop! Examples using the fungibles API are always welcome! + +For any questions related to ink! you can also go to [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) or +ask the [ink! community](https://t.me/inkathon/1). + +[ink]: https://use.ink +[erc-20]: https://ethereum.org/en/developers/docs/standards/tokens/erc-20/ +[pop-api]: https://github.com/r0gue-io/pop-node/tree/main/pop-api/ +[pop-api-fungibles]: https://github.com/r0gue-io/pop-node/tree/main/pop-api-vnext/src/fungibles +[pop-drink]: https://github.com/r0gue-io/pop-drink diff --git a/pop-api-vnext/src/fungibles/README.md b/pop-api-vnext/src/fungibles/README.md new file mode 100644 index 000000000..88d83b65f --- /dev/null +++ b/pop-api-vnext/src/fungibles/README.md @@ -0,0 +1,18 @@ +## Fungibles API + +The `fungibles` module provides an api for interacting and managing fungible tokens. + +It includes the following interfaces: + +1. `Fungibles` +2. `Erc20` +3. `Erc20Metadata` + +To use it in your contract add the `fungibles` feature to the `pop-api` dependency. + +```toml +# Cargo.toml +pop-api = { git = "https://github.com/r0gue-io/pop-node", default-features = false, features = [ "fungibles" ] } +``` + +Check out the [examples](../../examples/fungibles/) to learn how you can use the fungibles api. From 03f2ffaf19c7c552cda22eb328b20765de5f61ac Mon Sep 17 00:00:00 2001 From: chungquantin Date: Wed, 2 Jul 2025 18:29:09 +0700 Subject: [PATCH 154/162] feat: nonfungibles precompiles init code --- Cargo.lock | 1 + pallets/api-vnext/Cargo.toml | 6 +- pallets/api-vnext/src/lib.rs | 3 + pallets/api-vnext/src/mock.rs | 72 +- pallets/api-vnext/src/nonfungibles.rs | 259 ++++++ .../api-vnext/src/nonfungibles/precompiles.rs | 18 + .../src/nonfungibles/precompiles/erc721.rs | 4 + .../src/nonfungibles/precompiles/erc721/v0.rs | 736 ++++++++++++++++++ .../precompiles/interfaces/v0/IERC721.sol | 166 ++++ .../interfaces/v0/INonfungibles.sol | 258 ++++++ .../src/nonfungibles/precompiles/v0.rs | 274 +++++++ 11 files changed, 1792 insertions(+), 5 deletions(-) create mode 100644 pallets/api-vnext/src/nonfungibles.rs create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles.rs create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/IERC721.sol create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol create mode 100644 pallets/api-vnext/src/nonfungibles/precompiles/v0.rs diff --git a/Cargo.lock b/Cargo.lock index adae3a2c6..8f7d2297e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9905,6 +9905,7 @@ dependencies = [ "frame-system 28.0.0", "pallet-assets 29.1.0", "pallet-balances 28.0.0", + "pallet-nfts 34.1.0", "pallet-revive 0.1.0", "pallet-timestamp 27.0.0", "parity-scale-codec", diff --git a/pallets/api-vnext/Cargo.toml b/pallets/api-vnext/Cargo.toml index ebf32e521..d50b2fc03 100644 --- a/pallets/api-vnext/Cargo.toml +++ b/pallets/api-vnext/Cargo.toml @@ -17,6 +17,7 @@ frame-benchmarking.workspace = true frame-support.workspace = true frame-system.workspace = true pallet-assets = { workspace = true, default-features = false, optional = true } +pallet-nfts = { workspace = true, default-features = false, optional = true } pallet-revive = { workspace = true, default-features = false } scale-info.workspace = true @@ -26,13 +27,15 @@ pallet-timestamp.workspace = true sp-io.workspace = true [features] -default = [ "fungibles", "std" ] +default = [ "fungibles", "nonfungibles", "std" ] fungibles = [ "pallet-assets" ] +nonfungibles = [ "pallet-nfts" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", + "pallet-nfts/runtime-benchmarks", "pallet-revive/runtime-benchmarks", ] std = [ @@ -42,6 +45,7 @@ std = [ "frame-system/std", "pallet-assets?/std", "pallet-balances/std", + "pallet-nfts?/std", "pallet-revive/std", "pallet-timestamp/std", "scale-info/std", diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index 6d8b8621a..b0ea7a009 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -29,10 +29,13 @@ use { pub mod fungibles; #[cfg(test)] mod mock; +#[cfg(feature = "nonfungibles")] +pub mod nonfungibles; type AccountIdOf = ::AccountId; type AddressMapper = ::AddressMapper; type Assets = pallet_assets::Pallet; +type Nfts = pallet_nfts::Pallet; // A bare call to a contract. #[cfg(test)] diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 1c8b74ef0..b7d7f9494 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -1,12 +1,17 @@ -use codec::Compact; +use codec::{Compact, Decode, DecodeWithMemTracking, Encode}; use frame_support::{ - derive_impl, - sp_runtime::{traits::AccountIdLookup, AccountId32, BuildStorage}, - traits::{AsEnsureOriginWithArg, Get}, + derive_impl, parameter_types, + sp_runtime::{ + traits::{AccountIdLookup, IdentifyAccount, Lazy, Verify}, + AccountId32, BuildStorage, + }, + traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64}, }; use frame_system::{EnsureRoot, EnsureSigned}; use pallet_assets::AutoIncAssetId; +use pallet_nfts::PalletFeatures; pub(crate) use pallet_revive::test_utils::{ALICE, BOB, CHARLIE}; +use scale_info::TypeInfo; use super::fungibles; @@ -50,6 +55,8 @@ mod runtime { pub type Timestamp = pallet_timestamp::Pallet; #[runtime::pallet_index(5)] pub type Fungibles = fungibles::Pallet; + #[runtime::pallet_index(6)] + pub type Nfts = pallet_nfts::Pallet; } #[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] @@ -68,6 +75,63 @@ impl pallet_balances::Config for Test { type Balance = Balance; } +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] +pub struct Noop; + +impl IdentifyAccount for Noop { + type AccountId = AccountId32; + + fn into_account(self) -> Self::AccountId { + AccountId32::new([0; 32]) + } +} + +impl Verify for Noop { + type Signer = Noop; + + fn verify>( + &self, + _msg: L, + _signer: &::AccountId, + ) -> bool { + false + } +} + +parameter_types! { + pub NftsPalletFeatures: PalletFeatures = PalletFeatures::all_enabled(); +} + +impl pallet_nfts::Config for Test { + type ApprovalsLimit = ConstU32<10>; + type AttributeDepositBase = ConstU128<1>; + type BlockNumberProvider = frame_system::Pallet; + type CollectionApprovalDeposit = ConstU128<1>; + type CollectionBalanceDeposit = ConstU128<1>; + type CollectionDeposit = ConstU128<2>; + type CollectionId = u32; + type CreateOrigin = AsEnsureOriginWithArg>; + type Currency = Balances; + type DepositPerByte = ConstU128<1>; + type Features = NftsPalletFeatures; + type ForceOrigin = frame_system::EnsureRoot; + type ItemAttributesApprovalsLimit = ConstU32<2>; + type ItemDeposit = ConstU128<1>; + type ItemId = u32; + type KeyLimit = ConstU32<50>; + type Locker = (); + type MaxAttributesPerCall = ConstU32<2>; + type MaxDeadlineDuration = ConstU64<10000>; + type MaxTips = ConstU32<10>; + type MetadataDepositBase = ConstU128<1>; + type OffchainPublic = Noop; + type OffchainSignature = Noop; + type RuntimeEvent = RuntimeEvent; + type StringLimit = ConstU32<50>; + type ValueLimit = ConstU32<50>; + type WeightInfo = (); +} + #[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)] impl pallet_revive::Config for Test { type AddressMapper = pallet_revive::AccountId32Mapper; diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs new file mode 100644 index 000000000..2ce1cfdee --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -0,0 +1,259 @@ +use frame_support::{ + dispatch::{DispatchResult, DispatchResultWithPostInfo, WithPostDispatchInfo}, + traits::{nonfungibles_v2::Inspect, Incrementable}, + weights::Weight, + BoundedVec, +}; +use frame_system::pallet_prelude::OriginFor; +use pallet_nfts::{ + AccountBalance, Attribute, AttributeNamespace, CancelAttributesApprovalWitness, + CollectionConfigFor, Config, DepositBalanceOf, DestroyWitness, MintWitness, NextCollectionId, +}; + +use super::*; + +pub mod precompiles; + +type BlockNumberFor = pallet_nfts::BlockNumberFor; +type CollectionIdOf = + as Inspect<::AccountId>>::CollectionId; +type ItemIdOf = as Inspect<::AccountId>>::ItemId; + +fn approve, I>( + origin: OriginFor, + collection: CollectionIdOf, + operator: AccountIdOf, + item: Option>, + approved: bool, + deadline: Option>, +) -> DispatchResultWithPostInfo { + // TODO: weights + let operator_lookup = T::Lookup::unlookup(operator.clone()); + let weight = if approved { + match item { + Some(item) => { + Nfts::::approve_transfer(origin, collection, item, operator_lookup, deadline) + .map_err(|e| e.with_weight(Weight::zero()))?; + Weight::zero() + }, + None => { + Nfts::::approve_collection_transfer( + origin, + collection, + operator_lookup, + deadline, + ) + .map_err(|e| e.with_weight(Weight::zero()))?; + Weight::zero() + }, + } + } else { + match item { + Some(item) => { + Nfts::::cancel_approval(origin, collection, item, operator_lookup) + .map_err(|e| e.with_weight(Weight::zero()))?; + Weight::zero() + }, + None => { + Nfts::::cancel_collection_approval(origin, collection, operator_lookup) + .map_err(|e| e.with_weight(Weight::zero()))?; + Weight::zero() + }, + } + }; + Ok(Some(weight).into()) +} + +fn transfer, I>( + origin: OriginFor, + collection: CollectionIdOf, + to: AccountIdOf, + item: ItemIdOf, +) -> DispatchResult { + Nfts::::transfer(origin, collection, item, T::Lookup::unlookup(to.clone())) +} + +fn create, I>( + origin: OriginFor, + admin: AccountIdOf, + config: CollectionConfigFor, +) -> DispatchResult { + Nfts::::create(origin, T::Lookup::unlookup(admin.clone()), config) +} + +fn destroy, I>( + origin: OriginFor, + collection: CollectionIdOf, + witness: DestroyWitness, +) -> DispatchResultWithPostInfo { + Nfts::::destroy(origin, collection, witness) +} + +fn set_attribute, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: Option>, + namespace: AttributeNamespace>, + key: BoundedVec, + value: BoundedVec, +) -> DispatchResult { + Nfts::::set_attribute(origin, collection, item, namespace, key, value) +} + +fn clear_attribute, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: Option>, + namespace: AttributeNamespace>, + key: BoundedVec, +) -> DispatchResult { + Nfts::::clear_attribute(origin, collection, item, namespace, key) +} + +fn set_metadata, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, + data: BoundedVec, +) -> DispatchResult { + Nfts::::set_metadata(origin, collection, item, data) +} + +fn clear_metadata, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, +) -> DispatchResult { + Nfts::::clear_metadata(origin, collection, item) +} + +fn set_max_supply, I>( + origin: OriginFor, + collection: CollectionIdOf, + max_supply: u32, +) -> DispatchResult { + Nfts::::set_collection_max_supply(origin, collection, max_supply) +} + +fn approve_item_attributes, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, + delegate: AccountIdOf, +) -> DispatchResult { + Nfts::::approve_item_attributes(origin, collection, item, T::Lookup::unlookup(delegate)) +} + +fn cancel_item_attributes_approval, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, + delegate: AccountIdOf, + witness: CancelAttributesApprovalWitness, +) -> DispatchResult { + Nfts::::cancel_item_attributes_approval( + origin, + collection, + item, + T::Lookup::unlookup(delegate), + witness, + ) +} + +fn clear_all_transfer_approvals, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, +) -> DispatchResult { + Nfts::::clear_all_transfer_approvals(origin, collection, item) +} + +fn clear_collection_approvals, I>( + origin: OriginFor, + collection: CollectionIdOf, + limit: u32, +) -> DispatchResultWithPostInfo { + Nfts::::clear_collection_approvals(origin, collection, limit) +} + +fn mint, I>( + origin: OriginFor, + collection: CollectionIdOf, + to: AccountIdOf, + item: ItemIdOf, + witness: Option, DepositBalanceOf>>, +) -> DispatchResult { + Nfts::::mint(origin, collection, item, T::Lookup::unlookup(to.clone()), witness) +} + +fn burn, I>( + origin: OriginFor, + collection: CollectionIdOf, + item: ItemIdOf, +) -> DispatchResult { + Nfts::::burn(origin, collection, item) +} + +fn balance_of, I>(collection: CollectionIdOf, owner: AccountIdOf) -> u32 { + AccountBalance::::get(collection, owner) + .map(|(balance, _)| balance) + .unwrap_or_default() +} + +fn owner_of, I>( + collection: CollectionIdOf, + item: ItemIdOf, +) -> Option> { + Nfts::::owner(collection, item) +} + +fn allowance, I>( + collection: CollectionIdOf, + owner: AccountIdOf, + operator: AccountIdOf, + item: Option>, +) -> bool { + Nfts::::check_approval_permission(&collection, &item, &owner, &operator).is_ok() +} + +fn total_supply, I>(collection: CollectionIdOf) -> u32 { + Nfts::::collection_items(collection).unwrap_or_default() +} + +fn get_attributes, I>( + collection: CollectionIdOf, + item: Option>, + namespace: AttributeNamespace>, + key: BoundedVec, +) -> Option> { + Attribute::::get((collection, item, namespace, key)).map(|attribute| attribute.0.into()) +} + +fn item_metadata, I>( + collection: CollectionIdOf, + item: ItemIdOf, +) -> Option> { + Nfts::::item_metadata(collection, item).map(|metadata| metadata.into()) +} + +fn next_collection_id, I>() -> Option> { + NextCollectionId::::get().or(T::CollectionId::initial_value()) +} + +// TODO: replace with type in pallet_nfts once available in future release +pub struct InlineCollectionIdExtractor; +impl CollectionIdExtractor for InlineCollectionIdExtractor { + type CollectionId = u32; + + fn collection_id_from_address(addr: &[u8; 20]) -> Result { + let bytes: [u8; 4] = addr[0..4].try_into().expect("slice is 4 bytes; qed"); + let collection_index = u32::from_be_bytes(bytes); + Ok(collection_index) + } +} +/// Mean of extracting the asset id from the precompile address. +pub trait CollectionIdExtractor { + type CollectionId; + + fn collection_id_from_address(address: &[u8; 20]) -> Result; +} diff --git a/pallets/api-vnext/src/nonfungibles/precompiles.rs b/pallets/api-vnext/src/nonfungibles/precompiles.rs new file mode 100644 index 000000000..cbf5412f4 --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles.rs @@ -0,0 +1,18 @@ +use alloc::string::String; + +pub(super) use pallet_revive::precompiles::alloy::{ + primitives::{ + ruint::{UintTryFrom, UintTryTo}, + U256, + }, + sol_types::SolCall, +}; + +// use weights::WeightInfo; +use super::*; + +/// APIs for fungible tokens conforming to the ERC721 standard. +pub mod erc721; + +/// The first version of the Nonfungibles API. +pub mod v0; diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs new file mode 100644 index 000000000..fdd6b843a --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs @@ -0,0 +1,4 @@ +use super::{SolCall, UintTryFrom, UintTryTo, U256}; + +/// The first version of the Erc721 API. +pub mod v0; diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs new file mode 100644 index 000000000..320404403 --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs @@ -0,0 +1,736 @@ +use frame_support::sp_runtime::traits::AtLeast32Bit; +use pallet_nfts::Item; +use pallet_revive::precompiles::alloy::{ + primitives::{Address, FixedBytes}, + sol_types::{Revert, SolCall}, +}; +use AddressMatcher::Prefix; +use IERC721::*; + +use super::*; + +sol!("src/nonfungibles/precompiles/interfaces/IERC721.sol"); + +/// Precompile providing an interface of the ERC-721 standard as defined in the ERC. +pub struct Erc721(PhantomData<(T, I)>); +impl< + const PREFIX: u16, + T: frame_system::Config + + Config + + pallet_revive::Config, + I: 'static, + > Precompile for Erc721 +{ + type Interface = IERC721Calls; + type T = T; + + const HAS_CONTRACT_INFO: bool = false; + const MATCHER: AddressMatcher = + Prefix(NonZero::new(PREFIX).expect("expected non-zero precompile address")); + + fn call( + address: &[u8; 20], + input: &Self::Interface, + env: &mut impl Ext, + ) -> Result, Error> { + use IERC721::{IERC721Calls::*, *}; + + let collection_id = InlineCollectionIdExtractor::collection_id_from_address(address)?; + + let mut transfer_from = + |transferFromCall { from, to, tokenId }: transferFromCall| -> Result<(), Error> { + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + super::transfer::( + to_runtime_origin(env.caller()), + collection_id.into(), + env.to_account_id(&(*to.0).into()), + item_id, + )?; + deposit_event::(env, address, Transfer { from, to, tokenId }); + Ok(()) + }; + + let get_attribute = + |key: &str, item_id: Option>| -> Result, Error> { + let collection_id: CollectionIdOf = collection_id.into(); + let attribute = match super::get_attributes::( + collection_id, + item_id, + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + ) { + Some(value) => value, + None => + return Err(Error::Revert(Revert { + reason: "ERC721: No attribute found".to_string(), + })), + }; + Ok(attribute) + }; + + match input { + // IERC721 + balanceOf(balanceOfCall { owner }) => { + // TODO: charge based on benchmarked weight + let owner = env.to_account_id(&(*owner.0).into()); + let balance = + U256::saturating_from(super::balance_of::(collection_id.into(), owner)); + Ok(balanceOfCall::abi_encode_returns(&(balance,))) + }, + ownerOf(ownerOfCall { tokenId }) => { + let collection_id: CollectionIdOf = collection_id.into(); + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + + let owner = super::owner_of::(collection_id, item_id).unwrap(); + let address: Address = >::to_address(&owner).0.into(); + Ok(ownerOfCall::abi_encode_returns(&(address,))) + }, + // TODO: checkOnERC721Received, reference: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L135C21-L135C42 + safeTransferFrom_0(safeTransferFrom_0Call { from, to, tokenId, data: _ }) => { + transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; + Ok(safeTransferFrom_0Call::abi_encode_returns(&())) + }, + // TODO: checkOnERC721Received, reference: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L135C21-L135C42 + safeTransferFrom_1(safeTransferFrom_1Call { from, to, tokenId }) => { + transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; + Ok(safeTransferFrom_1Call::abi_encode_returns(&())) + }, + transferFrom(transferFromCall { from, to, tokenId }) => { + transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; + Ok(transferFromCall::abi_encode_returns(&())) + }, + approve(approveCall { to, tokenId }) => { + // TODO: charge based on benchmarked weight + let collection_id: CollectionIdOf = collection_id.into(); + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + + let owner = >::to_address(env.caller().account_id()?).0.into(); + let item_details = match Item::::get(collection_id, item_id) { + Some(details) => details, + None => + return Err(Error::Revert(Revert { + reason: "ERC721: Item not found".to_string(), + })), + }; + + if *to == Address(FixedBytes::default()) { + super::clear_all_transfer_approvals::( + to_runtime_origin(env.caller()), + collection_id, + item_id, + )?; + } else { + // Only a single account can be approved at a time, so approving the zero + // address clears previous approvals. + if !item_details.approvals.is_empty() { + return Err(Error::Revert(Revert { + reason: "ERC721: Item already approved".to_string(), + })); + } + super::approve::( + to_runtime_origin(env.caller()), + collection_id.into(), + env.to_account_id(&(*to.0).into()), + Some(item_id), + true, + None, + ) + .map_err(|e| e.error)?; + + deposit_event( + env, + address, + Approval { owner, approved: *to, tokenId: *tokenId }, + ); + } + Ok(approveCall::abi_encode_returns(&())) + }, + setApprovalForAll(setApprovalForAllCall { operator, approved }) => { + // TODO: charge based on benchmarked weight + let collection_id: CollectionIdOf = collection_id.into(); + let owner = >::to_address(env.caller().account_id()?).0.into(); + + super::approve::( + to_runtime_origin(env.caller()), + collection_id, + env.to_account_id(&(*operator.0).into()), + None, + *approved, + None, + ) + .map_err(|e| e.error)?; + + deposit_event( + env, + address, + ApprovalForAll { owner, operator: *operator, approved: *approved }, + ); + Ok(setApprovalForAllCall::abi_encode_returns(&())) + }, + getApproved(getApprovedCall { tokenId }) => { + // TODO: charge based on benchmarked weight + let collection_id: CollectionIdOf = collection_id.into(); + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + + let item_details = match Item::::get(collection_id, item_id) { + Some(details) => details, + None => + return Err(Error::Revert(Revert { + reason: "ERC721: Item not found".to_string(), + })), + }; + let accounts = item_details.approvals.first_key_value(); + match accounts { + Some((approved, _)) => { + let address: Address = >::to_address(&approved).0.into(); + Ok(getApprovedCall::abi_encode_returns(&(address,))) + }, + None => + Err(Error::Revert(Revert { reason: "ERC721: Not approved".to_string() })), + } + }, + isApprovedForAll(isApprovedForAllCall { owner, operator }) => { + let collection_id: CollectionIdOf = collection_id.into(); + let approved = super::allowance::( + collection_id, + env.to_account_id(&(*owner.0).into()), + env.to_account_id(&(*operator.0).into()), + None, + ); + Ok(isApprovedForAllCall::abi_encode_returns(&(approved,))) + }, + // IERC721Burnable + burn(burnCall { tokenId }) => { + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + + // Clear all transfer approvals before burning a collection item. + // Reference: https://github.com/binodnp/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L260 + super::clear_all_transfer_approvals::( + to_runtime_origin(env.caller()), + collection_id.into(), + item_id, + )?; + super::burn::( + to_runtime_origin(env.caller()), + collection_id.into(), + item_id, + )?; + Ok(burnCall::abi_encode_returns(&())) + }, + // IERC721Metadata + // Reference: https://wiki.polkadot.network/learn/learn-nft-pallets/ + name(_) => get_attribute("name", None) + .map(|attr| nameCall::abi_encode_returns(&(String::from_utf8_lossy(&attr),))), + symbol(_) => get_attribute("symbol", None) + .map(|attr| nameCall::abi_encode_returns(&(String::from_utf8_lossy(&attr),))), + tokenURI(tokenURICall { tokenId }) => { + let item_id: ItemIdOf = tokenId.saturating_to::().into(); + get_attribute("image", Some(item_id)).map(|attr| { + tokenURICall::abi_encode_returns(&(String::from_utf8_lossy(&attr),)) + }) + }, + } + } +} + +impl, I: 'static> Erc721 { + pub fn address(collection_id: u32) -> [u8; 20] { + prefixed_address(PREFIX, collection_id) + } +} + +#[cfg(test)] +mod tests { + use frame_support::assert_ok; + use pallet_nfts::{CollectionConfig, CollectionSettings, Instance1, MintSettings}; + use pallet_revive::{ + precompiles::{ + alloy::{primitives::Bytes, sol_types::SolType}, + ExtWithInfo, + }, + test_utils::{ALICE, ALICE_ADDR, BOB, BOB_ADDR}, + }; + + use super::*; + use crate::mock::{ExtBuilder, RuntimeOrigin, Test}; + + const ERC721: u16 = 100; + + type Erc721 = super::Erc721; + + #[test] + fn balance_of_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::balanceOf(IERC721::balanceOfCall { owner: ALICE_ADDR.0.into() }) + ) + .unwrap(), + U256::from(1) + ); + assert_eq!(super::balance_of::(collection_id, ALICE), 1); + }); + } + + #[test] + fn owner_of_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + let address: Address = ALICE_ADDR.0.into(); + assert_eq!( + call_precompile::

( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::ownerOf(IERC721::ownerOfCall { tokenId: U256::from(item_id) }) + ) + .unwrap(), + address + ); + assert_eq!(super::owner_of::(collection_id, item_id), Some(ALICE)); + }); + } + + #[test] + fn safe_transfer_from_0_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + call_setup.set_origin(Origin::Signed(BOB)); + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::safeTransferFrom_0(IERC721::safeTransferFrom_0Call { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id), + data: Bytes::default() + }) + )); + assert_eq!(super::balance_of::(collection_id, BOB), 1); + }); + } + + #[test] + fn safe_transfer_from_1_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + call_setup.set_origin(Origin::Signed(BOB)); + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::safeTransferFrom_1(IERC721::safeTransferFrom_1Call { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id), + }) + )); + assert_eq!(super::balance_of::(collection_id, BOB), 1); + }); + } + + #[test] + fn transfer_from_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + call_setup.set_origin(Origin::Signed(BOB)); + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::transferFrom(IERC721::transferFromCall { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + )); + assert_eq!(super::balance_of::(collection_id, BOB), 1); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::Transfer { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::saturating_from(item_id), + }, + ); + }); + } + + #[test] + fn approve_fails_with_unknown_item() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + // No item found. + assert!(matches!( + call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(1) + }) + ), + Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Item not found".to_string() } + )); + }); + } + + #[test] + fn approve_fails_with_existing_approval() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + // Item already approved. + assert!(matches!( + call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + ), + Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Item already approved".to_string() } + )); + }); + } + + #[test] + fn approve_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + )); + assert!(super::allowance::(collection_id, ALICE, BOB, Some(item_id))); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::Approval { + owner: ALICE_ADDR.0.into(), + approved: BOB_ADDR.0.into(), + tokenId: U256::saturating_from(item_id), + }, + ); + }); + } + + #[test] + fn approve_zero_address_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + // Clear all existing approvals if zero address is approved. + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: Address(FixedBytes::default()), + tokenId: U256::from(item_id) + }) + )); + assert!(!super::allowance::(collection_id, ALICE, BOB, Some(item_id))); + }); + } + + #[test] + fn set_approval_for_all_works() { + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, 0); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { + operator: BOB_ADDR.0.into(), + approved: true + }) + )); + assert!(super::allowance::(collection_id, ALICE, BOB, None)); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::ApprovalForAll { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into(), + approved: true, + }, + ); + }); + } + + #[test] + fn remove_approval_for_all_works() { + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, 0); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + None, + true, + None, + )); + // Successfully removes approval. + assert_ok!(call_precompile::<()>( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { + operator: BOB_ADDR.0.into(), + approved: false + }) + )); + assert!(!super::allowance::(collection_id, ALICE, BOB, None)); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::ApprovalForAll { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into(), + approved: false, + }, + ); + }); + } + + #[test] + fn get_approved_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + let address: Address = BOB_ADDR.0.into(); + // Approved. + call_setup.set_origin(Origin::Signed(BOB)); + assert_eq!( + call_precompile::
( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::getApproved(IERC721::getApprovedCall { + tokenId: U256::saturating_from(item_id) + }) + ) + .unwrap(), + address + ); + }); + } + + #[test] + fn get_approved_fails_with_no_approval() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + // Not approved. + call_setup.set_origin(Origin::Signed(BOB)); + assert!(matches!( + call_precompile::
( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::getApproved(IERC721::getApprovedCall { + tokenId: U256::saturating_from(item_id) + }) + ), + Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Not approved".to_string() } + )); + }); + } + + #[test] + fn is_approved_for_all_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(super::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + None, + true, + None, + )); + assert_ok!(call_precompile::( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::isApprovedForAll(IERC721::isApprovedForAllCall { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into() + }) + )); + }); + } + + #[test] + fn name_works() { + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection(ALICE); + set_attribute(collection_id, None, "name", "ERC721 Example Colection"); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::name(IERC721::nameCall {}) + ) + .unwrap(), + "ERC721 Example Colection".to_string() + ); + }); + } + + #[test] + fn symbol_works() { + let collection_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection(ALICE); + set_attribute(collection_id, None, "symbol", "POP"); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::symbol(IERC721::symbolCall {}) + ) + .unwrap(), + "POP".to_string() + ); + }); + } + + #[test] + fn image_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + ExtBuilder::new().build_with_env(|mut call_setup| { + create_collection_and_mint(ALICE, collection_id, item_id); + set_attribute(collection_id, Some(item_id), "image", "https://example.com/image.png"); + assert_eq!( + call_precompile::( + &mut call_setup.ext().0, + collection_id, + &IERC721Calls::tokenURI(IERC721::tokenURICall { + tokenId: U256::saturating_from(item_id) + }) + ) + .unwrap(), + "https://example.com/image.png".to_string() + ); + }); + } + + fn create_collection_and_mint(owner: AccountIdOf, collection_id: u32, item_id: u32) { + create_collection(owner.clone()); + assert_ok!(super::mint::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + owner, + item_id, + None, + )); + } + + fn create_collection(owner: AccountIdOf) { + assert_ok!(super::create::( + RuntimeOrigin::signed(owner.clone()), + owner, + default_collection_config(), + )); + } + + fn default_collection_config() -> CollectionConfigFor { + CollectionConfig { + settings: CollectionSettings::all_enabled(), + max_supply: None, + mint_settings: MintSettings::default(), + } + } + + fn set_attribute(collection_id: u32, item_id: Option, key: &str, value: &str) { + assert_ok!(super::set_attribute::( + RuntimeOrigin::signed(ALICE), + collection_id, + item_id, + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + BoundedVec::truncate_from(value.as_bytes().to_vec()), + )); + } + + fn call_precompile::RustType>>( + ext: &mut impl ExtWithInfo, + id: u32, + input: &IERC721Calls, + ) -> Result { + super::call_precompile::(ext, &prefixed_address(ERC721, id), input) + } +} diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/IERC721.sol b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/IERC721.sol new file mode 100644 index 000000000..694b08261 --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/IERC721.sol @@ -0,0 +1,166 @@ +/** + * @dev Required interface of an ERC-721 compliant contract. + * Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721.sol + */ +interface IERC721 { + /** + * @dev Emitted when `tokenId` token is transferred from `from` to `to`. + */ + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + + /** + * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. + */ + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + + /** + * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. + */ + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + + /** + * @dev Returns the number of tokens in ``owner``'s account. + */ + function balanceOf(address owner) external view returns (uint256 balance); + + /** + * @dev Returns the owner of the `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function ownerOf(uint256 tokenId) external view returns (address owner); + + /** + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon + * a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + + /** + * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients + * are aware of the ERC-721 protocol to prevent tokens from being forever locked. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or + * {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon + * a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom(address from, address to, uint256 tokenId) external; + + /** + * @dev Transfers `tokenId` token from `from` to `to`. + * + * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721 + * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must + * understand this adds an external call which potentially creates a reentrancy vulnerability. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * + * Emits a {Transfer} event. + */ + function transferFrom(address from, address to, uint256 tokenId) external; + + /** + * @dev Gives permission to `to` to transfer `tokenId` token to another account. + * The approval is cleared when the token is transferred. + * + * Only a single account can be approved at a time, so approving the zero address clears previous approvals. + * + * Requirements: + * + * - The caller must own the token or be an approved operator. + * - `tokenId` must exist. + * + * Emits an {Approval} event. + */ + function approve(address to, uint256 tokenId) external; + + /** + * @dev Approve or remove `operator` as an operator for the caller. + * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. + * + * Requirements: + * + * - The `operator` cannot be the address zero. + * + * Emits an {ApprovalForAll} event. + */ + function setApprovalForAll(address operator, bool approved) external; + + /** + * @dev Returns the account approved for `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function getApproved(uint256 tokenId) external view returns (address operator); + + /** + * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. + * + * See {setApprovalForAll} + */ + function isApprovedForAll(address owner, address operator) external view returns (bool); + + + // Extensions: `sol!` macro does not support inheritance, so extensions need to be included in same interface + + // IERC721Metadata: Interface for the optional metadata functions from the ERC-721 standard. + // Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Metadata.sol + + /** + * @dev Returns the token collection name. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the token collection symbol. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. + */ + function tokenURI(uint256 tokenId) external view returns (string memory); + + // IERC721Burnable: Interface for the optional burn function from the ERC-721 standard. + // Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Burnable.sol + + /** + * @dev Burns `tokenId`. See {ERC721-_burn}. + * + * Requirements: + * + * - The caller must own `tokenId` or be an approved operator. + */ + function burn(uint256 tokenId) public virtual { + // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists + // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. + _update(address(0), tokenId, _msgSender()); + } +} diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol new file mode 100644 index 000000000..610b4c5bd --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol @@ -0,0 +1,258 @@ +/// @title INonfungibles - Interface for interacting with the pallet_nfts logic +/** + * @dev The nonfungibles precompile offers a streamlined interface for interacting with a nonfungible token. The goal is to + * provide a simplified, consistent API that adheres to standards in the smart contract space. + */ +// TODO: consider size of id -> uint256 (word) +interface INonfungibles { + /** + * @dev Approves `operator` to transfer the given `item` on behalf of the caller until `deadline`. + */ + function approveTransfer( + uint32 collection, + address operator, + uint32 item, + bool approved, + uint32 deadline + ) external; + + /** + * @dev Approves `operator` to transfer all items in `collection` on behalf of the caller until `deadline`. + */ + function approveCollection( + uint32 collection, + address operator, + bool approved, + uint32 deadline + ) external; + + /** + * @dev Transfers the specified `item` in `collection` from caller to `to`. + */ + function transfer( + uint32 collection, + address to, + uint32 item + ) external; + + /** + * @dev Creates a new NFT collection with the given `admin` and `config`. + */ + function create( + address admin, + bytes calldata config + ) external returns (uint32 collection); + + /** + * @dev Destroys the specified `collection` with the given `witness`. + */ + function destroy( + uint32 collection, + bytes calldata witness + ) external; + + /** + * @dev Sets an attribute on `item` or entire `collection` under the given `namespace` and `key`. + */ + function setItemAttribute( + uint32 collection, + uint32 item, + bytes calldata namespace, + bytes calldata key, + bytes calldata value + ) external; + + /** + * @dev Sets an attribute on entire `collection` under the given `namespace` and `key`. + */ + function setCollectionAttribute( + uint32 collection, + bytes calldata namespace, + bytes calldata key, + bytes calldata value + ) external; + + /** + * @dev Clears an attribute from `item` or entire `collection` under the given `namespace` and `key`. + */ + function clearAttribute( + uint32 collection, + uint32 item, + bytes calldata namespace, + bytes calldata key + ) external; + + /** + * @dev Sets metadata for the specified `item` in `collection`. + */ + function setMetadata( + uint32 collection, + uint32 item, + bytes calldata data + ) external; + + /** + * @dev Clears metadata for the specified `item` in `collection`. + */ + function clearMetadata( + uint32 collection, + uint32 item + ) external; + + /** + * @dev Sets the max supply for the specified `collection`. + */ + function setMaxSupply( + uint32 collection, + uint32 maxSupply + ) external; + + /** + * @dev Approves `delegate` to manage attributes of `item` in `collection`. + */ + function approveItemAttributes( + uint32 collection, + uint32 item, + address delegate + ) external; + + /** + * @dev Cancels attribute approval for `delegate` on `item` in `collection` using the given `witness`. + */ + function cancelItemAttributesApproval( + uint32 collection, + uint32 item, + address delegate, + bytes calldata witness + ) external; + + /** + * @dev Clears all transfer approvals from the specified `item` in `collection`. + */ + function clearAllTransferApprovals( + uint32 collection, + uint32 item + ) external; + + /** + * @dev Clears collection-level approvals, with a `limit` to how many to remove. + */ + function clearCollectionApprovals( + uint32 collection, + uint32 limit + ) external; + + /** + * @dev Mints a new `item` in `collection` to `to` with optional `witness`. + */ + function mint( + uint32 collection, + address to, + uint32 item, + bytes calldata witness + ) external; + + /** + * @dev Burns the specified `item` in `collection`. + */ + function burn( + uint32 collection, + uint32 item + ) external; + + /** + * @dev Returns the balance (number of owned items) for `owner` in `collection`. + */ + function balanceOf( + uint32 collection, + address owner + ) external view returns (uint32); + + /** + * @dev Returns the owner of the specified `item` in `collection`. + */ + function ownerOf( + uint32 collection, + uint32 item + ) external view returns (address); + + /** + * @dev Returns if `operator` is approved to transfer the `item` on behalf of `owner`. + */ + function allowance( + uint32 collection, + address owner, + address operator, + uint32 item + ) external view returns (bool); + + /** + * @dev Returns whether `operator` is approved to transfer all items on behalf of `owner`. + */ + function collectionAllowance( + uint32 collection, + address owner, + address operator + ) external view returns (bool); + + /** + * @dev Returns the total number of items minted in `collection`. + */ + function totalSupply( + uint32 collection + ) external view returns (uint32); + + /** + * @dev Returns the attribute value of `key` under `namespace` for given `item` in `collection`. + */ + function getItemAttributes( + uint32 collection, + uint32 item, + bytes calldata namespace, + bytes calldata key + ) external view returns (string memory); + + /** + * @dev Returns the attribute value of `key` under `namespace` for `collection`. + */ + function getCollectionAttributes( + uint32 collection, + bytes calldata namespace, + bytes calldata key + ) external view returns (string memory); + + /** + * @dev Returns the metadata for the specified `item` in `collection`. + */ + function itemMetadata( + uint32 collection, + uint32 item + ) external view returns (string memory); + + /** + * @dev Emitted when a token transfer occurs. + * `from` is the address tokens are sent from (zero address if minted). + * `to` is the address tokens are sent to (zero address if burned). + */ + event Transfer(address indexed from, address indexed to, uint32 item); + + /** + * @dev Emitted when an approval is set or revoked for an item. + */ + event ItemApproval(address indexed owner, address indexed operator, uint32 item, bool approved); + + /** + * @dev Emitted when an approval is set or revoked for a collection. + */ + event CollectionApproval(address indexed owner, address indexed operator, uint32 collection, bool approved); + + /** + * @dev Emitted when an attribute is set on an item. + */ + event ItemAttributeSet(uint32 indexed item, bytes key, bytes data); + + /** + * @dev Emitted when an attribute is set on a collection. + */ + event CollectionAttributeSet(uint32 indexed collection, bytes key, bytes data); +} diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs new file mode 100644 index 000000000..0b5b8055f --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -0,0 +1,274 @@ +pub use erc721::{Erc721, IERC721}; +use pallet_revive::precompiles::{ + alloy::sol_types::{Revert, SolCall}, + AddressMatcher::Fixed, +}; +use INonfungibles::*; + +use super::*; + +mod erc721; + +sol!("src/nonfungibles/precompiles/interfaces/INonfungibles.sol"); + +/// The nonfungibles precompile offers a streamlined interface for interacting with nonfungible +/// tokens. The goal is to provide a simplified, consistent API that adheres to standards in the +/// smart contract space. +pub struct Nonfungibles(PhantomData<(T, I)>); +impl< + const FIXED: u16, + T: frame_system::Config + + Config + Into, ItemId: Default + From> + + pallet_revive::Config, + I: 'static, + > Precompile for Nonfungibles +{ + type Interface = INonfungiblesCalls; + type T = T; + + const HAS_CONTRACT_INFO: bool = false; + const MATCHER: AddressMatcher = + Fixed(NonZero::new(FIXED).expect("expected non-zero precompile address")); + + fn call( + address: &[u8; 20], + input: &Self::Interface, + env: &mut impl Ext, + ) -> Result, Error> { + use INonfungibles::{INonfungiblesCalls::*, *}; + match input { + approveTransfer(approveTransferCall { + collection, + operator, + item, + approved, + deadline, + }) => { + let owner = >::to_address(env.caller().account_id()?).0.into(); + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + + // Successfully approves. + let deadline: Option> = + if *deadline > 0 { Some((*deadline).into()) } else { None }; + super::approve::( + to_runtime_origin(env.caller()), + collection_id, + env.to_account_id(&(*operator.0).into()), + Some(item_id), + *approved, + deadline, + ) + .map_err(|e| e.error)?; + deposit_event( + env, + address, + ItemApproval { operator: *operator, approved: *approved, item: *item, owner }, + ); + Ok(approveTransferCall::abi_encode_returns(&())) + }, + approveCollection(approveCollectionCall { + collection, + operator, + approved, + deadline, + }) => { + let owner = >::to_address(env.caller().account_id()?).0.into(); + let collection_id: CollectionIdOf = (*collection).into(); + + // Successfully approves a collection. + let deadline: Option> = + if *deadline > 0 { Some((*deadline).into()) } else { None }; + super::approve::( + to_runtime_origin(env.caller()), + collection_id, + env.to_account_id(&(*operator.0).into()), + None, + *approved, + deadline, + ) + .map_err(|e| e.error)?; + deposit_event( + env, + address, + CollectionApproval { + operator: *operator, + approved: *approved, + collection: *collection, + owner, + }, + ); + Ok(approveCollectionCall::abi_encode_returns(&())) + }, + transfer(transferCall { collection, to, item }) => { + let owner = >::to_address(env.caller().account_id()?).0.into(); + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + + // Successfully transfers an item. + super::transfer::( + to_runtime_origin(env.caller()), + collection_id, + env.to_account_id(&(*to.0).into()), + item_id, + )?; + deposit_event(env, address, Transfer { from: owner, to: *to, item: *item }); + Ok(transferCall::abi_encode_returns(&())) + }, + create(createCall { admin, config }) => { + let collection_id: u32 = + super::next_collection_id::().unwrap_or_default().into(); + + // Successfully creates a collection. + super::create::( + to_runtime_origin(env.caller()), + env.to_account_id(&(*admin.0).into()), + decode_bytes::>(config)?, + )?; + Ok(createCall::abi_encode_returns(&(collection_id,))) + }, + destroy(destroyCall { collection, witness }) => { + let collection_id: CollectionIdOf = (*collection).into(); + + // Successfully destroys a collection. + super::destroy::( + to_runtime_origin(env.caller()), + collection_id, + decode_bytes(witness)?, + ) + .map_err(|e| e.error)?; + Ok(destroyCall::abi_encode_returns(&())) + }, + setItemAttribute(setItemAttributeCall { collection, item, namespace, key, value }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + super::set_attribute::( + to_runtime_origin(env.caller()), + collection_id, + Some(item_id), + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + BoundedVec::truncate_from(value.to_vec()), + )?; + deposit_event( + env, + address, + ItemAttributeSet { key: key.clone(), data: value.clone(), item: *item }, + ); + Ok(destroyCall::abi_encode_returns(&())) + }, + setCollectionAttribute(setCollectionAttributeCall { + collection, + namespace, + key, + value, + }) => { + let collection_id: CollectionIdOf = (*collection).into(); + super::set_attribute::( + to_runtime_origin(env.caller()), + collection_id, + None, + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + BoundedVec::truncate_from(value.to_vec()), + )?; + deposit_event( + env, + address, + CollectionAttributeSet { + key: key.clone(), + data: value.clone(), + collection: *collection, + }, + ); + Ok(setCollectionAttributeCall::abi_encode_returns(&())) + }, + clearAttribute(_) => { + unimplemented!() + }, + setMetadata(_) => { + unimplemented!() + }, + clearMetadata(_) => { + unimplemented!() + }, + setMaxSupply(_) => { + unimplemented!() + }, + approveItemAttributes(_) => { + unimplemented!() + }, + cancelItemAttributesApproval(_) => { + unimplemented!() + }, + clearCollectionApprovals(_) => { + unimplemented!() + }, + mint(_) => { + unimplemented!() + }, + burn(_) => { + unimplemented!() + }, + balanceOf(_) => { + unimplemented!() + }, + ownerOf(_) => { + unimplemented!() + }, + allowance(_) => { + unimplemented!() + }, + totalSupply(_) => { + unimplemented!() + }, + getItemAttributes(getItemAttributesCall { collection, item, namespace, key }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + let attribute = match super::get_attributes::( + collection_id, + Some(item_id), + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + ) { + Some(value) => value, + None => + return Err(Error::Revert(Revert { + reason: "Nonfungibles: No attribute found".to_string(), + })), + }; + Ok(getItemAttributesCall::abi_encode_returns(&(String::from_utf8_lossy( + &attribute, + ),))) + }, + getCollectionAttributes(getCollectionAttributesCall { collection, namespace, key }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let attribute = match super::get_attributes::( + collection_id, + None, + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + ) { + Some(value) => value, + None => + return Err(Error::Revert(Revert { + reason: "Nonfungibles: No attribute found".to_string(), + })), + }; + Ok(getItemAttributesCall::abi_encode_returns(&(String::from_utf8_lossy( + &attribute, + ),))) + }, + itemMetadata(_) => { + unimplemented!() + }, + _ => unimplemented!(), + } + } +} + +impl, I: 'static> Nonfungibles { + pub const fn address() -> [u8; 20] { + fixed_address(FIXED) + } +} From 3994fd0b0c170fc3698fed290f1bd20e30a5244b Mon Sep 17 00:00:00 2001 From: chungquantin Date: Wed, 9 Jul 2025 15:06:46 +0700 Subject: [PATCH 155/162] feat: update erc721 precompile implementation --- pallets/api-vnext/src/lib.rs | 4 +- pallets/api-vnext/src/mock.rs | 6 +- pallets/api-vnext/src/nonfungibles.rs | 30 + .../api-vnext/src/nonfungibles/precompiles.rs | 11 +- .../src/nonfungibles/precompiles/erc721.rs | 2 +- .../src/nonfungibles/precompiles/erc721/v0.rs | 230 ++++---- .../src/nonfungibles/precompiles/v0.rs | 538 +++++++++++++++++- 7 files changed, 669 insertions(+), 152 deletions(-) diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index b0ea7a009..40c593d3c 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -8,12 +8,14 @@ use core::{convert::Into, marker::PhantomData, num::NonZero}; use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; #[cfg(any(test, feature = "runtime-benchmarks"))] use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; +#[cfg(test)] +use pallet_revive::H160; use pallet_revive::{ precompiles::{ alloy::{primitives::IntoLogData, sol, sol_types::SolEvent}, AddressMatcher, Error, Ext, Precompile, }, - AddressMapper as _, Origin, H160, H256, U256, + AddressMapper as _, Origin, H256, U256, }; #[cfg(test)] use { diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index b7d7f9494..3819e876b 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -5,7 +5,7 @@ use frame_support::{ traits::{AccountIdLookup, IdentifyAccount, Lazy, Verify}, AccountId32, BuildStorage, }, - traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64}, + traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Get}, }; use frame_system::{EnsureRoot, EnsureSigned}; use pallet_assets::AutoIncAssetId; @@ -24,6 +24,7 @@ pub(crate) type TokenId = u32; pub(crate) const ERC20: u16 = 2; pub(crate) const FUNGIBLES: u16 = 1; +pub(crate) const ERC721: u16 = 3; pub(crate) const UNIT: Balance = 10_000_000_000; #[frame_support::runtime] @@ -102,7 +103,7 @@ parameter_types! { pub NftsPalletFeatures: PalletFeatures = PalletFeatures::all_enabled(); } -impl pallet_nfts::Config for Test { +impl pallet_nfts::Config for Test { type ApprovalsLimit = ConstU32<10>; type AttributeDepositBase = ConstU128<1>; type BlockNumberProvider = frame_system::Pallet; @@ -126,7 +127,6 @@ impl pallet_nfts::Config for Test { type MetadataDepositBase = ConstU128<1>; type OffchainPublic = Noop; type OffchainSignature = Noop; - type RuntimeEvent = RuntimeEvent; type StringLimit = ConstU32<50>; type ValueLimit = ConstU32<50>; type WeightInfo = (); diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs index 2ce1cfdee..8f8c514b9 100644 --- a/pallets/api-vnext/src/nonfungibles.rs +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -236,6 +236,36 @@ fn item_metadata, I>( Nfts::::item_metadata(collection, item).map(|metadata| metadata.into()) } +fn set_collection_metadata, I>( + origin: OriginFor, + collection: CollectionIdOf, + data: BoundedVec, +) -> DispatchResult { + Nfts::::set_collection_metadata(origin, collection, data) +} + +fn clear_collection_metadata, I>( + origin: OriginFor, + collection: CollectionIdOf, +) -> DispatchResult { + Nfts::::clear_collection_metadata(origin, collection) +} + +fn set_accept_ownership, I>( + origin: OriginFor, + collection: Option>, +) -> DispatchResult { + Nfts::::set_accept_ownership(origin, collection) +} + +fn set_collection_max_supply, I>( + origin: OriginFor, + collection: CollectionIdOf, + max_supply: u32, +) -> DispatchResult { + Nfts::::set_collection_max_supply(origin, collection, max_supply) +} + fn next_collection_id, I>() -> Option> { NextCollectionId::::get().or(T::CollectionId::initial_value()) } diff --git a/pallets/api-vnext/src/nonfungibles/precompiles.rs b/pallets/api-vnext/src/nonfungibles/precompiles.rs index cbf5412f4..dea23d0a5 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles.rs @@ -1,17 +1,12 @@ use alloc::string::String; -pub(super) use pallet_revive::precompiles::alloy::{ - primitives::{ - ruint::{UintTryFrom, UintTryTo}, - U256, - }, - sol_types::SolCall, -}; +pub(super) use pallet_revive::precompiles::alloy::primitives::U256; +use pallet_revive::precompiles::RuntimeCosts; // use weights::WeightInfo; use super::*; -/// APIs for fungible tokens conforming to the ERC721 standard. +/// APIs for nonfungible tokens conforming to the ERC721 standard. pub mod erc721; /// The first version of the Nonfungibles API. diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs index fdd6b843a..fed670501 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721.rs @@ -1,4 +1,4 @@ -use super::{SolCall, UintTryFrom, UintTryTo, U256}; +use super::U256; /// The first version of the Erc721 API. pub mod v0; diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs index 320404403..fd8f7e744 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs @@ -1,15 +1,20 @@ +use alloc::{string::String, vec::Vec}; + use frame_support::sp_runtime::traits::AtLeast32Bit; use pallet_nfts::Item; -use pallet_revive::precompiles::alloy::{ - primitives::{Address, FixedBytes}, - sol_types::{Revert, SolCall}, +use pallet_revive::{ + precompiles::alloy::{ + primitives::{Address, FixedBytes}, + sol_types::{Revert, SolCall}, + }, + AddressMapper as _, }; use AddressMatcher::Prefix; use IERC721::*; -use super::*; +use super::{super::super::*, U256}; -sol!("src/nonfungibles/precompiles/interfaces/IERC721.sol"); +sol!("src/nonfungibles/precompiles/interfaces/v0/IERC721.sol"); /// Precompile providing an interface of the ERC-721 standard as defined in the ERC. pub struct Erc721(PhantomData<(T, I)>); @@ -40,20 +45,20 @@ impl< let mut transfer_from = |transferFromCall { from, to, tokenId }: transferFromCall| -> Result<(), Error> { let item_id: ItemIdOf = tokenId.saturating_to::().into(); - super::transfer::( + transfer::( to_runtime_origin(env.caller()), collection_id.into(), env.to_account_id(&(*to.0).into()), item_id, )?; - deposit_event::(env, address, Transfer { from, to, tokenId }); + deposit_event::(env, Transfer { from, to, tokenId }); Ok(()) }; let get_attribute = |key: &str, item_id: Option>| -> Result, Error> { let collection_id: CollectionIdOf = collection_id.into(); - let attribute = match super::get_attributes::( + let attribute = match crate::nonfungibles::get_attributes::( collection_id, item_id, AttributeNamespace::CollectionOwner, @@ -74,30 +79,30 @@ impl< // TODO: charge based on benchmarked weight let owner = env.to_account_id(&(*owner.0).into()); let balance = - U256::saturating_from(super::balance_of::(collection_id.into(), owner)); - Ok(balanceOfCall::abi_encode_returns(&(balance,))) + U256::saturating_from(balance_of::(collection_id.into(), owner)); + Ok(balanceOfCall::abi_encode_returns(&balance)) }, ownerOf(ownerOfCall { tokenId }) => { let collection_id: CollectionIdOf = collection_id.into(); let item_id: ItemIdOf = tokenId.saturating_to::().into(); - let owner = super::owner_of::(collection_id, item_id).unwrap(); + let owner = owner_of::(collection_id, item_id).unwrap(); let address: Address = >::to_address(&owner).0.into(); - Ok(ownerOfCall::abi_encode_returns(&(address,))) + Ok(ownerOfCall::abi_encode_returns(&address)) }, // TODO: checkOnERC721Received, reference: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L135C21-L135C42 safeTransferFrom_0(safeTransferFrom_0Call { from, to, tokenId, data: _ }) => { transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; - Ok(safeTransferFrom_0Call::abi_encode_returns(&())) + Ok(safeTransferFrom_0Call::abi_encode_returns(&safeTransferFrom_0Return {})) }, // TODO: checkOnERC721Received, reference: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L135C21-L135C42 safeTransferFrom_1(safeTransferFrom_1Call { from, to, tokenId }) => { transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; - Ok(safeTransferFrom_1Call::abi_encode_returns(&())) + Ok(safeTransferFrom_1Call::abi_encode_returns(&safeTransferFrom_1Return {})) }, transferFrom(transferFromCall { from, to, tokenId }) => { transfer_from(transferFromCall { from: *from, to: *to, tokenId: *tokenId })?; - Ok(transferFromCall::abi_encode_returns(&())) + Ok(transferFromCall::abi_encode_returns(&transferFromReturn {})) }, approve(approveCall { to, tokenId }) => { // TODO: charge based on benchmarked weight @@ -114,7 +119,7 @@ impl< }; if *to == Address(FixedBytes::default()) { - super::clear_all_transfer_approvals::( + clear_all_transfer_approvals::( to_runtime_origin(env.caller()), collection_id, item_id, @@ -127,7 +132,7 @@ impl< reason: "ERC721: Item already approved".to_string(), })); } - super::approve::( + crate::nonfungibles::approve::( to_runtime_origin(env.caller()), collection_id.into(), env.to_account_id(&(*to.0).into()), @@ -137,20 +142,16 @@ impl< ) .map_err(|e| e.error)?; - deposit_event( - env, - address, - Approval { owner, approved: *to, tokenId: *tokenId }, - ); + deposit_event(env, Approval { owner, approved: *to, tokenId: *tokenId }); } - Ok(approveCall::abi_encode_returns(&())) + Ok(approveCall::abi_encode_returns(&approveReturn {})) }, setApprovalForAll(setApprovalForAllCall { operator, approved }) => { // TODO: charge based on benchmarked weight let collection_id: CollectionIdOf = collection_id.into(); let owner = >::to_address(env.caller().account_id()?).0.into(); - super::approve::( + crate::nonfungibles::approve::( to_runtime_origin(env.caller()), collection_id, env.to_account_id(&(*operator.0).into()), @@ -162,10 +163,9 @@ impl< deposit_event( env, - address, ApprovalForAll { owner, operator: *operator, approved: *approved }, ); - Ok(setApprovalForAllCall::abi_encode_returns(&())) + Ok(setApprovalForAllCall::abi_encode_returns(&setApprovalForAllReturn {})) }, getApproved(getApprovedCall { tokenId }) => { // TODO: charge based on benchmarked weight @@ -183,7 +183,7 @@ impl< match accounts { Some((approved, _)) => { let address: Address = >::to_address(&approved).0.into(); - Ok(getApprovedCall::abi_encode_returns(&(address,))) + Ok(getApprovedCall::abi_encode_returns(&address)) }, None => Err(Error::Revert(Revert { reason: "ERC721: Not approved".to_string() })), @@ -191,13 +191,13 @@ impl< }, isApprovedForAll(isApprovedForAllCall { owner, operator }) => { let collection_id: CollectionIdOf = collection_id.into(); - let approved = super::allowance::( + let approved = crate::nonfungibles::allowance::( collection_id, env.to_account_id(&(*owner.0).into()), env.to_account_id(&(*operator.0).into()), None, ); - Ok(isApprovedForAllCall::abi_encode_returns(&(approved,))) + Ok(isApprovedForAllCall::abi_encode_returns(&approved)) }, // IERC721Burnable burn(burnCall { tokenId }) => { @@ -205,28 +205,33 @@ impl< // Clear all transfer approvals before burning a collection item. // Reference: https://github.com/binodnp/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L260 - super::clear_all_transfer_approvals::( + crate::nonfungibles::clear_all_transfer_approvals::( to_runtime_origin(env.caller()), collection_id.into(), item_id, )?; - super::burn::( + crate::nonfungibles::burn::( to_runtime_origin(env.caller()), collection_id.into(), item_id, )?; - Ok(burnCall::abi_encode_returns(&())) + Ok(burnCall::abi_encode_returns(&burnReturn {})) }, // IERC721Metadata // Reference: https://wiki.polkadot.network/learn/learn-nft-pallets/ - name(_) => get_attribute("name", None) - .map(|attr| nameCall::abi_encode_returns(&(String::from_utf8_lossy(&attr),))), - symbol(_) => get_attribute("symbol", None) - .map(|attr| nameCall::abi_encode_returns(&(String::from_utf8_lossy(&attr),))), + name(_) => get_attribute("name", None).map(|attr| { + let result = String::from_utf8_lossy(attr.as_slice()).into(); + nameCall::abi_encode_returns(&result) + }), + symbol(_) => get_attribute("symbol", None).map(|attr| { + let result = String::from_utf8_lossy(attr.as_slice()).into(); + nameCall::abi_encode_returns(&result) + }), tokenURI(tokenURICall { tokenId }) => { let item_id: ItemIdOf = tokenId.saturating_to::().into(); get_attribute("image", Some(item_id)).map(|attr| { - tokenURICall::abi_encode_returns(&(String::from_utf8_lossy(&attr),)) + let result = String::from_utf8_lossy(attr.as_slice()).into(); + tokenURICall::abi_encode_returns(&result) }) }, } @@ -244,36 +249,38 @@ mod tests { use frame_support::assert_ok; use pallet_nfts::{CollectionConfig, CollectionSettings, Instance1, MintSettings}; use pallet_revive::{ - precompiles::{ - alloy::{primitives::Bytes, sol_types::SolType}, - ExtWithInfo, + precompiles::alloy::{ + primitives::Bytes, + sol_types::{SolInterface, SolType, SolValue}, }, test_utils::{ALICE, ALICE_ADDR, BOB, BOB_ADDR}, }; use super::*; - use crate::mock::{ExtBuilder, RuntimeOrigin, Test}; - - const ERC721: u16 = 100; + use crate::{ + mock::{ExtBuilder, RuntimeOrigin, Test, ERC721}, + nonfungibles::balance_of, + }; type Erc721 = super::Erc721; + type AccountId = ::AccountId; #[test] fn balance_of_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::balanceOf(IERC721::balanceOfCall { owner: ALICE_ADDR.0.into() }) ) .unwrap(), U256::from(1) ); - assert_eq!(super::balance_of::(collection_id, ALICE), 1); + assert_eq!(balance_of::(collection_id, ALICE), 1); }); } @@ -281,19 +288,19 @@ mod tests { fn owner_of_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); let address: Address = ALICE_ADDR.0.into(); assert_eq!( call_precompile::
( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::ownerOf(IERC721::ownerOfCall { tokenId: U256::from(item_id) }) ) .unwrap(), address ); - assert_eq!(super::owner_of::(collection_id, item_id), Some(ALICE)); + assert_eq!(owner_of::(collection_id, item_id), Some(ALICE)); }); } @@ -301,9 +308,9 @@ mod tests { fn safe_transfer_from_0_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -311,9 +318,8 @@ mod tests { true, None, )); - call_setup.set_origin(Origin::Signed(BOB)); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &BOB, collection_id, &IERC721Calls::safeTransferFrom_0(IERC721::safeTransferFrom_0Call { from: ALICE_ADDR.0.into(), @@ -322,7 +328,7 @@ mod tests { data: Bytes::default() }) )); - assert_eq!(super::balance_of::(collection_id, BOB), 1); + assert_eq!(balance_of::(collection_id, BOB), 1); }); } @@ -330,9 +336,9 @@ mod tests { fn safe_transfer_from_1_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -340,9 +346,8 @@ mod tests { true, None, )); - call_setup.set_origin(Origin::Signed(BOB)); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &BOB, collection_id, &IERC721Calls::safeTransferFrom_1(IERC721::safeTransferFrom_1Call { from: ALICE_ADDR.0.into(), @@ -350,7 +355,7 @@ mod tests { tokenId: U256::from(item_id), }) )); - assert_eq!(super::balance_of::(collection_id, BOB), 1); + assert_eq!(balance_of::(collection_id, BOB), 1); }); } @@ -358,9 +363,9 @@ mod tests { fn transfer_from_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -368,9 +373,8 @@ mod tests { true, None, )); - call_setup.set_origin(Origin::Signed(BOB)); assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &BOB, collection_id, &IERC721Calls::transferFrom(IERC721::transferFromCall { from: ALICE_ADDR.0.into(), @@ -378,7 +382,7 @@ mod tests { tokenId: U256::from(item_id) }) )); - assert_eq!(super::balance_of::(collection_id, BOB), 1); + assert_eq!(balance_of::(collection_id, BOB), 1); assert_last_event( prefixed_address(ERC721, collection_id), IERC721::Transfer { @@ -394,19 +398,19 @@ mod tests { fn approve_fails_with_unknown_item() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); // No item found. assert!(matches!( call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::approve(IERC721::approveCall { to: BOB_ADDR.0.into(), tokenId: U256::from(1) }) ), - Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Item not found".to_string() } + Err(DispatchError::Other("ERC721: Item already approved")) )); }); } @@ -415,9 +419,9 @@ mod tests { fn approve_fails_with_existing_approval() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -428,14 +432,14 @@ mod tests { // Item already approved. assert!(matches!( call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::approve(IERC721::approveCall { to: BOB_ADDR.0.into(), tokenId: U256::from(item_id) }) ), - Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Item already approved".to_string() } + Err(DispatchError::Other("ERC721: Item already approved")) )); }); } @@ -444,18 +448,18 @@ mod tests { fn approve_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); // Successfully approved. assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::approve(IERC721::approveCall { to: BOB_ADDR.0.into(), tokenId: U256::from(item_id) }) )); - assert!(super::allowance::(collection_id, ALICE, BOB, Some(item_id))); + assert!(allowance::(collection_id, ALICE, BOB, Some(item_id))); assert_last_event( prefixed_address(ERC721, collection_id), IERC721::Approval { @@ -471,9 +475,9 @@ mod tests { fn approve_zero_address_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(crate::nonfungibles::approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -483,32 +487,32 @@ mod tests { )); // Clear all existing approvals if zero address is approved. assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::approve(IERC721::approveCall { to: Address(FixedBytes::default()), tokenId: U256::from(item_id) }) )); - assert!(!super::allowance::(collection_id, ALICE, BOB, Some(item_id))); + assert!(!super::allowance::(collection_id, ALICE, BOB, Some(item_id))); }); } #[test] fn set_approval_for_all_works() { let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, 0); // Successfully approved. assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { operator: BOB_ADDR.0.into(), approved: true }) )); - assert!(super::allowance::(collection_id, ALICE, BOB, None)); + assert!(allowance::(collection_id, ALICE, BOB, None)); assert_last_event( prefixed_address(ERC721, collection_id), IERC721::ApprovalForAll { @@ -523,9 +527,9 @@ mod tests { #[test] fn remove_approval_for_all_works() { let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, 0); - assert_ok!(super::approve::( + assert_ok!(crate::nonfungibles::approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -535,14 +539,14 @@ mod tests { )); // Successfully removes approval. assert_ok!(call_precompile::<()>( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { operator: BOB_ADDR.0.into(), approved: false }) )); - assert!(!super::allowance::(collection_id, ALICE, BOB, None)); + assert!(!allowance::(collection_id, ALICE, BOB, None)); assert_last_event( prefixed_address(ERC721, collection_id), IERC721::ApprovalForAll { @@ -558,9 +562,9 @@ mod tests { fn get_approved_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(crate::nonfungibles::approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -570,10 +574,9 @@ mod tests { )); let address: Address = BOB_ADDR.0.into(); // Approved. - call_setup.set_origin(Origin::Signed(BOB)); assert_eq!( call_precompile::
( - &mut call_setup.ext().0, + &BOB, collection_id, &IERC721Calls::getApproved(IERC721::getApprovedCall { tokenId: U256::saturating_from(item_id) @@ -589,19 +592,18 @@ mod tests { fn get_approved_fails_with_no_approval() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); // Not approved. - call_setup.set_origin(Origin::Signed(BOB)); assert!(matches!( call_precompile::
( - &mut call_setup.ext().0, + &BOB, collection_id, &IERC721Calls::getApproved(IERC721::getApprovedCall { tokenId: U256::saturating_from(item_id) }) ), - Err(Error::Revert(e)) if e == Revert { reason: "ERC721: Not approved".to_string() } + Err(DispatchError::Other("ERC721: Not approved")) )); }); } @@ -610,9 +612,9 @@ mod tests { fn is_approved_for_all_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(super::approve::( + assert_ok!(crate::nonfungibles::approve::( RuntimeOrigin::signed(ALICE), collection_id, BOB, @@ -621,7 +623,7 @@ mod tests { None, )); assert_ok!(call_precompile::( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::isApprovedForAll(IERC721::isApprovedForAllCall { owner: ALICE_ADDR.0.into(), @@ -634,12 +636,12 @@ mod tests { #[test] fn name_works() { let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection(ALICE); set_attribute(collection_id, None, "name", "ERC721 Example Colection"); assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::name(IERC721::nameCall {}) ) @@ -652,12 +654,12 @@ mod tests { #[test] fn symbol_works() { let collection_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection(ALICE); set_attribute(collection_id, None, "symbol", "POP"); assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::symbol(IERC721::symbolCall {}) ) @@ -671,12 +673,12 @@ mod tests { fn image_works() { let collection_id: u32 = 0; let item_id: u32 = 0; - ExtBuilder::new().build_with_env(|mut call_setup| { + ExtBuilder::new().build().execute_with(|| { create_collection_and_mint(ALICE, collection_id, item_id); set_attribute(collection_id, Some(item_id), "image", "https://example.com/image.png"); assert_eq!( call_precompile::( - &mut call_setup.ext().0, + &ALICE, collection_id, &IERC721Calls::tokenURI(IERC721::tokenURICall { tokenId: U256::saturating_from(item_id) @@ -690,7 +692,7 @@ mod tests { fn create_collection_and_mint(owner: AccountIdOf, collection_id: u32, item_id: u32) { create_collection(owner.clone()); - assert_ok!(super::mint::( + assert_ok!(mint::( RuntimeOrigin::signed(owner.clone()), collection_id, owner, @@ -700,14 +702,14 @@ mod tests { } fn create_collection(owner: AccountIdOf) { - assert_ok!(super::create::( + assert_ok!(super::create::( RuntimeOrigin::signed(owner.clone()), owner, default_collection_config(), )); } - fn default_collection_config() -> CollectionConfigFor { + fn default_collection_config() -> CollectionConfigFor { CollectionConfig { settings: CollectionSettings::all_enabled(), max_supply: None, @@ -716,7 +718,7 @@ mod tests { } fn set_attribute(collection_id: u32, item_id: Option, key: &str, value: &str) { - assert_ok!(super::set_attribute::( + assert_ok!(crate::nonfungibles::set_attribute::( RuntimeOrigin::signed(ALICE), collection_id, item_id, @@ -727,10 +729,18 @@ mod tests { } fn call_precompile::RustType>>( - ext: &mut impl ExtWithInfo, - id: u32, + origin: &AccountId, + token: u32, input: &IERC721Calls, - ) -> Result { - super::call_precompile::(ext, &prefixed_address(ERC721, id), input) + ) -> Result { + let address = prefixed_address(ERC721, token); + bare_call::( + RuntimeOrigin::signed(origin.clone()), + address.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + input.abi_encode(), + ) } } diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index 0b5b8055f..a2aee0c1f 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -7,9 +7,7 @@ use INonfungibles::*; use super::*; -mod erc721; - -sol!("src/nonfungibles/precompiles/interfaces/INonfungibles.sol"); +sol!("src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol"); /// The nonfungibles precompile offers a streamlined interface for interacting with nonfungible /// tokens. The goal is to provide a simplified, consistent API that adheres to standards in the @@ -183,44 +181,270 @@ impl< ); Ok(setCollectionAttributeCall::abi_encode_returns(&())) }, - clearAttribute(_) => { - unimplemented!() + clearAttribute(clearAttributeCall { collection, item, namespace, key }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id = + if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + + super::clear_attribute::( + to_runtime_origin(env.caller()), + collection_id, + item_id, + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + )?; + + if let Some(item_value) = item { + deposit_event( + env, + address, + ItemAttributeCleared { key: key.clone(), item: *item_value }, + ); + } else { + deposit_event( + env, + address, + CollectionAttributeCleared { key: key.clone(), collection: *collection }, + ); + } + + Ok(clearAttributeCall::abi_encode_returns(&())) }, - setMetadata(_) => { - unimplemented!() + setMetadata(setMetadataCall { collection, item, data }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id = + if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + + super::set_metadata::( + to_runtime_origin(env.caller()), + collection_id, + item_id, + BoundedVec::truncate_from(data.to_vec()), + )?; + + if let Some(item_value) = item { + deposit_event( + env, + address, + ItemMetadataSet { data: data.clone(), item: *item_value }, + ); + } else { + deposit_event( + env, + address, + CollectionMetadataSet { data: data.clone(), collection: *collection }, + ); + } + + Ok(setMetadataCall::abi_encode_returns(&())) }, - clearMetadata(_) => { - unimplemented!() + clearMetadata(clearMetadataCall { collection, item }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id = + if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + + super::clear_metadata::( + to_runtime_origin(env.caller()), + collection_id, + item_id, + )?; + + if let Some(item_value) = item { + deposit_event(env, address, ItemMetadataCleared { item: *item_value }); + } else { + deposit_event( + env, + address, + CollectionMetadataCleared { collection: *collection }, + ); + } + + Ok(clearMetadataCall::abi_encode_returns(&())) }, - setMaxSupply(_) => { - unimplemented!() + setMaxSupply(setMaxSupplyCall { collection, max_supply }) => { + let collection_id: CollectionIdOf = (*collection).into(); + + super::set_collection_max_supply::( + to_runtime_origin(env.caller()), + collection_id, + (*max_supply).into(), + )?; + + deposit_event( + env, + address, + CollectionMaxSupplySet { max_supply: *max_supply, collection: *collection }, + ); + + Ok(setMaxSupplyCall::abi_encode_returns(&())) }, - approveItemAttributes(_) => { - unimplemented!() + approveItemAttributes(approveItemAttributesCall { collection, operator }) => { + let collection_id: CollectionIdOf = (*collection).into(); + + super::set_accept_ownership::( + to_runtime_origin(env.to_account_id(&(*operator.0).into())), + collection_id, + )?; + + deposit_event( + env, + address, + ItemAttributesApprovalSet { operator: *operator, collection: *collection }, + ); + + Ok(approveItemAttributesCall::abi_encode_returns(&())) }, - cancelItemAttributesApproval(_) => { - unimplemented!() + cancelItemAttributesApproval(cancelItemAttributesApprovalCall { + collection, + witness, + }) => { + let collection_id: CollectionIdOf = (*collection).into(); + + super::cancel_approval::( + to_runtime_origin(env.caller()), + collection_id, + decode_bytes(witness)?, + )?; + + deposit_event( + env, + address, + ItemAttributesApprovalCancelled { collection: *collection }, + ); + + Ok(cancelItemAttributesApprovalCall::abi_encode_returns(&())) }, - clearCollectionApprovals(_) => { - unimplemented!() + clearCollectionApprovals(clearCollectionApprovalsCall { collection }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let owner = >::to_address(env.caller().account_id()?).0.into(); + + super::clear_all_transfer_approvals::( + to_runtime_origin(env.caller()), + collection_id, + )?; + + deposit_event( + env, + address, + CollectionApprovalsCleared { collection: *collection, owner }, + ); + + Ok(clearCollectionApprovalsCall::abi_encode_returns(&())) }, - mint(_) => { - unimplemented!() + mint(mintCall { collection, item, owner }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + + super::mint::( + to_runtime_origin(env.caller()), + collection_id, + item_id, + env.to_account_id(&(*owner.0).into()), + None, + )?; + + deposit_event(env, address, Mint { to: *owner, item: *item }); + + Ok(mintCall::abi_encode_returns(&())) }, - burn(_) => { - unimplemented!() + burn(burnCall { collection, item }) => { + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + let owner = >::to_address(env.caller().account_id()?).0.into(); + + super::burn::(to_runtime_origin(env.caller()), collection_id, item_id)?; + + deposit_event(env, address, Burn { from: owner, item: *item }); + + Ok(burnCall::abi_encode_returns(&())) }, - balanceOf(_) => { - unimplemented!() + balanceOf(balanceOfCall { owner }) => { + // Charge the weight for this call. + T::ReviveCallRuntimeCost::charge_weight( + RuntimeCosts::BalanceOf, + env.remaining_gas()?, + )?; + + let account_id = env.to_account_id(&(*owner.0).into()); + let balance = super::balance_of::(account_id); + + Ok(balanceOfCall::abi_encode_returns(&(balance.into(),))) }, - ownerOf(_) => { - unimplemented!() + ownerOf(ownerOfCall { collection, item }) => { + // Charge the weight for this call. + T::ReviveCallRuntimeCost::charge_weight( + RuntimeCosts::OwnerOf, + env.remaining_gas()?, + )?; + + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + + let owner = match super::owner_of::(collection_id, item_id) { + Some(owner) => owner, + None => + return Err(Error::Revert(Revert { + reason: "Nonfungibles: No owner found for item".to_string(), + })), + }; + + let address = >::from_address(owner); + + Ok(ownerOfCall::abi_encode_returns(&(address,))) }, - allowance(_) => { - unimplemented!() + allowance(allowanceCall { owner, operator, item }) => { + // Charge the weight for this call. + T::ReviveCallRuntimeCost::charge_weight( + RuntimeCosts::Allowance, + env.remaining_gas()?, + )?; + + let collection_id: CollectionIdOf = (*item >> 128).into(); + let item_id: ItemIdOf = (*item & 0xFFFFFFFF).into(); + + let owner_account_id = env.to_account_id(&(*owner.0).into()); + let operator_account_id = env.to_account_id(&(*operator.0).into()); + + let is_approved = super::allowance::( + collection_id, + item_id, + owner_account_id, + operator_account_id, + ); + + Ok(allowanceCall::abi_encode_returns(&(is_approved,))) }, - totalSupply(_) => { - unimplemented!() + totalSupply(totalSupplyCall { collection }) => { + // Charge the weight for this call. + T::ReviveCallRuntimeCost::charge_weight( + RuntimeCosts::TotalSupply, + env.remaining_gas()?, + )?; + + let collection_id: CollectionIdOf = (*collection).into(); + let total = super::total_supply::(collection_id); + + Ok(totalSupplyCall::abi_encode_returns(&(total.into(),))) + }, + itemMetadata(itemMetadataCall { collection, item }) => { + // Charge the weight for this call. + T::ReviveCallRuntimeCost::charge_weight( + RuntimeCosts::ItemMetadata, + env.remaining_gas()?, + )?; + + let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); + + let metadata = match super::item_metadata::(collection_id, item_id) { + Some(metadata) => metadata, + None => + return Err(Error::Revert(Revert { + reason: "Nonfungibles: No metadata found for item".to_string(), + })), + }; + + Ok(itemMetadataCall::abi_encode_returns(&(String::from_utf8_lossy(&metadata),))) }, getItemAttributes(getItemAttributesCall { collection, item, namespace, key }) => { let collection_id: CollectionIdOf = (*collection).into(); @@ -272,3 +496,259 @@ impl, I: 'static> Nonfungibles { fixed_address(FIXED) } } + +#[cfg(test)] +mod tests { + use frame_support::{assert_ok, traits::ConstU32}; + use mock::{ExtBuilder, RuntimeEvent as Event, Test, TestCall}; + use pallet_nfts::{Instance1, Pallet as Nfts}; + use pallet_revive::precompiles::{ExtWithInfo, ExtWithInfoExt, Output}; + + use super::*; + use crate::tests::{accounts, mock}; + type TheFungibles = Nonfungibles<1, Test, Instance1>; + + #[test] + fn approve_transfer_works() { + ExtBuilder::default().build().execute_with(|| { + let collection = create_collection(accounts::alice()); + let item_id = 0u32; + + // Mint an NFT to Alice + assert_ok!(mint_nft(collection, item_id, accounts::alice())); + + // Approve Bob to transfer Alice's NFT + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let call = INonfungiblesCalls::approveTransfer(approveTransferCall { + collection, + operator: Address::from(accounts::bob()), + item: item_id, + approved: true, + deadline: 0, + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Verify Bob is approved to transfer Alice's NFT + let approved = super::allowance::( + collection, + accounts::alice(), + accounts::bob(), + Some(item_id), + ); + assert!(approved); + }); + } + + #[test] + fn transfer_works() { + ExtBuilder::default().build().execute_with(|| { + let collection = create_collection(accounts::alice()); + let item_id = 0u32; + + // Mint an NFT to Alice + assert_ok!(mint_nft(collection, item_id, accounts::alice())); + + // Transfer from Alice to Bob + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let call = INonfungiblesCalls::transfer(transferCall { + collection, + to: Address::from(accounts::bob()), + item: item_id, + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Verify Bob is now the owner + let owner = super::owner_of::(collection, item_id); + assert_eq!(owner, Some(accounts::bob())); + }); + } + + #[test] + fn create_and_mint_works() { + ExtBuilder::default().build().execute_with(|| { + // Create a collection + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let config = + super::decode_bytes::>(&abi::encode(&[ + alloy::sol_types::SolValue::Bytes(Vec::new()), + ])) + .unwrap(); + + let call = INonfungiblesCalls::create(createCall { + admin: Address::from(accounts::alice()), + config: abi::encode(&[alloy::sol_types::SolValue::Bytes(Vec::new())]), + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Extract collection ID from the result + let collection_id = 0u32; // First collection created + + // Mint an NFT + let item_id = 0u32; + let call = INonfungiblesCalls::mint(mintCall { + collection: collection_id, + item: item_id, + owner: Address::from(accounts::bob()), + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Verify Bob is now the owner + let owner = super::owner_of::(collection_id, item_id); + assert_eq!(owner, Some(accounts::bob())); + }); + } + + #[test] + fn set_and_get_attributes_works() { + ExtBuilder::default().build().execute_with(|| { + let collection = create_collection(accounts::alice()); + let item_id = 0u32; + + // Mint an NFT to Alice + assert_ok!(mint_nft(collection, item_id, accounts::alice())); + + // Set item attribute + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let key = "key".as_bytes().to_vec(); + let value = "value".as_bytes().to_vec(); + + let namespace = AttributeNamespace::Pallet; + let encoded_namespace = abi::encode(&[alloy::sol_types::SolValue::Uint(0u32.into())]); + + let call = INonfungiblesCalls::setItemAttribute(setItemAttributeCall { + collection, + item: item_id, + namespace: encoded_namespace.clone(), + key: key.clone(), + value: value.clone(), + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Get item attribute + let call = INonfungiblesCalls::getItemAttributes(getItemAttributesCall { + collection, + item: item_id, + namespace: encoded_namespace, + key, + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); + + // Verify attribute value + let decoded = getItemAttributesCall::abi_decode_returns(&result).unwrap(); + assert_eq!(decoded.0, "value"); + }); + } + + #[test] + fn burn_works() { + ExtBuilder::default().build().execute_with(|| { + let collection = create_collection(accounts::alice()); + let item_id = 0u32; + + // Mint an NFT to Alice + assert_ok!(mint_nft(collection, item_id, accounts::alice())); + + // Burn the NFT + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let call = INonfungiblesCalls::burn(burnCall { collection, item: item_id }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Verify NFT no longer exists + let owner = super::owner_of::(collection, item_id); + assert_eq!(owner, None); + }); + } + + #[test] + fn metadata_works() { + ExtBuilder::default().build().execute_with(|| { + let collection = create_collection(accounts::alice()); + let item_id = 0u32; + + // Mint an NFT to Alice + assert_ok!(mint_nft(collection, item_id, accounts::alice())); + + // Set metadata + let mut ext = ExtBuilder::build_ext(); + ext.setup(|_| {}); + ext.set_caller(accounts::alice()); + + let metadata = "metadata".as_bytes().to_vec(); + + let call = INonfungiblesCalls::setMetadata(setMetadataCall { + collection, + item: Some(item_id), + data: metadata.clone(), + }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call); + assert_ok!(result); + + // Get metadata + let call = + INonfungiblesCalls::itemMetadata(itemMetadataCall { collection, item: item_id }); + + let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); + + // Verify metadata + let decoded = itemMetadataCall::abi_decode_returns(&result).unwrap(); + assert_eq!(decoded.0, "metadata"); + }); + } + + // Helper functions + fn create_collection(owner: AccountIdOf) -> u32 { + let collection_id = super::next_collection_id::().unwrap_or_default(); + let config = default_collection_config(); + assert_ok!(Nfts::::create(Origin::signed(owner), owner, config,)); + collection_id + } + + fn mint_nft(collection_id: u32, item_id: u32, owner: AccountIdOf) -> DispatchResult { + Nfts::::mint(Origin::signed(owner), collection_id, item_id, owner, None) + } + + fn default_collection_config() -> CollectionConfigFor { + CollectionConfigFor:: { + settings: Default::default(), + max_supply: None, + mint_settings: Default::default(), + } + } + + fn call_precompile( + ext: &mut impl ExtWithInfo, + address: [u8; 20], + input: &INonfungiblesCalls, + ) -> Result { + ext.call_precompile(address, 0.into(), input, false) + } +} From 79c49b12bb269fa1326c4b9a6711d689beaddf72 Mon Sep 17 00:00:00 2001 From: chungquantin Date: Thu, 10 Jul 2025 18:31:44 +0700 Subject: [PATCH 156/162] feat: implement v0 --- pallets/api-vnext/src/lib.rs | 15 +- pallets/api-vnext/src/nonfungibles.rs | 7 - .../api-vnext/src/nonfungibles/precompiles.rs | 6 +- .../interfaces/v0/INonfungibles.sol | 72 +- .../src/nonfungibles/precompiles/v0.rs | 1100 ++++++++--------- 5 files changed, 612 insertions(+), 588 deletions(-) diff --git a/pallets/api-vnext/src/lib.rs b/pallets/api-vnext/src/lib.rs index 40c593d3c..c857ecb1b 100644 --- a/pallets/api-vnext/src/lib.rs +++ b/pallets/api-vnext/src/lib.rs @@ -5,6 +5,7 @@ extern crate alloc; use alloc::vec::Vec; use core::{convert::Into, marker::PhantomData, num::NonZero}; +use codec::Decode; use frame_support::{dispatch::RawOrigin, sp_runtime::traits::StaticLookup}; #[cfg(any(test, feature = "runtime-benchmarks"))] use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; @@ -12,7 +13,11 @@ use pallet_revive::precompiles::alloy::sol_types::{SolType, SolValue}; use pallet_revive::H160; use pallet_revive::{ precompiles::{ - alloy::{primitives::IntoLogData, sol, sol_types::SolEvent}, + alloy::{ + primitives::{Bytes, IntoLogData}, + sol, + sol_types::{Revert, SolEvent}, + }, AddressMatcher, Error, Ext, Precompile, }, AddressMapper as _, Origin, H256, U256, @@ -155,3 +160,11 @@ pub fn to_runtime_origin(o: Origin) -> T::RuntimeOr Origin::Signed(account) => RawOrigin::Signed(account).into(), } } + +/// Decodes a `Bytes` into a type that implements `Decode`. +pub fn decode_bytes(b: &Bytes) -> Result { + match P::decode(&mut &b[..]) { + Ok(b) => Ok(b), + Err(_) => return Err(Error::Revert(Revert { reason: "Failed to decode".to_string() })), + } +} diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs index 8f8c514b9..3cef8f9f7 100644 --- a/pallets/api-vnext/src/nonfungibles.rs +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -251,13 +251,6 @@ fn clear_collection_metadata, I>( Nfts::::clear_collection_metadata(origin, collection) } -fn set_accept_ownership, I>( - origin: OriginFor, - collection: Option>, -) -> DispatchResult { - Nfts::::set_accept_ownership(origin, collection) -} - fn set_collection_max_supply, I>( origin: OriginFor, collection: CollectionIdOf, diff --git a/pallets/api-vnext/src/nonfungibles/precompiles.rs b/pallets/api-vnext/src/nonfungibles/precompiles.rs index dea23d0a5..d7a33ad0c 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles.rs @@ -1,7 +1,11 @@ use alloc::string::String; pub(super) use pallet_revive::precompiles::alloy::primitives::U256; -use pallet_revive::precompiles::RuntimeCosts; +use pallet_revive::precompiles::{ + alloy::sol_types::{Revert, SolCall}, + AddressMatcher::Fixed, + RuntimeCosts, +}; // use weights::WeightInfo; use super::*; diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol index 610b4c5bd..cb9cd1fe6 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol +++ b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol @@ -6,22 +6,22 @@ // TODO: consider size of id -> uint256 (word) interface INonfungibles { /** - * @dev Approves `operator` to transfer the given `item` on behalf of the caller until `deadline`. + * @dev Approves `operator` to transfer all items in `collection` on behalf of the caller until `deadline`. */ - function approveTransfer( + function approve( uint32 collection, address operator, - uint32 item, bool approved, uint32 deadline ) external; /** - * @dev Approves `operator` to transfer all items in `collection` on behalf of the caller until `deadline`. + * @dev Approves `operator` to transfer the given `item` on behalf of the caller until `deadline`. */ - function approveCollection( + function approve( uint32 collection, address operator, + uint32 item, bool approved, uint32 deadline ) external; @@ -52,28 +52,37 @@ interface INonfungibles { ) external; /** - * @dev Sets an attribute on `item` or entire `collection` under the given `namespace` and `key`. + * @dev Sets an attribute on entire `collection` under the given `namespace` and `key`. */ - function setItemAttribute( + function setAttribute( uint32 collection, - uint32 item, bytes calldata namespace, bytes calldata key, bytes calldata value ) external; /** - * @dev Sets an attribute on entire `collection` under the given `namespace` and `key`. + * @dev Sets an attribute on `item` in a `collection` under the given `namespace` and `key`. */ - function setCollectionAttribute( + function setAttribute( uint32 collection, + uint32 item, bytes calldata namespace, bytes calldata key, bytes calldata value ) external; /** - * @dev Clears an attribute from `item` or entire `collection` under the given `namespace` and `key`. + * @dev Clears an attribute from an entire `collection` under the given `namespace` and `key`. + */ + function clearAttribute( + uint32 collection, + bytes calldata namespace, + bytes calldata key + ) external; + + /** + * @dev Clears an attribute from `item` in a `collection` under the given `namespace` and `key`. */ function clearAttribute( uint32 collection, @@ -91,6 +100,21 @@ interface INonfungibles { bytes calldata data ) external; + /** + * @dev Sets metadata for the specified `collection`. + */ + function setMetadata( + uint32 collection, + bytes calldata data + ) external; + + /** + * @dev Clears metadata for the specified `collection`. + */ + function clearMetadata( + uint32 collection + ) external; + /** * @dev Clears metadata for the specified `item` in `collection`. */ @@ -129,9 +153,9 @@ interface INonfungibles { /** * @dev Clears all transfer approvals from the specified `item` in `collection`. */ - function clearAllTransferApprovals( + function clearAllApprovals( uint32 collection, - uint32 item + uint32 item ) external; /** @@ -177,22 +201,22 @@ interface INonfungibles { ) external view returns (address); /** - * @dev Returns if `operator` is approved to transfer the `item` on behalf of `owner`. + * @dev Returns whether `operator` is approved to transfer all items on behalf of `owner`. */ function allowance( uint32 collection, address owner, - address operator, - uint32 item + address operator ) external view returns (bool); /** - * @dev Returns whether `operator` is approved to transfer all items on behalf of `owner`. + * @dev Returns if `operator` is approved to transfer the `item` on behalf of `owner`. */ - function collectionAllowance( + function allowance( uint32 collection, address owner, - address operator + address operator, + uint32 item ) external view returns (bool); /** @@ -203,20 +227,20 @@ interface INonfungibles { ) external view returns (uint32); /** - * @dev Returns the attribute value of `key` under `namespace` for given `item` in `collection`. + * @dev Returns the attribute value of `key` under `namespace` for `collection`. */ - function getItemAttributes( + function getAttributes( uint32 collection, - uint32 item, bytes calldata namespace, bytes calldata key ) external view returns (string memory); /** - * @dev Returns the attribute value of `key` under `namespace` for `collection`. + * @dev Returns the attribute value of `key` under `namespace` for given `item` in `collection`. */ - function getCollectionAttributes( + function getAttributes( uint32 collection, + uint32 item, bytes calldata namespace, bytes calldata key ) external view returns (string memory); diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index a2aee0c1f..f604cf530 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -1,9 +1,4 @@ -pub use erc721::{Erc721, IERC721}; -use pallet_revive::precompiles::{ - alloy::sol_types::{Revert, SolCall}, - AddressMatcher::Fixed, -}; -use INonfungibles::*; +pub(crate) use INonfungibles::*; use super::*; @@ -35,407 +30,398 @@ impl< ) -> Result, Error> { use INonfungibles::{INonfungiblesCalls::*, *}; match input { - approveTransfer(approveTransferCall { - collection, - operator, - item, - approved, - deadline, - }) => { + approve_0(approve_0Call { collection, operator, approved, deadline }) => { + // TODO: Implement real weight + let charged = env.charge(Weight::default())?; + let owner = >::to_address(env.caller().account_id()?).0.into(); let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); - - // Successfully approves. + // Successfully approves a collection. let deadline: Option> = if *deadline > 0 { Some((*deadline).into()) } else { None }; - super::approve::( + approve::( to_runtime_origin(env.caller()), collection_id, env.to_account_id(&(*operator.0).into()), - Some(item_id), + None, *approved, deadline, ) - .map_err(|e| e.error)?; - deposit_event( - env, - address, - ItemApproval { operator: *operator, approved: *approved, item: *item, owner }, - ); - Ok(approveTransferCall::abi_encode_returns(&())) + .map_err(|e| { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + e.error + })?; + + let event = CollectionApproval { + operator: *operator, + approved: *approved, + collection: *collection, + owner, + }; + deposit_event(env, event); + + Ok(approve_0Call::abi_encode_returns(&approve_0Return {})) }, - approveCollection(approveCollectionCall { - collection, - operator, - approved, - deadline, - }) => { + approve_1(approve_1Call { collection, item, operator, approved, deadline }) => { + // TODO: Implement real weight + let charged = env.charge(Weight::default())?; + let owner = >::to_address(env.caller().account_id()?).0.into(); - let collection_id: CollectionIdOf = (*collection).into(); + let item_id: ItemIdOf = (*item).into(); - // Successfully approves a collection. + // Successfully approves. let deadline: Option> = if *deadline > 0 { Some((*deadline).into()) } else { None }; super::approve::( to_runtime_origin(env.caller()), - collection_id, + (*collection).into(), env.to_account_id(&(*operator.0).into()), - None, + Some(item_id), *approved, deadline, ) - .map_err(|e| e.error)?; - deposit_event( - env, - address, - CollectionApproval { - operator: *operator, - approved: *approved, - collection: *collection, - owner, - }, - ); - Ok(approveCollectionCall::abi_encode_returns(&())) + .map_err(|e| { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + e.error + })?; + + let event = + ItemApproval { operator: *operator, approved: *approved, item: *item, owner }; + deposit_event(env, event); + Ok(approve_1Call::abi_encode_returns(&approve_1Return {})) }, transfer(transferCall { collection, to, item }) => { - let owner = >::to_address(env.caller().account_id()?).0.into(); - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); + // TODO: Implement real weight + env.charge(Weight::default())?; + let owner = >::to_address(env.caller().account_id()?).0.into(); // Successfully transfers an item. super::transfer::( to_runtime_origin(env.caller()), - collection_id, + (*collection).into(), env.to_account_id(&(*to.0).into()), - item_id, + (*item).into(), )?; - deposit_event(env, address, Transfer { from: owner, to: *to, item: *item }); - Ok(transferCall::abi_encode_returns(&())) + + deposit_event(env, Transfer { from: owner, to: *to, item: *item }); + Ok(transferCall::abi_encode_returns(&transferReturn {})) }, create(createCall { admin, config }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; + let collection_id: u32 = super::next_collection_id::().unwrap_or_default().into(); - - // Successfully creates a collection. super::create::( to_runtime_origin(env.caller()), env.to_account_id(&(*admin.0).into()), decode_bytes::>(config)?, )?; - Ok(createCall::abi_encode_returns(&(collection_id,))) + + Ok(createCall::abi_encode_returns(&collection_id)) }, destroy(destroyCall { collection, witness }) => { - let collection_id: CollectionIdOf = (*collection).into(); + // TODO: Implement real weight + let charged = env.charge(Weight::default())?; - // Successfully destroys a collection. super::destroy::( to_runtime_origin(env.caller()), - collection_id, + (*collection).into(), decode_bytes(witness)?, ) - .map_err(|e| e.error)?; - Ok(destroyCall::abi_encode_returns(&())) + .map_err(|e| { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + e.error + })?; + + Ok(destroyCall::abi_encode_returns(&destroyReturn {})) }, - setItemAttribute(setItemAttributeCall { collection, item, namespace, key, value }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); - super::set_attribute::( + setAttribute_0(setAttribute_0Call { collection, namespace, key, value }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; + + set_attribute::( to_runtime_origin(env.caller()), - collection_id, - Some(item_id), + (*collection).into(), + None, decode_bytes::>>(namespace)?, BoundedVec::truncate_from(key.to_vec()), BoundedVec::truncate_from(value.to_vec()), )?; - deposit_event( - env, - address, - ItemAttributeSet { key: key.clone(), data: value.clone(), item: *item }, - ); - Ok(destroyCall::abi_encode_returns(&())) + + let event = CollectionAttributeSet { + key: key.clone(), + data: value.clone(), + collection: *collection, + }; + deposit_event(env, event); + Ok(setAttribute_0Call::abi_encode_returns(&setAttribute_0Return {})) }, - setCollectionAttribute(setCollectionAttributeCall { - collection, - namespace, - key, - value, - }) => { - let collection_id: CollectionIdOf = (*collection).into(); - super::set_attribute::( + setAttribute_1(setAttribute_1Call { collection, item, namespace, key, value }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; + + set_attribute::( to_runtime_origin(env.caller()), - collection_id, - None, + (*collection).into(), + Some((*item).into()), decode_bytes::>>(namespace)?, BoundedVec::truncate_from(key.to_vec()), BoundedVec::truncate_from(value.to_vec()), )?; - deposit_event( - env, - address, - CollectionAttributeSet { - key: key.clone(), - data: value.clone(), - collection: *collection, - }, - ); - Ok(setCollectionAttributeCall::abi_encode_returns(&())) + + let event = ItemAttributeSet { key: key.clone(), data: value.clone(), item: *item }; + deposit_event(env, event); + Ok(setAttribute_1Call::abi_encode_returns(&setAttribute_1Return {})) }, - clearAttribute(clearAttributeCall { collection, item, namespace, key }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id = - if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + clearAttribute_1(clearAttribute_1Call { collection, item, namespace, key }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - super::clear_attribute::( + clear_attribute::( to_runtime_origin(env.caller()), - collection_id, - item_id, + (*collection).into(), + Some((*item).into()), decode_bytes::>>(namespace)?, BoundedVec::truncate_from(key.to_vec()), )?; - if let Some(item_value) = item { - deposit_event( - env, - address, - ItemAttributeCleared { key: key.clone(), item: *item_value }, - ); - } else { - deposit_event( - env, - address, - CollectionAttributeCleared { key: key.clone(), collection: *collection }, - ); - } - - Ok(clearAttributeCall::abi_encode_returns(&())) + Ok(clearAttribute_1Call::abi_encode_returns(&clearAttribute_1Return {})) }, - setMetadata(setMetadataCall { collection, item, data }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id = - if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + setMetadata_0(setMetadata_0Call { collection, item, data }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - super::set_metadata::( + set_metadata::( to_runtime_origin(env.caller()), - collection_id, - item_id, + (*collection).into(), + (*item).into(), BoundedVec::truncate_from(data.to_vec()), )?; - if let Some(item_value) = item { - deposit_event( - env, - address, - ItemMetadataSet { data: data.clone(), item: *item_value }, - ); - } else { - deposit_event( - env, - address, - CollectionMetadataSet { data: data.clone(), collection: *collection }, - ); - } - - Ok(setMetadataCall::abi_encode_returns(&())) + Ok(setMetadata_0Call::abi_encode_returns(&setMetadata_0Return {})) }, - clearMetadata(clearMetadataCall { collection, item }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id = - if let Some(item_value) = item { Some((*item_value).into()) } else { None }; + setMetadata_1(setMetadata_1Call { collection, data }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - super::clear_metadata::( + set_collection_metadata::( to_runtime_origin(env.caller()), - collection_id, - item_id, + (*collection).into(), + BoundedVec::truncate_from(data.to_vec()), )?; - if let Some(item_value) = item { - deposit_event(env, address, ItemMetadataCleared { item: *item_value }); - } else { - deposit_event( - env, - address, - CollectionMetadataCleared { collection: *collection }, - ); - } - - Ok(clearMetadataCall::abi_encode_returns(&())) + Ok(setMetadata_1Call::abi_encode_returns(&setMetadata_1Return {})) }, - setMaxSupply(setMaxSupplyCall { collection, max_supply }) => { - let collection_id: CollectionIdOf = (*collection).into(); + clearMetadata_0(clearMetadata_0Call { collection }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - super::set_collection_max_supply::( + clear_collection_metadata::( to_runtime_origin(env.caller()), - collection_id, - (*max_supply).into(), + (*collection).into(), )?; - deposit_event( - env, - address, - CollectionMaxSupplySet { max_supply: *max_supply, collection: *collection }, - ); + Ok(clearMetadata_0Call::abi_encode_returns(&clearMetadata_0Return {})) + }, + clearMetadata_1(clearMetadata_1Call { collection, item }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - Ok(setMaxSupplyCall::abi_encode_returns(&())) + clear_metadata::( + to_runtime_origin(env.caller()), + (*collection).into(), + (*item).into(), + )?; + + Ok(clearMetadata_1Call::abi_encode_returns(&clearMetadata_1Return {})) }, - approveItemAttributes(approveItemAttributesCall { collection, operator }) => { - let collection_id: CollectionIdOf = (*collection).into(); + setMaxSupply(setMaxSupplyCall { collection, maxSupply }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - super::set_accept_ownership::( - to_runtime_origin(env.to_account_id(&(*operator.0).into())), - collection_id, + super::set_collection_max_supply::( + to_runtime_origin(env.caller()), + (*collection).into(), + (*maxSupply).into(), )?; - deposit_event( - env, - address, - ItemAttributesApprovalSet { operator: *operator, collection: *collection }, - ); + Ok(setMaxSupplyCall::abi_encode_returns(&setMaxSupplyReturn {})) + }, + approveItemAttributes(approveItemAttributesCall { collection, item, delegate }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; - Ok(approveItemAttributesCall::abi_encode_returns(&())) + super::approve_item_attributes::( + to_runtime_origin(env.caller()), + (*collection).into(), + (*item).into(), + env.to_account_id(&(*delegate.0).into()), + )?; + Ok(approveItemAttributesCall::abi_encode_returns(&approveItemAttributesReturn {})) }, cancelItemAttributesApproval(cancelItemAttributesApprovalCall { collection, + item, + delegate, witness, }) => { - let collection_id: CollectionIdOf = (*collection).into(); + // TODO: Implement real weight + env.charge(Weight::default())?; - super::cancel_approval::( + super::cancel_item_attributes_approval::( to_runtime_origin(env.caller()), - collection_id, + (*collection).into(), + (*item).into(), + env.to_account_id(&(*delegate.0).into()), decode_bytes(witness)?, )?; - - deposit_event( - env, - address, - ItemAttributesApprovalCancelled { collection: *collection }, - ); - - Ok(cancelItemAttributesApprovalCall::abi_encode_returns(&())) + Ok(cancelItemAttributesApprovalCall::abi_encode_returns( + &cancelItemAttributesApprovalReturn {}, + )) }, - clearCollectionApprovals(clearCollectionApprovalsCall { collection }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let owner = >::to_address(env.caller().account_id()?).0.into(); + clearCollectionApprovals(clearCollectionApprovalsCall { collection, limit }) => { + // TODO: Implement real weight + let charged = env.charge(Weight::default())?; - super::clear_all_transfer_approvals::( + match super::clear_collection_approvals::( to_runtime_origin(env.caller()), - collection_id, - )?; - - deposit_event( - env, - address, - CollectionApprovalsCleared { collection: *collection, owner }, - ); - - Ok(clearCollectionApprovalsCall::abi_encode_returns(&())) + (*collection).into(), + *limit, + ) { + Ok(result) => { + // Adjust weight + if let Some(actual_weight) = result.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + }, + Err(e) => { + // Adjust weight + if let Some(actual_weight) = e.post_info.actual_weight { + // TODO: replace with `env.adjust_gas(charged, result.weight);` once + // #8693 lands + env.gas_meter_mut() + .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); + } + return Err(e.error.into()) + }, + }; + Ok(clearCollectionApprovalsCall::abi_encode_returns( + &clearCollectionApprovalsReturn {}, + )) }, - mint(mintCall { collection, item, owner }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); - + mint(mintCall { collection, to, item, witness }) => { super::mint::( to_runtime_origin(env.caller()), - collection_id, - item_id, - env.to_account_id(&(*owner.0).into()), + (*collection).into(), + env.to_account_id(&(*to.0).into()), + (*item).into(), None, )?; - - deposit_event(env, address, Mint { to: *owner, item: *item }); - - Ok(mintCall::abi_encode_returns(&())) + Ok(mintCall::abi_encode_returns(&mintReturn {})) }, burn(burnCall { collection, item }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); - let owner = >::to_address(env.caller().account_id()?).0.into(); - - super::burn::(to_runtime_origin(env.caller()), collection_id, item_id)?; - - deposit_event(env, address, Burn { from: owner, item: *item }); - - Ok(burnCall::abi_encode_returns(&())) - }, - balanceOf(balanceOfCall { owner }) => { - // Charge the weight for this call. - T::ReviveCallRuntimeCost::charge_weight( - RuntimeCosts::BalanceOf, - env.remaining_gas()?, + super::burn::( + to_runtime_origin(env.caller()), + (*collection).into(), + (*item).into(), )?; - - let account_id = env.to_account_id(&(*owner.0).into()); - let balance = super::balance_of::(account_id); - - Ok(balanceOfCall::abi_encode_returns(&(balance.into(),))) + Ok(burnCall::abi_encode_returns(&burnReturn {})) + }, + balanceOf(balanceOfCall { collection, owner }) => { + // // Charge the weight for this call. + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::BalanceOf, + // env.remaining_gas()?, + // )?; + let balance = super::balance_of::( + (*collection).into(), + env.to_account_id(&(*owner.0).into()), + ); + Ok(balanceOfCall::abi_encode_returns(&balance)) }, ownerOf(ownerOfCall { collection, item }) => { // Charge the weight for this call. - T::ReviveCallRuntimeCost::charge_weight( - RuntimeCosts::OwnerOf, - env.remaining_gas()?, - )?; - - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); - - let owner = match super::owner_of::(collection_id, item_id) { + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::OwnerOf, + // env.remaining_gas()?, + // )?; + let owner = match super::owner_of::((*collection).into(), (*item).into()) { Some(owner) => owner, None => return Err(Error::Revert(Revert { reason: "Nonfungibles: No owner found for item".to_string(), })), }; - - let address = >::from_address(owner); - - Ok(ownerOfCall::abi_encode_returns(&(address,))) + let owner = >::to_address(&owner).0.into(); + Ok(ownerOfCall::abi_encode_returns(&owner)) }, - allowance(allowanceCall { owner, operator, item }) => { + allowance_0(allowance_0Call { collection, owner, operator }) => { // Charge the weight for this call. - T::ReviveCallRuntimeCost::charge_weight( - RuntimeCosts::Allowance, - env.remaining_gas()?, - )?; - - let collection_id: CollectionIdOf = (*item >> 128).into(); - let item_id: ItemIdOf = (*item & 0xFFFFFFFF).into(); - - let owner_account_id = env.to_account_id(&(*owner.0).into()); - let operator_account_id = env.to_account_id(&(*operator.0).into()); - - let is_approved = super::allowance::( - collection_id, - item_id, - owner_account_id, - operator_account_id, + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::Allowance, + // env.remaining_gas()?, + // )?; + let is_approved = crate::nonfungibles::allowance::( + (*collection).into(), + env.to_account_id(&(*owner.0).into()), + env.to_account_id(&(*operator.0).into()), + None, ); - - Ok(allowanceCall::abi_encode_returns(&(is_approved,))) + Ok(allowance_0Call::abi_encode_returns(&is_approved)) + }, + allowance_1(allowance_1Call { collection, owner, operator, item }) => { + // Charge the weight for this call. + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::Allowance, + // env.remaining_gas()?, + // )?; + let is_approved = crate::nonfungibles::allowance::( + (*collection).into(), + env.to_account_id(&(*owner.0).into()), + env.to_account_id(&(*operator.0).into()), + Some((*item).into()), + ); + Ok(allowance_1Call::abi_encode_returns(&is_approved)) }, totalSupply(totalSupplyCall { collection }) => { // Charge the weight for this call. - T::ReviveCallRuntimeCost::charge_weight( - RuntimeCosts::TotalSupply, - env.remaining_gas()?, - )?; - - let collection_id: CollectionIdOf = (*collection).into(); - let total = super::total_supply::(collection_id); - - Ok(totalSupplyCall::abi_encode_returns(&(total.into(),))) + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::TotalSupply, + // env.remaining_gas()?, + // )?; + let total = super::total_supply::((*collection).into()); + Ok(totalSupplyCall::abi_encode_returns(&total)) }, itemMetadata(itemMetadataCall { collection, item }) => { // Charge the weight for this call. - T::ReviveCallRuntimeCost::charge_weight( - RuntimeCosts::ItemMetadata, - env.remaining_gas()?, - )?; - + // T::ReviveCallRuntimeCost::charge_weight( + // RuntimeCosts::ItemMetadata, + // env.remaining_gas()?, + // )?; let collection_id: CollectionIdOf = (*collection).into(); let item_id: ItemIdOf = (*item).into(); - let metadata = match super::item_metadata::(collection_id, item_id) { Some(metadata) => metadata, None => @@ -443,15 +429,13 @@ impl< reason: "Nonfungibles: No metadata found for item".to_string(), })), }; - - Ok(itemMetadataCall::abi_encode_returns(&(String::from_utf8_lossy(&metadata),))) + let item_metadata = String::from_utf8_lossy(&metadata).into(); + Ok(itemMetadataCall::abi_encode_returns(&item_metadata)) }, - getItemAttributes(getItemAttributesCall { collection, item, namespace, key }) => { - let collection_id: CollectionIdOf = (*collection).into(); - let item_id: ItemIdOf = (*item).into(); + getAttributes_0(getAttributes_0Call { collection, namespace, key }) => { let attribute = match super::get_attributes::( - collection_id, - Some(item_id), + (*collection).into(), + None, decode_bytes::>>(namespace)?, BoundedVec::truncate_from(key.to_vec()), ) { @@ -461,15 +445,13 @@ impl< reason: "Nonfungibles: No attribute found".to_string(), })), }; - Ok(getItemAttributesCall::abi_encode_returns(&(String::from_utf8_lossy( - &attribute, - ),))) + let result = String::from_utf8_lossy(&attribute).into(); + Ok(getAttributes_0Call::abi_encode_returns(&result)) }, - getCollectionAttributes(getCollectionAttributesCall { collection, namespace, key }) => { - let collection_id: CollectionIdOf = (*collection).into(); + getAttributes_1(getAttributes_1Call { collection, item, namespace, key }) => { let attribute = match super::get_attributes::( - collection_id, - None, + (*collection).into(), + Some((*item).into()), decode_bytes::>>(namespace)?, BoundedVec::truncate_from(key.to_vec()), ) { @@ -479,12 +461,20 @@ impl< reason: "Nonfungibles: No attribute found".to_string(), })), }; - Ok(getItemAttributesCall::abi_encode_returns(&(String::from_utf8_lossy( - &attribute, - ),))) + let result = String::from_utf8_lossy(&attribute).into(); + Ok(getAttributes_1Call::abi_encode_returns(&result)) }, - itemMetadata(_) => { - unimplemented!() + itemMetadata(itemMetadataCall { collection, item }) => { + let metadata = + match super::item_metadata::((*collection).into(), (*item).into()) { + Some(value) => value, + None => + return Err(Error::Revert(Revert { + reason: "Nonfungibles: No metadata found".to_string(), + })), + }; + let result = String::from_utf8_lossy(&metadata).into(); + Ok(getAttributes_1Call::abi_encode_returns(&result)) }, _ => unimplemented!(), } @@ -497,258 +487,258 @@ impl, I: 'static> Nonfungibles { } } -#[cfg(test)] -mod tests { - use frame_support::{assert_ok, traits::ConstU32}; - use mock::{ExtBuilder, RuntimeEvent as Event, Test, TestCall}; - use pallet_nfts::{Instance1, Pallet as Nfts}; - use pallet_revive::precompiles::{ExtWithInfo, ExtWithInfoExt, Output}; - - use super::*; - use crate::tests::{accounts, mock}; - type TheFungibles = Nonfungibles<1, Test, Instance1>; - - #[test] - fn approve_transfer_works() { - ExtBuilder::default().build().execute_with(|| { - let collection = create_collection(accounts::alice()); - let item_id = 0u32; - - // Mint an NFT to Alice - assert_ok!(mint_nft(collection, item_id, accounts::alice())); - - // Approve Bob to transfer Alice's NFT - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let call = INonfungiblesCalls::approveTransfer(approveTransferCall { - collection, - operator: Address::from(accounts::bob()), - item: item_id, - approved: true, - deadline: 0, - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Verify Bob is approved to transfer Alice's NFT - let approved = super::allowance::( - collection, - accounts::alice(), - accounts::bob(), - Some(item_id), - ); - assert!(approved); - }); - } - - #[test] - fn transfer_works() { - ExtBuilder::default().build().execute_with(|| { - let collection = create_collection(accounts::alice()); - let item_id = 0u32; - - // Mint an NFT to Alice - assert_ok!(mint_nft(collection, item_id, accounts::alice())); - - // Transfer from Alice to Bob - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let call = INonfungiblesCalls::transfer(transferCall { - collection, - to: Address::from(accounts::bob()), - item: item_id, - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Verify Bob is now the owner - let owner = super::owner_of::(collection, item_id); - assert_eq!(owner, Some(accounts::bob())); - }); - } - - #[test] - fn create_and_mint_works() { - ExtBuilder::default().build().execute_with(|| { - // Create a collection - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let config = - super::decode_bytes::>(&abi::encode(&[ - alloy::sol_types::SolValue::Bytes(Vec::new()), - ])) - .unwrap(); - - let call = INonfungiblesCalls::create(createCall { - admin: Address::from(accounts::alice()), - config: abi::encode(&[alloy::sol_types::SolValue::Bytes(Vec::new())]), - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Extract collection ID from the result - let collection_id = 0u32; // First collection created - - // Mint an NFT - let item_id = 0u32; - let call = INonfungiblesCalls::mint(mintCall { - collection: collection_id, - item: item_id, - owner: Address::from(accounts::bob()), - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Verify Bob is now the owner - let owner = super::owner_of::(collection_id, item_id); - assert_eq!(owner, Some(accounts::bob())); - }); - } - - #[test] - fn set_and_get_attributes_works() { - ExtBuilder::default().build().execute_with(|| { - let collection = create_collection(accounts::alice()); - let item_id = 0u32; - - // Mint an NFT to Alice - assert_ok!(mint_nft(collection, item_id, accounts::alice())); - - // Set item attribute - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let key = "key".as_bytes().to_vec(); - let value = "value".as_bytes().to_vec(); - - let namespace = AttributeNamespace::Pallet; - let encoded_namespace = abi::encode(&[alloy::sol_types::SolValue::Uint(0u32.into())]); - - let call = INonfungiblesCalls::setItemAttribute(setItemAttributeCall { - collection, - item: item_id, - namespace: encoded_namespace.clone(), - key: key.clone(), - value: value.clone(), - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Get item attribute - let call = INonfungiblesCalls::getItemAttributes(getItemAttributesCall { - collection, - item: item_id, - namespace: encoded_namespace, - key, - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); - - // Verify attribute value - let decoded = getItemAttributesCall::abi_decode_returns(&result).unwrap(); - assert_eq!(decoded.0, "value"); - }); - } - - #[test] - fn burn_works() { - ExtBuilder::default().build().execute_with(|| { - let collection = create_collection(accounts::alice()); - let item_id = 0u32; - - // Mint an NFT to Alice - assert_ok!(mint_nft(collection, item_id, accounts::alice())); - - // Burn the NFT - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let call = INonfungiblesCalls::burn(burnCall { collection, item: item_id }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Verify NFT no longer exists - let owner = super::owner_of::(collection, item_id); - assert_eq!(owner, None); - }); - } - - #[test] - fn metadata_works() { - ExtBuilder::default().build().execute_with(|| { - let collection = create_collection(accounts::alice()); - let item_id = 0u32; - - // Mint an NFT to Alice - assert_ok!(mint_nft(collection, item_id, accounts::alice())); - - // Set metadata - let mut ext = ExtBuilder::build_ext(); - ext.setup(|_| {}); - ext.set_caller(accounts::alice()); - - let metadata = "metadata".as_bytes().to_vec(); - - let call = INonfungiblesCalls::setMetadata(setMetadataCall { - collection, - item: Some(item_id), - data: metadata.clone(), - }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call); - assert_ok!(result); - - // Get metadata - let call = - INonfungiblesCalls::itemMetadata(itemMetadataCall { collection, item: item_id }); - - let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); - - // Verify metadata - let decoded = itemMetadataCall::abi_decode_returns(&result).unwrap(); - assert_eq!(decoded.0, "metadata"); - }); - } - - // Helper functions - fn create_collection(owner: AccountIdOf) -> u32 { - let collection_id = super::next_collection_id::().unwrap_or_default(); - let config = default_collection_config(); - assert_ok!(Nfts::::create(Origin::signed(owner), owner, config,)); - collection_id - } - - fn mint_nft(collection_id: u32, item_id: u32, owner: AccountIdOf) -> DispatchResult { - Nfts::::mint(Origin::signed(owner), collection_id, item_id, owner, None) - } - - fn default_collection_config() -> CollectionConfigFor { - CollectionConfigFor:: { - settings: Default::default(), - max_supply: None, - mint_settings: Default::default(), - } - } - - fn call_precompile( - ext: &mut impl ExtWithInfo, - address: [u8; 20], - input: &INonfungiblesCalls, - ) -> Result { - ext.call_precompile(address, 0.into(), input, false) - } -} +// #[cfg(test)] +// mod tests { +// use frame_support::{assert_ok, traits::ConstU32}; +// use mock::{ExtBuilder, RuntimeEvent as Event, Test, TestCall}; +// use pallet_nfts::{Instance1, Pallet as Nfts}; +// use pallet_revive::precompiles::{ExtWithInfo, ExtWithInfoExt, Output}; + +// use super::*; +// use crate::tests::{accounts, mock}; +// type TheFungibles = Nonfungibles<1, Test, Instance1>; + +// #[test] +// fn approve_transfer_works() { +// ExtBuilder::default().build().execute_with(|| { +// let collection = create_collection(accounts::alice()); +// let item_id = 0u32; + +// // Mint an NFT to Alice +// assert_ok!(mint_nft(collection, item_id, accounts::alice())); + +// // Approve Bob to transfer Alice's NFT +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let call = INonfungiblesCalls::approveTransfer(approveTransferCall { +// collection, +// operator: Address::from(accounts::bob()), +// item: item_id, +// approved: true, +// deadline: 0, +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Verify Bob is approved to transfer Alice's NFT +// let approved = super::allowance::( +// collection, +// accounts::alice(), +// accounts::bob(), +// Some(item_id), +// ); +// assert!(approved); +// }); +// } + +// #[test] +// fn transfer_works() { +// ExtBuilder::default().build().execute_with(|| { +// let collection = create_collection(accounts::alice()); +// let item_id = 0u32; + +// // Mint an NFT to Alice +// assert_ok!(mint_nft(collection, item_id, accounts::alice())); + +// // Transfer from Alice to Bob +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let call = INonfungiblesCalls::transfer(transferCall { +// collection, +// to: Address::from(accounts::bob()), +// item: item_id, +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Verify Bob is now the owner +// let owner = super::owner_of::(collection, item_id); +// assert_eq!(owner, Some(accounts::bob())); +// }); +// } + +// #[test] +// fn create_and_mint_works() { +// ExtBuilder::default().build().execute_with(|| { +// // Create a collection +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let config = +// super::decode_bytes::>(&abi::encode(&[ +// alloy::sol_types::SolValue::Bytes(Vec::new()), +// ])) +// .unwrap(); + +// let call = INonfungiblesCalls::create(createCall { +// admin: Address::from(accounts::alice()), +// config: abi::encode(&[alloy::sol_types::SolValue::Bytes(Vec::new())]), +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Extract collection ID from the result +// let collection_id = 0u32; // First collection created + +// // Mint an NFT +// let item_id = 0u32; +// let call = INonfungiblesCalls::mint(mintCall { +// collection: collection_id, +// item: item_id, +// owner: Address::from(accounts::bob()), +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Verify Bob is now the owner +// let owner = super::owner_of::(collection_id, item_id); +// assert_eq!(owner, Some(accounts::bob())); +// }); +// } + +// #[test] +// fn set_and_get_attributes_works() { +// ExtBuilder::default().build().execute_with(|| { +// let collection = create_collection(accounts::alice()); +// let item_id = 0u32; + +// // Mint an NFT to Alice +// assert_ok!(mint_nft(collection, item_id, accounts::alice())); + +// // Set item attribute +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let key = "key".as_bytes().to_vec(); +// let value = "value".as_bytes().to_vec(); + +// let namespace = AttributeNamespace::Pallet; +// let encoded_namespace = abi::encode(&[alloy::sol_types::SolValue::Uint(0u32.into())]); + +// let call = INonfungiblesCalls::setItemAttribute(setItemAttributeCall { +// collection, +// item: item_id, +// namespace: encoded_namespace.clone(), +// key: key.clone(), +// value: value.clone(), +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Get item attribute +// let call = INonfungiblesCalls::getItemAttributes(getItemAttributesCall { +// collection, +// item: item_id, +// namespace: encoded_namespace, +// key, +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); + +// // Verify attribute value +// let decoded = getItemAttributesCall::abi_decode_returns(&result).unwrap(); +// assert_eq!(decoded.0, "value"); +// }); +// } + +// #[test] +// fn burn_works() { +// ExtBuilder::default().build().execute_with(|| { +// let collection = create_collection(accounts::alice()); +// let item_id = 0u32; + +// // Mint an NFT to Alice +// assert_ok!(mint_nft(collection, item_id, accounts::alice())); + +// // Burn the NFT +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let call = INonfungiblesCalls::burn(burnCall { collection, item: item_id }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Verify NFT no longer exists +// let owner = super::owner_of::(collection, item_id); +// assert_eq!(owner, None); +// }); +// } + +// #[test] +// fn metadata_works() { +// ExtBuilder::default().build().execute_with(|| { +// let collection = create_collection(accounts::alice()); +// let item_id = 0u32; + +// // Mint an NFT to Alice +// assert_ok!(mint_nft(collection, item_id, accounts::alice())); + +// // Set metadata +// let mut ext = ExtBuilder::build_ext(); +// ext.setup(|_| {}); +// ext.set_caller(accounts::alice()); + +// let metadata = "metadata".as_bytes().to_vec(); + +// let call = INonfungiblesCalls::setMetadata(setMetadataCall { +// collection, +// item: Some(item_id), +// data: metadata.clone(), +// }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call); +// assert_ok!(result); + +// // Get metadata +// let call = +// INonfungiblesCalls::itemMetadata(itemMetadataCall { collection, item: item_id }); + +// let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); + +// // Verify metadata +// let decoded = itemMetadataCall::abi_decode_returns(&result).unwrap(); +// assert_eq!(decoded.0, "metadata"); +// }); +// } + +// // Helper functions +// fn create_collection(owner: AccountIdOf) -> u32 { +// let collection_id = super::next_collection_id::().unwrap_or_default(); +// let config = default_collection_config(); +// assert_ok!(Nfts::::create(Origin::signed(owner), owner, config,)); +// collection_id +// } + +// fn mint_nft(collection_id: u32, item_id: u32, owner: AccountIdOf) -> DispatchResult { +// Nfts::::mint(Origin::signed(owner), collection_id, item_id, owner, None) +// } + +// fn default_collection_config() -> CollectionConfigFor { +// CollectionConfigFor:: { +// settings: Default::default(), +// max_supply: None, +// mint_settings: Default::default(), +// } +// } + +// fn call_precompile( +// ext: &mut impl ExtWithInfo, +// address: [u8; 20], +// input: &INonfungiblesCalls, +// ) -> Result { +// ext.call_precompile(address, 0.into(), input, false) +// } +// } From 322373b36df2c94fd0fb480776a9d30727a23ff6 Mon Sep 17 00:00:00 2001 From: chungquantin Date: Fri, 11 Jul 2025 00:30:47 +0700 Subject: [PATCH 157/162] chore: add tests for shared methods --- pallets/api-vnext/src/mock.rs | 4 + pallets/api-vnext/src/nonfungibles.rs | 10 +- .../src/nonfungibles/precompiles/erc721/v0.rs | 720 ++++++++++-------- .../src/nonfungibles/precompiles/v0.rs | 262 ++++--- pallets/api-vnext/src/nonfungibles/tests.rs | 139 ++++ 5 files changed, 698 insertions(+), 437 deletions(-) create mode 100644 pallets/api-vnext/src/nonfungibles/tests.rs diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 3819e876b..115a84bda 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -14,6 +14,7 @@ pub(crate) use pallet_revive::test_utils::{ALICE, BOB, CHARLIE}; use scale_info::TypeInfo; use super::fungibles; +use crate::nonfungibles; pub(crate) type AccountId = AccountId32; pub(crate) type Balance = u128; @@ -24,6 +25,7 @@ pub(crate) type TokenId = u32; pub(crate) const ERC20: u16 = 2; pub(crate) const FUNGIBLES: u16 = 1; +pub(crate) const NONFUNGIBLES: u16 = 4; pub(crate) const ERC721: u16 = 3; pub(crate) const UNIT: Balance = 10_000_000_000; @@ -140,6 +142,8 @@ impl pallet_revive::Config for Test { type Precompiles = ( fungibles::precompiles::v0::Fungibles, fungibles::precompiles::erc20::v0::Erc20, + nonfungibles::precompiles::v0::Nonfungibles, + nonfungibles::precompiles::erc721::v0::Erc721, ); type Time = Timestamp; type UploadOrigin = EnsureSigned; diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs index 3cef8f9f7..673643228 100644 --- a/pallets/api-vnext/src/nonfungibles.rs +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -13,6 +13,8 @@ use pallet_nfts::{ use super::*; pub mod precompiles; +#[cfg(test)] +mod tests; type BlockNumberFor = pallet_nfts::BlockNumberFor; type CollectionIdOf = @@ -127,14 +129,6 @@ fn clear_metadata, I>( Nfts::::clear_metadata(origin, collection, item) } -fn set_max_supply, I>( - origin: OriginFor, - collection: CollectionIdOf, - max_supply: u32, -) -> DispatchResult { - Nfts::::set_collection_max_supply(origin, collection, max_supply) -} - fn approve_item_attributes, I>( origin: OriginFor, collection: CollectionIdOf, diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs index fd8f7e744..184abfe13 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs @@ -17,7 +17,7 @@ use super::{super::super::*, U256}; sol!("src/nonfungibles/precompiles/interfaces/v0/IERC721.sol"); /// Precompile providing an interface of the ERC-721 standard as defined in the ERC. -pub struct Erc721(PhantomData<(T, I)>); +pub struct Erc721(PhantomData<(T, I)>); impl< const PREFIX: u16, T: frame_system::Config @@ -51,7 +51,8 @@ impl< env.to_account_id(&(*to.0).into()), item_id, )?; - deposit_event::(env, Transfer { from, to, tokenId }); + + deposit_event::(env, Transfer { from, to, tokenId })?; Ok(()) }; @@ -142,7 +143,7 @@ impl< ) .map_err(|e| e.error)?; - deposit_event(env, Approval { owner, approved: *to, tokenId: *tokenId }); + deposit_event(env, Approval { owner, approved: *to, tokenId: *tokenId })?; } Ok(approveCall::abi_encode_returns(&approveReturn {})) }, @@ -164,7 +165,7 @@ impl< deposit_event( env, ApprovalForAll { owner, operator: *operator, approved: *approved }, - ); + )?; Ok(setApprovalForAllCall::abi_encode_returns(&setApprovalForAllReturn {})) }, getApproved(getApprovedCall { tokenId }) => { @@ -247,7 +248,7 @@ impl, I: 'static> Erc721 { #[cfg(test)] mod tests { use frame_support::assert_ok; - use pallet_nfts::{CollectionConfig, CollectionSettings, Instance1, MintSettings}; + use pallet_nfts::{CollectionConfig, CollectionSettings, MintSettings}; use pallet_revive::{ precompiles::alloy::{ primitives::Bytes, @@ -262,432 +263,491 @@ mod tests { nonfungibles::balance_of, }; - type Erc721 = super::Erc721; type AccountId = ::AccountId; #[test] fn balance_of_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_eq!( - call_precompile::( - &ALICE, - collection_id, - &IERC721Calls::balanceOf(IERC721::balanceOfCall { owner: ALICE_ADDR.0.into() }) - ) - .unwrap(), - U256::from(1) - ); - assert_eq!(balance_of::(collection_id, ALICE), 1); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_eq!( + call_precompile::( + &ALICE, + collection_id, + &IERC721Calls::balanceOf(IERC721::balanceOfCall { + owner: ALICE_ADDR.0.into() + }) + ) + .unwrap(), + U256::from(1) + ); + assert_eq!(balance_of::(collection_id, ALICE), 1); + }); } #[test] fn owner_of_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - let address: Address = ALICE_ADDR.0.into(); - assert_eq!( - call_precompile::
( - &ALICE, - collection_id, - &IERC721Calls::ownerOf(IERC721::ownerOfCall { tokenId: U256::from(item_id) }) - ) - .unwrap(), - address - ); - assert_eq!(owner_of::(collection_id, item_id), Some(ALICE)); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + let address: Address = ALICE_ADDR.0.into(); + assert_eq!( + call_precompile::
( + &ALICE, + collection_id, + &IERC721Calls::ownerOf(IERC721::ownerOfCall { + tokenId: U256::from(item_id) + }) + ) + .unwrap(), + address + ); + assert_eq!(owner_of::(collection_id, item_id), Some(ALICE)); + }); } #[test] fn safe_transfer_from_0_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - assert_ok!(call_precompile::<()>( - &BOB, - collection_id, - &IERC721Calls::safeTransferFrom_0(IERC721::safeTransferFrom_0Call { - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id), - data: Bytes::default() - }) - )); - assert_eq!(balance_of::(collection_id, BOB), 1); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + assert_ok!(call_precompile::<()>( + &BOB, + collection_id, + &IERC721Calls::safeTransferFrom_0(IERC721::safeTransferFrom_0Call { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id), + data: Bytes::default() + }) + )); + assert_eq!(balance_of::(collection_id, BOB), 1); + }); } #[test] fn safe_transfer_from_1_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - assert_ok!(call_precompile::<()>( - &BOB, - collection_id, - &IERC721Calls::safeTransferFrom_1(IERC721::safeTransferFrom_1Call { - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id), - }) - )); - assert_eq!(balance_of::(collection_id, BOB), 1); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + assert_ok!(call_precompile::<()>( + &BOB, + collection_id, + &IERC721Calls::safeTransferFrom_1(IERC721::safeTransferFrom_1Call { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id), + }) + )); + assert_eq!(balance_of::(collection_id, BOB), 1); + }); } #[test] fn transfer_from_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - assert_ok!(call_precompile::<()>( - &BOB, - collection_id, - &IERC721Calls::transferFrom(IERC721::transferFromCall { - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id) - }) - )); - assert_eq!(balance_of::(collection_id, BOB), 1); - assert_last_event( - prefixed_address(ERC721, collection_id), - IERC721::Transfer { - from: ALICE_ADDR.0.into(), - to: BOB_ADDR.0.into(), - tokenId: U256::saturating_from(item_id), - }, - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + assert_ok!(call_precompile::<()>( + &BOB, + collection_id, + &IERC721Calls::transferFrom(IERC721::transferFromCall { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + )); + assert_eq!(balance_of::(collection_id, BOB), 1); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::Transfer { + from: ALICE_ADDR.0.into(), + to: BOB_ADDR.0.into(), + tokenId: U256::saturating_from(item_id), + }, + ); + }); } #[test] fn approve_fails_with_unknown_item() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - // No item found. - assert!(matches!( - call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: BOB_ADDR.0.into(), - tokenId: U256::from(1) - }) - ), - Err(DispatchError::Other("ERC721: Item already approved")) - )); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + // No item found. + assert!(matches!( + call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(1) + }) + ), + Err(DispatchError::Other("ERC721: Item already approved")) + )); + }); } #[test] fn approve_fails_with_existing_approval() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - // Item already approved. - assert!(matches!( - call_precompile::<()>( - &ALICE, + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(approve::( + RuntimeOrigin::signed(ALICE), collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id) - }) - ), - Err(DispatchError::Other("ERC721: Item already approved")) - )); - }); + BOB, + Some(item_id), + true, + None, + )); + // Item already approved. + assert!(matches!( + call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + ), + Err(DispatchError::Other("ERC721: Item already approved")) + )); + }); } #[test] fn approve_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - // Successfully approved. - assert_ok!(call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id) - }) - )); - assert!(allowance::(collection_id, ALICE, BOB, Some(item_id))); - assert_last_event( - prefixed_address(ERC721, collection_id), - IERC721::Approval { - owner: ALICE_ADDR.0.into(), - approved: BOB_ADDR.0.into(), - tokenId: U256::saturating_from(item_id), - }, - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: BOB_ADDR.0.into(), + tokenId: U256::from(item_id) + }) + )); + assert!(allowance::(collection_id, ALICE, BOB, Some(item_id))); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::Approval { + owner: ALICE_ADDR.0.into(), + approved: BOB_ADDR.0.into(), + tokenId: U256::saturating_from(item_id), + }, + ); + }); } #[test] fn approve_zero_address_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(crate::nonfungibles::approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - // Clear all existing approvals if zero address is approved. - assert_ok!(call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: Address(FixedBytes::default()), - tokenId: U256::from(item_id) - }) - )); - assert!(!super::allowance::(collection_id, ALICE, BOB, Some(item_id))); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(crate::nonfungibles::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + Some(item_id), + true, + None, + )); + // Clear all existing approvals if zero address is approved. + assert_ok!(call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::approve(IERC721::approveCall { + to: Address(FixedBytes::default()), + tokenId: U256::from(item_id) + }) + )); + assert!(!super::allowance::(collection_id, ALICE, BOB, Some(item_id))); + }); } #[test] fn set_approval_for_all_works() { let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, 0); - // Successfully approved. - assert_ok!(call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { - operator: BOB_ADDR.0.into(), - approved: true - }) - )); - assert!(allowance::(collection_id, ALICE, BOB, None)); - assert_last_event( - prefixed_address(ERC721, collection_id), - IERC721::ApprovalForAll { - owner: ALICE_ADDR.0.into(), - operator: BOB_ADDR.0.into(), - approved: true, - }, - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, 0); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { + operator: BOB_ADDR.0.into(), + approved: true + }) + )); + assert!(allowance::(collection_id, ALICE, BOB, None)); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::ApprovalForAll { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into(), + approved: true, + }, + ); + }); } #[test] fn remove_approval_for_all_works() { let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, 0); - assert_ok!(crate::nonfungibles::approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - None, - true, - None, - )); - // Successfully removes approval. - assert_ok!(call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { - operator: BOB_ADDR.0.into(), - approved: false - }) - )); - assert!(!allowance::(collection_id, ALICE, BOB, None)); - assert_last_event( - prefixed_address(ERC721, collection_id), - IERC721::ApprovalForAll { - owner: ALICE_ADDR.0.into(), - operator: BOB_ADDR.0.into(), - approved: false, - }, - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, 0); + assert_ok!(crate::nonfungibles::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + None, + true, + None, + )); + // Successfully removes approval. + assert_ok!(call_precompile::<()>( + &ALICE, + collection_id, + &IERC721Calls::setApprovalForAll(IERC721::setApprovalForAllCall { + operator: BOB_ADDR.0.into(), + approved: false + }) + )); + assert!(!allowance::(collection_id, ALICE, BOB, None)); + assert_last_event( + prefixed_address(ERC721, collection_id), + IERC721::ApprovalForAll { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into(), + approved: false, + }, + ); + }); } #[test] fn get_approved_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(crate::nonfungibles::approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - let address: Address = BOB_ADDR.0.into(); - // Approved. - assert_eq!( - call_precompile::
( - &BOB, + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(crate::nonfungibles::approve::( + RuntimeOrigin::signed(ALICE), collection_id, - &IERC721Calls::getApproved(IERC721::getApprovedCall { - tokenId: U256::saturating_from(item_id) - }) - ) - .unwrap(), - address - ); - }); + BOB, + Some(item_id), + true, + None, + )); + let address: Address = BOB_ADDR.0.into(); + // Approved. + assert_eq!( + call_precompile::
( + &BOB, + collection_id, + &IERC721Calls::getApproved(IERC721::getApprovedCall { + tokenId: U256::saturating_from(item_id) + }) + ) + .unwrap(), + address + ); + }); } #[test] fn get_approved_fails_with_no_approval() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - // Not approved. - assert!(matches!( - call_precompile::
( - &BOB, - collection_id, - &IERC721Calls::getApproved(IERC721::getApprovedCall { - tokenId: U256::saturating_from(item_id) - }) - ), - Err(DispatchError::Other("ERC721: Not approved")) - )); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + // Not approved. + assert!(matches!( + call_precompile::
( + &BOB, + collection_id, + &IERC721Calls::getApproved(IERC721::getApprovedCall { + tokenId: U256::saturating_from(item_id) + }) + ), + Err(DispatchError::Other("ERC721: Not approved")) + )); + }); } #[test] fn is_approved_for_all_works() { let item_id: u32 = 0; let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(crate::nonfungibles::approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - None, - true, - None, - )); - assert_ok!(call_precompile::( - &ALICE, - collection_id, - &IERC721Calls::isApprovedForAll(IERC721::isApprovedForAllCall { - owner: ALICE_ADDR.0.into(), - operator: BOB_ADDR.0.into() - }) - )); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + assert_ok!(crate::nonfungibles::approve::( + RuntimeOrigin::signed(ALICE), + collection_id, + BOB, + None, + true, + None, + )); + assert_ok!(call_precompile::( + &ALICE, + collection_id, + &IERC721Calls::isApprovedForAll(IERC721::isApprovedForAllCall { + owner: ALICE_ADDR.0.into(), + operator: BOB_ADDR.0.into() + }) + )); + }); } #[test] fn name_works() { let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection(ALICE); - set_attribute(collection_id, None, "name", "ERC721 Example Colection"); - assert_eq!( - call_precompile::( - &ALICE, - collection_id, - &IERC721Calls::name(IERC721::nameCall {}) - ) - .unwrap(), - "ERC721 Example Colection".to_string() - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection(ALICE); + set_attribute(collection_id, None, "name", "ERC721 Example Colection"); + assert_eq!( + call_precompile::( + &ALICE, + collection_id, + &IERC721Calls::name(IERC721::nameCall {}) + ) + .unwrap(), + "ERC721 Example Colection".to_string() + ); + }); } #[test] fn symbol_works() { let collection_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection(ALICE); - set_attribute(collection_id, None, "symbol", "POP"); - assert_eq!( - call_precompile::( - &ALICE, - collection_id, - &IERC721Calls::symbol(IERC721::symbolCall {}) - ) - .unwrap(), - "POP".to_string() - ); - }); + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection(ALICE); + set_attribute(collection_id, None, "symbol", "POP"); + assert_eq!( + call_precompile::( + &ALICE, + collection_id, + &IERC721Calls::symbol(IERC721::symbolCall {}) + ) + .unwrap(), + "POP".to_string() + ); + }); } #[test] fn image_works() { let collection_id: u32 = 0; let item_id: u32 = 0; - ExtBuilder::new().build().execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - set_attribute(collection_id, Some(item_id), "image", "https://example.com/image.png"); - assert_eq!( - call_precompile::( - &ALICE, + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(ALICE, collection_id, item_id); + set_attribute( collection_id, - &IERC721Calls::tokenURI(IERC721::tokenURICall { - tokenId: U256::saturating_from(item_id) - }) - ) - .unwrap(), - "https://example.com/image.png".to_string() - ); - }); + Some(item_id), + "image", + "https://example.com/image.png", + ); + assert_eq!( + call_precompile::( + &ALICE, + collection_id, + &IERC721Calls::tokenURI(IERC721::tokenURICall { + tokenId: U256::saturating_from(item_id) + }) + ) + .unwrap(), + "https://example.com/image.png".to_string() + ); + }); } fn create_collection_and_mint(owner: AccountIdOf, collection_id: u32, item_id: u32) { diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index f604cf530..987f24385 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -7,7 +7,7 @@ sol!("src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol"); /// The nonfungibles precompile offers a streamlined interface for interacting with nonfungible /// tokens. The goal is to provide a simplified, consistent API that adheres to standards in the /// smart contract space. -pub struct Nonfungibles(PhantomData<(T, I)>); +pub struct Nonfungibles(PhantomData<(T, I)>); impl< const FIXED: u16, T: frame_system::Config @@ -24,13 +24,17 @@ impl< Fixed(NonZero::new(FIXED).expect("expected non-zero precompile address")); fn call( - address: &[u8; 20], + _address: &[u8; 20], input: &Self::Interface, env: &mut impl Ext, ) -> Result, Error> { - use INonfungibles::{INonfungiblesCalls::*, *}; match input { - approve_0(approve_0Call { collection, operator, approved, deadline }) => { + INonfungiblesCalls::approve_0(approve_0Call { + collection, + operator, + approved, + deadline, + }) => { // TODO: Implement real weight let charged = env.charge(Weight::default())?; @@ -58,17 +62,24 @@ impl< e.error })?; - let event = CollectionApproval { - operator: *operator, - approved: *approved, - collection: *collection, - owner, - }; - deposit_event(env, event); - + deposit_event( + env, + CollectionApproval { + operator: *operator, + approved: *approved, + collection: *collection, + owner, + }, + )?; Ok(approve_0Call::abi_encode_returns(&approve_0Return {})) }, - approve_1(approve_1Call { collection, item, operator, approved, deadline }) => { + INonfungiblesCalls::approve_1(approve_1Call { + collection, + item, + operator, + approved, + deadline, + }) => { // TODO: Implement real weight let charged = env.charge(Weight::default())?; @@ -97,12 +108,13 @@ impl< e.error })?; - let event = - ItemApproval { operator: *operator, approved: *approved, item: *item, owner }; - deposit_event(env, event); + deposit_event( + env, + ItemApproval { operator: *operator, approved: *approved, item: *item, owner }, + )?; Ok(approve_1Call::abi_encode_returns(&approve_1Return {})) }, - transfer(transferCall { collection, to, item }) => { + INonfungiblesCalls::transfer(transferCall { collection, to, item }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -115,10 +127,10 @@ impl< (*item).into(), )?; - deposit_event(env, Transfer { from: owner, to: *to, item: *item }); + deposit_event(env, Transfer { from: owner, to: *to, item: *item })?; Ok(transferCall::abi_encode_returns(&transferReturn {})) }, - create(createCall { admin, config }) => { + INonfungiblesCalls::create(createCall { admin, config }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -132,7 +144,7 @@ impl< Ok(createCall::abi_encode_returns(&collection_id)) }, - destroy(destroyCall { collection, witness }) => { + INonfungiblesCalls::destroy(destroyCall { collection, witness }) => { // TODO: Implement real weight let charged = env.charge(Weight::default())?; @@ -154,7 +166,12 @@ impl< Ok(destroyCall::abi_encode_returns(&destroyReturn {})) }, - setAttribute_0(setAttribute_0Call { collection, namespace, key, value }) => { + INonfungiblesCalls::setAttribute_0(setAttribute_0Call { + collection, + namespace, + key, + value, + }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -167,15 +184,23 @@ impl< BoundedVec::truncate_from(value.to_vec()), )?; - let event = CollectionAttributeSet { - key: key.clone(), - data: value.clone(), - collection: *collection, - }; - deposit_event(env, event); + deposit_event( + env, + CollectionAttributeSet { + key: key.clone(), + data: value.clone(), + collection: *collection, + }, + )?; Ok(setAttribute_0Call::abi_encode_returns(&setAttribute_0Return {})) }, - setAttribute_1(setAttribute_1Call { collection, item, namespace, key, value }) => { + INonfungiblesCalls::setAttribute_1(setAttribute_1Call { + collection, + item, + namespace, + key, + value, + }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -188,11 +213,36 @@ impl< BoundedVec::truncate_from(value.to_vec()), )?; - let event = ItemAttributeSet { key: key.clone(), data: value.clone(), item: *item }; - deposit_event(env, event); + deposit_event( + env, + ItemAttributeSet { key: key.clone(), data: value.clone(), item: *item }, + )?; Ok(setAttribute_1Call::abi_encode_returns(&setAttribute_1Return {})) }, - clearAttribute_1(clearAttribute_1Call { collection, item, namespace, key }) => { + INonfungiblesCalls::clearAttribute_0(clearAttribute_0Call { + collection, + namespace, + key, + }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; + + super::clear_attribute::( + to_runtime_origin(env.caller()), + (*collection).into(), + None, + decode_bytes::>>(namespace)?, + BoundedVec::truncate_from(key.to_vec()), + )?; + + Ok(clearAttribute_0Call::abi_encode_returns(&clearAttribute_0Return {})) + }, + INonfungiblesCalls::clearAttribute_1(clearAttribute_1Call { + collection, + item, + namespace, + key, + }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -206,7 +256,7 @@ impl< Ok(clearAttribute_1Call::abi_encode_returns(&clearAttribute_1Return {})) }, - setMetadata_0(setMetadata_0Call { collection, item, data }) => { + INonfungiblesCalls::setMetadata_0(setMetadata_0Call { collection, item, data }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -219,7 +269,7 @@ impl< Ok(setMetadata_0Call::abi_encode_returns(&setMetadata_0Return {})) }, - setMetadata_1(setMetadata_1Call { collection, data }) => { + INonfungiblesCalls::setMetadata_1(setMetadata_1Call { collection, data }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -231,7 +281,7 @@ impl< Ok(setMetadata_1Call::abi_encode_returns(&setMetadata_1Return {})) }, - clearMetadata_0(clearMetadata_0Call { collection }) => { + INonfungiblesCalls::clearMetadata_0(clearMetadata_0Call { collection }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -242,7 +292,7 @@ impl< Ok(clearMetadata_0Call::abi_encode_returns(&clearMetadata_0Return {})) }, - clearMetadata_1(clearMetadata_1Call { collection, item }) => { + INonfungiblesCalls::clearMetadata_1(clearMetadata_1Call { collection, item }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -254,7 +304,7 @@ impl< Ok(clearMetadata_1Call::abi_encode_returns(&clearMetadata_1Return {})) }, - setMaxSupply(setMaxSupplyCall { collection, maxSupply }) => { + INonfungiblesCalls::setMaxSupply(setMaxSupplyCall { collection, maxSupply }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -266,7 +316,11 @@ impl< Ok(setMaxSupplyCall::abi_encode_returns(&setMaxSupplyReturn {})) }, - approveItemAttributes(approveItemAttributesCall { collection, item, delegate }) => { + INonfungiblesCalls::approveItemAttributes(approveItemAttributesCall { + collection, + item, + delegate, + }) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -276,14 +330,12 @@ impl< (*item).into(), env.to_account_id(&(*delegate.0).into()), )?; + Ok(approveItemAttributesCall::abi_encode_returns(&approveItemAttributesReturn {})) }, - cancelItemAttributesApproval(cancelItemAttributesApprovalCall { - collection, - item, - delegate, - witness, - }) => { + INonfungiblesCalls::cancelItemAttributesApproval( + cancelItemAttributesApprovalCall { collection, item, delegate, witness }, + ) => { // TODO: Implement real weight env.charge(Weight::default())?; @@ -294,11 +346,27 @@ impl< env.to_account_id(&(*delegate.0).into()), decode_bytes(witness)?, )?; + Ok(cancelItemAttributesApprovalCall::abi_encode_returns( &cancelItemAttributesApprovalReturn {}, )) }, - clearCollectionApprovals(clearCollectionApprovalsCall { collection, limit }) => { + INonfungiblesCalls::clearAllApprovals(clearAllApprovalsCall { collection, item }) => { + // TODO: Implement real weight + env.charge(Weight::default())?; + + super::clear_all_transfer_approvals::( + to_runtime_origin(env.caller()), + (*collection).into(), + (*item).into(), + )?; + + Ok(clearAllApprovalsCall::abi_encode_returns(&clearAllApprovalsReturn {})) + }, + INonfungiblesCalls::clearCollectionApprovals(clearCollectionApprovalsCall { + collection, + limit, + }) => { // TODO: Implement real weight let charged = env.charge(Weight::default())?; @@ -331,42 +399,44 @@ impl< &clearCollectionApprovalsReturn {}, )) }, - mint(mintCall { collection, to, item, witness }) => { + INonfungiblesCalls::mint(mintCall { collection, to, item, witness }) => { + env.charge(Weight::default())?; + super::mint::( to_runtime_origin(env.caller()), (*collection).into(), env.to_account_id(&(*to.0).into()), (*item).into(), - None, + Some(decode_bytes::, DepositBalanceOf>>( + &witness, + )?), )?; + Ok(mintCall::abi_encode_returns(&mintReturn {})) }, - burn(burnCall { collection, item }) => { + INonfungiblesCalls::burn(burnCall { collection, item }) => { + env.charge(Weight::default())?; + super::burn::( to_runtime_origin(env.caller()), (*collection).into(), (*item).into(), )?; + Ok(burnCall::abi_encode_returns(&burnReturn {})) }, - balanceOf(balanceOfCall { collection, owner }) => { - // // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::BalanceOf, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::balanceOf(balanceOfCall { collection, owner }) => { + env.charge(Weight::default())?; + let balance = super::balance_of::( (*collection).into(), env.to_account_id(&(*owner.0).into()), ); Ok(balanceOfCall::abi_encode_returns(&balance)) }, - ownerOf(ownerOfCall { collection, item }) => { - // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::OwnerOf, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::ownerOf(ownerOfCall { collection, item }) => { + env.charge(Weight::default())?; + let owner = match super::owner_of::((*collection).into(), (*item).into()) { Some(owner) => owner, None => @@ -377,12 +447,9 @@ impl< let owner = >::to_address(&owner).0.into(); Ok(ownerOfCall::abi_encode_returns(&owner)) }, - allowance_0(allowance_0Call { collection, owner, operator }) => { - // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::Allowance, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::allowance_0(allowance_0Call { collection, owner, operator }) => { + env.charge(Weight::default())?; + let is_approved = crate::nonfungibles::allowance::( (*collection).into(), env.to_account_id(&(*owner.0).into()), @@ -391,12 +458,14 @@ impl< ); Ok(allowance_0Call::abi_encode_returns(&is_approved)) }, - allowance_1(allowance_1Call { collection, owner, operator, item }) => { - // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::Allowance, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::allowance_1(allowance_1Call { + collection, + owner, + operator, + item, + }) => { + env.charge(Weight::default())?; + let is_approved = crate::nonfungibles::allowance::( (*collection).into(), env.to_account_id(&(*owner.0).into()), @@ -405,21 +474,15 @@ impl< ); Ok(allowance_1Call::abi_encode_returns(&is_approved)) }, - totalSupply(totalSupplyCall { collection }) => { - // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::TotalSupply, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::totalSupply(totalSupplyCall { collection }) => { + env.charge(Weight::default())?; + let total = super::total_supply::((*collection).into()); Ok(totalSupplyCall::abi_encode_returns(&total)) }, - itemMetadata(itemMetadataCall { collection, item }) => { - // Charge the weight for this call. - // T::ReviveCallRuntimeCost::charge_weight( - // RuntimeCosts::ItemMetadata, - // env.remaining_gas()?, - // )?; + INonfungiblesCalls::itemMetadata(itemMetadataCall { collection, item }) => { + env.charge(Weight::default())?; + let collection_id: CollectionIdOf = (*collection).into(); let item_id: ItemIdOf = (*item).into(); let metadata = match super::item_metadata::(collection_id, item_id) { @@ -432,7 +495,13 @@ impl< let item_metadata = String::from_utf8_lossy(&metadata).into(); Ok(itemMetadataCall::abi_encode_returns(&item_metadata)) }, - getAttributes_0(getAttributes_0Call { collection, namespace, key }) => { + INonfungiblesCalls::getAttributes_0(getAttributes_0Call { + collection, + namespace, + key, + }) => { + env.charge(Weight::default())?; + let attribute = match super::get_attributes::( (*collection).into(), None, @@ -448,7 +517,14 @@ impl< let result = String::from_utf8_lossy(&attribute).into(); Ok(getAttributes_0Call::abi_encode_returns(&result)) }, - getAttributes_1(getAttributes_1Call { collection, item, namespace, key }) => { + INonfungiblesCalls::getAttributes_1(getAttributes_1Call { + collection, + item, + namespace, + key, + }) => { + env.charge(Weight::default())?; + let attribute = match super::get_attributes::( (*collection).into(), Some((*item).into()), @@ -464,24 +540,12 @@ impl< let result = String::from_utf8_lossy(&attribute).into(); Ok(getAttributes_1Call::abi_encode_returns(&result)) }, - itemMetadata(itemMetadataCall { collection, item }) => { - let metadata = - match super::item_metadata::((*collection).into(), (*item).into()) { - Some(value) => value, - None => - return Err(Error::Revert(Revert { - reason: "Nonfungibles: No metadata found".to_string(), - })), - }; - let result = String::from_utf8_lossy(&metadata).into(); - Ok(getAttributes_1Call::abi_encode_returns(&result)) - }, - _ => unimplemented!(), } } } -impl, I: 'static> Nonfungibles { +impl, I: 'static> Nonfungibles { + /// The address of the precompile. pub const fn address() -> [u8; 20] { fixed_address(FIXED) } diff --git a/pallets/api-vnext/src/nonfungibles/tests.rs b/pallets/api-vnext/src/nonfungibles/tests.rs new file mode 100644 index 000000000..cd39e932e --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/tests.rs @@ -0,0 +1,139 @@ +use frame_support::assert_noop; +use pallet_nfts::CollectionConfig; + +use super::*; +use crate::mock::{Nfts, *}; + +const COLLECTION: u32 = 0; +const ITEM: u32 = 1; + +type AccountBalanceOf = pallet_nfts::AccountBalance; +type AttributeNamespaceOf = AttributeNamespace>; +type AttributeOf = pallet_nfts::Attribute; +type ED = ExistentialDeposit; +type NextCollectionIdOf = pallet_nfts::NextCollectionId; +type NftsError = pallet_nfts::Error; +type NftsWeightInfo = ::WeightInfo; +type WeightInfo = ::WeightInfo; + +mod approve { + use frame_support::assert_ok; + + use super::*; + + #[test] + fn approve_works() { + let collection = COLLECTION; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(ALICE, 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::approve_transfer()`. + assert_noop!( + approve::( + signed(owner.clone()), + collection, + operator.clone(), + Some(item), + true, + None + ), + // TODO: Handle weight + NftsError::UnknownItem.with_weight(Weight::default()) + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Successfully approve `operator` to transfer the collection item. + assert_ok!(approve::( + signed(owner.clone()), + collection, + operator.clone(), + Some(item), + true, + None + )); + assert_ok!(Nfts::check_approval_permission( + &collection, + &Some(item), + &owner, + &operator + )); + }); + } +} + +// Helper functions for interacting with pallet-nfts. +mod nfts { + use frame_support::assert_ok; + use pallet_nfts::{CollectionSettings, MintSettings}; + + use super::*; + + pub(super) fn balance_of(collection: CollectionIdOf, owner: &AccountId) -> u32 { + AccountBalanceOf::get(collection, &owner) + .map(|(balance, _)| balance) + .unwrap_or_default() + } + + pub(super) fn create_collection(owner: AccountId) -> u32 { + let next_id = NextCollectionIdOf::get().unwrap_or_default(); + assert_ok!(Nfts::create( + signed(owner.clone()), + owner.into(), + collection_config_with_all_settings_enabled() + )); + next_id + } + + pub(super) fn create_collection_and_mint( + owner: AccountId, + mint_to: AccountId, + item: ItemIdOf, + ) -> (u32, u32) { + let collection = create_collection(owner.clone()); + assert_ok!(Nfts::mint(signed(owner), collection, item, mint_to.into(), None)); + (collection, item) + } + + pub(super) fn create_collection_mint_and_approve( + owner: AccountId, + mint_to: AccountId, + item: ItemIdOf, + operator: AccountId, + ) { + let (collection, item) = create_collection_and_mint(owner.clone(), mint_to, item); + assert_ok!(Nfts::approve_transfer( + signed(owner.clone().into()), + collection, + item, + operator.clone().into(), + None + )); + assert_ok!(Nfts::check_approval_permission( + &collection, + &Some(item), + &owner.into(), + &operator.into() + )); + } + + pub(super) fn collection_config_with_all_settings_enabled() -> CollectionConfigFor { + CollectionConfig { + settings: CollectionSettings::all_enabled(), + max_supply: None, + mint_settings: MintSettings::default(), + } + } + + pub(super) fn get_attribute( + collection: CollectionIdOf, + maybe_item: Option>, + namespace: AttributeNamespaceOf, + key: BoundedVec>::KeyLimit>, + ) -> Option> { + AttributeOf::get((collection, maybe_item, namespace, key)) + .map(|attribute| attribute.0.into()) + } +} From 03d16b34a64f8770a7b568085f02a6dd480e6d95 Mon Sep 17 00:00:00 2001 From: chungquantin Date: Fri, 11 Jul 2025 10:57:37 +0700 Subject: [PATCH 158/162] chore: add tests for pallet methods --- pallets/api-vnext/src/nonfungibles.rs | 4 +- .../src/nonfungibles/precompiles/erc721/v0.rs | 156 +-- .../interfaces/v0/INonfungibles.sol | 4 +- .../src/nonfungibles/precompiles/v0.rs | 14 +- pallets/api-vnext/src/nonfungibles/tests.rs | 987 +++++++++++++++++- 5 files changed, 1068 insertions(+), 97 deletions(-) diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs index 673643228..e76d2b5d4 100644 --- a/pallets/api-vnext/src/nonfungibles.rs +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -214,7 +214,7 @@ fn total_supply, I>(collection: CollectionIdOf) -> u32 { Nfts::::collection_items(collection).unwrap_or_default() } -fn get_attributes, I>( +fn get_attribute, I>( collection: CollectionIdOf, item: Option>, namespace: AttributeNamespace>, @@ -245,7 +245,7 @@ fn clear_collection_metadata, I>( Nfts::::clear_collection_metadata(origin, collection) } -fn set_collection_max_supply, I>( +fn set_max_supply, I>( origin: OriginFor, collection: CollectionIdOf, max_supply: u32, diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs index 184abfe13..aa1a4188d 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/erc721/v0.rs @@ -59,7 +59,7 @@ impl< let get_attribute = |key: &str, item_id: Option>| -> Result, Error> { let collection_id: CollectionIdOf = collection_id.into(); - let attribute = match crate::nonfungibles::get_attributes::( + let attribute = match crate::nonfungibles::get_attribute::( collection_id, item_id, AttributeNamespace::CollectionOwner, @@ -413,61 +413,61 @@ mod tests { }); } - #[test] - fn approve_fails_with_unknown_item() { - let item_id: u32 = 0; - let collection_id: u32 = 0; - ExtBuilder::new() - .with_balances(vec![(ALICE, 10_000_000)]) - .build() - .execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - // No item found. - assert!(matches!( - call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: BOB_ADDR.0.into(), - tokenId: U256::from(1) - }) - ), - Err(DispatchError::Other("ERC721: Item already approved")) - )); - }); - } - - #[test] - fn approve_fails_with_existing_approval() { - let item_id: u32 = 0; - let collection_id: u32 = 0; - ExtBuilder::new() - .with_balances(vec![(ALICE, 10_000_000)]) - .build() - .execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - assert_ok!(approve::( - RuntimeOrigin::signed(ALICE), - collection_id, - BOB, - Some(item_id), - true, - None, - )); - // Item already approved. - assert!(matches!( - call_precompile::<()>( - &ALICE, - collection_id, - &IERC721Calls::approve(IERC721::approveCall { - to: BOB_ADDR.0.into(), - tokenId: U256::from(item_id) - }) - ), - Err(DispatchError::Other("ERC721: Item already approved")) - )); - }); - } + // #[test] + // fn approve_fails_with_unknown_item() { + // let item_id: u32 = 0; + // let collection_id: u32 = 0; + // ExtBuilder::new() + // .with_balances(vec![(ALICE, 10_000_000)]) + // .build() + // .execute_with(|| { + // create_collection_and_mint(ALICE, collection_id, item_id); + // // No item found. + // assert!(matches!( + // call_precompile::<()>( + // &ALICE, + // collection_id, + // &IERC721Calls::approve(IERC721::approveCall { + // to: BOB_ADDR.0.into(), + // tokenId: U256::from(1) + // }) + // ), + // Err(DispatchError::Other("ERC721: Item already approved")) + // )); + // }); + // } + + // #[test] + // fn approve_fails_with_existing_approval() { + // let item_id: u32 = 0; + // let collection_id: u32 = 0; + // ExtBuilder::new() + // .with_balances(vec![(ALICE, 10_000_000)]) + // .build() + // .execute_with(|| { + // create_collection_and_mint(ALICE, collection_id, item_id); + // assert_ok!(approve::( + // RuntimeOrigin::signed(ALICE), + // collection_id, + // BOB, + // Some(item_id), + // true, + // None, + // )); + // // Item already approved. + // assert!(matches!( + // call_precompile::<()>( + // &ALICE, + // collection_id, + // &IERC721Calls::approve(IERC721::approveCall { + // to: BOB_ADDR.0.into(), + // tokenId: U256::from(item_id) + // }) + // ), + // Err(DispatchError::Other("ERC721: Item already approved")) + // )); + // }); + // } #[test] fn approve_works() { @@ -628,28 +628,28 @@ mod tests { }); } - #[test] - fn get_approved_fails_with_no_approval() { - let item_id: u32 = 0; - let collection_id: u32 = 0; - ExtBuilder::new() - .with_balances(vec![(ALICE, 10_000_000)]) - .build() - .execute_with(|| { - create_collection_and_mint(ALICE, collection_id, item_id); - // Not approved. - assert!(matches!( - call_precompile::
( - &BOB, - collection_id, - &IERC721Calls::getApproved(IERC721::getApprovedCall { - tokenId: U256::saturating_from(item_id) - }) - ), - Err(DispatchError::Other("ERC721: Not approved")) - )); - }); - } + // #[test] + // fn get_approved_fails_with_no_approval() { + // let item_id: u32 = 0; + // let collection_id: u32 = 0; + // ExtBuilder::new() + // .with_balances(vec![(ALICE, 10_000_000)]) + // .build() + // .execute_with(|| { + // create_collection_and_mint(ALICE, collection_id, item_id); + // // Not approved. + // assert!(matches!( + // call_precompile::
( + // &BOB, + // collection_id, + // &IERC721Calls::getApproved(IERC721::getApprovedCall { + // tokenId: U256::saturating_from(item_id) + // }) + // ), + // Err(DispatchError::Other("ERC721: Not approved")) + // )); + // }); + // } #[test] fn is_approved_for_all_works() { diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol index cb9cd1fe6..7843166f1 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol +++ b/pallets/api-vnext/src/nonfungibles/precompiles/interfaces/v0/INonfungibles.sol @@ -229,7 +229,7 @@ interface INonfungibles { /** * @dev Returns the attribute value of `key` under `namespace` for `collection`. */ - function getAttributes( + function getAttribute( uint32 collection, bytes calldata namespace, bytes calldata key @@ -238,7 +238,7 @@ interface INonfungibles { /** * @dev Returns the attribute value of `key` under `namespace` for given `item` in `collection`. */ - function getAttributes( + function getAttribute( uint32 collection, uint32 item, bytes calldata namespace, diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index 987f24385..541b6ef4b 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -308,7 +308,7 @@ impl< // TODO: Implement real weight env.charge(Weight::default())?; - super::set_collection_max_supply::( + super::set_max_supply::( to_runtime_origin(env.caller()), (*collection).into(), (*maxSupply).into(), @@ -495,14 +495,14 @@ impl< let item_metadata = String::from_utf8_lossy(&metadata).into(); Ok(itemMetadataCall::abi_encode_returns(&item_metadata)) }, - INonfungiblesCalls::getAttributes_0(getAttributes_0Call { + INonfungiblesCalls::getAttribute_0(getAttribute_0Call { collection, namespace, key, }) => { env.charge(Weight::default())?; - let attribute = match super::get_attributes::( + let attribute = match super::get_attribute::( (*collection).into(), None, decode_bytes::>>(namespace)?, @@ -515,9 +515,9 @@ impl< })), }; let result = String::from_utf8_lossy(&attribute).into(); - Ok(getAttributes_0Call::abi_encode_returns(&result)) + Ok(getAttribute_0Call::abi_encode_returns(&result)) }, - INonfungiblesCalls::getAttributes_1(getAttributes_1Call { + INonfungiblesCalls::getAttribute_1(getAttribute_1Call { collection, item, namespace, @@ -525,7 +525,7 @@ impl< }) => { env.charge(Weight::default())?; - let attribute = match super::get_attributes::( + let attribute = match super::get_attribute::( (*collection).into(), Some((*item).into()), decode_bytes::>>(namespace)?, @@ -538,7 +538,7 @@ impl< })), }; let result = String::from_utf8_lossy(&attribute).into(); - Ok(getAttributes_1Call::abi_encode_returns(&result)) + Ok(getAttribute_1Call::abi_encode_returns(&result)) }, } } diff --git a/pallets/api-vnext/src/nonfungibles/tests.rs b/pallets/api-vnext/src/nonfungibles/tests.rs index cd39e932e..2b27bdde6 100644 --- a/pallets/api-vnext/src/nonfungibles/tests.rs +++ b/pallets/api-vnext/src/nonfungibles/tests.rs @@ -1,5 +1,13 @@ -use frame_support::assert_noop; -use pallet_nfts::CollectionConfig; +use frame_support::{ + assert_noop, assert_ok, + pallet_prelude::Zero, + sp_runtime::{traits::BadOrigin, AccountId32}, + traits::Get, +}; +use pallet_nfts::{ + CollectionApprovals, CollectionConfig, CollectionSetting, CollectionSettings, MintSettings, + WeightInfo, +}; use super::*; use crate::mock::{Nfts, *}; @@ -14,11 +22,9 @@ type ED = ExistentialDeposit; type NextCollectionIdOf = pallet_nfts::NextCollectionId; type NftsError = pallet_nfts::Error; type NftsWeightInfo = ::WeightInfo; -type WeightInfo = ::WeightInfo; +// type WeightInfo = ::WeightInfo; mod approve { - use frame_support::assert_ok; - use super::*; #[test] @@ -28,7 +34,7 @@ mod approve { let operator = BOB; let owner = ALICE; ExtBuilder::new() - .with_balances(vec![(ALICE, 10_000_000)]) + .with_balances(vec![(owner.clone(), 10_000_000), (operator.clone(), ED::get())]) .build() .execute_with(|| { // Check error works for `Nfts::approve_transfer()`. @@ -62,12 +68,977 @@ mod approve { )); }); } + + #[test] + fn approve_collection_works() { + let collection = COLLECTION; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (operator.clone(), ED::get())]) + .build() + .execute_with(|| { + // Check error works for `Nfts::approve_collection_transfer()`. + assert_noop!( + approve::( + signed(owner.clone()), + collection, + operator.clone(), + None, + true, + None + ), + NftsError::NoItemOwned.with_weight(Weight::default()) + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Successfully approve `operator` to transfer all collection items owned by + // `owner`. + assert_ok!(approve::( + signed(owner.clone()), + collection, + operator.clone(), + None, + true, + None + )); + assert_ok!(Nfts::check_approval_permission(&collection, &None, &owner, &operator)); + }); + } + + #[test] + fn cancel_approval_works() { + let collection = COLLECTION; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (operator.clone(), ED::get())]) + .build() + .execute_with(|| { + // Check error works for `Nfts::cancel_approval()`. + assert_noop!( + approve::( + signed(owner.clone()), + collection, + operator.clone(), + Some(item), + false, + None + ), + NftsError::UnknownItem.with_weight(Weight::default()) + ); + nfts::create_collection_mint_and_approve( + owner.clone(), + owner.clone(), + item, + operator.clone(), + ); + // Successfully cancel the transfer approval of `operator` by `owner`. + assert_ok!(approve::( + signed(owner.clone()), + collection, + operator.clone(), + Some(item), + false, + None + )); + assert_eq!( + Nfts::check_approval_permission(&collection, &Some(item), &owner, &operator), + Err(NftsError::NoPermission.into()) + ); + }); + } + + #[test] + fn cancel_collection_approval_works() { + let collection = COLLECTION; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (operator.clone(), ED::get())]) + .build() + .execute_with(|| { + // Check error works for `Nfts::cancel_collection_approval()`. + assert_noop!( + approve::( + signed(owner.clone()), + collection, + operator.clone(), + None, + false, + None + ), + // TODO: Handle weight calculation + NftsError::NotDelegate.with_weight(Weight::default()) + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_ok!(Nfts::approve_collection_transfer( + signed(owner.clone()), + collection, + operator.clone().into(), + None + )); + // Successfully cancel the transfer collection approval of `operator` by `owner`. + assert_ok!(approve::( + signed(owner.clone()), + collection, + operator.clone(), + None, + false, + None + )); + assert_eq!( + Nfts::check_approval_permission(&collection, &None, &owner, &operator), + Err(NftsError::NoPermission.into()) + ); + }); + } +} + +mod transfer { + use frame_support::assert_ok; + + use super::*; + + #[test] + fn transfer_works() { + let collection = COLLECTION; + let dest = BOB; + let item = ITEM; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (dest.clone(), ED::get())]) + .build() + .execute_with(|| { + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Throw `NftsError::UnknownItem` if no item found. + assert_noop!( + transfer::(signed(dest.clone()), collection, dest.clone(), ITEM + 1), + NftsError::UnknownItem + ); + // Check error works for `Nfts::transfer()`. + assert_noop!( + transfer::(signed(dest.clone()), collection, dest.clone(), item), + NftsError::NoPermission + ); + // Successfully transfer a collection item. + let owner_balance_before_transfer = nfts::balance_of(collection, &owner); + let dest_balance_before_transfer = nfts::balance_of(collection, &dest); + assert_ok!(transfer::( + signed(owner.clone()), + collection, + dest.clone(), + item + )); + let owner_balance_after_transfer = nfts::balance_of(collection, &owner); + let dest_balance_after_transfer = nfts::balance_of(collection, &dest); + // Check that `to` has received the collection item from `from`. + assert_eq!(owner_balance_after_transfer, owner_balance_before_transfer - 1); + assert_eq!(dest_balance_after_transfer, dest_balance_before_transfer + 1); + }); + } + + #[test] + fn approved_transfer_works() { + let collection = COLLECTION; + let dest = CHARLIE; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![ + (owner.clone(), 10_000_000), + (operator.clone(), 10_000_000), + (dest.clone(), 10_000_000), + ]) + .build() + .execute_with(|| { + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Approve `operator` to transfer all `collection` items owned by the `owner`. + assert_ok!(Nfts::approve_collection_transfer( + signed(owner.clone()), + collection, + operator.clone().into(), + None + )); + // Successfully transfer a collection item. + let owner_balance_before_transfer = nfts::balance_of(collection, &owner); + let dest_balance_before_transfer = nfts::balance_of(collection, &dest); + assert_ok!(transfer::( + signed(operator.clone()), + collection, + dest.clone(), + item + )); + let owner_balance_after_transfer = nfts::balance_of(collection, &owner); + let dest_balance_after_transfer = nfts::balance_of(collection, &dest); + // Check that `to` has received the collection item from `from`. + assert_eq!(owner_balance_after_transfer, owner_balance_before_transfer - 1); + assert_eq!(dest_balance_after_transfer, dest_balance_before_transfer + 1); + }); + } +} + +#[test] +fn create_works() { + let admin = ALICE; + let mut config = CollectionConfig { + max_supply: None, + mint_settings: MintSettings::default(), + settings: CollectionSettings::all_enabled(), + }; + let collection = COLLECTION; + let creator = ALICE; + ExtBuilder::new() + .with_balances(vec![(admin.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Origin checks. + for origin in vec![root(), none()] { + assert_noop!(create::(origin, admin.clone(), config.clone()), BadOrigin); + } + + // Check error works for `Nfts::create()`. + config.disable_setting(CollectionSetting::DepositRequired); + assert_noop!( + create::(signed(creator.clone()), admin.clone(), config.clone()), + NftsError::WrongSetting + ); + config.enable_setting(CollectionSetting::DepositRequired); + // Successfully create a collection. + assert_ok!(create::(signed(creator.clone()), admin, config)); + assert_eq!(Nfts::collection_owner(collection), Some(creator)); + }); +} + +#[test] +fn destroy_works() { + let collection = COLLECTION; + let owner = ALICE; + let witness = DestroyWitness { item_metadatas: 0, item_configs: 0, attributes: 0 }; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::destroy()`. + assert_noop!( + destroy::(signed(owner.clone()), collection, witness), + NftsError::UnknownCollection + ); + nfts::create_collection(owner.clone()); + // Successfully destroy a collection. + assert_ok!(destroy::(signed(owner), collection, witness)); + assert_eq!(Nfts::collection_owner(collection), None); + }); +} + +#[test] +fn set_attribute_works() { + let attribute = BoundedVec::truncate_from("some attribute".into()); + let collection = COLLECTION; + let item = ITEM; + let owner = ALICE; + let value = BoundedVec::truncate_from("some value".into()); + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::clear_attribute()`. + assert_noop!( + Nfts::set_attribute( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + value.clone() + ), + NftsError::UnknownCollection + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_ok!(Nfts::set_attribute( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + value.clone() + )); + // Successfully clear an attribute. + assert_ok!(clear_attribute::( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + )); + assert!(nfts::get_attribute( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute + ) + .is_none()); + }); +} + +#[test] +fn clear_attribute_works() { + let attribute = BoundedVec::truncate_from("some attribute".as_bytes().to_vec()); + let collection = COLLECTION; + let item = ITEM; + let owner = ALICE; + let value = BoundedVec::truncate_from("some value".as_bytes().to_vec()); + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::clear_attribute()`. + assert_noop!( + Nfts::set_attribute( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + value.clone() + ), + NftsError::UnknownCollection + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_ok!(Nfts::set_attribute( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + value.clone() + )); + // Successfully clear an attribute. + assert_ok!(clear_attribute::( + signed(owner.clone()), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + )); + assert!(nfts::get_attribute( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute + ) + .is_none()); + }); +} + +#[test] +fn set_metadata_works() { + let collection = COLLECTION; + let item = ITEM; + let metadata = BoundedVec::truncate_from("some metadata".into()); + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::set_metadata()`. + assert_noop!( + set_metadata::(signed(owner.clone()), collection, item, metadata.clone()), + NftsError::NoPermission + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Successfully set the metadata. + assert_ok!(set_metadata::( + signed(owner.clone()), + collection, + item, + metadata.clone() + )); + assert_eq!(Nfts::item_metadata(collection, item), Some(metadata)); + }); +} + +#[test] +fn clear_metadata_works() { + let collection = COLLECTION; + let item = ITEM; + let metadata = BoundedVec::truncate_from("some metadata".into()); + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::clear_metadata()`. + assert_noop!( + clear_metadata::(signed(owner.clone()), collection, item), + NftsError::NoPermission + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_ok!(Nfts::set_metadata(signed(owner.clone()), collection, item, metadata)); + // Successfully clear the metadata. + assert_ok!(clear_metadata::(signed(owner), collection, item)); + assert!(Nfts::item_metadata(collection, item).is_none()); + }); +} + +#[test] +fn set_max_supply_works() { + let collection = COLLECTION; + let owner = ALICE; + let max_supply = 10; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::set_max_supply()`. + assert_noop!( + set_max_supply::(signed(owner.clone()), collection, max_supply), + NftsError::NoConfig + ); + nfts::create_collection(owner.clone()); + // Successfully set the max supply for the collection. + assert_ok!(set_max_supply::(signed(owner.clone()), collection, max_supply)); + (0..max_supply).into_iter().for_each(|i| { + assert_ok!(Nfts::mint( + signed(owner.clone()), + collection, + i, + owner.clone().into(), + None + )); + }); + // Throws `MaxSupplyReached` error if number of minted items is over the max supply. + assert_noop!( + Nfts::mint(signed(owner.clone()), collection, 42, owner.clone().into(), None), + NftsError::MaxSupplyReached + ); + // Override the max supply. + assert_ok!(set_max_supply::( + signed(owner.clone()), + collection, + max_supply * 2 + )); + assert_ok!(Nfts::mint(signed(owner.clone()), collection, 42, owner.into(), None)); + }); +} + +#[test] +fn approve_item_attribute_works() { + let attribute = BoundedVec::truncate_from("some attribute".as_bytes().to_vec()); + let collection = COLLECTION; + let delegate = BOB; + let item = ITEM; + let owner = ALICE; + let value = BoundedVec::truncate_from("some value".as_bytes().to_vec()); + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (delegate.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::approve_item_attributes()`. + assert_noop!( + approve_item_attributes::( + signed(owner.clone()), + collection, + item, + delegate.clone() + ), + NftsError::UnknownItem + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Successfully approve delegate to set attributes. + assert_ok!(approve_item_attributes::( + signed(owner.clone()), + collection, + item, + delegate.clone() + )); + assert_ok!(Nfts::set_attribute( + signed(delegate.clone()), + collection, + Some(item), + AttributeNamespace::Account(delegate), + attribute, + value + )); + }); +} + +#[test] +fn cancel_item_attribute_approval_works() { + let attribute = BoundedVec::truncate_from("some attribute".as_bytes().to_vec()); + let collection = COLLECTION; + let delegate = BOB; + let item = ITEM; + let owner = ALICE; + let value = BoundedVec::truncate_from("some value".as_bytes().to_vec()); + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (delegate.clone(), ED::get())]) + .build() + .execute_with(|| { + // Check error works for `Nfts::cancel_item_attribute_approval()`. + assert_noop!( + cancel_item_attributes_approval::( + signed(owner.clone()), + collection, + item, + delegate.clone(), + CancelAttributesApprovalWitness { account_attributes: 1 } + ), + NftsError::UnknownItem + ); + + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_ok!(Nfts::approve_item_attributes( + signed(owner.clone()), + collection, + item, + delegate.clone().into() + )); + // Successfully cancel item attribute approval. + assert_ok!(Nfts::cancel_item_attributes_approval( + signed(owner), + collection, + item, + delegate.clone().into(), + CancelAttributesApprovalWitness { account_attributes: 1 } + )); + assert_noop!( + Nfts::set_attribute( + signed(delegate.clone()), + collection, + Some(item), + AttributeNamespace::Account(delegate), + attribute, + value + ), + NftsError::NoPermission + ); + }); +} + +#[test] +fn clear_all_transfer_approvals_works() { + let collection = COLLECTION; + let delegates = 10..20; + let delegate_balances = delegates + .clone() + .into_iter() + .map(|d| (AccountId32::new([d; 32]), ED::get())) + .collect::>(); + let item = ITEM; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![vec![(owner.clone(), 10_000_000)], delegate_balances].concat()) + .build() + .execute_with(|| { + // Check error works for `Nfts::clear_all_transfer_approvals()`. + assert_noop!( + clear_all_transfer_approvals::(signed(owner.clone()), collection, item), + NftsError::UnknownCollection + ); + + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + delegates.clone().for_each(|delegate| { + assert_ok!(Nfts::approve_transfer( + signed(owner.clone()), + collection, + item, + AccountId32::new([delegate; 32]).into(), + None + )); + }); + // Successfully clear all transfer approvals. + assert_ok!(clear_all_transfer_approvals::( + signed(owner.clone()), + collection, + item + )); + delegates.for_each(|delegate| { + assert!(Nfts::check_approval_permission( + &collection, + &Some(item), + &owner, + &AccountId32::new([delegate; 32]).into() + ) + .is_err()); + }); + }); +} + +#[test] +fn clear_collection_approvals_works() { + let collection = COLLECTION; + let delegates = 10..20; + let delegate_balances = delegates + .clone() + .into_iter() + .map(|d| (AccountId32::new([d; 32]), ED::get())) + .collect::>(); + let owner = ALICE; + let approvals = (delegates.end - delegates.start) as u32; + ExtBuilder::new() + .with_balances(vec![vec![(owner.clone(), 10_000_000)], delegate_balances].concat()) + .build() + .execute_with(|| { + // Check error works for `Nfts::clear_collection_approvals()`. + assert_noop!( + clear_collection_approvals::(none(), collection, 1), + BadOrigin.with_weight(NftsWeightInfo::clear_collection_approvals(0)) + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), ITEM); + delegates.clone().for_each(|delegate| { + assert_ok!(Nfts::approve_collection_transfer( + signed(owner.clone()), + collection, + AccountId32::new([delegate; 32]).into(), + None + )); + }); + // Partially clear collection approvals. + assert_eq!( + clear_collection_approvals::(signed(owner.clone()), collection, 1), + Ok(Some(NftsWeightInfo::clear_collection_approvals(1)).into()) + ); + assert_eq!( + CollectionApprovals::::iter_prefix((collection, owner.clone(),)).count(), + (approvals - 1) as usize + ); + // Successfully clear all collection approvals. + assert_eq!( + clear_collection_approvals::( + signed(owner.clone()), + collection, + approvals + ), + Ok(Some(NftsWeightInfo::clear_collection_approvals(approvals - 1)).into()) + ); + assert!(CollectionApprovals::::iter_prefix((collection, owner,)) + .count() + .is_zero()); + }); +} + +#[test] +fn mint_works() { + let collection = COLLECTION; + let item = ITEM; + let owner = ALICE; + let witness = MintWitness { mint_price: None, owned_item: None }; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Check error works for `Nfts::mint()`. + assert_noop!( + mint::( + signed(owner.clone()), + collection, + owner.clone(), + item, + Some(witness.clone()) + ), + NftsError::NoConfig + ); + // Successfully mint a new collection item. + nfts::create_collection(owner.clone()); + let balance_before_mint = nfts::balance_of(collection, &owner); + assert_ok!(mint::( + signed(owner.clone()), + collection, + owner.clone(), + item, + Some(witness) + )); + let balance_after_mint = nfts::balance_of(collection, &owner); + assert_eq!(balance_after_mint, balance_before_mint + 1); + }); +} + +#[test] +fn burn_works() { + let collection = COLLECTION; + let owner = ALICE; + let item = ITEM; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (BOB, ED::get())]) + .build() + .execute_with(|| { + // Throw `NftsError::UnknownItem` if no owner found for the item. + assert_noop!( + burn::(signed(owner.clone()), collection, item), + NftsError::UnknownItem + ); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Check error works for `Nfts::burn()`. + assert_noop!(burn::(signed(BOB), collection, item), NftsError::NoPermission); + // Successfully burn a collection item. + let balance_before_burn = nfts::balance_of(collection, &owner); + assert_ok!(burn::(signed(owner.clone()), collection, item)); + let balance_after_burn = nfts::balance_of(collection, &owner); + assert_eq!(balance_after_burn, balance_before_burn - 1); + }); +} + +#[test] +fn balance_of_works() { + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + let collection = nfts::create_collection(owner.clone()); + assert_eq!(balance_of::(collection, owner.clone()), 0); + (0..10).into_iter().for_each(|i| { + assert_ok!(Nfts::mint( + signed(owner.clone()), + collection, + i, + owner.clone().into(), + None + )); + assert_eq!(balance_of::(collection, owner.clone()), i + 1); + assert_eq!( + balance_of::(collection, owner.clone()), + nfts::balance_of(collection, &owner) + ); + }); + }); +} + +#[test] +fn owner_of_works() { + let collection = COLLECTION; + let item = ITEM; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + assert_eq!(owner_of::(collection, item), None); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + assert_eq!(owner_of::(collection, item), Some(owner)); + assert_eq!(owner_of::(collection, item), Nfts::owner(collection, item)); + }); +} + +#[test] +fn allowance_works() { + let collection = COLLECTION; + let item = ITEM; + let operator = BOB; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (operator.clone(), ED::get())]) + .build() + .execute_with(|| { + nfts::create_collection_mint_and_approve( + owner.clone(), + owner.clone(), + item, + operator.clone(), + ); + assert!(allowance::(collection, owner.clone(), operator.clone(), Some(item))); + assert_eq!( + allowance::(collection, owner.clone(), operator.clone(), Some(item)), + Nfts::check_approval_permission(&collection, &Some(item), &owner, &operator) + .is_ok() + ); + }); +} + +#[test] +fn total_supply_works() { + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + let collection = nfts::create_collection(owner.clone()); + assert_eq!(total_supply::(collection), 0); + (0..10).into_iter().for_each(|i| { + assert_ok!(Nfts::mint( + signed(owner.clone()), + collection, + i, + owner.clone().into(), + None + )); + assert_eq!(total_supply::(collection), i + 1); + assert_eq!( + total_supply::(collection), + Nfts::collection_items(collection).unwrap_or_default() + ); + }); + }); +} + +mod get_attribute { + use super::*; + + #[test] + fn get_attribute_works() { + let attribute = BoundedVec::truncate_from("some attribute".into()); + let collection = COLLECTION; + let item = ITEM; + let metadata = "some value".as_bytes().to_vec(); + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // No attribute set. + assert_eq!( + get_attribute::( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + None + ); + // Successfully get an existing attribute. + assert_ok!(Nfts::set_attribute( + signed(owner), + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone(), + BoundedVec::truncate_from(metadata.clone()), + )); + assert_eq!( + get_attribute::( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + Some(metadata) + ); + assert_eq!( + get_attribute::( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + nfts::get_attribute( + collection, + Some(item), + AttributeNamespace::CollectionOwner, + attribute + ) + ); + }); + } + + #[test] + fn get_collection_attribute_works() { + let attribute = BoundedVec::truncate_from("some attribute".into()); + let collection = COLLECTION; + let metadata = "some value".as_bytes().to_vec(); + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + nfts::create_collection(owner.clone()); + // No attribute set. + assert_eq!( + get_attribute::( + collection, + None, + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + None + ); + // Successfully get an existing attribute. + assert_ok!(Nfts::set_attribute( + signed(owner.clone()), + collection, + None, + AttributeNamespace::CollectionOwner, + attribute.clone(), + BoundedVec::truncate_from(metadata.clone()), + )); + assert_eq!( + get_attribute::( + collection, + None, + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + Some(metadata) + ); + assert_eq!( + get_attribute::( + collection, + None, + AttributeNamespace::CollectionOwner, + attribute.clone() + ), + nfts::get_attribute( + collection, + None, + AttributeNamespace::CollectionOwner, + attribute + ) + ); + }); + } +} + +#[test] +fn next_collection_id_works() { + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + assert_eq!(next_collection_id::(), Some(0)); + nfts::create_collection_and_mint(ALICE, ALICE, ITEM); + assert_eq!(next_collection_id::(), Some(1)); + assert_eq!( + next_collection_id::(), + Some(NextCollectionIdOf::get().unwrap_or_default()) + ); + }); +} + +#[test] +fn item_metadata_works() { + let collection = COLLECTION; + let item = ITEM; + let metadata = "some metadata".as_bytes().to_vec(); + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + // Read item metadata of an unknown collection. + assert_eq!(item_metadata::(collection, item), None); + nfts::create_collection_and_mint(owner.clone(), owner.clone(), item); + // Successfully set the metadata of an item. + assert_ok!(set_metadata::( + signed(owner), + collection, + item, + BoundedVec::truncate_from(metadata.clone()) + )); + assert_eq!(item_metadata::(collection, item), Some(metadata)); + assert_eq!( + item_metadata::(collection, item).map(|m| BoundedVec::truncate_from(m)), + Nfts::item_metadata(collection, item) + ); + }); } -// Helper functions for interacting with pallet-nfts. mod nfts { use frame_support::assert_ok; - use pallet_nfts::{CollectionSettings, MintSettings}; use super::*; From aba7a84fdf129c54db585555c546ac433f0b4976 Mon Sep 17 00:00:00 2001 From: chungquantin Date: Fri, 11 Jul 2025 16:13:33 +0700 Subject: [PATCH 159/162] chore: add tests for v0::{approve_0,approve_1} --- .../src/nonfungibles/precompiles/v0.rs | 486 +++++++++--------- 1 file changed, 231 insertions(+), 255 deletions(-) diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index 541b6ef4b..f106079a8 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -551,258 +551,234 @@ impl, I: 'static> Nonfungibles; - -// #[test] -// fn approve_transfer_works() { -// ExtBuilder::default().build().execute_with(|| { -// let collection = create_collection(accounts::alice()); -// let item_id = 0u32; - -// // Mint an NFT to Alice -// assert_ok!(mint_nft(collection, item_id, accounts::alice())); - -// // Approve Bob to transfer Alice's NFT -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let call = INonfungiblesCalls::approveTransfer(approveTransferCall { -// collection, -// operator: Address::from(accounts::bob()), -// item: item_id, -// approved: true, -// deadline: 0, -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Verify Bob is approved to transfer Alice's NFT -// let approved = super::allowance::( -// collection, -// accounts::alice(), -// accounts::bob(), -// Some(item_id), -// ); -// assert!(approved); -// }); -// } - -// #[test] -// fn transfer_works() { -// ExtBuilder::default().build().execute_with(|| { -// let collection = create_collection(accounts::alice()); -// let item_id = 0u32; - -// // Mint an NFT to Alice -// assert_ok!(mint_nft(collection, item_id, accounts::alice())); - -// // Transfer from Alice to Bob -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let call = INonfungiblesCalls::transfer(transferCall { -// collection, -// to: Address::from(accounts::bob()), -// item: item_id, -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Verify Bob is now the owner -// let owner = super::owner_of::(collection, item_id); -// assert_eq!(owner, Some(accounts::bob())); -// }); -// } - -// #[test] -// fn create_and_mint_works() { -// ExtBuilder::default().build().execute_with(|| { -// // Create a collection -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let config = -// super::decode_bytes::>(&abi::encode(&[ -// alloy::sol_types::SolValue::Bytes(Vec::new()), -// ])) -// .unwrap(); - -// let call = INonfungiblesCalls::create(createCall { -// admin: Address::from(accounts::alice()), -// config: abi::encode(&[alloy::sol_types::SolValue::Bytes(Vec::new())]), -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Extract collection ID from the result -// let collection_id = 0u32; // First collection created - -// // Mint an NFT -// let item_id = 0u32; -// let call = INonfungiblesCalls::mint(mintCall { -// collection: collection_id, -// item: item_id, -// owner: Address::from(accounts::bob()), -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Verify Bob is now the owner -// let owner = super::owner_of::(collection_id, item_id); -// assert_eq!(owner, Some(accounts::bob())); -// }); -// } - -// #[test] -// fn set_and_get_attributes_works() { -// ExtBuilder::default().build().execute_with(|| { -// let collection = create_collection(accounts::alice()); -// let item_id = 0u32; - -// // Mint an NFT to Alice -// assert_ok!(mint_nft(collection, item_id, accounts::alice())); - -// // Set item attribute -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let key = "key".as_bytes().to_vec(); -// let value = "value".as_bytes().to_vec(); - -// let namespace = AttributeNamespace::Pallet; -// let encoded_namespace = abi::encode(&[alloy::sol_types::SolValue::Uint(0u32.into())]); - -// let call = INonfungiblesCalls::setItemAttribute(setItemAttributeCall { -// collection, -// item: item_id, -// namespace: encoded_namespace.clone(), -// key: key.clone(), -// value: value.clone(), -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Get item attribute -// let call = INonfungiblesCalls::getItemAttributes(getItemAttributesCall { -// collection, -// item: item_id, -// namespace: encoded_namespace, -// key, -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); - -// // Verify attribute value -// let decoded = getItemAttributesCall::abi_decode_returns(&result).unwrap(); -// assert_eq!(decoded.0, "value"); -// }); -// } - -// #[test] -// fn burn_works() { -// ExtBuilder::default().build().execute_with(|| { -// let collection = create_collection(accounts::alice()); -// let item_id = 0u32; - -// // Mint an NFT to Alice -// assert_ok!(mint_nft(collection, item_id, accounts::alice())); - -// // Burn the NFT -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let call = INonfungiblesCalls::burn(burnCall { collection, item: item_id }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Verify NFT no longer exists -// let owner = super::owner_of::(collection, item_id); -// assert_eq!(owner, None); -// }); -// } - -// #[test] -// fn metadata_works() { -// ExtBuilder::default().build().execute_with(|| { -// let collection = create_collection(accounts::alice()); -// let item_id = 0u32; - -// // Mint an NFT to Alice -// assert_ok!(mint_nft(collection, item_id, accounts::alice())); - -// // Set metadata -// let mut ext = ExtBuilder::build_ext(); -// ext.setup(|_| {}); -// ext.set_caller(accounts::alice()); - -// let metadata = "metadata".as_bytes().to_vec(); - -// let call = INonfungiblesCalls::setMetadata(setMetadataCall { -// collection, -// item: Some(item_id), -// data: metadata.clone(), -// }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call); -// assert_ok!(result); - -// // Get metadata -// let call = -// INonfungiblesCalls::itemMetadata(itemMetadataCall { collection, item: item_id }); - -// let result = call_precompile(&mut ext, TheFungibles::address(), &call).unwrap(); - -// // Verify metadata -// let decoded = itemMetadataCall::abi_decode_returns(&result).unwrap(); -// assert_eq!(decoded.0, "metadata"); -// }); -// } - -// // Helper functions -// fn create_collection(owner: AccountIdOf) -> u32 { -// let collection_id = super::next_collection_id::().unwrap_or_default(); -// let config = default_collection_config(); -// assert_ok!(Nfts::::create(Origin::signed(owner), owner, config,)); -// collection_id -// } - -// fn mint_nft(collection_id: u32, item_id: u32, owner: AccountIdOf) -> DispatchResult { -// Nfts::::mint(Origin::signed(owner), collection_id, item_id, owner, None) -// } - -// fn default_collection_config() -> CollectionConfigFor { -// CollectionConfigFor:: { -// settings: Default::default(), -// max_supply: None, -// mint_settings: Default::default(), -// } -// } - -// fn call_precompile( -// ext: &mut impl ExtWithInfo, -// address: [u8; 20], -// input: &INonfungiblesCalls, -// ) -> Result { -// ext.call_precompile(address, 0.into(), input, false) -// } -// } +#[cfg(test)] +mod tests { + use frame_support::{assert_ok, sp_runtime::DispatchError, BoundedVec}; + use pallet_nfts::{ + AttributeNamespace, CollectionConfig, CollectionConfigFor, CollectionSettings, MintSettings, + }; + use pallet_revive::{ + precompiles::alloy::sol_types::{SolInterface, SolType, SolValue}, + test_utils::{ALICE, BOB}, + DepositLimit, Weight, + }; + + use super::*; + use crate::{ + bare_call, fixed_address, + mock::{AccountId, ExtBuilder, RuntimeOrigin, Test, NONFUNGIBLES}, + nonfungibles::mint, + prefixed_address, AccountIdOf, + }; + + const ADDRESS: [u8; 20] = fixed_address(NONFUNGIBLES); + + #[test] + fn approve_0_works() { + let collection_id: u32 = 0; + let item_id = 0; + let owner = ALICE; + let operator = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &owner, + collection_id, + &INonfungiblesCalls::approve_0(INonfungibles::approve_0Call { + collection: collection_id.into(), + operator: to_address(&operator).0.into(), + approved: true, + deadline: 0 + }) + )); + assert!(allowance::( + collection_id, + owner.clone(), + operator.clone(), + None + )); + let event = INonfungibles::CollectionApproval { + collection: collection_id.into(), + owner: to_address(&owner).0.into(), + operator: to_address(&operator).0.into(), + approved: true, + }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn approve_1_works() { + let item_id: u32 = 0; + let collection_id: u32 = 0; + let owner = ALICE; + let operator = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + // Successfully approved. + assert_ok!(call_precompile::<()>( + &owner, + collection_id, + &INonfungiblesCalls::approve_1(INonfungibles::approve_1Call { + collection: collection_id.into(), + item: item_id.into(), + operator: to_address(&operator).0.into(), + approved: true, + deadline: 0 + }) + )); + assert!(allowance::( + collection_id, + owner.clone(), + operator.clone(), + Some(item_id) + )); + let event = INonfungibles::ItemApproval { + item: item_id.into(), + owner: to_address(&owner).0.into(), + operator: to_address(&operator).0.into(), + approved: true, + }; + assert_last_event(ADDRESS, event); + }); + } + + #[test] + fn transfer_works() {} + + #[test] + fn create_works() {} + + #[test] + fn destroy_works() {} + + #[test] + fn set_attribute_0_works() {} + + #[test] + fn set_attribute_1_works() {} + + #[test] + fn clear_attribute_0_works() {} + + #[test] + fn clear_attribute_1_works() {} + + #[test] + fn set_metadata_0_works() {} + + #[test] + fn set_metadata_1_works() {} + + #[test] + fn clear_metadata_0_works() {} + + #[test] + fn clear_metadata_1_works() {} + + #[test] + fn set_max_supply_works() {} + + #[test] + fn approve_item_attributes_works() {} + + #[test] + fn cancel_item_attributes_works() {} + + #[test] + fn clear_all_approvals_works() {} + + #[test] + fn clear_collection_approvals_works() {} + + #[test] + fn mint_works() {} + + #[test] + fn burn_works() {} + + #[test] + fn balance_of_works() {} + + #[test] + fn owner_of_works() {} + + #[test] + fn allowance_0_works() {} + + #[test] + fn allowance_1_works() {} + + #[test] + fn total_supply_works() {} + + #[test] + fn item_metadata_works() {} + + #[test] + fn get_attribute_0_works() {} + + #[test] + fn get_attribute_1_works() {} + + fn create_collection_and_mint(owner: AccountIdOf, collection_id: u32, item_id: u32) { + create_collection(owner.clone()); + assert_ok!(mint::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + owner, + item_id, + None, + )); + } + + fn create_collection(owner: AccountIdOf) { + assert_ok!(super::create::( + RuntimeOrigin::signed(owner.clone()), + owner, + default_collection_config(), + )); + } + + fn default_collection_config() -> CollectionConfigFor { + CollectionConfig { + settings: CollectionSettings::all_enabled(), + max_supply: None, + mint_settings: MintSettings::default(), + } + } + + fn set_attribute(collection_id: u32, item_id: Option, key: &str, value: &str) { + assert_ok!(crate::nonfungibles::set_attribute::( + RuntimeOrigin::signed(ALICE), + collection_id, + item_id, + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + BoundedVec::truncate_from(value.as_bytes().to_vec()), + )); + } + + fn call_precompile::RustType>>( + origin: &AccountId, + token: u32, + input: &INonfungiblesCalls, + ) -> Result { + let address = prefixed_address(NONFUNGIBLES, token); + bare_call::( + RuntimeOrigin::signed(origin.clone()), + address.into(), + 0, + Weight::MAX, + DepositLimit::Balance(u128::MAX), + input.abi_encode(), + ) + } +} From 39f0edd46ec157f0b6e506425ad4a856e60b49c9 Mon Sep 17 00:00:00 2001 From: chungquantin Date: Wed, 16 Jul 2025 13:02:31 +0700 Subject: [PATCH 160/162] feat: update tests for nonfungibles/precompiles/v0.rs --- .../src/nonfungibles/precompiles/v0.rs | 699 +++++++++++++++++- 1 file changed, 666 insertions(+), 33 deletions(-) diff --git a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs index f106079a8..976576c67 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles/v0.rs @@ -392,7 +392,7 @@ impl< env.gas_meter_mut() .adjust_gas(charged, RuntimeCosts::Precompile(actual_weight)); } - return Err(e.error.into()) + return Err(e.error.into()); }, }; Ok(clearCollectionApprovalsCall::abi_encode_returns( @@ -568,7 +568,7 @@ mod tests { bare_call, fixed_address, mock::{AccountId, ExtBuilder, RuntimeOrigin, Test, NONFUNGIBLES}, nonfungibles::mint, - prefixed_address, AccountIdOf, + AccountIdOf, }; const ADDRESS: [u8; 20] = fixed_address(NONFUNGIBLES); @@ -587,7 +587,6 @@ mod tests { // Successfully approved. assert_ok!(call_precompile::<()>( &owner, - collection_id, &INonfungiblesCalls::approve_0(INonfungibles::approve_0Call { collection: collection_id.into(), operator: to_address(&operator).0.into(), @@ -625,7 +624,6 @@ mod tests { // Successfully approved. assert_ok!(call_precompile::<()>( &owner, - collection_id, &INonfungiblesCalls::approve_1(INonfungibles::approve_1Call { collection: collection_id.into(), item: item_id.into(), @@ -651,82 +649,719 @@ mod tests { } #[test] - fn transfer_works() {} + fn transfer_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let to = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000), (to.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + let owner_balance_before = balance_of::(collection_id, owner.clone()); + let to_balance_before = balance_of::(collection_id, to.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::transfer(INonfungibles::transferCall { + collection: collection_id.into(), + to: to_address(&to).0.into(), + item: item_id.into() + }) + )); + + let owner_balance_after = balance_of::(collection_id, owner.clone()); + let to_balance_after = balance_of::(collection_id, to.clone()); + assert_eq!(owner_balance_after, owner_balance_before - 1); + assert_eq!(to_balance_after, to_balance_before + 1); + let event = INonfungibles::Transfer { + from: to_address(&owner).0.into(), + to: to_address(&to).0.into(), + item: item_id.into(), + }; + assert_last_event(ADDRESS, event); + }); + } #[test] - fn create_works() {} + fn create_works() { + let admin = ALICE; + let creator = BOB; + ExtBuilder::new() + .with_balances(vec![(creator.clone(), 10_000_000)]) + .build() + .execute_with(|| { + let config = default_collection_config(); + let config_bytes = codec::Encode::encode(&config); + + let collection_id = call_precompile::( + &creator, + &INonfungiblesCalls::create(INonfungibles::createCall { + admin: to_address(&admin).0.into(), + config: config_bytes.into(), + }), + ) + .unwrap(); + assert_eq!(collection_id, 0); + assert_eq!(owner_of::(collection_id, 0), None); + }); + } #[test] - fn destroy_works() {} + fn destroy_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let witness = + pallet_nfts::DestroyWitness { item_metadatas: 0, item_configs: 0, attributes: 0 }; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::destroy(INonfungibles::destroyCall { + collection: collection_id.into(), + witness: codec::Encode::encode(&witness).into() + }) + )); + assert_eq!(owner_of::(collection_id, 0), None); + }); + } #[test] - fn set_attribute_0_works() {} + fn set_attribute_0_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let key = b"name"; + let value = b"Test Collection"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + let namespace: AttributeNamespace> = + AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::setAttribute_0(INonfungibles::setAttribute_0Call { + collection: collection_id.into(), + namespace: namespace_bytes.into(), + key: key.to_vec().into(), + value: value.to_vec().into() + }) + )); + let event = INonfungibles::CollectionAttributeSet { + collection: collection_id.into(), + key: key.to_vec().into(), + data: value.to_vec().into(), + }; + assert_last_event(ADDRESS, event); + }); + } #[test] - fn set_attribute_1_works() {} + fn set_attribute_1_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let key = b"description"; + let value = b"Test Item"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + let namespace: AttributeNamespace> = + AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::setAttribute_1(INonfungibles::setAttribute_1Call { + collection: collection_id.into(), + item: item_id.into(), + namespace: namespace_bytes.into(), + key: key.to_vec().into(), + value: value.to_vec().into() + }) + )); + let event = INonfungibles::ItemAttributeSet { + item: item_id.into(), + key: key.to_vec().into(), + data: value.to_vec().into(), + }; + assert_last_event(ADDRESS, event); + }); + } #[test] - fn clear_attribute_0_works() {} + fn clear_attribute_0_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let key = "dummy attribute"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + set_attribute(collection_id, None, key, "Test Collection"); + + let namespace: AttributeNamespace> = + AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearAttribute_0(INonfungibles::clearAttribute_0Call { + collection: collection_id.into(), + namespace: namespace_bytes.into(), + key: key.as_bytes().to_vec().into() + }) + )); + }); + } #[test] - fn clear_attribute_1_works() {} + fn clear_attribute_1_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let key = "dummy attribute"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + set_attribute(collection_id, Some(item_id), key, "Test Item"); + + let namespace: AttributeNamespace> = + AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearAttribute_1(INonfungibles::clearAttribute_1Call { + collection: collection_id.into(), + item: item_id.into(), + namespace: namespace_bytes.into(), + key: key.as_bytes().to_vec().into() + }) + )); + + assert!(get_attribute::( + collection_id, + Some(item_id), + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + ) + .is_none()); + }); + } #[test] - fn set_metadata_0_works() {} + fn set_metadata_0_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let metadata = b"Test Item Metadata"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::setMetadata_0(INonfungibles::setMetadata_0Call { + collection: collection_id.into(), + item: item_id.into(), + data: metadata.to_vec().into() + }) + )); + + assert_eq!( + item_metadata::(collection_id, item_id), + Some(metadata.to_vec()) + ); + }); + } #[test] - fn set_metadata_1_works() {} + fn set_metadata_1_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let metadata = b"Test Collection Metadata"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::setMetadata_1(INonfungibles::setMetadata_1Call { + collection: collection_id.into(), + data: metadata.to_vec().into() + }) + )); + + // State check: verify that collection metadata was set + // This is tested by the underlying pallet tests + }); + } #[test] - fn clear_metadata_0_works() {} + fn clear_metadata_0_works() { + let collection_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + assert_ok!(set_collection_metadata::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + BoundedVec::truncate_from(b"Test Collection Metadata".to_vec()), + )); + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearMetadata_0(INonfungibles::clearMetadata_0Call { + collection: collection_id.into() + }) + )); + }); + } #[test] - fn clear_metadata_1_works() {} + fn clear_metadata_1_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + assert_ok!(set_metadata::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + item_id, + BoundedVec::truncate_from(b"Test Item Metadata".to_vec()), + )); + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearMetadata_1(INonfungibles::clearMetadata_1Call { + collection: collection_id.into(), + item: item_id.into() + }) + )); + + assert!(item_metadata::(collection_id, item_id).is_none()); + }); + } #[test] - fn set_max_supply_works() {} + fn set_max_supply_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let max_supply: u32 = 1000; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::setMaxSupply(INonfungibles::setMaxSupplyCall { + collection: collection_id.into(), + maxSupply: max_supply.into() + }) + )); + + assert_eq!(total_supply::(collection_id), 0); + }); + } #[test] - fn approve_item_attributes_works() {} + fn approve_item_attributes_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let delegate = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::approveItemAttributes( + INonfungibles::approveItemAttributesCall { + collection: collection_id.into(), + item: item_id.into(), + delegate: to_address(&delegate).0.into() + } + ) + )); + + // State check: verify that the delegate can now set attributes on the item + // This is tested by the underlying pallet tests + }); + } #[test] - fn cancel_item_attributes_works() {} + fn cancel_item_attributes_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let delegate = BOB; + let witness = pallet_nfts::CancelAttributesApprovalWitness { account_attributes: 0 }; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::cancelItemAttributesApproval( + INonfungibles::cancelItemAttributesApprovalCall { + collection: collection_id.into(), + item: item_id.into(), + delegate: to_address(&delegate).0.into(), + witness: codec::Encode::encode(&witness).into() + } + ) + )); + + assert!(!allowance::( + collection_id, + owner.clone(), + delegate.clone(), + Some(item_id) + )); + }); + } #[test] - fn clear_all_approvals_works() {} + fn clear_all_approvals_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearAllApprovals(INonfungibles::clearAllApprovalsCall { + collection: collection_id.into(), + item: item_id.into() + }) + )); + + assert!(!allowance::(collection_id, owner.clone(), BOB, Some(item_id))); + }); + } #[test] - fn clear_collection_approvals_works() {} + fn clear_collection_approvals_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let limit: u32 = 10; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::clearCollectionApprovals( + INonfungibles::clearCollectionApprovalsCall { + collection: collection_id.into(), + limit: limit.into() + } + ) + )); + + assert!(!allowance::(collection_id, owner.clone(), BOB, None)); + }); + } #[test] - fn mint_works() {} + fn mint_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let to = BOB; + let witness: MintWitness, DepositBalanceOf> = + pallet_nfts::MintWitness { mint_price: None, owned_item: None }; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + let balance_before = balance_of::(collection_id, to.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::mint(INonfungibles::mintCall { + collection: collection_id.into(), + to: to_address(&to).0.into(), + item: item_id.into(), + witness: codec::Encode::encode(&witness).into() + }) + )); + + let balance_after = balance_of::(collection_id, to.clone()); + assert_eq!(balance_after, balance_before + 1); + }); + } #[test] - fn burn_works() {} + fn burn_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + let balance_before = balance_of::(collection_id, owner.clone()); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::burn(INonfungibles::burnCall { + collection: collection_id.into(), + item: item_id.into() + }) + )); + + let balance_after = balance_of::(collection_id, owner.clone()); + assert_eq!(balance_after, balance_before - 1); + }); + } #[test] - fn balance_of_works() {} + fn balance_of_works() { + let collection_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_eq!(balance_of::(collection_id, owner.clone()), 0); + + assert_ok!(mint::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + owner.clone(), + 0, + None, + )); + + assert_eq!(balance_of::(collection_id, owner), 1); + }); + } #[test] - fn owner_of_works() {} + fn owner_of_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + assert_eq!(owner_of::(collection_id, item_id).unwrap(), owner); + }); + } #[test] - fn allowance_0_works() {} + fn allowance_0_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let operator = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert!(!allowance::( + collection_id, + owner.clone(), + operator.clone(), + None + )); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::approve_0(INonfungibles::approve_0Call { + collection: collection_id.into(), + operator: to_address(&operator).0.into(), + approved: true, + deadline: 0 + }) + )); + + assert!(allowance::(collection_id, owner, operator, None)); + }); + } #[test] - fn allowance_1_works() {} + fn allowance_1_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let operator = BOB; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert!(!allowance::( + collection_id, + owner.clone(), + operator.clone(), + Some(item_id) + )); + + assert_ok!(call_precompile::<()>( + &owner, + &INonfungiblesCalls::approve_1(INonfungibles::approve_1Call { + collection: collection_id.into(), + item: item_id.into(), + operator: to_address(&operator).0.into(), + approved: true, + deadline: 0 + }) + )); + + assert!(allowance::(collection_id, owner, operator, Some(item_id))); + }); + } #[test] - fn total_supply_works() {} + fn total_supply_works() { + let collection_id: u32 = 0; + let owner = ALICE; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + + assert_eq!(total_supply::(collection_id), 0); + + assert_ok!(mint::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + owner.clone(), + 0, + None, + )); + + assert_eq!(total_supply::(collection_id), 1); + }); + } #[test] - fn item_metadata_works() {} + fn item_metadata_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let metadata = b"Test Item Metadata"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + + assert_ok!(set_metadata::( + RuntimeOrigin::signed(owner.clone()), + collection_id, + item_id, + BoundedVec::truncate_from(metadata.to_vec()), + )); + + let expected_metadata = item_metadata::(collection_id, item_id).unwrap(); + assert_eq!( + String::from_utf8_lossy(&expected_metadata), + String::from_utf8_lossy(metadata) + ); + }); + } #[test] - fn get_attribute_0_works() {} + fn get_attribute_0_works() { + let collection_id: u32 = 0; + let owner = ALICE; + let key = "dummy attribute"; + let value = "Test Collection"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection(owner.clone()); + set_attribute(collection_id, None, key, value); + + let expected_value = get_attribute::( + collection_id, + None, + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + ) + .unwrap(); + assert_eq!(String::from_utf8_lossy(&expected_value), value); + }); + } #[test] - fn get_attribute_1_works() {} + fn get_attribute_1_works() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = ALICE; + let key = "dummy attribute"; + let value = "Test Item"; + ExtBuilder::new() + .with_balances(vec![(owner.clone(), 10_000_000)]) + .build() + .execute_with(|| { + create_collection_and_mint(owner.clone(), collection_id, item_id); + set_attribute(collection_id, Some(item_id), key, value); + + let expected_value = get_attribute::( + collection_id, + Some(item_id), + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.as_bytes().to_vec()), + ) + .unwrap(); + assert_eq!(String::from_utf8_lossy(&expected_value), value); + }); + } fn create_collection_and_mint(owner: AccountIdOf, collection_id: u32, item_id: u32) { create_collection(owner.clone()); @@ -768,13 +1403,11 @@ mod tests { fn call_precompile::RustType>>( origin: &AccountId, - token: u32, input: &INonfungiblesCalls, ) -> Result { - let address = prefixed_address(NONFUNGIBLES, token); bare_call::( RuntimeOrigin::signed(origin.clone()), - address.into(), + ADDRESS.into(), 0, Weight::MAX, DepositLimit::Balance(u128::MAX), From 02021dba4ff969bcec15e827812b506649583c1b Mon Sep 17 00:00:00 2001 From: chungquantin Date: Wed, 16 Jul 2025 15:26:06 +0700 Subject: [PATCH 161/162] feat: benchmarking partially --- pallets/api-vnext/src/mock.rs | 2 + pallets/api-vnext/src/nonfungibles.rs | 16 + .../src/nonfungibles/benchmarking.rs | 722 ++++++++++++++++++ .../api-vnext/src/nonfungibles/precompiles.rs | 8 +- 4 files changed, 742 insertions(+), 6 deletions(-) create mode 100644 pallets/api-vnext/src/nonfungibles/benchmarking.rs diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 115a84bda..50b98a88e 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -132,6 +132,8 @@ impl pallet_nfts::Config for Test { type StringLimit = ConstU32<50>; type ValueLimit = ConstU32<50>; type WeightInfo = (); + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); } #[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)] diff --git a/pallets/api-vnext/src/nonfungibles.rs b/pallets/api-vnext/src/nonfungibles.rs index e76d2b5d4..405407352 100644 --- a/pallets/api-vnext/src/nonfungibles.rs +++ b/pallets/api-vnext/src/nonfungibles.rs @@ -12,6 +12,8 @@ use pallet_nfts::{ use super::*; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; pub mod precompiles; #[cfg(test)] mod tests; @@ -21,6 +23,20 @@ type CollectionIdOf = as Inspect<::AccountId>>::CollectionId; type ItemIdOf = as Inspect<::AccountId>>::ItemId; +#[frame_support::pallet] +pub mod pallet { + use super::*; + + #[pallet::config] + pub trait Config: frame_system::Config { + /// Weight information for precompiles in this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + pub struct Pallet(_); +} + fn approve, I>( origin: OriginFor, collection: CollectionIdOf, diff --git a/pallets/api-vnext/src/nonfungibles/benchmarking.rs b/pallets/api-vnext/src/nonfungibles/benchmarking.rs new file mode 100644 index 000000000..cb9940ace --- /dev/null +++ b/pallets/api-vnext/src/nonfungibles/benchmarking.rs @@ -0,0 +1,722 @@ +//! Benchmarking setup for pallet_api::nonfungibles::precompiles + +use alloc::{string::String, vec}; + +use frame_benchmarking::v2::*; +use frame_support::{ + assert_ok, + pallet_prelude::IsType, + sp_runtime::traits::StaticLookup, + traits::{ + fungible::{Inspect, Mutate}, + Get, Time, + }, + BoundedVec, +}; +use frame_system::pallet_prelude::OriginFor; +use pallet_nfts::{AttributeNamespace, CollectionConfig, CollectionSettings, MintSettings}; +use pallet_revive::{ + precompiles::{ + alloy::primitives as alloy, + run::{CallSetup, WasmModule, H256, U256}, + }, + test_utils::{ALICE_ADDR, BOB_ADDR}, + AddressMapper as _, Origin, +}; + +use super::{ + precompiles::v0::{INonfungibles, INonfungiblesCalls}, + Config, NextCollectionId, +}; +#[cfg(test)] +use crate::mock::ExtBuilder; +use crate::{call_precompile, fixed_address}; + +const NONFUNGIBLES: u16 = 101; +const ADDRESS: [u8; 20] = fixed_address(NONFUNGIBLES); + +type AddressMapper = ::AddressMapper; +type Nfts = pallet_nfts::Pallet; +type CollectionId = >::CollectionId; +type ItemId = >::ItemId; +type Balances = ::Currency; +type Nonfungibles = super::precompiles::v0::Nonfungibles; + +#[instance_benchmarks( + where + // Precompiles + T: pallet_revive::Config< + Currency: Inspect<::AccountId, Balance: Into + TryFrom>, + Hash: IsType, + Time: Time> + >, + // Nonfungibles + T: pallet_nfts::Config + Into, ItemId: Default + From> +)] +mod benchmarks { + use super::*; + + #[benchmark] + fn approve() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let operator = >::to_account_id(&BOB_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::approve_1(INonfungibles::approve_1Call { + collection: collection_id.into(), + item: item_id.into(), + operator: >::to_address(&operator).0.into(), + approved: true, + deadline: 0, + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + // Verify approval was set + assert!(check_allowance::(collection_id, owner, operator, Some(item_id))); + } + + #[benchmark] + fn transfer() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let to = >::to_account_id(&BOB_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::transfer(INonfungibles::transferCall { + collection: collection_id.into(), + to: >::to_address(&to).0.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + + // Verify transfer occurred + assert_eq!(get_owner_of::(collection_id, item_id), Some(to)); + } + + #[benchmark] + fn create() { + let admin = >::to_account_id(&ALICE_ADDR); + let creator = >::to_account_id(&BOB_ADDR); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(creator.clone())); + let mut ext = call_setup.ext().0; + let config = default_collection_config::(); + let config_bytes = codec::Encode::encode(&config); + let input = INonfungiblesCalls::create(INonfungibles::createCall { + admin: >::to_address(&admin).0.into(), + config: config_bytes.into(), + }); + + #[block] + { + let collection_id = + call_precompile::, _, u32>(&mut ext, &ADDRESS, &input).unwrap(); + assert_eq!(collection_id, 0); + } + } + + #[benchmark] + fn destroy() { + let collection_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let witness = + pallet_nfts::DestroyWitness { item_metadatas: 0, item_configs: 0, attributes: 0 }; + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::destroy(INonfungibles::destroyCall { + collection: collection_id.into(), + witness: codec::Encode::encode(&witness).into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn set_attribute() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let key = b"test_key"; + let value = b"test_value"; + let namespace: AttributeNamespace> = AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::setAttribute_1(INonfungibles::setAttribute_1Call { + collection: collection_id.into(), + item: item_id.into(), + namespace: namespace_bytes.clone().into(), + key: key.to_vec().into(), + value: value.to_vec().into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn clear_attribute() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let key = b"test_key"; + let namespace: AttributeNamespace> = AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + set_item_attribute::(collection_id, Some(item_id), key, b"test_value"); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::clearAttribute_1(INonfungibles::clearAttribute_1Call { + collection: collection_id.into(), + item: item_id.into(), + namespace: namespace_bytes.clone().into(), + key: key.to_vec().into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn set_metadata() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let metadata = b"test metadata"; + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::setMetadata_0(INonfungibles::setMetadata_0Call { + collection: collection_id.into(), + item: item_id.into(), + data: metadata.to_vec().into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn clear_metadata() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + set_item_metadata::(owner.clone(), collection_id, item_id, b"test metadata"); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::clearMetadata_1(INonfungibles::clearMetadata_1Call { + collection: collection_id.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn set_max_supply() { + let collection_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let max_supply: u32 = 1000; + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::setMaxSupply(INonfungibles::setMaxSupplyCall { + collection: collection_id.into(), + maxSupply: max_supply.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn approve_item_attributes() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let delegate = >::to_account_id(&BOB_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = + INonfungiblesCalls::approveItemAttributes(INonfungibles::approveItemAttributesCall { + collection: collection_id.into(), + item: item_id.into(), + delegate: >::to_address(&delegate).0.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn cancel_item_attributes_approval() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let delegate = >::to_account_id(&BOB_ADDR); + let witness = pallet_nfts::CancelAttributesApprovalWitness { account_attributes: 0 }; + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::cancelItemAttributesApproval( + INonfungibles::cancelItemAttributesApprovalCall { + collection: collection_id.into(), + item: item_id.into(), + delegate: >::to_address(&delegate).0.into(), + witness: codec::Encode::encode(&witness).into(), + }, + ); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn clear_all_approvals() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::clearAllApprovals(INonfungibles::clearAllApprovalsCall { + collection: collection_id.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn clear_collection_approvals(l: Linear<1, 1000>) { + let collection_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::clearCollectionApprovals( + INonfungibles::clearCollectionApprovalsCall { + collection: collection_id.into(), + limit: l.into(), + }, + ); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn mint() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let to = >::to_account_id(&BOB_ADDR); + let witness: pallet_nfts::MintWitness<_, >::Balance> = + pallet_nfts::MintWitness { owned_item: Some(0), mint_price: None }; + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::mint(INonfungibles::mintCall { + collection: collection_id.into(), + to: >::to_address(&to).0.into(), + item: item_id.into(), + witness: codec::Encode::encode(&witness).into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn burn() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + call_setup.set_origin(Origin::Signed(owner.clone())); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::burn(INonfungibles::burnCall { + collection: collection_id.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, ()>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn balance_of() { + let collection_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::balanceOf(INonfungibles::balanceOfCall { + collection: collection_id.into(), + owner: >::to_address(&owner).0.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, u32>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn owner_of() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::ownerOf(INonfungibles::ownerOfCall { + collection: collection_id.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, alloy::Address>( + &mut ext, &ADDRESS, &input + )); + } + } + + #[benchmark] + fn allowance() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let operator = >::to_account_id(&BOB_ADDR); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::allowance_1(INonfungibles::allowance_1Call { + collection: collection_id.into(), + owner: >::to_address(&owner).0.into(), + operator: >::to_address(&operator).0.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, bool>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn total_supply() { + let collection_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + + create_collection::(owner.clone()); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::totalSupply(INonfungibles::totalSupplyCall { + collection: collection_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, u32>(&mut ext, &ADDRESS, &input)); + } + } + + #[benchmark] + fn get_attribute() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let key = b"test_key"; + let value = b"test_value"; + let namespace: AttributeNamespace> = AttributeNamespace::CollectionOwner; + let namespace_bytes = codec::Encode::encode(&namespace); + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + set_item_attribute::(collection_id, Some(item_id), key, value); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::getAttribute_1(INonfungibles::getAttribute_1Call { + collection: collection_id.into(), + item: item_id.into(), + namespace: namespace_bytes.clone().into(), + key: key.to_vec().into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, String>( + &mut ext, &ADDRESS, &input + )); + } + } + + #[benchmark] + fn item_metadata() { + let collection_id: u32 = 0; + let item_id: u32 = 0; + let owner = >::to_account_id(&ALICE_ADDR); + let metadata = b"test metadata"; + + create_collection_and_mint::(owner.clone(), collection_id, item_id); + set_item_metadata::(owner.clone(), collection_id, item_id, metadata); + + let mut call_setup = set_up_call(); + let mut ext = call_setup.ext().0; + let input = INonfungiblesCalls::itemMetadata(INonfungibles::itemMetadataCall { + collection: collection_id.into(), + item: item_id.into(), + }); + + #[block] + { + assert_ok!(call_precompile::, _, String>( + &mut ext, &ADDRESS, &input + )); + } + } + + impl_benchmark_test_suite!(pallet_nfts::Pallet, ExtBuilder::new().build(), crate::mock::Test); +} + +// Helper functions +fn create_collection< + T: Config + pallet_nfts::Config + pallet_revive::Config, + I: 'static, +>( + owner: T::AccountId, +) -> CollectionId { + let collection_id = NextCollectionId::::get().unwrap_or_default(); + >::set_balance(&owner, u32::MAX.into()); + assert_ok!(>::create( + OriginFor::::Signed(owner.clone()), + T::Lookup::unlookup(owner.clone()), + default_collection_config::(), + )); + collection_id +} + +fn create_collection_and_mint< + T: Config + + pallet_nfts::Config, ItemId: From> + + pallet_revive::Config, + I: 'static, +>( + owner: T::AccountId, + collection_id: u32, + item_id: u32, +) { + create_collection::(owner.clone()); + assert_ok!(>::mint( + OriginFor::::Signed(owner.clone()), + collection_id.into(), + item_id.into(), + T::Lookup::unlookup(owner.clone()), + None, + )); +} + +fn default_collection_config + pallet_nfts::Config, I: 'static>( +) -> CollectionConfigFor { + CollectionConfig { + settings: CollectionSettings::all_enabled(), + max_supply: None, + mint_settings: MintSettings::default(), + } +} + +fn set_item_attribute< + T: Config + + pallet_nfts::Config, ItemId: From> + + pallet_revive::Config, + I: 'static, +>( + collection_id: u32, + item_id: Option, + key: &[u8], + value: &[u8], +) { + let owner = >::to_account_id(&ALICE_ADDR); + assert_ok!(>::set_attribute( + OriginFor::::Signed(owner.clone()), + collection_id.into(), + item_id.map(|id| id.into()), + AttributeNamespace::CollectionOwner, + BoundedVec::truncate_from(key.to_vec()), + BoundedVec::truncate_from(value.to_vec()), + )); +} + +fn set_item_metadata< + T: Config + pallet_nfts::Config, ItemId: From>, + I: 'static, +>( + owner: T::AccountId, + collection_id: u32, + item_id: u32, + metadata: &[u8], +) { + assert_ok!(>::set_metadata( + OriginFor::::Signed(owner.clone()), + collection_id.into(), + item_id.into(), + BoundedVec::truncate_from(metadata.to_vec()), + )); +} + +fn set_collection_metadata< + T: Config + pallet_nfts::Config>, + I: 'static, +>( + owner: T::AccountId, + collection_id: u32, + metadata: &[u8], +) { + assert_ok!(>::set_collection_metadata( + OriginFor::::Signed(owner.clone()), + collection_id.into(), + BoundedVec::truncate_from(metadata.to_vec()), + )); +} + +fn check_allowance< + T: Config + pallet_nfts::Config, ItemId: From>, + I: 'static, +>( + collection_id: u32, + owner: T::AccountId, + operator: T::AccountId, + item_id: Option, +) -> bool { + >::check_approval_permission( + &collection_id.into(), + &item_id.map(|id| id.into()), + &owner, + &operator, + ) + .is_ok() +} + +fn get_owner_of< + T: Config + pallet_nfts::Config, ItemId: From>, + I: 'static, +>( + collection_id: u32, + item_id: u32, +) -> Option { + >::owner(collection_id.into(), item_id.into()) +} + +fn set_up_call< + T: pallet_revive::Config< + Currency: Inspect< + ::AccountId, + Balance: Into + TryFrom, + >, + Hash: IsType, + Time: Time>, + >, +>() -> CallSetup { + CallSetup::::new(WasmModule::dummy()) +} + +// Type aliases for cleaner code +type AccountIdOf = ::AccountId; +type CollectionConfigFor = pallet_nfts::CollectionConfigFor; +type DepositBalanceOf = pallet_nfts::DepositBalanceOf; diff --git a/pallets/api-vnext/src/nonfungibles/precompiles.rs b/pallets/api-vnext/src/nonfungibles/precompiles.rs index d7a33ad0c..a8a254237 100644 --- a/pallets/api-vnext/src/nonfungibles/precompiles.rs +++ b/pallets/api-vnext/src/nonfungibles/precompiles.rs @@ -1,11 +1,7 @@ use alloc::string::String; -pub(super) use pallet_revive::precompiles::alloy::primitives::U256; -use pallet_revive::precompiles::{ - alloy::sol_types::{Revert, SolCall}, - AddressMatcher::Fixed, - RuntimeCosts, -}; +pub(super) use pallet_revive::precompiles::alloy::{primitives::U256, sol_types::SolCall}; +use pallet_revive::precompiles::{alloy::sol_types::Revert, AddressMatcher::Fixed, RuntimeCosts}; // use weights::WeightInfo; use super::*; From c588340396abc985d1ced4d970aa116a123e645d Mon Sep 17 00:00:00 2001 From: chungquantin Date: Wed, 16 Jul 2025 15:26:49 +0700 Subject: [PATCH 162/162] feat: benchmarking partially --- pallets/api-vnext/src/mock.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/api-vnext/src/mock.rs b/pallets/api-vnext/src/mock.rs index 50b98a88e..eee31bccf 100644 --- a/pallets/api-vnext/src/mock.rs +++ b/pallets/api-vnext/src/mock.rs @@ -118,6 +118,8 @@ impl pallet_nfts::Config for Test { type DepositPerByte = ConstU128<1>; type Features = NftsPalletFeatures; type ForceOrigin = frame_system::EnsureRoot; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); type ItemAttributesApprovalsLimit = ConstU32<2>; type ItemDeposit = ConstU128<1>; type ItemId = u32; @@ -132,8 +134,6 @@ impl pallet_nfts::Config for Test { type StringLimit = ConstU32<50>; type ValueLimit = ConstU32<50>; type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type Helper = (); } #[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)]