--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5504,7 +5504,6 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
- "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
@@ -6067,33 +6066,10 @@
"frame-support",
"frame-system",
"pallet-ethereum",
- "pallet-evm",
- "parity-scale-codec 3.1.2",
- "scale-info",
- "sp-core",
- "sp-std",
- "up-data-structs",
-]
-
-[[package]]
-name = "pallet-evm-collection"
-version = "0.1.0"
-dependencies = [
- "ethereum",
- "evm-coder",
- "fp-evm-mapping",
- "frame-support",
- "frame-system",
- "log",
- "pallet-common",
"pallet-evm",
- "pallet-evm-coder-substrate",
- "pallet-nonfungible",
"parity-scale-codec 3.1.2",
"scale-info",
- "serde-json-core",
"sp-core",
- "sp-runtime",
"sp-std",
"up-data-structs",
]
@@ -6849,6 +6825,8 @@
"pallet-evm",
"parity-scale-codec 3.1.2",
"scale-info",
+ "serde",
+ "serde-json-core",
"sp-core",
"sp-io",
"sp-runtime",
@@ -8808,7 +8786,6 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
- "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
@@ -12880,7 +12857,6 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
- "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json
-COLLECTION_STUBS=./pallets/evm-collection/src/stubs/
+COLLECTION_STUBS=./pallets/unique/src/eth/stubs/
COLLECTION_ABI=./tests/src/eth/collectionAbi.json
TESTS_API=./tests/src/eth/api/
@@ -36,8 +36,8 @@
PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
Collection.sol:
- PACKAGE=pallet-evm-collection NAME=eth::collection_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
- PACKAGE=pallet-evm-collection NAME=eth::collection_impl OUTPUT=$(COLLECTION_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
+ PACKAGE=pallet-unique NAME=eth::pallet_evm_collection::collection_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+ PACKAGE=pallet-unique NAME=eth::pallet_evm_collection::collection_impl OUTPUT=$(COLLECTION_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
UniqueFungible: UniqueFungible.sol
INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw ./.maintain/scripts/compile_stub.sh
--- a/pallets/evm-collection/Cargo.toml
+++ /dev/null
@@ -1,51 +0,0 @@
-[package]
-name = "pallet-evm-collection"
-version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
-
-[dependencies]
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-ethereum = { version = "0.12.0", default-features = false }
-log = { default-features = false, version = "0.4.14" }
-serde-json-core = { version = "0.4", default-features = false }
-
-# Substrate
-frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
-frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
-sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
-sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
-sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
-
-# Unique
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.21-logs" }
-fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.21-logs" }
-
-# Locals
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-common = { default-features = false, path = '../../pallets/common' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
-pallet-nonfungible = { default-features = false, path = '../../pallets/nonfungible' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = ["serde1"] }
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[features]
-default = ["std"]
-std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "sp-core/std",
- "evm-coder/std",
- "pallet-evm-coder-substrate/std",
- "pallet-evm/std",
- "serde-json-core/std",
-]
--- a/pallets/evm-collection/src/eth.rs
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see .
-
-use core::marker::PhantomData;
-use evm_coder::{abi::AbiWriter, execution::*, generate_stubgen, solidity_interface, types::*, ToLog};
-use ethereum as _;
-use pallet_common::CollectionById;
-use pallet_common::{CollectionHandle};
-use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
-use pallet_evm::{
- ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure,
- account::CrossAccountId, Pallet as PalletEvm,
-};
-use sp_core::H160;
-use up_data_structs::{
- CreateCollectionData, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
- MAX_COLLECTION_NAME_LENGTH,
-};
-use crate::{Config, Pallet};
-use frame_support::traits::Get;
-
-use sp_std::{vec::Vec, rc::Rc};
-use alloc::format;
-
-struct EvmCollection(SubstrateRecorder);
-impl WithRecorder for EvmCollection {
- fn recorder(&self) -> &SubstrateRecorder {
- &self.0
- }
-
- fn into_recorder(self) -> SubstrateRecorder {
- self.0
- }
-}
-
-#[derive(ToLog)]
-pub enum EthCollectionEvent {
- CollectionCreated {
- #[indexed]
- owner: address,
- #[indexed]
- collection_id: address,
- },
-}
-
-#[solidity_interface(name = "Collection")]
-impl EvmCollection {
- fn create_721_collection(
- &self,
- caller: caller,
- name: string,
- description: string,
- token_prefix: string,
- ) -> Result {
- let caller = T::CrossAccountId::from_eth(caller);
- let name = name
- .encode_utf16()
- .collect::>()
- .try_into()
- .map_err(|_| error_feild_too_long("name", MAX_COLLECTION_NAME_LENGTH))?;
- let description = description
- .encode_utf16()
- .collect::>()
- .try_into()
- .map_err(|_| error_feild_too_long("description", MAX_COLLECTION_DESCRIPTION_LENGTH))?;
- let token_prefix = token_prefix
- .into_bytes()
- .try_into()
- .map_err(|_| error_feild_too_long("token_prefix", MAX_TOKEN_PREFIX_LENGTH))?;
-
- let data = CreateCollectionData {
- name,
- description,
- token_prefix,
- ..Default::default()
- };
-
- let collection_id =
- >::init_collection(caller.as_sub().clone(), data)
- .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
-
- let address = pallet_common::eth::collection_id_to_address(collection_id);
- >::deposit_log(
- EthCollectionEvent::CollectionCreated {
- owner: *caller.as_eth(),
- collection_id: address,
- }
- .to_log(address),
- );
- Ok(address)
- }
-
- fn set_sponsor(
- &self,
- caller: caller,
- collection_address: address,
- sponsor: address,
- ) -> Result {
- let mut collection = collection_from_address(collection_address, &self.0)?;
- check_is_owner(caller, &collection)?;
-
- let sponsor = T::CrossAccountId::from_eth(sponsor);
- collection.set_sponsor(sponsor.as_sub().clone());
- collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
- Ok(()).map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
- Ok(())
- }
-
- fn confirm_sponsorship(&self, caller: caller, collection_address: address) -> Result {
- let mut collection = collection_from_address(collection_address, &self.0)?;
- let caller = T::CrossAccountId::from_eth(caller);
- if !collection.confirm_sponsorship(caller.as_sub()) {
- return Err(Error::Revert("Caller is not set as sponsor".into()));
- }
- collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
- Ok(())
- }
-
- fn set_limits(
- &self,
- caller: caller,
- collection_address: address,
- limits_json: string,
- ) -> Result {
- let mut collection = collection_from_address(collection_address, &self.0)?;
- check_is_owner(caller, &collection)?;
-
- let limits = serde_json_core::from_str(limits_json.as_ref())
- .map_err(|e| Error::Revert(format!("Parse JSON error: {}", e)))?;
- collection.limits = limits.0;
- collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
- Ok(())
- }
-}
-
-fn error_feild_too_long(feild: &str, bound: u32) -> Error {
- Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
-}
-
-fn collection_from_address(
- collection_address: address,
- recorder: &SubstrateRecorder,
-) -> Result> {
- let collection_id = pallet_common::eth::map_eth_to_id(&collection_address)
- .ok_or(Error::Revert("Contract is not an unique collection".into()))?;
- let collection =
- pallet_common::CollectionHandle::new_with_gas_limit(collection_id, recorder.gas_left())
- .ok_or(Error::Revert("Create collection handle error".into()))?;
- Ok(collection)
-}
-
-fn check_is_owner(caller: caller, collection: &CollectionHandle) -> Result<()> {
- let caller = T::CrossAccountId::from_eth(caller);
- collection
- .check_is_owner(&caller)
- .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?;
- Ok(())
-}
-
-pub struct CollectionOnMethodCall(PhantomData<*const T>);
-impl OnMethodCall for CollectionOnMethodCall {
- fn is_reserved(contract: &sp_core::H160) -> bool {
- contract == &T::ContractAddress::get()
- }
-
- fn is_used(contract: &sp_core::H160) -> bool {
- contract == &T::ContractAddress::get()
- }
-
- fn call(
- source: &sp_core::H160,
- target: &sp_core::H160,
- gas_left: u64,
- input: &[u8],
- value: sp_core::U256,
- ) -> Option {
- if target != &T::ContractAddress::get() {
- return None;
- }
-
- let helpers = EvmCollection::(SubstrateRecorder::new(gas_left));
- pallet_evm_coder_substrate::call(*source, helpers, value, input)
- }
-
- fn get_code(contract: &sp_core::H160) -> Option> {
- (contract == &T::ContractAddress::get())
- .then(|| include_bytes!("./stubs/Collection.raw").to_vec())
- }
-}
-
-generate_stubgen!(collection_impl, CollectionCall<()>, true);
-generate_stubgen!(collection_iface, CollectionCall<()>, false);
--- a/pallets/evm-collection/src/lib.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see .
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-extern crate alloc;
-
-pub use pallet::*;
-pub use eth::*;
-pub mod eth;
-
-#[frame_support::pallet]
-pub mod pallet {
- pub use super::*;
- use frame_support::pallet_prelude::*;
- use sp_core::H160;
-
- #[pallet::config]
- pub trait Config:
- frame_system::Config
- + pallet_evm_coder_substrate::Config
- + pallet_evm::account::Config
- + pallet_nonfungible::Config
- {
- type ContractAddress: Get;
- }
-
- #[pallet::error]
- pub enum Error {
- /// This method is only executable by owner
- NoPermission,
- }
-
- #[pallet::pallet]
- // #[pallet::generate_store(pub(super) trait Store)]
- pub struct Pallet(_);
-
- impl Pallet {}
-}
--- a/pallets/evm-collection/src/stubs/Collection.sol
+++ /dev/null
@@ -1,101 +0,0 @@
-// SPDX-License-Identifier: OTHER
-// This code is automatically generated
-
-pragma solidity >=0.8.0 <0.9.0;
-
-// Common stubs holder
-contract Dummy {
- uint8 dummy;
- string stub_error = "this contract is implemented in native";
-}
-
-contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
- require(false, stub_error);
- interfaceID;
- return true;
- }
-}
-
-// Selector: f83ad95b
-contract Collection is Dummy, ERC165 {
- // Selector: create721Collection(string,string,string) 951c0151
- function create721Collection(
- string memory name,
- string memory description,
- string memory tokenPrefix
- ) public view returns (address) {
- require(false, stub_error);
- name;
- description;
- tokenPrefix;
- dummy;
- return 0x0000000000000000000000000000000000000000;
- }
-
- // Selector: setSponsor(address,address) f01fba93
- function setSponsor(address collectionAddress, address sponsor)
- public
- view
- {
- require(false, stub_error);
- collectionAddress;
- sponsor;
- dummy;
- }
-
- // Selector: confirmSponsorship(address) abc00001
- function confirmSponsorship(address collectionAddress) public view {
- require(false, stub_error);
- collectionAddress;
- dummy;
- }
-
- // Selector: setOffchainSchema(address,string) 2c9d9d70
- function setOffchainSchema(address collectionAddress, string memory schema)
- public
- view
- {
- require(false, stub_error);
- collectionAddress;
- schema;
- dummy;
- }
-
- // Selector: setVariableOnChainSchema(address,string) 582691c3
- function setVariableOnChainSchema(
- address collectionAddress,
- string memory variable
- ) public view {
- require(false, stub_error);
- collectionAddress;
- variable;
- dummy;
- }
-
- // Selector: setConstOnChainSchema(address,string) 921456e7
- function setConstOnChainSchema(
- address collectionAddress,
- string memory constOnChain
- ) public view {
- require(false, stub_error);
- collectionAddress;
- constOnChain;
- dummy;
- }
-
- // Selector: setLimits(address,string) d05638cc
- function setLimits(address collectionAddress, string memory limitsJson)
- public
- view
- {
- require(false, stub_error);
- collectionAddress;
- limitsJson;
- dummy;
- }
-}
--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -19,6 +19,8 @@
runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
std = [
'codec/std',
+ 'serde/std',
+ 'serde-json-core/std',
'frame-support/std',
'frame-system/std',
'pallet-evm/std',
@@ -60,6 +62,20 @@
git = "https://github.com/paritytech/substrate"
branch = "polkadot-v0.9.21"
+# [dependencies.pallet-transaction-payment]
+# default-features = false
+# git = "https://github.com/paritytech/substrate"
+# branch = "polkadot-v0.9.21"
+
+[dependencies.serde]
+default-features = false
+features = ['derive']
+version = '1.0.130'
+
+[dependencies.serde-json-core]
+default-features = false
+version = "0.4"
+
[dependencies.sp-runtime]
default-features = false
git = "https://github.com/paritytech/substrate"
--- /dev/null
+++ b/pallets/unique/src/eth/stubs/Collection.sol
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: OTHER
+// This code is automatically generated
+
+pragma solidity >=0.8.0 <0.9.0;
+
+// Common stubs holder
+contract Dummy {
+ uint8 dummy;
+ string stub_error = "this contract is implemented in native";
+}
+
+contract ERC165 is Dummy {
+ function supportsInterface(bytes4 interfaceID)
+ external
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ interfaceID;
+ return true;
+ }
+}
+
+// Selector: 1e95830f
+contract Collection is Dummy, ERC165 {
+ // Selector: create721Collection(string,string,string) 951c0151
+ function create721Collection(
+ string memory name,
+ string memory description,
+ string memory tokenPrefix
+ ) public view returns (address) {
+ require(false, stub_error);
+ name;
+ description;
+ tokenPrefix;
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
+
+ // Selector: setSponsor(address,address) f01fba93
+ function setSponsor(address collectionAddress, address sponsor)
+ public
+ view
+ {
+ require(false, stub_error);
+ collectionAddress;
+ sponsor;
+ dummy;
+ }
+
+ // Selector: confirmSponsorship(address) abc00001
+ function confirmSponsorship(address collectionAddress) public view {
+ require(false, stub_error);
+ collectionAddress;
+ dummy;
+ }
+
+ // Selector: setLimits(address,string) d05638cc
+ function setLimits(address collectionAddress, string memory limitsJson)
+ public
+ view
+ {
+ require(false, stub_error);
+ collectionAddress;
+ limitsJson;
+ dummy;
+ }
+}
--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -46,6 +46,7 @@
CollectionHandle, Pallet as PalletCommon, CommonWeightInfo, dispatch::dispatch_call,
dispatch::CollectionDispatch,
};
+pub use eth::pallet_evm_collection;
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -74,7 +74,6 @@
'pallet-evm/std',
'pallet-evm-migration/std',
'pallet-evm-contract-helpers/std',
- 'pallet-evm-collection/std',
'pallet-evm-transaction-payment/std',
'pallet-evm-coder-substrate/std',
'pallet-ethereum/std',
@@ -418,7 +417,6 @@
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-collection = { path = '../../pallets/evm-collection', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -80,6 +80,7 @@
};
use smallvec::smallvec;
use codec::{Encode, Decode};
+use pallet_unique::pallet_evm_collection;
use fp_rpc::TransactionStatus;
use sp_runtime::{
traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},
@@ -1043,7 +1044,6 @@
EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
- EvmCollection: pallet_evm_collection::{Pallet} = 154,
}
);
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -74,7 +74,6 @@
'pallet-evm/std',
'pallet-evm-migration/std',
'pallet-evm-contract-helpers/std',
- 'pallet-evm-collection/std',
'pallet-evm-transaction-payment/std',
'pallet-evm-coder-substrate/std',
'pallet-ethereum/std',
@@ -423,7 +422,6 @@
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-collection = { path = '../../pallets/evm-collection', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -80,6 +80,7 @@
use smallvec::smallvec;
use codec::{Encode, Decode};
use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping, OnMethodCall};
+use pallet_unique::pallet_evm_collection;
use fp_rpc::TransactionStatus;
use sp_runtime::{
traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},
@@ -1020,7 +1021,6 @@
EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
- EvmCollection: pallet_evm_collection::{Pallet} = 154,
}
);
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -75,7 +75,6 @@
'pallet-evm/std',
'pallet-evm-migration/std',
'pallet-evm-contract-helpers/std',
- 'pallet-evm-collection/std',
'pallet-evm-transaction-payment/std',
'pallet-evm-coder-substrate/std',
'pallet-ethereum/std',
@@ -415,7 +414,6 @@
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }
-pallet-evm-collection = { path = '../../pallets/evm-collection', default-features = false }
pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -85,6 +85,7 @@
use smallvec::smallvec;
use codec::{Encode, Decode};
use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping, OnMethodCall};
+use pallet_unique::pallet_evm_collection;
use fp_rpc::TransactionStatus;
use sp_runtime::{
traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},
@@ -1025,7 +1026,6 @@
EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
- EvmCollection: pallet_evm_collection::{Pallet} = 154,
}
);
--- a/tests/src/eth/api/Collection.sol
+++ b/tests/src/eth/api/Collection.sol
@@ -12,7 +12,7 @@
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
-// Selector: f83ad95b
+// Selector: 1e95830f
interface Collection is Dummy, ERC165 {
// Selector: create721Collection(string,string,string) 951c0151
function create721Collection(
@@ -28,23 +28,6 @@
// Selector: confirmSponsorship(address) abc00001
function confirmSponsorship(address collectionAddress) external view;
-
- // Selector: setOffchainSchema(address,string) 2c9d9d70
- function setOffchainSchema(address collectionAddress, string memory schema)
- external
- view;
-
- // Selector: setVariableOnChainSchema(address,string) 582691c3
- function setVariableOnChainSchema(
- address collectionAddress,
- string memory variable
- ) external view;
-
- // Selector: setConstOnChainSchema(address,string) 921456e7
- function setConstOnChainSchema(
- address collectionAddress,
- string memory constOnChain
- ) external view;
// Selector: setLimits(address,string) d05638cc
function setLimits(address collectionAddress, string memory limitsJson)
--- a/tests/src/eth/collectionAbi.json
+++ b/tests/src/eth/collectionAbi.json
@@ -30,37 +30,9 @@
"name": "collectionAddress",
"type": "address"
},
- { "internalType": "string", "name": "constOnChain", "type": "string" }
- ],
- "name": "setConstOnChainSchema",
- "outputs": [],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "collectionAddress",
- "type": "address"
- },
{ "internalType": "string", "name": "limitsJson", "type": "string" }
],
"name": "setLimits",
- "outputs": [],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "collectionAddress",
- "type": "address"
- },
- { "internalType": "string", "name": "schema", "type": "string" }
- ],
- "name": "setOffchainSchema",
"outputs": [],
"stateMutability": "view",
"type": "function"
@@ -75,20 +47,6 @@
{ "internalType": "address", "name": "sponsor", "type": "address" }
],
"name": "setSponsor",
- "outputs": [],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "collectionAddress",
- "type": "address"
- },
- { "internalType": "string", "name": "variable", "type": "string" }
- ],
- "name": "setVariableOnChainSchema",
"outputs": [],
"stateMutability": "view",
"type": "function"
--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -249,16 +249,6 @@
**/
[key: string]: AugmentedError;
};
- evmCollection: {
- /**
- * This method is only executable by owner
- **/
- NoPermission: AugmentedError;
- /**
- * Generic error
- **/
- [key: string]: AugmentedError;
- };
evmContractHelpers: {
/**
* This method is only executable by owner
--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -13,6 +13,7 @@
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
+import type { BlockStats } from '@polkadot/types/interfaces/dev';
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
@@ -22,7 +23,7 @@
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
-import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
+import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
import type { IExtrinsic, Observable } from '@polkadot/types/types';
@@ -156,6 +157,12 @@
**/
uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>;
};
+ dev: {
+ /**
+ * Reexecute the specified `block_hash` and gather statistics while doing so
+ **/
+ getBlockStats: AugmentedRpc<(at: Hash | string | Uint8Array) => Observable