difftreelog
Merge pull request #871 from UniqueNetwork/feature/move_TokenChanged_event
in: master
21 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2445,8 +2445,8 @@
[[package]]
name = "evm-coder"
-version = "0.3.0"
-source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.0#c4bfdf39d84fbe74c6178417177f2a7f81d92bdd"
+version = "0.3.1"
+source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"
dependencies = [
"ethereum",
"evm-coder-procedural",
@@ -2457,8 +2457,8 @@
[[package]]
name = "evm-coder-procedural"
-version = "0.3.0"
-source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.0#c4bfdf39d84fbe74c6178417177f2a7f81d92bdd"
+version = "0.3.1"
+source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"
dependencies = [
"Inflector",
"hex",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,16 +19,9 @@
[workspace.dependencies]
# Unique
-evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.0", default-features = false }
-struct-versioning = { path = "crates/struct-versioning" }
-precompile-utils-macro = { path = "runtime/common/ethereum/precompiles/utils/macro" }
-up-common = { path = "primitives/common", default-features = false }
-up-data-structs = { path = "primitives/data-structs", default-features = false }
-up-pov-estimate-rpc = { path = "primitives/pov-estimate-rpc", default-features = false }
-up-rpc = { path = "primitives/rpc", default-features = false }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.37" }
-uc-rpc = { path = "client/rpc" }
-unique-rpc = { path = "node/rpc" }
+app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false }
+evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.1", default-features = false }
+pallet-app-promotion = { path = "pallets/app-promotion", default-features = false }
pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.37" }
pallet-collator-selection = { default-features = false, path = "pallets/collator-selection" }
pallet-common = { default-features = false, path = "pallets/common" }
@@ -45,56 +38,59 @@
pallet-nonfungible = { default-features = false, path = "pallets/nonfungible" }
pallet-refungible = { default-features = false, path = "pallets/refungible" }
pallet-structure = { default-features = false, path = "pallets/structure" }
+pallet-test-utils = { default-features = false, path = "test-pallets/utils" }
pallet-unique = { path = "pallets/unique", default-features = false }
pallet-unique-scheduler-v2 = { path = "pallets/scheduler-v2", default-features = false }
-pallet-test-utils = { default-features = false, path = "test-pallets/utils" }
-pallet-app-promotion = { path = "pallets/app-promotion", default-features = false }
-app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false }
+precompile-utils-macro = { path = "runtime/common/ethereum/precompiles/utils/macro" }
+struct-versioning = { path = "crates/struct-versioning" }
+uc-rpc = { path = "client/rpc" }
+unique-rpc = { path = "node/rpc" }
+up-common = { path = "primitives/common", default-features = false }
+up-data-structs = { path = "primitives/data-structs", default-features = false }
+up-pov-estimate-rpc = { path = "primitives/pov-estimate-rpc", default-features = false }
+up-rpc = { path = "primitives/rpc", default-features = false }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.37" }
# Unique: Runtimes
+opal-runtime = { path = "runtime/opal" }
+quartz-runtime = { path = "runtime/quartz" }
unique-runtime = { path = "runtime/unique" }
-quartz-runtime = { path = "runtime/quartz" }
-opal-runtime = { path = "runtime/opal" }
# Frontier (Unique patches over the Parity version)
+fc-consensus = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
+fc-db = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
+fc-mapping-sync = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
+fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
+fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-fc-db = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-fc-consensus = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-fc-mapping-sync = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
+pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
-pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.37" }
# Parity
codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.2.2" }
-scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
-polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
-polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
-polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
-cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
-cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
-cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
-cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
+cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
+cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
+cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
+cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
@@ -107,67 +103,71 @@
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
-pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37" }
+polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
+polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
+polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" }
+sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
# Parity: Build utils
+substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
# Parity: Benchmarking
+frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
# Parity: Try Runtime
+frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
-frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
# ORML
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.37", default-features = false }
@@ -176,15 +176,15 @@
orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.37", default-features = false }
# Other
-smallvec = "1.6.1"
derivative = { version = "2.2.0", features = ["use_core"] }
-serde = { default-features = false, features = ['derive'], version = "1.0.136" }
-log = { version = "0.4.16", default-features = false }
-num_enum = { version = "0.5.3", default-features = false }
+ethereum = { version = "0.14.0", default-features = false }
+evm-core = { default-features = false, version = "0.37.0" }
hex-literal = "0.3.4"
impl-trait-for-tuples = "0.2.2"
+jsonrpsee = { version = "0.16.2", features = ["macros", "server"] }
+log = { version = "0.4.16", default-features = false }
logtest = "2.0.0"
-ethereum = { version = "0.14.0", default-features = false }
-evm-core = { default-features = false, version = "0.37.0" }
+num_enum = { version = "0.5.3", default-features = false }
primitive-types = { version = "0.12.1", default-features = false }
-jsonrpsee = { version = "0.16.2", features = ["macros", "server"] }
+serde = { default-features = false, features = ['derive'], version = "1.0.136" }
+smallvec = "1.6.1"
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -26,7 +26,6 @@
};
use pallet_evm_coder_substrate::dispatch_to_evm;
use sp_std::{vec, vec::Vec};
-use sp_core::U256;
use up_data_structs::{
CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property, SponsoringRateLimit,
SponsorshipState,
@@ -62,18 +61,9 @@
},
/// The collection has been changed.
CollectionChanged {
- /// Collection ID.
- #[indexed]
- collection_id: Address,
- },
-
- /// The token has been changed.
- TokenChanged {
/// Collection ID.
#[indexed]
collection_id: Address,
- /// Token ID.
- token_id: U256,
},
}
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -86,7 +86,6 @@
use sp_core::H160;
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
-use crate::erc::CollectionHelpersEvents;
#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarking;
pub mod dispatch;
@@ -1250,6 +1249,7 @@
mut stored_properties: Properties,
is_token_owner: impl Fn() -> Result<bool, DispatchError>,
set_token_properties: impl FnOnce(Properties),
+ log: evm_coder::ethereum::Log,
) -> DispatchResult {
let is_collection_admin = collection.is_owner_or_admin(sender);
let permissions = Self::property_permissions(collection.id);
@@ -1304,13 +1304,7 @@
}
}
- <PalletEvm<T>>::deposit_log(
- CollectionHelpersEvents::TokenChanged {
- collection_id: eth::collection_id_to_address(collection.id),
- token_id: token_id.into(),
- }
- .to_log(T::ContractAddress::get()),
- );
+ <PalletEvm<T>>::deposit_log(log.clone());
}
set_token_properties(stored_properties);
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -50,13 +50,24 @@
TokenProperties, SelfWeightOf, weights::WeightInfo,
};
+/// Nft events.
+#[derive(ToLog)]
+pub enum ERC721TokenEvent {
+ /// The token has been changed.
+ TokenChanged {
+ /// Token ID.
+ #[indexed]
+ token_id: U256,
+ },
+}
+
frontier_contract! {
macro_rules! NonfungibleHandle_result {...}
impl<T: Config> Contract for NonfungibleHandle<T> {...}
}
/// @title A contract that allows to set and delete token properties and change token property permissions.
-#[solidity_interface(name = TokenProperties, enum(derive(PreDispatch)), enum_attr(weight))]
+#[solidity_interface(name = TokenProperties, events(ERC721TokenEvent), enum(derive(PreDispatch)), enum_attr(weight))]
impl<T: Config> NonfungibleHandle<T> {
/// @notice Set permissions for token property.
/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -112,7 +112,7 @@
};
use pallet_structure::{Pallet as PalletStructure, Error as StructureError};
use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
-use sp_core::H160;
+use sp_core::{Get, H160};
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use core::ops::Deref;
@@ -622,6 +622,10 @@
stored_properties,
is_token_owner,
|properties| <TokenProperties<T>>::set((collection.id, token_id), properties),
+ erc::ERC721TokenEvent::TokenChanged {
+ token_id: token_id.into(),
+ }
+ .to_log(T::ContractAddress::get()),
)
}
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -17,9 +17,14 @@
}
}
+/// @dev inlined interface
+contract ERC721TokenEvent {
+ event TokenChanged(uint256 indexed tokenId);
+}
+
/// @title A contract that allows to set and delete token properties and change token property permissions.
/// @dev the ERC-165 identifier for this interface is 0xde0695c2
-contract TokenProperties is Dummy, ERC165 {
+contract TokenProperties is Dummy, ERC165, ERC721TokenEvent {
// /// @notice Set permissions for token property.
// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.
// /// @param key Property key.
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -59,8 +59,19 @@
pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);
+/// Rft events.
+#[derive(ToLog)]
+pub enum ERC721TokenEvent {
+ /// The token has been changed.
+ TokenChanged {
+ /// Token ID.
+ #[indexed]
+ token_id: U256,
+ },
+}
+
/// @title A contract that allows to set and delete token properties and change token property permissions.
-#[solidity_interface(name = TokenProperties, enum(derive(PreDispatch)), enum_attr(weight))]
+#[solidity_interface(name = TokenProperties, events(ERC721TokenEvent), enum(derive(PreDispatch)), enum_attr(weight))]
impl<T: Config> RefungibleHandle<T> {
/// @notice Set permissions for token property.
/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -100,7 +100,7 @@
Event as CommonEvent, Pallet as PalletCommon,
};
use pallet_structure::Pallet as PalletStructure;
-use sp_core::H160;
+use sp_core::{Get, H160};
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use up_data_structs::{
@@ -571,6 +571,10 @@
stored_properties,
is_token_owner,
|properties| <TokenProperties<T>>::set((collection.id, token_id), properties),
+ erc::ERC721TokenEvent::TokenChanged {
+ token_id: token_id.into(),
+ }
+ .to_log(T::ContractAddress::get()),
)
}
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -17,9 +17,14 @@
}
}
+/// @dev inlined interface
+contract ERC721TokenEvent {
+ event TokenChanged(uint256 indexed tokenId);
+}
+
/// @title A contract that allows to set and delete token properties and change token property permissions.
/// @dev the ERC-165 identifier for this interface is 0xde0695c2
-contract TokenProperties is Dummy, ERC165 {
+contract TokenProperties is Dummy, ERC165, ERC721TokenEvent {
// /// @notice Set permissions for token property.
// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.
// /// @param key Property key.
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -22,7 +22,6 @@
event CollectionCreated(address indexed owner, address indexed collectionId);
event CollectionDestroyed(address indexed collectionId);
event CollectionChanged(address indexed collectionId);
- event TokenChanged(address indexed collectionId, uint256 tokenId);
}
/// @title Contract, which allows users to operate with collections
tests/src/eth/abi/collectionHelpers.jsondiffbeforeafterboth--- a/tests/src/eth/abi/collectionHelpers.json
+++ b/tests/src/eth/abi/collectionHelpers.json
@@ -45,25 +45,6 @@
"type": "event"
},
{
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "internalType": "address",
- "name": "collectionId",
- "type": "address"
- },
- {
- "indexed": false,
- "internalType": "uint256",
- "name": "tokenId",
- "type": "uint256"
- }
- ],
- "name": "TokenChanged",
- "type": "event"
- },
- {
"inputs": [
{ "internalType": "uint32", "name": "collectionId", "type": "uint32" }
],
tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/nonFungible.json
+++ b/tests/src/eth/abi/nonFungible.json
@@ -54,6 +54,19 @@
"inputs": [
{
"indexed": true,
+ "internalType": "uint256",
+ "name": "tokenId",
+ "type": "uint256"
+ }
+ ],
+ "name": "TokenChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
tests/src/eth/abi/reFungible.jsondiffbeforeafterboth1[2 {3 "anonymous": false,4 "inputs": [5 {6 "indexed": true,7 "internalType": "address",8 "name": "owner",9 "type": "address"10 },11 {12 "indexed": true,13 "internalType": "address",14 "name": "approved",15 "type": "address"16 },17 {18 "indexed": true,19 "internalType": "uint256",20 "name": "tokenId",21 "type": "uint256"22 }23 ],24 "name": "Approval",25 "type": "event"26 },27 {28 "anonymous": false,29 "inputs": [30 {31 "indexed": true,32 "internalType": "address",33 "name": "owner",34 "type": "address"35 },36 {37 "indexed": true,38 "internalType": "address",39 "name": "operator",40 "type": "address"41 },42 {43 "indexed": false,44 "internalType": "bool",45 "name": "approved",46 "type": "bool"47 }48 ],49 "name": "ApprovalForAll",50 "type": "event"51 },52 {53 "anonymous": false,54 "inputs": [55 {56 "indexed": true,57 "internalType": "address",58 "name": "from",59 "type": "address"60 },61 {62 "indexed": true,63 "internalType": "address",64 "name": "to",65 "type": "address"66 },67 {68 "indexed": true,69 "internalType": "uint256",70 "name": "tokenId",71 "type": "uint256"72 }73 ],74 "name": "Transfer",75 "type": "event"76 },77 {78 "inputs": [79 {80 "components": [81 { "internalType": "address", "name": "eth", "type": "address" },82 { "internalType": "uint256", "name": "sub", "type": "uint256" }83 ],84 "internalType": "struct CrossAddress",85 "name": "newAdmin",86 "type": "tuple"87 }88 ],89 "name": "addCollectionAdminCross",90 "outputs": [],91 "stateMutability": "nonpayable",92 "type": "function"93 },94 {95 "inputs": [96 {97 "components": [98 { "internalType": "address", "name": "eth", "type": "address" },99 { "internalType": "uint256", "name": "sub", "type": "uint256" }100 ],101 "internalType": "struct CrossAddress",102 "name": "user",103 "type": "tuple"104 }105 ],106 "name": "addToCollectionAllowListCross",107 "outputs": [],108 "stateMutability": "nonpayable",109 "type": "function"110 },111 {112 "inputs": [113 {114 "components": [115 { "internalType": "address", "name": "eth", "type": "address" },116 { "internalType": "uint256", "name": "sub", "type": "uint256" }117 ],118 "internalType": "struct CrossAddress",119 "name": "user",120 "type": "tuple"121 }122 ],123 "name": "allowlistedCross",124 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],125 "stateMutability": "view",126 "type": "function"127 },128 {129 "inputs": [130 { "internalType": "address", "name": "approved", "type": "address" },131 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }132 ],133 "name": "approve",134 "outputs": [],135 "stateMutability": "nonpayable",136 "type": "function"137 },138 {139 "inputs": [140 { "internalType": "address", "name": "owner", "type": "address" }141 ],142 "name": "balanceOf",143 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],144 "stateMutability": "view",145 "type": "function"146 },147 {148 "inputs": [149 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }150 ],151 "name": "burn",152 "outputs": [],153 "stateMutability": "nonpayable",154 "type": "function"155 },156 {157 "inputs": [158 {159 "components": [160 { "internalType": "address", "name": "eth", "type": "address" },161 { "internalType": "uint256", "name": "sub", "type": "uint256" }162 ],163 "internalType": "struct CrossAddress",164 "name": "from",165 "type": "tuple"166 },167 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }168 ],169 "name": "burnFromCross",170 "outputs": [],171 "stateMutability": "nonpayable",172 "type": "function"173 },174 {175 "inputs": [176 {177 "components": [178 { "internalType": "address", "name": "eth", "type": "address" },179 { "internalType": "uint256", "name": "sub", "type": "uint256" }180 ],181 "internalType": "struct CrossAddress",182 "name": "newOwner",183 "type": "tuple"184 }185 ],186 "name": "changeCollectionOwnerCross",187 "outputs": [],188 "stateMutability": "nonpayable",189 "type": "function"190 },191 {192 "inputs": [],193 "name": "collectionAdmins",194 "outputs": [195 {196 "components": [197 { "internalType": "address", "name": "eth", "type": "address" },198 { "internalType": "uint256", "name": "sub", "type": "uint256" }199 ],200 "internalType": "struct CrossAddress[]",201 "name": "",202 "type": "tuple[]"203 }204 ],205 "stateMutability": "view",206 "type": "function"207 },208 {209 "inputs": [],210 "name": "collectionHelperAddress",211 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],212 "stateMutability": "view",213 "type": "function"214 },215 {216 "inputs": [],217 "name": "collectionLimits",218 "outputs": [219 {220 "components": [221 {222 "internalType": "enum CollectionLimitField",223 "name": "field",224 "type": "uint8"225 },226 {227 "components": [228 { "internalType": "bool", "name": "status", "type": "bool" },229 { "internalType": "uint256", "name": "value", "type": "uint256" }230 ],231 "internalType": "struct OptionUint256",232 "name": "value",233 "type": "tuple"234 }235 ],236 "internalType": "struct CollectionLimit[]",237 "name": "",238 "type": "tuple[]"239 }240 ],241 "stateMutability": "view",242 "type": "function"243 },244 {245 "inputs": [],246 "name": "collectionNestingPermissions",247 "outputs": [248 {249 "components": [250 {251 "internalType": "enum CollectionPermissionField",252 "name": "field",253 "type": "uint8"254 },255 { "internalType": "bool", "name": "value", "type": "bool" }256 ],257 "internalType": "struct CollectionNestingPermission[]",258 "name": "",259 "type": "tuple[]"260 }261 ],262 "stateMutability": "view",263 "type": "function"264 },265 {266 "inputs": [],267 "name": "collectionNestingRestrictedCollectionIds",268 "outputs": [269 {270 "components": [271 { "internalType": "bool", "name": "token_owner", "type": "bool" },272 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }273 ],274 "internalType": "struct CollectionNesting",275 "name": "",276 "type": "tuple"277 }278 ],279 "stateMutability": "view",280 "type": "function"281 },282 {283 "inputs": [],284 "name": "collectionOwner",285 "outputs": [286 {287 "components": [288 { "internalType": "address", "name": "eth", "type": "address" },289 { "internalType": "uint256", "name": "sub", "type": "uint256" }290 ],291 "internalType": "struct CrossAddress",292 "name": "",293 "type": "tuple"294 }295 ],296 "stateMutability": "view",297 "type": "function"298 },299 {300 "inputs": [301 { "internalType": "string[]", "name": "keys", "type": "string[]" }302 ],303 "name": "collectionProperties",304 "outputs": [305 {306 "components": [307 { "internalType": "string", "name": "key", "type": "string" },308 { "internalType": "bytes", "name": "value", "type": "bytes" }309 ],310 "internalType": "struct Property[]",311 "name": "",312 "type": "tuple[]"313 }314 ],315 "stateMutability": "view",316 "type": "function"317 },318 {319 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],320 "name": "collectionProperty",321 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],322 "stateMutability": "view",323 "type": "function"324 },325 {326 "inputs": [],327 "name": "collectionSponsor",328 "outputs": [329 {330 "components": [331 { "internalType": "address", "name": "eth", "type": "address" },332 { "internalType": "uint256", "name": "sub", "type": "uint256" }333 ],334 "internalType": "struct CrossAddress",335 "name": "",336 "type": "tuple"337 }338 ],339 "stateMutability": "view",340 "type": "function"341 },342 {343 "inputs": [],344 "name": "confirmCollectionSponsorship",345 "outputs": [],346 "stateMutability": "nonpayable",347 "type": "function"348 },349 {350 "inputs": [],351 "name": "contractAddress",352 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],353 "stateMutability": "view",354 "type": "function"355 },356 {357 "inputs": [358 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }359 ],360 "name": "crossOwnerOf",361 "outputs": [362 {363 "components": [364 { "internalType": "address", "name": "eth", "type": "address" },365 { "internalType": "uint256", "name": "sub", "type": "uint256" }366 ],367 "internalType": "struct CrossAddress",368 "name": "",369 "type": "tuple"370 }371 ],372 "stateMutability": "view",373 "type": "function"374 },375 {376 "inputs": [377 { "internalType": "string[]", "name": "keys", "type": "string[]" }378 ],379 "name": "deleteCollectionProperties",380 "outputs": [],381 "stateMutability": "nonpayable",382 "type": "function"383 },384 {385 "inputs": [386 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },387 { "internalType": "string[]", "name": "keys", "type": "string[]" }388 ],389 "name": "deleteProperties",390 "outputs": [],391 "stateMutability": "nonpayable",392 "type": "function"393 },394 {395 "inputs": [],396 "name": "description",397 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],398 "stateMutability": "view",399 "type": "function"400 },401 {402 "inputs": [403 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }404 ],405 "name": "getApproved",406 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],407 "stateMutability": "view",408 "type": "function"409 },410 {411 "inputs": [],412 "name": "hasCollectionPendingSponsor",413 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],414 "stateMutability": "view",415 "type": "function"416 },417 {418 "inputs": [419 { "internalType": "address", "name": "owner", "type": "address" },420 { "internalType": "address", "name": "operator", "type": "address" }421 ],422 "name": "isApprovedForAll",423 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],424 "stateMutability": "view",425 "type": "function"426 },427 {428 "inputs": [429 {430 "components": [431 { "internalType": "address", "name": "eth", "type": "address" },432 { "internalType": "uint256", "name": "sub", "type": "uint256" }433 ],434 "internalType": "struct CrossAddress",435 "name": "user",436 "type": "tuple"437 }438 ],439 "name": "isOwnerOrAdminCross",440 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],441 "stateMutability": "view",442 "type": "function"443 },444 {445 "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],446 "name": "mint",447 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],448 "stateMutability": "nonpayable",449 "type": "function"450 },451 {452 "inputs": [453 {454 "components": [455 { "internalType": "address", "name": "eth", "type": "address" },456 { "internalType": "uint256", "name": "sub", "type": "uint256" }457 ],458 "internalType": "struct CrossAddress",459 "name": "to",460 "type": "tuple"461 },462 {463 "components": [464 { "internalType": "string", "name": "key", "type": "string" },465 { "internalType": "bytes", "name": "value", "type": "bytes" }466 ],467 "internalType": "struct Property[]",468 "name": "properties",469 "type": "tuple[]"470 }471 ],472 "name": "mintCross",473 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],474 "stateMutability": "nonpayable",475 "type": "function"476 },477 {478 "inputs": [479 { "internalType": "address", "name": "to", "type": "address" },480 { "internalType": "string", "name": "tokenUri", "type": "string" }481 ],482 "name": "mintWithTokenURI",483 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],484 "stateMutability": "nonpayable",485 "type": "function"486 },487 {488 "inputs": [],489 "name": "name",490 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],491 "stateMutability": "view",492 "type": "function"493 },494 {495 "inputs": [],496 "name": "nextTokenId",497 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],498 "stateMutability": "view",499 "type": "function"500 },501 {502 "inputs": [503 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }504 ],505 "name": "ownerOf",506 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],507 "stateMutability": "view",508 "type": "function"509 },510 {511 "inputs": [512 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },513 { "internalType": "string[]", "name": "keys", "type": "string[]" }514 ],515 "name": "properties",516 "outputs": [517 {518 "components": [519 { "internalType": "string", "name": "key", "type": "string" },520 { "internalType": "bytes", "name": "value", "type": "bytes" }521 ],522 "internalType": "struct Property[]",523 "name": "",524 "type": "tuple[]"525 }526 ],527 "stateMutability": "view",528 "type": "function"529 },530 {531 "inputs": [532 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },533 { "internalType": "string", "name": "key", "type": "string" }534 ],535 "name": "property",536 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],537 "stateMutability": "view",538 "type": "function"539 },540 {541 "inputs": [542 {543 "components": [544 { "internalType": "address", "name": "eth", "type": "address" },545 { "internalType": "uint256", "name": "sub", "type": "uint256" }546 ],547 "internalType": "struct CrossAddress",548 "name": "admin",549 "type": "tuple"550 }551 ],552 "name": "removeCollectionAdminCross",553 "outputs": [],554 "stateMutability": "nonpayable",555 "type": "function"556 },557 {558 "inputs": [],559 "name": "removeCollectionSponsor",560 "outputs": [],561 "stateMutability": "nonpayable",562 "type": "function"563 },564 {565 "inputs": [566 {567 "components": [568 { "internalType": "address", "name": "eth", "type": "address" },569 { "internalType": "uint256", "name": "sub", "type": "uint256" }570 ],571 "internalType": "struct CrossAddress",572 "name": "user",573 "type": "tuple"574 }575 ],576 "name": "removeFromCollectionAllowListCross",577 "outputs": [],578 "stateMutability": "nonpayable",579 "type": "function"580 },581 {582 "inputs": [583 { "internalType": "address", "name": "from", "type": "address" },584 { "internalType": "address", "name": "to", "type": "address" },585 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }586 ],587 "name": "safeTransferFrom",588 "outputs": [],589 "stateMutability": "nonpayable",590 "type": "function"591 },592 {593 "inputs": [594 { "internalType": "address", "name": "from", "type": "address" },595 { "internalType": "address", "name": "to", "type": "address" },596 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },597 { "internalType": "bytes", "name": "data", "type": "bytes" }598 ],599 "name": "safeTransferFrom",600 "outputs": [],601 "stateMutability": "nonpayable",602 "type": "function"603 },604 {605 "inputs": [606 { "internalType": "address", "name": "operator", "type": "address" },607 { "internalType": "bool", "name": "approved", "type": "bool" }608 ],609 "name": "setApprovalForAll",610 "outputs": [],611 "stateMutability": "nonpayable",612 "type": "function"613 },614 {615 "inputs": [616 { "internalType": "enum AccessMode", "name": "mode", "type": "uint8" }617 ],618 "name": "setCollectionAccess",619 "outputs": [],620 "stateMutability": "nonpayable",621 "type": "function"622 },623 {624 "inputs": [625 {626 "components": [627 {628 "internalType": "enum CollectionLimitField",629 "name": "field",630 "type": "uint8"631 },632 {633 "components": [634 { "internalType": "bool", "name": "status", "type": "bool" },635 { "internalType": "uint256", "name": "value", "type": "uint256" }636 ],637 "internalType": "struct OptionUint256",638 "name": "value",639 "type": "tuple"640 }641 ],642 "internalType": "struct CollectionLimit",643 "name": "limit",644 "type": "tuple"645 }646 ],647 "name": "setCollectionLimit",648 "outputs": [],649 "stateMutability": "nonpayable",650 "type": "function"651 },652 {653 "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],654 "name": "setCollectionMintMode",655 "outputs": [],656 "stateMutability": "nonpayable",657 "type": "function"658 },659 {660 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],661 "name": "setCollectionNesting",662 "outputs": [],663 "stateMutability": "nonpayable",664 "type": "function"665 },666 {667 "inputs": [668 { "internalType": "bool", "name": "enable", "type": "bool" },669 {670 "internalType": "address[]",671 "name": "collections",672 "type": "address[]"673 }674 ],675 "name": "setCollectionNesting",676 "outputs": [],677 "stateMutability": "nonpayable",678 "type": "function"679 },680 {681 "inputs": [682 {683 "components": [684 { "internalType": "string", "name": "key", "type": "string" },685 { "internalType": "bytes", "name": "value", "type": "bytes" }686 ],687 "internalType": "struct Property[]",688 "name": "properties",689 "type": "tuple[]"690 }691 ],692 "name": "setCollectionProperties",693 "outputs": [],694 "stateMutability": "nonpayable",695 "type": "function"696 },697 {698 "inputs": [699 {700 "components": [701 { "internalType": "address", "name": "eth", "type": "address" },702 { "internalType": "uint256", "name": "sub", "type": "uint256" }703 ],704 "internalType": "struct CrossAddress",705 "name": "sponsor",706 "type": "tuple"707 }708 ],709 "name": "setCollectionSponsorCross",710 "outputs": [],711 "stateMutability": "nonpayable",712 "type": "function"713 },714 {715 "inputs": [716 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },717 {718 "components": [719 { "internalType": "string", "name": "key", "type": "string" },720 { "internalType": "bytes", "name": "value", "type": "bytes" }721 ],722 "internalType": "struct Property[]",723 "name": "properties",724 "type": "tuple[]"725 }726 ],727 "name": "setProperties",728 "outputs": [],729 "stateMutability": "nonpayable",730 "type": "function"731 },732 {733 "inputs": [734 {735 "components": [736 { "internalType": "string", "name": "key", "type": "string" },737 {738 "components": [739 {740 "internalType": "enum TokenPermissionField",741 "name": "code",742 "type": "uint8"743 },744 { "internalType": "bool", "name": "value", "type": "bool" }745 ],746 "internalType": "struct PropertyPermission[]",747 "name": "permissions",748 "type": "tuple[]"749 }750 ],751 "internalType": "struct TokenPropertyPermission[]",752 "name": "permissions",753 "type": "tuple[]"754 }755 ],756 "name": "setTokenPropertyPermissions",757 "outputs": [],758 "stateMutability": "nonpayable",759 "type": "function"760 },761 {762 "inputs": [763 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }764 ],765 "name": "supportsInterface",766 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],767 "stateMutability": "view",768 "type": "function"769 },770 {771 "inputs": [],772 "name": "symbol",773 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],774 "stateMutability": "view",775 "type": "function"776 },777 {778 "inputs": [779 { "internalType": "uint256", "name": "index", "type": "uint256" }780 ],781 "name": "tokenByIndex",782 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],783 "stateMutability": "view",784 "type": "function"785 },786 {787 "inputs": [788 { "internalType": "uint256", "name": "token", "type": "uint256" }789 ],790 "name": "tokenContractAddress",791 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],792 "stateMutability": "view",793 "type": "function"794 },795 {796 "inputs": [797 { "internalType": "address", "name": "owner", "type": "address" },798 { "internalType": "uint256", "name": "index", "type": "uint256" }799 ],800 "name": "tokenOfOwnerByIndex",801 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],802 "stateMutability": "view",803 "type": "function"804 },805 {806 "inputs": [],807 "name": "tokenPropertyPermissions",808 "outputs": [809 {810 "components": [811 { "internalType": "string", "name": "key", "type": "string" },812 {813 "components": [814 {815 "internalType": "enum TokenPermissionField",816 "name": "code",817 "type": "uint8"818 },819 { "internalType": "bool", "name": "value", "type": "bool" }820 ],821 "internalType": "struct PropertyPermission[]",822 "name": "permissions",823 "type": "tuple[]"824 }825 ],826 "internalType": "struct TokenPropertyPermission[]",827 "name": "",828 "type": "tuple[]"829 }830 ],831 "stateMutability": "view",832 "type": "function"833 },834 {835 "inputs": [836 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }837 ],838 "name": "tokenURI",839 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],840 "stateMutability": "view",841 "type": "function"842 },843 {844 "inputs": [],845 "name": "totalSupply",846 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],847 "stateMutability": "view",848 "type": "function"849 },850 {851 "inputs": [852 { "internalType": "address", "name": "to", "type": "address" },853 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }854 ],855 "name": "transfer",856 "outputs": [],857 "stateMutability": "nonpayable",858 "type": "function"859 },860 {861 "inputs": [862 {863 "components": [864 { "internalType": "address", "name": "eth", "type": "address" },865 { "internalType": "uint256", "name": "sub", "type": "uint256" }866 ],867 "internalType": "struct CrossAddress",868 "name": "to",869 "type": "tuple"870 },871 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }872 ],873 "name": "transferCross",874 "outputs": [],875 "stateMutability": "nonpayable",876 "type": "function"877 },878 {879 "inputs": [880 { "internalType": "address", "name": "from", "type": "address" },881 { "internalType": "address", "name": "to", "type": "address" },882 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }883 ],884 "name": "transferFrom",885 "outputs": [],886 "stateMutability": "nonpayable",887 "type": "function"888 },889 {890 "inputs": [891 {892 "components": [893 { "internalType": "address", "name": "eth", "type": "address" },894 { "internalType": "uint256", "name": "sub", "type": "uint256" }895 ],896 "internalType": "struct CrossAddress",897 "name": "from",898 "type": "tuple"899 },900 {901 "components": [902 { "internalType": "address", "name": "eth", "type": "address" },903 { "internalType": "uint256", "name": "sub", "type": "uint256" }904 ],905 "internalType": "struct CrossAddress",906 "name": "to",907 "type": "tuple"908 },909 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }910 ],911 "name": "transferFromCross",912 "outputs": [],913 "stateMutability": "nonpayable",914 "type": "function"915 },916 {917 "inputs": [],918 "name": "uniqueCollectionType",919 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],920 "stateMutability": "view",921 "type": "function"922 }923]1[2 {3 "anonymous": false,4 "inputs": [5 {6 "indexed": true,7 "internalType": "address",8 "name": "owner",9 "type": "address"10 },11 {12 "indexed": true,13 "internalType": "address",14 "name": "approved",15 "type": "address"16 },17 {18 "indexed": true,19 "internalType": "uint256",20 "name": "tokenId",21 "type": "uint256"22 }23 ],24 "name": "Approval",25 "type": "event"26 },27 {28 "anonymous": false,29 "inputs": [30 {31 "indexed": true,32 "internalType": "address",33 "name": "owner",34 "type": "address"35 },36 {37 "indexed": true,38 "internalType": "address",39 "name": "operator",40 "type": "address"41 },42 {43 "indexed": false,44 "internalType": "bool",45 "name": "approved",46 "type": "bool"47 }48 ],49 "name": "ApprovalForAll",50 "type": "event"51 },52 {53 "anonymous": false,54 "inputs": [55 {56 "indexed": true,57 "internalType": "uint256",58 "name": "tokenId",59 "type": "uint256"60 }61 ],62 "name": "TokenChanged",63 "type": "event"64 },65 {66 "anonymous": false,67 "inputs": [68 {69 "indexed": true,70 "internalType": "address",71 "name": "from",72 "type": "address"73 },74 {75 "indexed": true,76 "internalType": "address",77 "name": "to",78 "type": "address"79 },80 {81 "indexed": true,82 "internalType": "uint256",83 "name": "tokenId",84 "type": "uint256"85 }86 ],87 "name": "Transfer",88 "type": "event"89 },90 {91 "inputs": [92 {93 "components": [94 { "internalType": "address", "name": "eth", "type": "address" },95 { "internalType": "uint256", "name": "sub", "type": "uint256" }96 ],97 "internalType": "struct CrossAddress",98 "name": "newAdmin",99 "type": "tuple"100 }101 ],102 "name": "addCollectionAdminCross",103 "outputs": [],104 "stateMutability": "nonpayable",105 "type": "function"106 },107 {108 "inputs": [109 {110 "components": [111 { "internalType": "address", "name": "eth", "type": "address" },112 { "internalType": "uint256", "name": "sub", "type": "uint256" }113 ],114 "internalType": "struct CrossAddress",115 "name": "user",116 "type": "tuple"117 }118 ],119 "name": "addToCollectionAllowListCross",120 "outputs": [],121 "stateMutability": "nonpayable",122 "type": "function"123 },124 {125 "inputs": [126 {127 "components": [128 { "internalType": "address", "name": "eth", "type": "address" },129 { "internalType": "uint256", "name": "sub", "type": "uint256" }130 ],131 "internalType": "struct CrossAddress",132 "name": "user",133 "type": "tuple"134 }135 ],136 "name": "allowlistedCross",137 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],138 "stateMutability": "view",139 "type": "function"140 },141 {142 "inputs": [143 { "internalType": "address", "name": "approved", "type": "address" },144 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }145 ],146 "name": "approve",147 "outputs": [],148 "stateMutability": "nonpayable",149 "type": "function"150 },151 {152 "inputs": [153 { "internalType": "address", "name": "owner", "type": "address" }154 ],155 "name": "balanceOf",156 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],157 "stateMutability": "view",158 "type": "function"159 },160 {161 "inputs": [162 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }163 ],164 "name": "burn",165 "outputs": [],166 "stateMutability": "nonpayable",167 "type": "function"168 },169 {170 "inputs": [171 {172 "components": [173 { "internalType": "address", "name": "eth", "type": "address" },174 { "internalType": "uint256", "name": "sub", "type": "uint256" }175 ],176 "internalType": "struct CrossAddress",177 "name": "from",178 "type": "tuple"179 },180 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }181 ],182 "name": "burnFromCross",183 "outputs": [],184 "stateMutability": "nonpayable",185 "type": "function"186 },187 {188 "inputs": [189 {190 "components": [191 { "internalType": "address", "name": "eth", "type": "address" },192 { "internalType": "uint256", "name": "sub", "type": "uint256" }193 ],194 "internalType": "struct CrossAddress",195 "name": "newOwner",196 "type": "tuple"197 }198 ],199 "name": "changeCollectionOwnerCross",200 "outputs": [],201 "stateMutability": "nonpayable",202 "type": "function"203 },204 {205 "inputs": [],206 "name": "collectionAdmins",207 "outputs": [208 {209 "components": [210 { "internalType": "address", "name": "eth", "type": "address" },211 { "internalType": "uint256", "name": "sub", "type": "uint256" }212 ],213 "internalType": "struct CrossAddress[]",214 "name": "",215 "type": "tuple[]"216 }217 ],218 "stateMutability": "view",219 "type": "function"220 },221 {222 "inputs": [],223 "name": "collectionHelperAddress",224 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],225 "stateMutability": "view",226 "type": "function"227 },228 {229 "inputs": [],230 "name": "collectionLimits",231 "outputs": [232 {233 "components": [234 {235 "internalType": "enum CollectionLimitField",236 "name": "field",237 "type": "uint8"238 },239 {240 "components": [241 { "internalType": "bool", "name": "status", "type": "bool" },242 { "internalType": "uint256", "name": "value", "type": "uint256" }243 ],244 "internalType": "struct OptionUint256",245 "name": "value",246 "type": "tuple"247 }248 ],249 "internalType": "struct CollectionLimit[]",250 "name": "",251 "type": "tuple[]"252 }253 ],254 "stateMutability": "view",255 "type": "function"256 },257 {258 "inputs": [],259 "name": "collectionNestingPermissions",260 "outputs": [261 {262 "components": [263 {264 "internalType": "enum CollectionPermissionField",265 "name": "field",266 "type": "uint8"267 },268 { "internalType": "bool", "name": "value", "type": "bool" }269 ],270 "internalType": "struct CollectionNestingPermission[]",271 "name": "",272 "type": "tuple[]"273 }274 ],275 "stateMutability": "view",276 "type": "function"277 },278 {279 "inputs": [],280 "name": "collectionNestingRestrictedCollectionIds",281 "outputs": [282 {283 "components": [284 { "internalType": "bool", "name": "token_owner", "type": "bool" },285 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }286 ],287 "internalType": "struct CollectionNesting",288 "name": "",289 "type": "tuple"290 }291 ],292 "stateMutability": "view",293 "type": "function"294 },295 {296 "inputs": [],297 "name": "collectionOwner",298 "outputs": [299 {300 "components": [301 { "internalType": "address", "name": "eth", "type": "address" },302 { "internalType": "uint256", "name": "sub", "type": "uint256" }303 ],304 "internalType": "struct CrossAddress",305 "name": "",306 "type": "tuple"307 }308 ],309 "stateMutability": "view",310 "type": "function"311 },312 {313 "inputs": [314 { "internalType": "string[]", "name": "keys", "type": "string[]" }315 ],316 "name": "collectionProperties",317 "outputs": [318 {319 "components": [320 { "internalType": "string", "name": "key", "type": "string" },321 { "internalType": "bytes", "name": "value", "type": "bytes" }322 ],323 "internalType": "struct Property[]",324 "name": "",325 "type": "tuple[]"326 }327 ],328 "stateMutability": "view",329 "type": "function"330 },331 {332 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],333 "name": "collectionProperty",334 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],335 "stateMutability": "view",336 "type": "function"337 },338 {339 "inputs": [],340 "name": "collectionSponsor",341 "outputs": [342 {343 "components": [344 { "internalType": "address", "name": "eth", "type": "address" },345 { "internalType": "uint256", "name": "sub", "type": "uint256" }346 ],347 "internalType": "struct CrossAddress",348 "name": "",349 "type": "tuple"350 }351 ],352 "stateMutability": "view",353 "type": "function"354 },355 {356 "inputs": [],357 "name": "confirmCollectionSponsorship",358 "outputs": [],359 "stateMutability": "nonpayable",360 "type": "function"361 },362 {363 "inputs": [],364 "name": "contractAddress",365 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],366 "stateMutability": "view",367 "type": "function"368 },369 {370 "inputs": [371 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }372 ],373 "name": "crossOwnerOf",374 "outputs": [375 {376 "components": [377 { "internalType": "address", "name": "eth", "type": "address" },378 { "internalType": "uint256", "name": "sub", "type": "uint256" }379 ],380 "internalType": "struct CrossAddress",381 "name": "",382 "type": "tuple"383 }384 ],385 "stateMutability": "view",386 "type": "function"387 },388 {389 "inputs": [390 { "internalType": "string[]", "name": "keys", "type": "string[]" }391 ],392 "name": "deleteCollectionProperties",393 "outputs": [],394 "stateMutability": "nonpayable",395 "type": "function"396 },397 {398 "inputs": [399 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },400 { "internalType": "string[]", "name": "keys", "type": "string[]" }401 ],402 "name": "deleteProperties",403 "outputs": [],404 "stateMutability": "nonpayable",405 "type": "function"406 },407 {408 "inputs": [],409 "name": "description",410 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],411 "stateMutability": "view",412 "type": "function"413 },414 {415 "inputs": [416 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }417 ],418 "name": "getApproved",419 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],420 "stateMutability": "view",421 "type": "function"422 },423 {424 "inputs": [],425 "name": "hasCollectionPendingSponsor",426 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],427 "stateMutability": "view",428 "type": "function"429 },430 {431 "inputs": [432 { "internalType": "address", "name": "owner", "type": "address" },433 { "internalType": "address", "name": "operator", "type": "address" }434 ],435 "name": "isApprovedForAll",436 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],437 "stateMutability": "view",438 "type": "function"439 },440 {441 "inputs": [442 {443 "components": [444 { "internalType": "address", "name": "eth", "type": "address" },445 { "internalType": "uint256", "name": "sub", "type": "uint256" }446 ],447 "internalType": "struct CrossAddress",448 "name": "user",449 "type": "tuple"450 }451 ],452 "name": "isOwnerOrAdminCross",453 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],454 "stateMutability": "view",455 "type": "function"456 },457 {458 "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],459 "name": "mint",460 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],461 "stateMutability": "nonpayable",462 "type": "function"463 },464 {465 "inputs": [466 {467 "components": [468 { "internalType": "address", "name": "eth", "type": "address" },469 { "internalType": "uint256", "name": "sub", "type": "uint256" }470 ],471 "internalType": "struct CrossAddress",472 "name": "to",473 "type": "tuple"474 },475 {476 "components": [477 { "internalType": "string", "name": "key", "type": "string" },478 { "internalType": "bytes", "name": "value", "type": "bytes" }479 ],480 "internalType": "struct Property[]",481 "name": "properties",482 "type": "tuple[]"483 }484 ],485 "name": "mintCross",486 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],487 "stateMutability": "nonpayable",488 "type": "function"489 },490 {491 "inputs": [492 { "internalType": "address", "name": "to", "type": "address" },493 { "internalType": "string", "name": "tokenUri", "type": "string" }494 ],495 "name": "mintWithTokenURI",496 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],497 "stateMutability": "nonpayable",498 "type": "function"499 },500 {501 "inputs": [],502 "name": "name",503 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],504 "stateMutability": "view",505 "type": "function"506 },507 {508 "inputs": [],509 "name": "nextTokenId",510 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],511 "stateMutability": "view",512 "type": "function"513 },514 {515 "inputs": [516 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }517 ],518 "name": "ownerOf",519 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],520 "stateMutability": "view",521 "type": "function"522 },523 {524 "inputs": [525 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },526 { "internalType": "string[]", "name": "keys", "type": "string[]" }527 ],528 "name": "properties",529 "outputs": [530 {531 "components": [532 { "internalType": "string", "name": "key", "type": "string" },533 { "internalType": "bytes", "name": "value", "type": "bytes" }534 ],535 "internalType": "struct Property[]",536 "name": "",537 "type": "tuple[]"538 }539 ],540 "stateMutability": "view",541 "type": "function"542 },543 {544 "inputs": [545 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },546 { "internalType": "string", "name": "key", "type": "string" }547 ],548 "name": "property",549 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],550 "stateMutability": "view",551 "type": "function"552 },553 {554 "inputs": [555 {556 "components": [557 { "internalType": "address", "name": "eth", "type": "address" },558 { "internalType": "uint256", "name": "sub", "type": "uint256" }559 ],560 "internalType": "struct CrossAddress",561 "name": "admin",562 "type": "tuple"563 }564 ],565 "name": "removeCollectionAdminCross",566 "outputs": [],567 "stateMutability": "nonpayable",568 "type": "function"569 },570 {571 "inputs": [],572 "name": "removeCollectionSponsor",573 "outputs": [],574 "stateMutability": "nonpayable",575 "type": "function"576 },577 {578 "inputs": [579 {580 "components": [581 { "internalType": "address", "name": "eth", "type": "address" },582 { "internalType": "uint256", "name": "sub", "type": "uint256" }583 ],584 "internalType": "struct CrossAddress",585 "name": "user",586 "type": "tuple"587 }588 ],589 "name": "removeFromCollectionAllowListCross",590 "outputs": [],591 "stateMutability": "nonpayable",592 "type": "function"593 },594 {595 "inputs": [596 { "internalType": "address", "name": "from", "type": "address" },597 { "internalType": "address", "name": "to", "type": "address" },598 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }599 ],600 "name": "safeTransferFrom",601 "outputs": [],602 "stateMutability": "nonpayable",603 "type": "function"604 },605 {606 "inputs": [607 { "internalType": "address", "name": "from", "type": "address" },608 { "internalType": "address", "name": "to", "type": "address" },609 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },610 { "internalType": "bytes", "name": "data", "type": "bytes" }611 ],612 "name": "safeTransferFrom",613 "outputs": [],614 "stateMutability": "nonpayable",615 "type": "function"616 },617 {618 "inputs": [619 { "internalType": "address", "name": "operator", "type": "address" },620 { "internalType": "bool", "name": "approved", "type": "bool" }621 ],622 "name": "setApprovalForAll",623 "outputs": [],624 "stateMutability": "nonpayable",625 "type": "function"626 },627 {628 "inputs": [629 { "internalType": "enum AccessMode", "name": "mode", "type": "uint8" }630 ],631 "name": "setCollectionAccess",632 "outputs": [],633 "stateMutability": "nonpayable",634 "type": "function"635 },636 {637 "inputs": [638 {639 "components": [640 {641 "internalType": "enum CollectionLimitField",642 "name": "field",643 "type": "uint8"644 },645 {646 "components": [647 { "internalType": "bool", "name": "status", "type": "bool" },648 { "internalType": "uint256", "name": "value", "type": "uint256" }649 ],650 "internalType": "struct OptionUint256",651 "name": "value",652 "type": "tuple"653 }654 ],655 "internalType": "struct CollectionLimit",656 "name": "limit",657 "type": "tuple"658 }659 ],660 "name": "setCollectionLimit",661 "outputs": [],662 "stateMutability": "nonpayable",663 "type": "function"664 },665 {666 "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],667 "name": "setCollectionMintMode",668 "outputs": [],669 "stateMutability": "nonpayable",670 "type": "function"671 },672 {673 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],674 "name": "setCollectionNesting",675 "outputs": [],676 "stateMutability": "nonpayable",677 "type": "function"678 },679 {680 "inputs": [681 { "internalType": "bool", "name": "enable", "type": "bool" },682 {683 "internalType": "address[]",684 "name": "collections",685 "type": "address[]"686 }687 ],688 "name": "setCollectionNesting",689 "outputs": [],690 "stateMutability": "nonpayable",691 "type": "function"692 },693 {694 "inputs": [695 {696 "components": [697 { "internalType": "string", "name": "key", "type": "string" },698 { "internalType": "bytes", "name": "value", "type": "bytes" }699 ],700 "internalType": "struct Property[]",701 "name": "properties",702 "type": "tuple[]"703 }704 ],705 "name": "setCollectionProperties",706 "outputs": [],707 "stateMutability": "nonpayable",708 "type": "function"709 },710 {711 "inputs": [712 {713 "components": [714 { "internalType": "address", "name": "eth", "type": "address" },715 { "internalType": "uint256", "name": "sub", "type": "uint256" }716 ],717 "internalType": "struct CrossAddress",718 "name": "sponsor",719 "type": "tuple"720 }721 ],722 "name": "setCollectionSponsorCross",723 "outputs": [],724 "stateMutability": "nonpayable",725 "type": "function"726 },727 {728 "inputs": [729 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },730 {731 "components": [732 { "internalType": "string", "name": "key", "type": "string" },733 { "internalType": "bytes", "name": "value", "type": "bytes" }734 ],735 "internalType": "struct Property[]",736 "name": "properties",737 "type": "tuple[]"738 }739 ],740 "name": "setProperties",741 "outputs": [],742 "stateMutability": "nonpayable",743 "type": "function"744 },745 {746 "inputs": [747 {748 "components": [749 { "internalType": "string", "name": "key", "type": "string" },750 {751 "components": [752 {753 "internalType": "enum TokenPermissionField",754 "name": "code",755 "type": "uint8"756 },757 { "internalType": "bool", "name": "value", "type": "bool" }758 ],759 "internalType": "struct PropertyPermission[]",760 "name": "permissions",761 "type": "tuple[]"762 }763 ],764 "internalType": "struct TokenPropertyPermission[]",765 "name": "permissions",766 "type": "tuple[]"767 }768 ],769 "name": "setTokenPropertyPermissions",770 "outputs": [],771 "stateMutability": "nonpayable",772 "type": "function"773 },774 {775 "inputs": [776 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }777 ],778 "name": "supportsInterface",779 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],780 "stateMutability": "view",781 "type": "function"782 },783 {784 "inputs": [],785 "name": "symbol",786 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],787 "stateMutability": "view",788 "type": "function"789 },790 {791 "inputs": [792 { "internalType": "uint256", "name": "index", "type": "uint256" }793 ],794 "name": "tokenByIndex",795 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],796 "stateMutability": "view",797 "type": "function"798 },799 {800 "inputs": [801 { "internalType": "uint256", "name": "token", "type": "uint256" }802 ],803 "name": "tokenContractAddress",804 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],805 "stateMutability": "view",806 "type": "function"807 },808 {809 "inputs": [810 { "internalType": "address", "name": "owner", "type": "address" },811 { "internalType": "uint256", "name": "index", "type": "uint256" }812 ],813 "name": "tokenOfOwnerByIndex",814 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],815 "stateMutability": "view",816 "type": "function"817 },818 {819 "inputs": [],820 "name": "tokenPropertyPermissions",821 "outputs": [822 {823 "components": [824 { "internalType": "string", "name": "key", "type": "string" },825 {826 "components": [827 {828 "internalType": "enum TokenPermissionField",829 "name": "code",830 "type": "uint8"831 },832 { "internalType": "bool", "name": "value", "type": "bool" }833 ],834 "internalType": "struct PropertyPermission[]",835 "name": "permissions",836 "type": "tuple[]"837 }838 ],839 "internalType": "struct TokenPropertyPermission[]",840 "name": "",841 "type": "tuple[]"842 }843 ],844 "stateMutability": "view",845 "type": "function"846 },847 {848 "inputs": [849 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }850 ],851 "name": "tokenURI",852 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],853 "stateMutability": "view",854 "type": "function"855 },856 {857 "inputs": [],858 "name": "totalSupply",859 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],860 "stateMutability": "view",861 "type": "function"862 },863 {864 "inputs": [865 { "internalType": "address", "name": "to", "type": "address" },866 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }867 ],868 "name": "transfer",869 "outputs": [],870 "stateMutability": "nonpayable",871 "type": "function"872 },873 {874 "inputs": [875 {876 "components": [877 { "internalType": "address", "name": "eth", "type": "address" },878 { "internalType": "uint256", "name": "sub", "type": "uint256" }879 ],880 "internalType": "struct CrossAddress",881 "name": "to",882 "type": "tuple"883 },884 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }885 ],886 "name": "transferCross",887 "outputs": [],888 "stateMutability": "nonpayable",889 "type": "function"890 },891 {892 "inputs": [893 { "internalType": "address", "name": "from", "type": "address" },894 { "internalType": "address", "name": "to", "type": "address" },895 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }896 ],897 "name": "transferFrom",898 "outputs": [],899 "stateMutability": "nonpayable",900 "type": "function"901 },902 {903 "inputs": [904 {905 "components": [906 { "internalType": "address", "name": "eth", "type": "address" },907 { "internalType": "uint256", "name": "sub", "type": "uint256" }908 ],909 "internalType": "struct CrossAddress",910 "name": "from",911 "type": "tuple"912 },913 {914 "components": [915 { "internalType": "address", "name": "eth", "type": "address" },916 { "internalType": "uint256", "name": "sub", "type": "uint256" }917 ],918 "internalType": "struct CrossAddress",919 "name": "to",920 "type": "tuple"921 },922 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }923 ],924 "name": "transferFromCross",925 "outputs": [],926 "stateMutability": "nonpayable",927 "type": "function"928 },929 {930 "inputs": [],931 "name": "uniqueCollectionType",932 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],933 "stateMutability": "view",934 "type": "function"935 }936]tests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -17,7 +17,6 @@
event CollectionCreated(address indexed owner, address indexed collectionId);
event CollectionDestroyed(address indexed collectionId);
event CollectionChanged(address indexed collectionId);
- event TokenChanged(address indexed collectionId, uint256 tokenId);
}
/// @title Contract, which allows users to operate with collections
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -12,9 +12,14 @@
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
+/// @dev inlined interface
+interface ERC721TokenEvent {
+ event TokenChanged(uint256 indexed tokenId);
+}
+
/// @title A contract that allows to set and delete token properties and change token property permissions.
/// @dev the ERC-165 identifier for this interface is 0xde0695c2
-interface TokenProperties is Dummy, ERC165 {
+interface TokenProperties is Dummy, ERC165, ERC721TokenEvent {
// /// @notice Set permissions for token property.
// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.
// /// @param key Property key.
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -12,9 +12,14 @@
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
+/// @dev inlined interface
+interface ERC721TokenEvent {
+ event TokenChanged(uint256 indexed tokenId);
+}
+
/// @title A contract that allows to set and delete token properties and change token property permissions.
/// @dev the ERC-165 identifier for this interface is 0xde0695c2
-interface TokenProperties is Dummy, ERC165 {
+interface TokenProperties is Dummy, ERC165, ERC721TokenEvent {
// /// @notice Set permissions for token property.
// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.
// /// @param key Property key.
tests/src/eth/events.test.tsdiffbeforeafterboth--- a/tests/src/eth/events.test.ts
+++ b/tests/src/eth/events.test.ts
@@ -29,8 +29,10 @@
});
});
-function clearEvents(ethEvents: NormalizedEvent[], subEvents: IEvent[]) {
- ethEvents.splice(0);
+function clearEvents(ethEvents: NormalizedEvent[] | null, subEvents: IEvent[]) {
+ if (ethEvents !== null) {
+ ethEvents.splice(0);
+ }
subEvents.splice(0);
}
@@ -374,7 +376,6 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
- const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const result = await collection.methods.mint(owner).send({from: owner});
const tokenId = result.events.Transfer.returnValues.tokenId;
await collection.methods.setTokenPropertyPermissions([
@@ -384,38 +385,29 @@
[TokenPermissionField.CollectionAdmin, true]],
],
]).send({from: owner});
-
- const ethEvents: any = [];
- collectionHelper.events.allEvents((_: any, event: any) => {
- ethEvents.push(event);
- });
const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['TokenPropertySet', 'TokenPropertyDeleted']}]);
{
- await collection.methods.setProperties(tokenId, [{key: 'A', value: [1,2,3]}]).send({from: owner});
+ const result = await collection.methods.setProperties(tokenId, [{key: 'A', value: [1,2,3]}]).send({from: owner});
await helper.wait.newBlocks(1);
- expect(ethEvents).to.containSubset([
- {
- event: 'TokenChanged',
- returnValues: {
- collectionId: collectionAddress,
- },
+ expect(result.events.TokenChanged).to.be.like({
+ event: 'TokenChanged',
+ returnValues: {
+ tokenId: tokenId,
},
- ]);
+ });
expect(subEvents).to.containSubset([{method: 'TokenPropertySet'}]);
- clearEvents(ethEvents, subEvents);
+ clearEvents(null, subEvents);
}
{
- await collection.methods.deleteProperties(tokenId, ['A']).send({from: owner});
+ const result = await collection.methods.deleteProperties(tokenId, ['A']).send({from: owner});
await helper.wait.newBlocks(1);
- expect(ethEvents).to.containSubset([
- {
- event: 'TokenChanged',
- returnValues: {
- collectionId: collectionAddress,
- },
+ expect(result.events.TokenChanged).to.be.like({
+ event: 'TokenChanged',
+ returnValues: {
+ tokenId: tokenId,
},
- ]);
+ });
expect(subEvents).to.containSubset([{method: 'TokenPropertyDeleted'}]);
}
unsubscribe();