difftreelog
CORE-302 Add EvmCollection Pallet
in: master
24 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5504,6 +5504,7 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
+ "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
@@ -6075,6 +6076,28 @@
]
[[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",
+ "scale-info",
+ "sp-core",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+]
+
+[[package]]
name = "pallet-evm-contract-helpers"
version = "0.1.0"
dependencies = [
@@ -8784,6 +8807,7 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
+ "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
@@ -12845,6 +12869,7 @@
"pallet-ethereum",
"pallet-evm",
"pallet-evm-coder-substrate",
+ "pallet-evm-collection",
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,9 @@
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_ABI=./tests/src/eth/collectionAbi.json
+
TESTS_API=./tests/src/eth/api/
.PHONY: regenerate_solidity
@@ -32,6 +35,10 @@
PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
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::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+ PACKAGE=pallet-evm-collection NAME=eth::contract_helpers_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
INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh
@@ -44,7 +51,11 @@
INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh
INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh
-evm_stubs: UniqueFungible UniqueNFT ContractHelpers
+Collection: Collection.sol
+ INPUT=$(COLLECTION_STUBS)/$< OUTPUT=$(COLLECTION_STUBS)/Collection.raw ./.maintain/scripts/compile_stub.sh
+ INPUT=$(COLLECTION_STUBS)/$< OUTPUT=$(COLLECTION_ABI) ./.maintain/scripts/generate_abi.sh
+
+evm_stubs: UniqueFungible UniqueNFT ContractHelpers Collection
.PHONY: _bench
_bench:
pallets/evm-collection/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-collection/Cargo.toml
@@ -0,0 +1,49 @@
+[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" }
+
+# 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' }
+
+[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",
+]
pallets/evm-collection/src/eth.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-collection/src/eth.rs
@@ -0,0 +1,169 @@
+// 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 <http://www.gnu.org/licenses/>.
+
+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_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;
+use alloc::format;
+
+struct EvmCollection<T: Config>(SubstrateRecorder<T>);
+impl<T: Config> WithRecorder<T> for EvmCollection<T> {
+ fn recorder(&self) -> &SubstrateRecorder<T> {
+ &self.0
+ }
+
+ fn into_recorder(self) -> SubstrateRecorder<T> {
+ self.0
+ }
+}
+
+#[derive(ToLog)]
+pub enum CollectionEvent {
+ CollectionCreated {
+ #[indexed]
+ owner: address,
+ #[indexed]
+ collection_id: address,
+ },
+}
+
+#[solidity_interface(name = "Collection")]
+impl<T: Config> EvmCollection<T> {
+ fn create_721_collection(
+ &self,
+ caller: caller,
+ name: string,
+ description: string,
+ token_prefix: string,
+ ) -> Result<address> {
+ let caller = T::CrossAccountId::from_eth(caller);
+ let name = name
+ .encode_utf16()
+ .collect::<Vec<u16>>()
+ .try_into()
+ .map_err(|_| error_feild_too_long("name", MAX_COLLECTION_NAME_LENGTH))?;
+ let description = description
+ .encode_utf16()
+ .collect::<Vec<u16>>()
+ .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 =
+ <pallet_nonfungible::Pallet<T>>::init_collection(caller.as_sub().clone(), data)
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+
+ let address = pallet_common::eth::collection_id_to_address(collection_id);
+ <PalletEvm<T>>::deposit_log(
+ CollectionEvent::CollectionCreated {
+ owner: *caller.as_eth(),
+ collection_id: address,
+ }
+ .to_log(address),
+ );
+ Ok(address)
+ }
+
+ // fn set_sponsor(collection_id: address, sponsor: address) -> Result<void> {
+ // let collection_id =
+ // pallet_common::eth::map_eth_to_id(&collection_id).ok_or(Error::Revert("".into()))?;
+ // let mut collection = <CollectionById<T>>::get(collection_id).ok_or(Error::Revert("".into()))?;
+ // let sponsor = T::CrossAccountId::from_eth(sponsor);
+ // collection.sponsorship = SponsorshipState::Unconfirmed(sponsor.as_sub().clone());
+ // <CollectionById<T>>::insert(collection_id, collection);
+ // Ok(())
+ // }
+
+ // fn set_offchain_shema(shema: string) -> Result<void> {
+ // Ok(())
+ // }
+
+ // fn set_const_on_chain_schema(shema: string) -> Result<void> {
+ // Ok(())
+ // }
+
+ // fn set_variable_on_chain_schema(shema: string) -> Result<void> {
+ // Ok(())
+ // }
+
+ // fn set_limits(limits: string) -> Result<void> {
+ // Ok(())
+ // }
+}
+
+fn error_feild_too_long(feild: &str, bound: u32) -> Error {
+ Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
+}
+
+pub struct CollectionOnMethodCall<T: Config>(PhantomData<*const T>);
+impl<T: Config> OnMethodCall<T> for CollectionOnMethodCall<T> {
+ 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<PrecompileResult> {
+ // TODO: Extract to another OnMethodCall handler
+ if target != &T::ContractAddress::get() {
+ return None;
+ }
+
+ let helpers = EvmCollection::<T>(SubstrateRecorder::<T>::new(gas_left));
+ pallet_evm_coder_substrate::call(*source, helpers, value, input)
+ }
+
+ fn get_code(contract: &sp_core::H160) -> Option<Vec<u8>> {
+ (contract == &T::ContractAddress::get())
+ .then(|| include_bytes!("./stubs/Collection.raw").to_vec())
+ }
+}
+
+generate_stubgen!(collection_impl, CollectionCall<()>, true);
+generate_stubgen!(collection_iface, CollectionCall<()>, false);
pallets/evm-collection/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-collection/src/lib.rs
@@ -0,0 +1,53 @@
+// 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 <http://www.gnu.org/licenses/>.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+extern crate alloc;
+
+use codec::{Decode, Encode, MaxEncodedLen};
+pub use pallet::*;
+pub use eth::*;
+use scale_info::TypeInfo;
+pub mod eth;
+
+#[frame_support::pallet]
+pub mod pallet {
+ pub use super::*;
+ use evm_coder::execution::Result;
+ 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<H160>;
+ }
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /// This method is only executable by owner
+ NoPermission,
+ }
+
+ #[pallet::pallet]
+ // #[pallet::generate_store(pub(super) trait Store)]
+ pub struct Pallet<T>(_);
+
+
+ impl<T: Config> Pallet<T> {}
+}
pallets/evm-collection/src/stubs/Collection.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-collection/src/stubs/Collection.soldiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-collection/src/stubs/Collection.sol
@@ -0,0 +1,161 @@
+// 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: ee5467a8
+contract Collection is Dummy, ERC165 {
+ // Selector: contractOwner(address) 5152b14c
+ function contractOwner(address contractAddress)
+ public
+ view
+ returns (address)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
+
+ // Selector: sponsoringEnabled(address) 6027dc61
+ function sponsoringEnabled(address contractAddress)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return false;
+ }
+
+ // Deprecated
+ //
+ // Selector: toggleSponsoring(address,bool) fcac6d86
+ function toggleSponsoring(address contractAddress, bool enabled) public {
+ require(false, stub_error);
+ contractAddress;
+ enabled;
+ dummy = 0;
+ }
+
+ // Selector: setSponsoringMode(address,uint8) fde8a560
+ function setSponsoringMode(address contractAddress, uint8 mode) public {
+ require(false, stub_error);
+ contractAddress;
+ mode;
+ dummy = 0;
+ }
+
+ // Selector: sponsoringMode(address) b70c7267
+ function sponsoringMode(address contractAddress)
+ public
+ view
+ returns (uint8)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0;
+ }
+
+ // Selector: setSponsoringRateLimit(address,uint32) 77b6c908
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
+ public
+ {
+ require(false, stub_error);
+ contractAddress;
+ rateLimit;
+ dummy = 0;
+ }
+
+ // Selector: getSponsoringRateLimit(address) 610cfabd
+ function getSponsoringRateLimit(address contractAddress)
+ public
+ view
+ returns (uint32)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0;
+ }
+
+ // Selector: allowed(address,address) 5c658165
+ function allowed(address contractAddress, address user)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ user;
+ dummy;
+ return false;
+ }
+
+ // Selector: allowlistEnabled(address) c772ef6c
+ function allowlistEnabled(address contractAddress)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return false;
+ }
+
+ // Selector: toggleAllowlist(address,bool) 36de20f5
+ function toggleAllowlist(address contractAddress, bool enabled) public {
+ require(false, stub_error);
+ contractAddress;
+ enabled;
+ dummy = 0;
+ }
+
+ // Selector: toggleAllowed(address,address,bool) 4706cc1c
+ function toggleAllowed(
+ address contractAddress,
+ address user,
+ bool allowed
+ ) public {
+ require(false, stub_error);
+ contractAddress;
+ user;
+ allowed;
+ dummy = 0;
+ }
+
+ // 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;
+ }
+}
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -20,20 +20,15 @@
use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
use pallet_evm::{
ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure,
- account::CrossAccountId, Pallet as PalletEvm
+ account::CrossAccountId
};
use sp_core::H160;
-use up_data_structs::{
- CreateCollectionData, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
- MAX_COLLECTION_NAME_LENGTH,
-};
use crate::{
AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT,
};
use frame_support::traits::Get;
use up_sponsorship::SponsorshipHandler;
use sp_std::vec::Vec;
-use alloc::format;
struct ContractHelpers<T: Config>(SubstrateRecorder<T>);
impl<T: Config> WithRecorder<T> for ContractHelpers<T> {
@@ -142,56 +137,6 @@
<Pallet<T>>::toggle_allowed(contract_address, user, allowed);
Ok(())
}
-
- fn create_721_collection(
- &self,
- caller: caller,
- name: string,
- description: string,
- token_prefix: string,
- ) -> Result<address> {
- let caller = T::CrossAccountId::from_eth(caller);
- let name = name
- .encode_utf16()
- .collect::<Vec<u16>>()
- .try_into()
- .map_err(|_| error_feild_too_long("name", MAX_COLLECTION_NAME_LENGTH))?;
- let description = description
- .encode_utf16()
- .collect::<Vec<u16>>()
- .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 =
- <pallet_nonfungible::Pallet<T>>::init_collection(caller.as_sub().clone(), data)
- .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
-
- let address = pallet_common::eth::collection_id_to_address(collection_id);
-
- <PalletEvm<T>>::deposit_log(
- ContractHelperEvent::CollectionCreated {
- owner: *caller.as_eth(),
- collection_id: address,
- }
- .to_log(address),
- );
- Ok(address)
- }
-}
-
-fn error_feild_too_long(feild: &str, bound: u32) -> Error {
- Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
}
pub struct HelpersOnMethodCall<T: Config>(PhantomData<*const T>);
pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -16,9 +16,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
-#[macro_use(format)]
-extern crate alloc;
-
use codec::{Decode, Encode, MaxEncodedLen};
pub use pallet::*;
pub use eth::*;
pallets/evm-contract-helpers/src/stubs/Collection.soldiffbeforeafterboth--- /dev/null
+++ b/pallets/evm-contract-helpers/src/stubs/Collection.sol
@@ -0,0 +1,192 @@
+// 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: 61f17ed8
+contract ContractHelpers is Dummy, ERC165 {
+ // Selector: contractOwner(address) 5152b14c
+ function contractOwner(address contractAddress)
+ public
+ view
+ returns (address)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
+
+ // Selector: sponsoringEnabled(address) 6027dc61
+ function sponsoringEnabled(address contractAddress)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return false;
+ }
+
+ // Deprecated
+ //
+ // Selector: toggleSponsoring(address,bool) fcac6d86
+ function toggleSponsoring(address contractAddress, bool enabled) public {
+ require(false, stub_error);
+ contractAddress;
+ enabled;
+ dummy = 0;
+ }
+
+ // Selector: setSponsoringMode(address,uint8) fde8a560
+ function setSponsoringMode(address contractAddress, uint8 mode) public {
+ require(false, stub_error);
+ contractAddress;
+ mode;
+ dummy = 0;
+ }
+
+ // Selector: sponsoringMode(address) b70c7267
+ function sponsoringMode(address contractAddress)
+ public
+ view
+ returns (uint8)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0;
+ }
+
+ // Selector: setSponsoringRateLimit(address,uint32) 77b6c908
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
+ public
+ {
+ require(false, stub_error);
+ contractAddress;
+ rateLimit;
+ dummy = 0;
+ }
+
+ // Selector: getSponsoringRateLimit(address) 610cfabd
+ function getSponsoringRateLimit(address contractAddress)
+ public
+ view
+ returns (uint32)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return 0;
+ }
+
+ // Selector: allowed(address,address) 5c658165
+ function allowed(address contractAddress, address user)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ user;
+ dummy;
+ return false;
+ }
+
+ // Selector: allowlistEnabled(address) c772ef6c
+ function allowlistEnabled(address contractAddress)
+ public
+ view
+ returns (bool)
+ {
+ require(false, stub_error);
+ contractAddress;
+ dummy;
+ return false;
+ }
+
+ // Selector: toggleAllowlist(address,bool) 36de20f5
+ function toggleAllowlist(address contractAddress, bool enabled) public {
+ require(false, stub_error);
+ contractAddress;
+ enabled;
+ dummy = 0;
+ }
+
+ // Selector: toggleAllowed(address,address,bool) 4706cc1c
+ function toggleAllowed(
+ address contractAddress,
+ address user,
+ bool allowed
+ ) public {
+ require(false, stub_error);
+ contractAddress;
+ user;
+ allowed;
+ dummy = 0;
+ }
+
+ // 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 collectionId, address sponsor) public pure {
+ require(false, stub_error);
+ collectionId;
+ sponsor;
+ }
+
+ // Selector: setOffchainShema(string) c3aa408b
+ function setOffchainShema(string memory shema) public pure {
+ require(false, stub_error);
+ shema;
+ }
+
+ // Selector: setConstOnChainSchema(string) b284d8df
+ function setConstOnChainSchema(string memory shema) public pure {
+ require(false, stub_error);
+ shema;
+ }
+
+ // Selector: setVariableOnChainSchema(string) 7c5f0fea
+ function setVariableOnChainSchema(string memory shema) public pure {
+ require(false, stub_error);
+ shema;
+ }
+
+ // Selector: setLimits(string) 72cb345d
+ function setLimits(string memory limits) public pure {
+ require(false, stub_error);
+ limits;
+ }
+}
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -21,7 +21,7 @@
}
}
-// Selector: ee5467a8
+// Selector: 7b4866f9
contract ContractHelpers is Dummy, ERC165 {
// Selector: contractOwner(address) 5152b14c
function contractOwner(address contractAddress)
@@ -143,19 +143,5 @@
user;
allowed;
dummy = 0;
- }
-
- // 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;
}
}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -74,6 +74,7 @@
'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',
@@ -417,6 +418,7 @@
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" }
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -49,7 +49,7 @@
// A few exports that help ease life for downstream crates.
pub use pallet_balances::Call as BalancesCall;
pub use pallet_evm::{
- EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _,
+ EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, OnMethodCall,
};
pub use frame_support::{
construct_runtime, match_types,
@@ -306,6 +306,7 @@
pallet_evm_migration::OnMethodCall<Self>,
pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
CollectionDispatchT<Self>,
+ pallet_evm_collection::CollectionOnMethodCall<Self>,
);
type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
type ChainId = ChainId;
@@ -974,6 +975,11 @@
pub const HelpersContractAddress: H160 = H160([
0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
]);
+
+ // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
+ pub const EvmCollectionAddress: H160 = H160([
+ 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
+ ]);
}
impl pallet_evm_contract_helpers::Config for Runtime {
@@ -981,6 +987,10 @@
type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
}
+impl pallet_evm_collection::Config for Runtime {
+ type ContractAddress = EvmCollectionAddress;
+}
+
construct_runtime!(
pub enum Runtime where
Block = Block,
@@ -1033,6 +1043,7 @@
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,
}
);
runtime/quartz/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Quartz Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'quartz-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.20'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-structure/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',40 'sp-runtime/runtime-benchmarks',41 'xcm-builder/runtime-benchmarks',42]43try-runtime = [44 'frame-try-runtime',45 'frame-executive/try-runtime',46 'frame-system/try-runtime',47]48std = [49 'codec/std',50 'cumulus-pallet-aura-ext/std',51 'cumulus-pallet-parachain-system/std',52 'cumulus-pallet-xcm/std',53 'cumulus-pallet-xcmp-queue/std',54 'cumulus-primitives-core/std',55 'cumulus-primitives-utility/std',56 'frame-try-runtime/std',57 'frame-executive/std',58 'frame-support/std',59 'frame-system/std',60 'frame-system-rpc-runtime-api/std',61 'pallet-aura/std',62 'pallet-balances/std',63 # 'pallet-contracts/std',64 # 'pallet-contracts-primitives/std',65 # 'pallet-contracts-rpc-runtime-api/std',66 # 'pallet-contract-helpers/std',67 'pallet-randomness-collective-flip/std',68 'pallet-sudo/std',69 'pallet-timestamp/std',70 'pallet-transaction-payment/std',71 'pallet-transaction-payment-rpc-runtime-api/std',72 'pallet-treasury/std',73 # 'pallet-vesting/std',74 'pallet-evm/std',75 'pallet-evm-migration/std',76 'pallet-evm-contract-helpers/std',77 'pallet-evm-transaction-payment/std',78 'pallet-evm-coder-substrate/std',79 'pallet-ethereum/std',80 'pallet-base-fee/std',81 'fp-rpc/std',82 'up-rpc/std',83 'fp-evm-mapping/std',84 'fp-self-contained/std',85 'parachain-info/std',86 'serde',87 'pallet-inflation/std',88 'pallet-common/std',89 'pallet-structure/std',90 'pallet-fungible/std',91 'pallet-refungible/std',92 'pallet-nonfungible/std',93 'pallet-proxy-rmrk-core/std',94 'pallet-unique/std',95 'pallet-unq-scheduler/std',96 'pallet-charge-transaction/std',97 'up-data-structs/std',98 'sp-api/std',99 'sp-block-builder/std',100 "sp-consensus-aura/std",101 'sp-core/std',102 'sp-inherents/std',103 'sp-io/std',104 'sp-offchain/std',105 'sp-runtime/std',106 'sp-session/std',107 'sp-std/std',108 'sp-transaction-pool/std',109 'sp-version/std',110 'xcm/std',111 'xcm-builder/std',112 'xcm-executor/std',113 'unique-runtime-common/std',114115 "orml-vesting/std",116]117limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']118119################################################################################120# Substrate Dependencies121122[dependencies.codec]123default-features = false124features = ['derive']125package = 'parity-scale-codec'126version = '3.1.2'127128[dependencies.frame-benchmarking]129default-features = false130git = "https://github.com/paritytech/substrate"131optional = true132branch = "polkadot-v0.9.21"133134[dependencies.frame-try-runtime]135default-features = false136git = 'https://github.com/paritytech/substrate'137optional = true138branch = 'polkadot-v0.9.21'139140[dependencies.frame-executive]141default-features = false142git = "https://github.com/paritytech/substrate"143branch = "polkadot-v0.9.21"144145[dependencies.frame-support]146default-features = false147git = "https://github.com/paritytech/substrate"148branch = "polkadot-v0.9.21"149150[dependencies.frame-system]151default-features = false152git = "https://github.com/paritytech/substrate"153branch = "polkadot-v0.9.21"154155[dependencies.frame-system-benchmarking]156default-features = false157git = "https://github.com/paritytech/substrate"158optional = true159branch = "polkadot-v0.9.21"160161[dependencies.frame-system-rpc-runtime-api]162default-features = false163git = "https://github.com/paritytech/substrate"164branch = "polkadot-v0.9.21"165166[dependencies.hex-literal]167optional = true168version = '0.3.3'169170[dependencies.serde]171default-features = false172features = ['derive']173optional = true174version = '1.0.130'175176[dependencies.pallet-aura]177default-features = false178git = "https://github.com/paritytech/substrate"179branch = "polkadot-v0.9.21"180181[dependencies.pallet-balances]182default-features = false183git = "https://github.com/paritytech/substrate"184branch = "polkadot-v0.9.21"185186# Contracts specific packages187# [dependencies.pallet-contracts]188# git = 'https://github.com/paritytech/substrate'189# default-features = false190# branch = 'master'191# version = '4.0.0-dev'192193# [dependencies.pallet-contracts-primitives]194# git = 'https://github.com/paritytech/substrate'195# default-features = false196# branch = 'master'197# version = '4.0.0-dev'198199# [dependencies.pallet-contracts-rpc-runtime-api]200# git = 'https://github.com/paritytech/substrate'201# default-features = false202# branch = 'master'203# version = '4.0.0-dev'204205[dependencies.pallet-randomness-collective-flip]206default-features = false207git = "https://github.com/paritytech/substrate"208branch = "polkadot-v0.9.21"209210[dependencies.pallet-sudo]211default-features = false212git = "https://github.com/paritytech/substrate"213branch = "polkadot-v0.9.21"214215[dependencies.pallet-timestamp]216default-features = false217git = "https://github.com/paritytech/substrate"218branch = "polkadot-v0.9.21"219220[dependencies.pallet-transaction-payment]221default-features = false222git = "https://github.com/paritytech/substrate"223branch = "polkadot-v0.9.21"224225[dependencies.pallet-transaction-payment-rpc-runtime-api]226default-features = false227git = "https://github.com/paritytech/substrate"228branch = "polkadot-v0.9.21"229230[dependencies.pallet-treasury]231default-features = false232git = "https://github.com/paritytech/substrate"233branch = "polkadot-v0.9.21"234235# [dependencies.pallet-vesting]236# default-features = false237# git = 'https://github.com/paritytech/substrate'238# branch = 'master'239240[dependencies.sp-arithmetic]241default-features = false242git = "https://github.com/paritytech/substrate"243branch = "polkadot-v0.9.21"244245[dependencies.sp-api]246default-features = false247git = "https://github.com/paritytech/substrate"248branch = "polkadot-v0.9.21"249250[dependencies.sp-block-builder]251default-features = false252git = "https://github.com/paritytech/substrate"253branch = "polkadot-v0.9.21"254255[dependencies.sp-core]256default-features = false257git = "https://github.com/paritytech/substrate"258branch = "polkadot-v0.9.21"259260[dependencies.sp-consensus-aura]261default-features = false262git = "https://github.com/paritytech/substrate"263branch = "polkadot-v0.9.21"264265[dependencies.sp-inherents]266default-features = false267git = "https://github.com/paritytech/substrate"268branch = "polkadot-v0.9.21"269270[dependencies.sp-io]271default-features = false272git = "https://github.com/paritytech/substrate"273branch = "polkadot-v0.9.21"274275[dependencies.sp-offchain]276default-features = false277git = "https://github.com/paritytech/substrate"278branch = "polkadot-v0.9.21"279280[dependencies.sp-runtime]281default-features = false282git = "https://github.com/paritytech/substrate"283branch = "polkadot-v0.9.21"284285[dependencies.sp-session]286default-features = false287git = "https://github.com/paritytech/substrate"288branch = "polkadot-v0.9.21"289290[dependencies.sp-std]291default-features = false292git = "https://github.com/paritytech/substrate"293branch = "polkadot-v0.9.21"294295[dependencies.sp-transaction-pool]296default-features = false297git = "https://github.com/paritytech/substrate"298branch = "polkadot-v0.9.21"299300[dependencies.sp-version]301default-features = false302git = "https://github.com/paritytech/substrate"303branch = "polkadot-v0.9.21"304305[dependencies.smallvec]306version = '1.6.1'307308################################################################################309# Cumulus dependencies310311[dependencies.parachain-info]312default-features = false313git = "https://github.com/uniquenetwork/cumulus"314branch = "polkadot-v0.9.21"315316[dependencies.cumulus-pallet-aura-ext]317git = "https://github.com/uniquenetwork/cumulus"318branch = "polkadot-v0.9.21"319default-features = false320321[dependencies.cumulus-pallet-parachain-system]322git = "https://github.com/uniquenetwork/cumulus"323branch = "polkadot-v0.9.21"324default-features = false325326[dependencies.cumulus-primitives-core]327git = "https://github.com/uniquenetwork/cumulus"328branch = "polkadot-v0.9.21"329default-features = false330331[dependencies.cumulus-pallet-xcm]332git = "https://github.com/uniquenetwork/cumulus"333branch = "polkadot-v0.9.21"334default-features = false335336[dependencies.cumulus-pallet-dmp-queue]337git = "https://github.com/uniquenetwork/cumulus"338branch = "polkadot-v0.9.21"339default-features = false340341[dependencies.cumulus-pallet-xcmp-queue]342git = "https://github.com/uniquenetwork/cumulus"343branch = "polkadot-v0.9.21"344default-features = false345346[dependencies.cumulus-primitives-utility]347git = "https://github.com/uniquenetwork/cumulus"348branch = "polkadot-v0.9.21"349default-features = false350351[dependencies.cumulus-primitives-timestamp]352git = "https://github.com/uniquenetwork/cumulus"353branch = "polkadot-v0.9.21"354default-features = false355356################################################################################357# Polkadot dependencies358359[dependencies.polkadot-parachain]360git = "https://github.com/paritytech/polkadot"361branch = "release-v0.9.21"362default-features = false363364[dependencies.xcm]365git = "https://github.com/paritytech/polkadot"366branch = "release-v0.9.21"367default-features = false368369[dependencies.xcm-builder]370git = "https://github.com/paritytech/polkadot"371branch = "release-v0.9.21"372default-features = false373374[dependencies.xcm-executor]375git = "https://github.com/paritytech/polkadot"376branch = "release-v0.9.21"377default-features = false378379[dependencies.pallet-xcm]380git = "https://github.com/paritytech/polkadot"381branch = "release-v0.9.21"382default-features = false383384[dependencies.orml-vesting]385git = "https://github.com/uniquenetwork/open-runtime-module-library"386branch = "unique-polkadot-v0.9.21"387version = "0.4.1-dev"388default-features = false389390################################################################################391# RMRK dependencies392393# todo git394[dependencies.rmrk-rpc]395default-features = false396git = "https://github.com/UniqueNetwork/rmrk-substrate.git"397branch = "feature/separate-types-and-traits"398399################################################################################400# local dependencies401402[dependencies]403log = { version = "0.4.16", default-features = false }404unique-runtime-common = { path = "../common", default-features = false }405scale-info = { version = "2.0.1", default-features = false, features = [406 "derive",407] }408derivative = "2.2.0"409pallet-unique = { path = '../../pallets/unique', default-features = false }410up-rpc = { path = "../../primitives/rpc", default-features = false }411fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }412pallet-inflation = { path = '../../pallets/inflation', default-features = false }413up-data-structs = { path = '../../primitives/data-structs', default-features = false }414pallet-common = { default-features = false, path = "../../pallets/common" }415pallet-structure = { default-features = false, path = "../../pallets/structure" }416pallet-fungible = { default-features = false, path = "../../pallets/fungible" }417pallet-refungible = { default-features = false, path = "../../pallets/refungible" }418pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }419pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }420pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }421# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }422pallet-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" }423pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }424pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }425pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }426pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }427pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }428pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }429pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }430fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }431fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }432433################################################################################434# Build Dependencies435436[build-dependencies.substrate-wasm-builder]437git = "https://github.com/paritytech/substrate"438branch = "polkadot-v0.9.21"1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Quartz Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'quartz-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.20'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-structure/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',40 'sp-runtime/runtime-benchmarks',41 'xcm-builder/runtime-benchmarks',42]43try-runtime = [44 'frame-try-runtime',45 'frame-executive/try-runtime',46 'frame-system/try-runtime',47]48std = [49 'codec/std',50 'cumulus-pallet-aura-ext/std',51 'cumulus-pallet-parachain-system/std',52 'cumulus-pallet-xcm/std',53 'cumulus-pallet-xcmp-queue/std',54 'cumulus-primitives-core/std',55 'cumulus-primitives-utility/std',56 'frame-try-runtime/std',57 'frame-executive/std',58 'frame-support/std',59 'frame-system/std',60 'frame-system-rpc-runtime-api/std',61 'pallet-aura/std',62 'pallet-balances/std',63 # 'pallet-contracts/std',64 # 'pallet-contracts-primitives/std',65 # 'pallet-contracts-rpc-runtime-api/std',66 # 'pallet-contract-helpers/std',67 'pallet-randomness-collective-flip/std',68 'pallet-sudo/std',69 'pallet-timestamp/std',70 'pallet-transaction-payment/std',71 'pallet-transaction-payment-rpc-runtime-api/std',72 'pallet-treasury/std',73 # 'pallet-vesting/std',74 'pallet-evm/std',75 'pallet-evm-migration/std',76 'pallet-evm-contract-helpers/std',77 'pallet-evm-collection/std',78 'pallet-evm-transaction-payment/std',79 'pallet-evm-coder-substrate/std',80 'pallet-ethereum/std',81 'pallet-base-fee/std',82 'fp-rpc/std',83 'up-rpc/std',84 'fp-evm-mapping/std',85 'fp-self-contained/std',86 'parachain-info/std',87 'serde',88 'pallet-inflation/std',89 'pallet-common/std',90 'pallet-structure/std',91 'pallet-fungible/std',92 'pallet-refungible/std',93 'pallet-nonfungible/std',94 'pallet-proxy-rmrk-core/std',95 'pallet-unique/std',96 'pallet-unq-scheduler/std',97 'pallet-charge-transaction/std',98 'up-data-structs/std',99 'sp-api/std',100 'sp-block-builder/std',101 "sp-consensus-aura/std",102 'sp-core/std',103 'sp-inherents/std',104 'sp-io/std',105 'sp-offchain/std',106 'sp-runtime/std',107 'sp-session/std',108 'sp-std/std',109 'sp-transaction-pool/std',110 'sp-version/std',111 'xcm/std',112 'xcm-builder/std',113 'xcm-executor/std',114 'unique-runtime-common/std',115116 "orml-vesting/std",117]118limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']119120################################################################################121# Substrate Dependencies122123[dependencies.codec]124default-features = false125features = ['derive']126package = 'parity-scale-codec'127version = '3.1.2'128129[dependencies.frame-benchmarking]130default-features = false131git = "https://github.com/paritytech/substrate"132optional = true133branch = "polkadot-v0.9.21"134135[dependencies.frame-try-runtime]136default-features = false137git = 'https://github.com/paritytech/substrate'138optional = true139branch = 'polkadot-v0.9.21'140141[dependencies.frame-executive]142default-features = false143git = "https://github.com/paritytech/substrate"144branch = "polkadot-v0.9.21"145146[dependencies.frame-support]147default-features = false148git = "https://github.com/paritytech/substrate"149branch = "polkadot-v0.9.21"150151[dependencies.frame-system]152default-features = false153git = "https://github.com/paritytech/substrate"154branch = "polkadot-v0.9.21"155156[dependencies.frame-system-benchmarking]157default-features = false158git = "https://github.com/paritytech/substrate"159optional = true160branch = "polkadot-v0.9.21"161162[dependencies.frame-system-rpc-runtime-api]163default-features = false164git = "https://github.com/paritytech/substrate"165branch = "polkadot-v0.9.21"166167[dependencies.hex-literal]168optional = true169version = '0.3.3'170171[dependencies.serde]172default-features = false173features = ['derive']174optional = true175version = '1.0.130'176177[dependencies.pallet-aura]178default-features = false179git = "https://github.com/paritytech/substrate"180branch = "polkadot-v0.9.21"181182[dependencies.pallet-balances]183default-features = false184git = "https://github.com/paritytech/substrate"185branch = "polkadot-v0.9.21"186187# Contracts specific packages188# [dependencies.pallet-contracts]189# git = 'https://github.com/paritytech/substrate'190# default-features = false191# branch = 'master'192# version = '4.0.0-dev'193194# [dependencies.pallet-contracts-primitives]195# git = 'https://github.com/paritytech/substrate'196# default-features = false197# branch = 'master'198# version = '4.0.0-dev'199200# [dependencies.pallet-contracts-rpc-runtime-api]201# git = 'https://github.com/paritytech/substrate'202# default-features = false203# branch = 'master'204# version = '4.0.0-dev'205206[dependencies.pallet-randomness-collective-flip]207default-features = false208git = "https://github.com/paritytech/substrate"209branch = "polkadot-v0.9.21"210211[dependencies.pallet-sudo]212default-features = false213git = "https://github.com/paritytech/substrate"214branch = "polkadot-v0.9.21"215216[dependencies.pallet-timestamp]217default-features = false218git = "https://github.com/paritytech/substrate"219branch = "polkadot-v0.9.21"220221[dependencies.pallet-transaction-payment]222default-features = false223git = "https://github.com/paritytech/substrate"224branch = "polkadot-v0.9.21"225226[dependencies.pallet-transaction-payment-rpc-runtime-api]227default-features = false228git = "https://github.com/paritytech/substrate"229branch = "polkadot-v0.9.21"230231[dependencies.pallet-treasury]232default-features = false233git = "https://github.com/paritytech/substrate"234branch = "polkadot-v0.9.21"235236# [dependencies.pallet-vesting]237# default-features = false238# git = 'https://github.com/paritytech/substrate'239# branch = 'master'240241[dependencies.sp-arithmetic]242default-features = false243git = "https://github.com/paritytech/substrate"244branch = "polkadot-v0.9.21"245246[dependencies.sp-api]247default-features = false248git = "https://github.com/paritytech/substrate"249branch = "polkadot-v0.9.21"250251[dependencies.sp-block-builder]252default-features = false253git = "https://github.com/paritytech/substrate"254branch = "polkadot-v0.9.21"255256[dependencies.sp-core]257default-features = false258git = "https://github.com/paritytech/substrate"259branch = "polkadot-v0.9.21"260261[dependencies.sp-consensus-aura]262default-features = false263git = "https://github.com/paritytech/substrate"264branch = "polkadot-v0.9.21"265266[dependencies.sp-inherents]267default-features = false268git = "https://github.com/paritytech/substrate"269branch = "polkadot-v0.9.21"270271[dependencies.sp-io]272default-features = false273git = "https://github.com/paritytech/substrate"274branch = "polkadot-v0.9.21"275276[dependencies.sp-offchain]277default-features = false278git = "https://github.com/paritytech/substrate"279branch = "polkadot-v0.9.21"280281[dependencies.sp-runtime]282default-features = false283git = "https://github.com/paritytech/substrate"284branch = "polkadot-v0.9.21"285286[dependencies.sp-session]287default-features = false288git = "https://github.com/paritytech/substrate"289branch = "polkadot-v0.9.21"290291[dependencies.sp-std]292default-features = false293git = "https://github.com/paritytech/substrate"294branch = "polkadot-v0.9.21"295296[dependencies.sp-transaction-pool]297default-features = false298git = "https://github.com/paritytech/substrate"299branch = "polkadot-v0.9.21"300301[dependencies.sp-version]302default-features = false303git = "https://github.com/paritytech/substrate"304branch = "polkadot-v0.9.21"305306[dependencies.smallvec]307version = '1.6.1'308309################################################################################310# Cumulus dependencies311312[dependencies.parachain-info]313default-features = false314git = "https://github.com/uniquenetwork/cumulus"315branch = "polkadot-v0.9.21"316317[dependencies.cumulus-pallet-aura-ext]318git = "https://github.com/uniquenetwork/cumulus"319branch = "polkadot-v0.9.21"320default-features = false321322[dependencies.cumulus-pallet-parachain-system]323git = "https://github.com/uniquenetwork/cumulus"324branch = "polkadot-v0.9.21"325default-features = false326327[dependencies.cumulus-primitives-core]328git = "https://github.com/uniquenetwork/cumulus"329branch = "polkadot-v0.9.21"330default-features = false331332[dependencies.cumulus-pallet-xcm]333git = "https://github.com/uniquenetwork/cumulus"334branch = "polkadot-v0.9.21"335default-features = false336337[dependencies.cumulus-pallet-dmp-queue]338git = "https://github.com/uniquenetwork/cumulus"339branch = "polkadot-v0.9.21"340default-features = false341342[dependencies.cumulus-pallet-xcmp-queue]343git = "https://github.com/uniquenetwork/cumulus"344branch = "polkadot-v0.9.21"345default-features = false346347[dependencies.cumulus-primitives-utility]348git = "https://github.com/uniquenetwork/cumulus"349branch = "polkadot-v0.9.21"350default-features = false351352[dependencies.cumulus-primitives-timestamp]353git = "https://github.com/uniquenetwork/cumulus"354branch = "polkadot-v0.9.21"355default-features = false356357################################################################################358# Polkadot dependencies359360[dependencies.polkadot-parachain]361git = "https://github.com/paritytech/polkadot"362branch = "release-v0.9.21"363default-features = false364365[dependencies.xcm]366git = "https://github.com/paritytech/polkadot"367branch = "release-v0.9.21"368default-features = false369370[dependencies.xcm-builder]371git = "https://github.com/paritytech/polkadot"372branch = "release-v0.9.21"373default-features = false374375[dependencies.xcm-executor]376git = "https://github.com/paritytech/polkadot"377branch = "release-v0.9.21"378default-features = false379380[dependencies.pallet-xcm]381git = "https://github.com/paritytech/polkadot"382branch = "release-v0.9.21"383default-features = false384385[dependencies.orml-vesting]386git = "https://github.com/uniquenetwork/open-runtime-module-library"387branch = "unique-polkadot-v0.9.21"388version = "0.4.1-dev"389default-features = false390391################################################################################392# RMRK dependencies393394# todo git395[dependencies.rmrk-rpc]396default-features = false397git = "https://github.com/UniqueNetwork/rmrk-substrate.git"398branch = "feature/separate-types-and-traits"399400################################################################################401# local dependencies402403[dependencies]404log = { version = "0.4.16", default-features = false }405unique-runtime-common = { path = "../common", default-features = false }406scale-info = { version = "2.0.1", default-features = false, features = [407 "derive",408] }409derivative = "2.2.0"410pallet-unique = { path = '../../pallets/unique', default-features = false }411up-rpc = { path = "../../primitives/rpc", default-features = false }412fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }413pallet-inflation = { path = '../../pallets/inflation', default-features = false }414up-data-structs = { path = '../../primitives/data-structs', default-features = false }415pallet-common = { default-features = false, path = "../../pallets/common" }416pallet-structure = { default-features = false, path = "../../pallets/structure" }417pallet-fungible = { default-features = false, path = "../../pallets/fungible" }418pallet-refungible = { default-features = false, path = "../../pallets/refungible" }419pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }420pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }421pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }422# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }423pallet-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" }424pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }425pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }426pallet-evm-collection = { path = '../../pallets/evm-collection', default-features = false }427pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }428pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }429pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }430pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }431pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }432fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }433fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }434435################################################################################436# Build Dependencies437438[build-dependencies.substrate-wasm-builder]439git = "https://github.com/paritytech/substrate"440branch = "polkadot-v0.9.21"runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -79,7 +79,7 @@
};
use smallvec::smallvec;
use codec::{Encode, Decode};
-use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping};
+use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping, OnMethodCall};
use fp_rpc::TransactionStatus;
use sp_runtime::{
traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},
@@ -278,6 +278,7 @@
pallet_evm_migration::OnMethodCall<Self>,
pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
CollectionDispatchT<Self>,
+ pallet_evm_collection::CollectionOnMethodCall<Self>,
);
type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
type ChainId = ChainId;
@@ -951,6 +952,11 @@
pub const HelpersContractAddress: H160 = H160([
0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
]);
+
+ // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
+ pub const EvmCollectionAddress: H160 = H160([
+ 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
+ ]);
}
impl pallet_evm_contract_helpers::Config for Runtime {
@@ -958,6 +964,10 @@
type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
}
+impl pallet_evm_collection::Config for Runtime {
+ type ContractAddress = EvmCollectionAddress;
+}
+
construct_runtime!(
pub enum Runtime where
Block = Block,
@@ -1010,6 +1020,7 @@
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,
}
);
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -75,6 +75,7 @@
'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',
@@ -414,6 +415,7 @@
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" }
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -49,7 +49,7 @@
// A few exports that help ease life for downstream crates.
pub use pallet_balances::Call as BalancesCall;
pub use pallet_evm::{
- EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _,
+ EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, OnMethodCall,
};
pub use frame_support::{
construct_runtime, match_types,
@@ -282,6 +282,7 @@
pallet_evm_migration::OnMethodCall<Self>,
pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
CollectionDispatchT<Self>,
+ pallet_evm_collection::CollectionOnMethodCall<Self>,
);
type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
type ChainId = ChainId;
@@ -956,6 +957,11 @@
pub const HelpersContractAddress: H160 = H160([
0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
]);
+
+ // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
+ pub const EvmCollectionAddress: H160 = H160([
+ 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
+ ]);
}
impl pallet_evm_contract_helpers::Config for Runtime {
@@ -963,6 +969,10 @@
type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
}
+impl pallet_evm_collection::Config for Runtime {
+ type ContractAddress = EvmCollectionAddress;
+}
+
construct_runtime!(
pub enum Runtime where
Block = Block,
@@ -1015,6 +1025,7 @@
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,
}
);
tests/src/eth/api/Collection.soldiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/api/Collection.sol
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: OTHER
+// This code is automatically generated
+
+pragma solidity >=0.8.0 <0.9.0;
+
+// Common stubs holder
+interface Dummy {
+
+}
+
+interface ERC165 is Dummy {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool);
+}
+
+// Selector: ee5467a8
+interface Collection is Dummy, ERC165 {
+ // Selector: contractOwner(address) 5152b14c
+ function contractOwner(address contractAddress)
+ external
+ view
+ returns (address);
+
+ // Selector: sponsoringEnabled(address) 6027dc61
+ function sponsoringEnabled(address contractAddress)
+ external
+ view
+ returns (bool);
+
+ // Deprecated
+ //
+ // Selector: toggleSponsoring(address,bool) fcac6d86
+ function toggleSponsoring(address contractAddress, bool enabled) external;
+
+ // Selector: setSponsoringMode(address,uint8) fde8a560
+ function setSponsoringMode(address contractAddress, uint8 mode) external;
+
+ // Selector: sponsoringMode(address) b70c7267
+ function sponsoringMode(address contractAddress)
+ external
+ view
+ returns (uint8);
+
+ // Selector: setSponsoringRateLimit(address,uint32) 77b6c908
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
+ external;
+
+ // Selector: getSponsoringRateLimit(address) 610cfabd
+ function getSponsoringRateLimit(address contractAddress)
+ external
+ view
+ returns (uint32);
+
+ // Selector: allowed(address,address) 5c658165
+ function allowed(address contractAddress, address user)
+ external
+ view
+ returns (bool);
+
+ // Selector: allowlistEnabled(address) c772ef6c
+ function allowlistEnabled(address contractAddress)
+ external
+ view
+ returns (bool);
+
+ // Selector: toggleAllowlist(address,bool) 36de20f5
+ function toggleAllowlist(address contractAddress, bool enabled) external;
+
+ // Selector: toggleAllowed(address,address,bool) 4706cc1c
+ function toggleAllowed(
+ address contractAddress,
+ address user,
+ bool allowed
+ ) external;
+
+ // Selector: create721Collection(string,string,string) 951c0151
+ function create721Collection(
+ string memory name,
+ string memory description,
+ string memory tokenPrefix
+ ) external view returns (address);
+}
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -12,7 +12,7 @@
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
-// Selector: ee5467a8
+// Selector: 7b4866f9
interface ContractHelpers is Dummy, ERC165 {
// Selector: contractOwner(address) 5152b14c
function contractOwner(address contractAddress)
@@ -71,11 +71,4 @@
address user,
bool allowed
) external;
-
- // Selector: create721Collection(string,string,string) 951c0151
- function create721Collection(
- string memory name,
- string memory description,
- string memory tokenPrefix
- ) external view returns (address);
}
tests/src/eth/collectionAbi.jsondiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/collectionAbi.json
@@ -0,0 +1,172 @@
+[
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "address", "name": "user", "type": "address" }
+ ],
+ "name": "allowed",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "allowlistEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "contractOwner",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "string", "name": "name", "type": "string" },
+ { "internalType": "string", "name": "description", "type": "string" },
+ { "internalType": "string", "name": "tokenPrefix", "type": "string" }
+ ],
+ "name": "create721Collection",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "getSponsoringRateLimit",
+ "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "uint8", "name": "mode", "type": "uint8" }
+ ],
+ "name": "setSponsoringMode",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+ ],
+ "name": "setSponsoringRateLimit",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "sponsoringEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "sponsoringMode",
+ "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+ ],
+ "name": "supportsInterface",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "address", "name": "user", "type": "address" },
+ { "internalType": "bool", "name": "allowed", "type": "bool" }
+ ],
+ "name": "toggleAllowed",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "bool", "name": "enabled", "type": "bool" }
+ ],
+ "name": "toggleAllowlist",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ { "internalType": "bool", "name": "enabled", "type": "bool" }
+ ],
+ "name": "toggleSponsoring",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
tests/src/eth/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createCollection.test.ts
+++ b/tests/src/eth/createCollection.test.ts
@@ -16,12 +16,12 @@
import {expect} from 'chai';
import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers';
-import {collectionIdFromAddress, contractHelpers, createEthAccountWithBalance, itWeb3} from './util/helpers';
+import {collectionHelper, collectionIdFromAddress, contractHelpers, createEthAccountWithBalance, itWeb3} from './util/helpers';
describe('Create collection from EVM', () => {
itWeb3('Create collection', async ({api, web3}) => {
const owner = await createEthAccountWithBalance(api, web3);
- const helpers = contractHelpers(web3, owner);
+ const helpers = collectionHelper(web3, owner);
const collectionName = 'CollectionEVM';
const description = 'Some description';
const tokenPrefix = 'token prefix';
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -41,17 +41,6 @@
},
{
"inputs": [
- { "internalType": "string", "name": "name", "type": "string" },
- { "internalType": "string", "name": "description", "type": "string" },
- { "internalType": "string", "name": "tokenPrefix", "type": "string" }
- ],
- "name": "create721Collection",
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
{
"internalType": "address",
"name": "contractAddress",
tests/src/eth/util/helpers.tsdiffbeforeafterboth--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -28,6 +28,7 @@
import config from '../../config';
import privateKey from '../../substrate/privateKey';
import contractHelpersAbi from './contractHelpersAbi.json';
+import collectionAbi from '../collectionAbi.json';
import getBalance from '../../substrate/get-balance';
import waitNewBlocks from '../../substrate/wait-new-blocks';
@@ -273,6 +274,16 @@
return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, ...GAS_ARGS});
}
+/**
+ * pallet evm_collection
+ * @param web3
+ * @param caller - eth address
+ * @returns
+ */
+export function collectionHelper(web3: Web3, caller: string) {
+ return new web3.eth.Contract(collectionAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, ...GAS_ARGS});
+}
+
/**
* Execute ethereum method call using substrate account
* @param to target contract