Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,549 changes: 9,581 additions & 3,968 deletions Cargo.lock

Large diffs are not rendered by default.

283 changes: 140 additions & 143 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/rpc-core/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = { workspace = true }
version = "0.1.0"

[dependencies]
ethereum = { workspace = true, features = [ "with-codec" ] }
ethereum = { workspace = true, features = [ "with-scale" ] }
ethereum-types = { workspace = true, features = [ "std" ] }
futures = { workspace = true, features = [ "compat" ] }
jsonrpsee = { workspace = true, features = [ "macros", "server" ] }
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/txpool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = { workspace = true }
version = "0.6.0"

[dependencies]
ethereum = { workspace = true, features = [ "std", "with-codec" ] }
ethereum = { workspace = true, features = [ "std", "with-scale" ] }
ethereum-types = { workspace = true, features = [ "std" ] }
jsonrpsee = { workspace = true, features = [ "macros", "server" ] }
serde = { workspace = true, features = [ "derive" ] }
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sp-runtime = { workspace = true, features = [ "std" ] }
sp-trie = { workspace = true, features = [ "std" ] }

# Frontier
ethereum = { workspace = true, features = [ "std", "with-codec" ] }
ethereum = { workspace = true, features = [ "std", "with-scale" ] }
ethereum-types = { workspace = true, features = [ "std" ] }
fc-consensus = { workspace = true }
fc-db = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/trace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = { workspace = true }
version = "0.6.0"

[dependencies]
ethereum = { workspace = true, features = [ "with-codec" ] }
ethereum = { workspace = true, features = [ "with-scale" ] }
ethereum-types = { workspace = true }
futures = { workspace = true }
jsonrpsee = { workspace = true, features = [ "macros", "server" ] }
Expand Down
30 changes: 15 additions & 15 deletions pallets/asset-manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
[package]
name = "pallet-asset-manager"
authors = { workspace = true }
authors = ["PureStake"]
edition = "2021"
version = "0.1.0"

[dependencies]
log = { workspace = true }
serde = { workspace = true, optional = true }
log = { version = "0.4.21", default-features = false }
serde = { version = "1.0.197", default-features = false, optional = true }

# Moonbeam
xcm-primitives = { workspace = true }
xcm-primitives = { path = "../../primitives/xcm", default-features = false }

# Substrate
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true, features = [ "derive" ] }
scale-info = { workspace = true, features = [ "derive" ] }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
parity-scale-codec = { version = "3.6.5", default-features = false, features = [ "derive" ] }
scale-info = { version = "2.10.0", default-features = false, features = [ "derive" ] }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Polkadot
xcm = { workspace = true }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Benchmarks
frame-benchmarking = { workspace = true, optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false, optional = true }

[dev-dependencies]
pallet-balances = { workspace = true, features = [ "insecure_zero_ed", "std" ] }
sp-core = { workspace = true, features = [ "std" ] }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "insecure_zero_ed", "std" ] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "std" ] }

[features]
default = [ "std" ]
Expand Down
49 changes: 29 additions & 20 deletions pallets/erc20-xcm-bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
[package]
name = "pallet-erc20-xcm-bridge"
authors = { workspace = true }
authors = ["PureStake"]
edition = "2021"
version = "1.0.0"

[dependencies]
environmental = { workspace = true }
ethereum-types = { workspace = true }
serde = { workspace = true, optional = true, features = ["derive"] }
log = { workspace = true }
environmental = { version = "1.1.4", default-features = false }
ethereum = { git = "https://github.com/rust-ethereum/ethereum", rev = "3be0d8fd4c2ad1ba216b69ef65b9382612efc8ba", default-features = false, features = ["with-scale"] }
ethereum-types = { version = "0.15.1", default-features = false }
serde = { version = "1.0.197", default-features = false, optional = true, features = ["derive"] }
log = { version = "0.4.21", default-features = false }

# Substrate
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.6", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Frontier
fp-evm = { workspace = true }
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
fp-evm = { git = "https://github.com/OpenZeppelin/frontier", branch = "polkadot-branch-stable2412", default-features = false }
pallet-evm = { git = "https://github.com/OpenZeppelin/frontier", branch = "polkadot-branch-stable2412", default-features = false, features = ["forbid-evm-reentrancy"] }

# Moonbeam
xcm-primitives = { path = "../../primitives/xcm", default-features = false }

#Polkadot / XCM
xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

[dev-dependencies]
pallet-balances = { workspace = true, features = ["insecure_zero_ed", "std"] }
pallet-timestamp = { workspace = true }
sp-core = { workspace = true, features = ["std"] }
sp-io = { workspace = true, features = ["std"] }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = ["insecure_zero_ed", "std"] }
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = ["std"] }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = ["std"] }

[features]
default = ["std"]
std = [
"environmental/std",
"ethereum/std",
"ethereum-types/std",
"fp-evm/std",
"frame-support/std",
"frame-system/std",
Expand All @@ -47,7 +54,9 @@ std = [
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
"sp-weights/std",
"xcm-executor/std",
"xcm-primitives/std",
"xcm/std",
]
try-runtime = ["frame-support/try-runtime"]
12 changes: 6 additions & 6 deletions pallets/erc20-xcm-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ pub mod pallet {
use crate::erc20_matcher::*;
use crate::errors::*;
use crate::xcm_holding_ext::*;
use ethereum_types::BigEndianHash;
use ethereum_types::{H160, H256, U256};
use fp_evm::{ExitReason, ExitSucceed};
use frame_support::pallet_prelude::*;
use pallet_evm::{GasWeightMapping, Runner};
use sp_core::{H160, H256, U256};
use sp_std::vec::Vec;
use sp_weights::Weight;
use xcm::latest::{
Asset, AssetId, Error as XcmError, Junction, Location, Result as XcmResult, XcmContext,
};
Expand Down Expand Up @@ -109,9 +109,10 @@ pub mod pallet {
// append receiver address
input.extend_from_slice(H256::from(to).as_bytes());
// append amount to be transferred
input.extend_from_slice(H256::from_uint(&amount).as_bytes());
let amount_bytes = amount.to_big_endian();
input.extend_from_slice(&amount_bytes);

let weight_limit: Weight = T::GasWeightMapping::gas_to_weight(gas_limit, true);
let weight_limit = T::GasWeightMapping::gas_to_weight(gas_limit, true);

let exec_info = T::EvmRunner::call(
from,
Expand Down Expand Up @@ -140,8 +141,7 @@ pub mod pallet {
);

// return value is true.
let mut bytes = [0u8; 32];
U256::from(1).to_big_endian(&mut bytes);
let bytes = U256::from(1).to_big_endian();

// Check return value to make sure not calling on empty contracts.
ensure!(
Expand Down
2 changes: 1 addition & 1 deletion pallets/ethereum-xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "1.0.0-dev"
targets = [ "x86_64-unknown-linux-gnu" ]

[dependencies]
ethereum = { workspace = true, features = [ "with-codec" ] }
ethereum = { workspace = true, features = [ "with-scale" ] }
serde = { workspace = true, optional = true }

# Parity
Expand Down
44 changes: 22 additions & 22 deletions pallets/xcm-transactor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
[package]
name = "pallet-xcm-transactor"
authors = { workspace = true }
authors = ["PureStake"]
edition = "2021"
version = "0.2.0"

[dependencies]
log = { version = "0.4", default-features = false }
serde = { workspace = true }
log = { version = "0.4.21", default-features = false }
serde = { version = "1.0.197", default-features = false }

# Moonbeam
xcm-primitives = { workspace = true }
xcm-primitives = { path = "../../primitives/xcm", default-features = false }

# Substrate
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true, features = [ "derive" ] }
scale-info = { workspace = true, features = [ "derive" ] }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
parity-scale-codec = { version = "3.6.5", default-features = false, features = [ "derive" ] }
scale-info = { version = "2.10.0", default-features = false, features = [ "derive" ] }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Cumulus
cumulus-primitives-core = { workspace = true }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Polkadot / XCM
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false }

# Benchmarks
frame-benchmarking = { workspace = true, optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", default-features = false, optional = true }

[dev-dependencies]
pallet-balances = { workspace = true, features = [ "insecure_zero_ed", "std" ] }
pallet-timestamp = { workspace = true, features = [ "std" ] }
pallet-xcm = { workspace = true, features = [ "std" ] }
parity-scale-codec = { workspace = true, features = [ "std" ] }
sp-core = { workspace = true, features = [ "std" ] }
sp-runtime = { workspace = true }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "insecure_zero_ed", "std" ] }
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "std" ] }
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "std" ] }
parity-scale-codec = { version = "3.6.5", features = [ "std" ] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524", features = [ "std" ] }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "110d90bb85f866cc757287526022a66f3d576524" }

[features]
default = [ "std" ]
Expand Down
28 changes: 14 additions & 14 deletions pallets/xcm-transactor/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ benchmarks! {
let location = Location::parent();
}: _(
RawOrigin::Root,
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
None
Expand All @@ -70,12 +70,12 @@ benchmarks! {
let location = Location::parent();
Pallet::<T>::set_transact_info(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
None
).expect("must succeed");
}: _(RawOrigin::Root, Box::new(xcm::VersionedLocation::V4(location.clone())))
}: _(RawOrigin::Root, Box::new(xcm::VersionedLocation::V5(location.clone())))
verify {
assert!(Pallet::<T>::transact_info(&location).is_none());
}
Expand All @@ -85,7 +85,7 @@ benchmarks! {
let location = Location::parent();
}: _(
RawOrigin::Root,
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
fee_per_second
)
verify {
Expand All @@ -105,14 +105,14 @@ benchmarks! {
let user: T::AccountId = account("account id", 0u32, 0u32);
Pallet::<T>::set_transact_info(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
Some(extra_weight)
).expect("must succeed");
Pallet::<T>::set_fee_per_second(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
fee_per_second
).expect("must succeed");
Pallet::<T>::register(
Expand Down Expand Up @@ -162,21 +162,21 @@ benchmarks! {
let user: T::AccountId = account("account id", 0u32, 0u32);
Pallet::<T>::set_transact_info(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
Some(extra_weight)
).expect("must succeed");
Pallet::<T>::set_fee_per_second(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
fee_per_second
).expect("must succeed");
}: {

let result = Pallet::<T>::transact_through_sovereign(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
Some(user.clone()),
CurrencyPayment {
// This might involve a db Read when translating, therefore worst case
Expand Down Expand Up @@ -215,19 +215,19 @@ benchmarks! {
let user: T::AccountId = account("account id", 0u32, 0u32);
Pallet::<T>::set_transact_info(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
Some(extra_weight)
).expect("must succeed");
Pallet::<T>::set_fee_per_second(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
fee_per_second
).expect("must succeed");
}: _(
RawOrigin::Signed(user.clone()),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
CurrencyPayment {
// This might involve a db Read when translating, therefore worst case
currency: Currency::AsCurrencyId(currency),
Expand All @@ -254,14 +254,14 @@ benchmarks! {
let user: T::AccountId = account("account id", 0u32, 0u32);
Pallet::<T>::set_transact_info(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
extra_weight,
max_weight,
Some(extra_weight)
).expect("must succeed");
Pallet::<T>::set_fee_per_second(
RawOrigin::Root.into(),
Box::new(xcm::VersionedLocation::V4(location.clone())),
Box::new(xcm::VersionedLocation::V5(location.clone())),
fee_per_second
).expect("must succeed");
}: _(
Expand Down
Loading