difftreelog
CORE-302 Fully support create collection from evm
in: master
10 files changed
crates/evm-coder/src/solidity.rsdiffbeforeafterboth--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -327,7 +327,7 @@
}
}
-#[impl_for_tuples(1, 5)]
+#[impl_for_tuples(1, 12)]
impl SolidityArguments for Tuple {
for_tuples!( where #( Tuple: SolidityArguments ),* );
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -23,12 +23,17 @@
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::{
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> {
@@ -138,13 +143,40 @@
Ok(())
}
- fn create_721_collection(&self, caller: caller) -> Result<address> {
+ fn create_721_collection(
+ &self,
+ caller: caller,
+ name: string,
+ description: string,
+ token_prefix: string,
+ ) -> Result<address> {
let caller = T::CrossAccountId::from_eth(caller);
- let collection_id = <pallet_nonfungible::Pallet<T>>::init_collection(
- caller.as_sub().clone(),
- Default::default(),
- )
- .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+ 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(
@@ -158,6 +190,10 @@
}
}
+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>);
impl<T: Config> OnMethodCall<T> for HelpersOnMethodCall<T> {
fn is_reserved(contract: &sp_core::H160) -> bool {
pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -16,6 +16,9 @@
#![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/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: e123b7a8
+// Selector: ee5467a8
contract ContractHelpers is Dummy, ERC165 {
// Selector: contractOwner(address) 5152b14c
function contractOwner(address contractAddress)
@@ -145,9 +145,16 @@
dummy = 0;
}
- // Selector: create721Collection() 9a6bd151
- function create721Collection() public view returns (address) {
+ // 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;
}
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: e123b7a8
+// Selector: ee5467a8
interface ContractHelpers is Dummy, ERC165 {
// Selector: contractOwner(address) 5152b14c
function contractOwner(address contractAddress)
@@ -72,6 +72,10 @@
bool allowed
) external;
- // Selector: create721Collection() 9a6bd151
- function create721Collection() external view returns (address);
+ // Selector: create721Collection(string,string,string) 951c0151
+ function create721Collection(
+ string memory name,
+ string memory description,
+ string memory tokenPrefix
+ ) external view returns (address);
}
tests/src/eth/base.test.tsdiffbeforeafterboth--- a/tests/src/eth/base.test.ts
+++ b/tests/src/eth/base.test.ts
@@ -28,7 +28,7 @@
usingWeb3,
} from './util/helpers';
import {expect} from 'chai';
-import {createCollectionExpectSuccess, createItemExpectSuccess, getCreatedCollectionCount, UNIQUE} from '../util/helpers';
+import {createCollectionExpectSuccess, createItemExpectSuccess, getCreatedCollectionCount, getDetailedCollectionInfo, UNIQUE} from '../util/helpers';
import nonFungibleAbi from './nonFungibleAbi.json';
import privateKey from '../substrate/privateKey';
import {Contract} from 'web3-eth-contract';
@@ -128,14 +128,24 @@
describe('Create collection from EVM', () => {
itWeb3('Create collection', async ({api, web3}) => {
const owner = await createEthAccountWithBalance(api, web3);
- console.log(owner);
const helpers = contractHelpers(web3, owner);
+ const collectionName = 'CollectionEVM';
+ const description = 'Some description';
+ const tokenPrefix = 'token prefix';
+
const collectionCountBefore = await getCreatedCollectionCount(api);
- const result = await helpers.methods.create721Collection().send();
- console.log(result.events[0].raw);
- const collectionId = collectionIdFromAddress(result.events[0].raw.topics[2]);
+ const result = await helpers.methods
+ .create721Collection(collectionName, description, tokenPrefix)
+ .send();
const collectionCountAfter = await getCreatedCollectionCount(api);
+
+ const collectionId = collectionIdFromAddress(result.events[0].raw.topics[2]);
expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);
expect(collectionId).to.be.eq(collectionCountAfter);
+
+ const collection = (await getDetailedCollectionInfo(api, collectionId))!;
+ expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName);
+ expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description);
+ expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix);
});
});
tests/src/eth/fungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -1,175 +1,173 @@
[
- {
- "constant": false,
- "inputs": [
- {
- "name": "_spender",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "approve",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [],
- "name": "totalSupply",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_from",
- "type": "address"
- },
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transferFrom",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- }
- ],
- "name": "balanceOf",
- "outputs": [
- {
- "name": "balance",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "_to",
- "type": "address"
- },
- {
- "name": "_value",
- "type": "uint256"
- }
- ],
- "name": "transfer",
- "outputs": [
- {
- "name": "",
- "type": "bool"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": true,
- "inputs": [
- {
- "name": "_owner",
- "type": "address"
- },
- {
- "name": "_spender",
- "type": "address"
- }
- ],
- "name": "allowance",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "owner",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "spender",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Approval",
- "type": "event"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": true,
- "name": "from",
- "type": "address"
- },
- {
- "indexed": true,
- "name": "to",
- "type": "address"
- },
- {
- "indexed": false,
- "name": "value",
- "type": "uint256"
- }
- ],
- "name": "Transfer",
- "type": "event"
- }
-]
\ No newline at end of file
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "spender",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "Approval",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "Transfer",
+ "type": "event"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "owner", "type": "address" },
+ { "internalType": "address", "name": "spender", "type": "address" }
+ ],
+ "name": "allowance",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "spender", "type": "address" },
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
+ ],
+ "name": "approve",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "owner", "type": "address" }
+ ],
+ "name": "balanceOf",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "from", "type": "address" },
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
+ ],
+ "name": "burnFrom",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+ "name": "collectionProperty",
+ "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "decimals",
+ "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+ "name": "deleteCollectionProperty",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "name",
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "string", "name": "key", "type": "string" },
+ { "internalType": "bytes", "name": "value", "type": "bytes" }
+ ],
+ "name": "setCollectionProperty",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+ ],
+ "name": "supportsInterface",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "symbol",
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "totalSupply",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "to", "type": "address" },
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
+ ],
+ "name": "transfer",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "address", "name": "from", "type": "address" },
+ { "internalType": "address", "name": "to", "type": "address" },
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
+ ],
+ "name": "transferFrom",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
tests/src/eth/nonFungibleAbi.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 "name": "MintingFinished",56 "type": "event"57 },58 {59 "anonymous": false,60 "inputs": [61 {62 "indexed": true,63 "internalType": "address",64 "name": "from",65 "type": "address"66 },67 {68 "indexed": true,69 "internalType": "address",70 "name": "to",71 "type": "address"72 },73 {74 "indexed": true,75 "internalType": "uint256",76 "name": "tokenId",77 "type": "uint256"78 }79 ],80 "name": "Transfer",81 "type": "event"82 },83 {84 "inputs": [85 {86 "internalType": "address",87 "name": "approved",88 "type": "address"89 },90 {91 "internalType": "uint256",92 "name": "tokenId",93 "type": "uint256"94 }95 ],96 "name": "approve",97 "outputs": [],98 "stateMutability": "nonpayable",99 "type": "function"100 },101 {102 "inputs": [103 {104 "internalType": "address",105 "name": "owner",106 "type": "address"107 }108 ],109 "name": "balanceOf",110 "outputs": [111 {112 "internalType": "uint256",113 "name": "",114 "type": "uint256"115 }116 ],117 "stateMutability": "view",118 "type": "function"119 },120 {121 "inputs": [122 {123 "internalType": "uint256",124 "name": "tokenId",125 "type": "uint256"126 }127 ],128 "name": "burn",129 "outputs": [],130 "stateMutability": "nonpayable",131 "type": "function"132 },133 {134 "inputs": [135 {136 "internalType": "address",137 "name": "from",138 "type": "address"139 },140 {141 "internalType": "uint256",142 "name": "tokenId",143 "type": "uint256"144 }145 ],146 "name": "burnFrom",147 "outputs": [],148 "stateMutability": "nonpayable",149 "type": "function"150 },151 {152 "inputs": [153 {154 "internalType": "string",155 "name": "key",156 "type": "string"157 }158 ],159 "name": "collectionProperty",160 "outputs": [161 {162 "internalType": "bytes",163 "name": "",164 "type": "bytes"165 }166 ],167 "stateMutability": "view",168 "type": "function"169 },170 {171 "inputs": [172 {173 "internalType": "string",174 "name": "key",175 "type": "string"176 }177 ],178 "name": "deleteCollectionProperty",179 "outputs": [],180 "stateMutability": "nonpayable",181 "type": "function"182 },183 {184 "inputs": [185 {186 "internalType": "uint256",187 "name": "tokenId",188 "type": "uint256"189 },190 {191 "internalType": "string",192 "name": "key",193 "type": "string"194 }195 ],196 "name": "deleteProperty",197 "outputs": [],198 "stateMutability": "nonpayable",199 "type": "function"200 },201 {202 "inputs": [],203 "name": "finishMinting",204 "outputs": [205 {206 "internalType": "bool",207 "name": "",208 "type": "bool"209 }210 ],211 "stateMutability": "nonpayable",212 "type": "function"213 },214 {215 "inputs": [216 {217 "internalType": "uint256",218 "name": "tokenId",219 "type": "uint256"220 }221 ],222 "name": "getApproved",223 "outputs": [224 {225 "internalType": "address",226 "name": "",227 "type": "address"228 }229 ],230 "stateMutability": "view",231 "type": "function"232 },233 {234 "inputs": [235 {236 "internalType": "address",237 "name": "owner",238 "type": "address"239 },240 {241 "internalType": "address",242 "name": "operator",243 "type": "address"244 }245 ],246 "name": "isApprovedForAll",247 "outputs": [248 {249 "internalType": "address",250 "name": "",251 "type": "address"252 }253 ],254 "stateMutability": "view",255 "type": "function"256 },257 {258 "inputs": [259 {260 "internalType": "address",261 "name": "to",262 "type": "address"263 },264 {265 "internalType": "uint256",266 "name": "tokenId",267 "type": "uint256"268 }269 ],270 "name": "mint",271 "outputs": [272 {273 "internalType": "bool",274 "name": "",275 "type": "bool"276 }277 ],278 "stateMutability": "nonpayable",279 "type": "function"280 },281 {282 "inputs": [283 {284 "internalType": "address",285 "name": "to",286 "type": "address"287 },288 {289 "internalType": "uint256[]",290 "name": "tokenIds",291 "type": "uint256[]"292 }293 ],294 "name": "mintBulk",295 "outputs": [296 {297 "internalType": "bool",298 "name": "",299 "type": "bool"300 }301 ],302 "stateMutability": "nonpayable",303 "type": "function"304 },305 {306 "inputs": [307 {308 "internalType": "address",309 "name": "to",310 "type": "address"311 },312 {313 "components": [314 {315 "internalType": "uint256",316 "name": "field_0",317 "type": "uint256"318 },319 {320 "internalType": "string",321 "name": "field_1",322 "type": "string"323 }324 ],325 "internalType": "struct Tuple0[]",326 "name": "tokens",327 "type": "tuple[]"328 }329 ],330 "name": "mintBulkWithTokenURI",331 "outputs": [332 {333 "internalType": "bool",334 "name": "",335 "type": "bool"336 }337 ],338 "stateMutability": "nonpayable",339 "type": "function"340 },341 {342 "inputs": [343 {344 "internalType": "address",345 "name": "to",346 "type": "address"347 },348 {349 "internalType": "uint256",350 "name": "tokenId",351 "type": "uint256"352 },353 {354 "internalType": "string",355 "name": "tokenUri",356 "type": "string"357 }358 ],359 "name": "mintWithTokenURI",360 "outputs": [361 {362 "internalType": "bool",363 "name": "",364 "type": "bool"365 }366 ],367 "stateMutability": "nonpayable",368 "type": "function"369 },370 {371 "inputs": [],372 "name": "mintingFinished",373 "outputs": [374 {375 "internalType": "bool",376 "name": "",377 "type": "bool"378 }379 ],380 "stateMutability": "view",381 "type": "function"382 },383 {384 "inputs": [],385 "name": "name",386 "outputs": [387 {388 "internalType": "string",389 "name": "",390 "type": "string"391 }392 ],393 "stateMutability": "view",394 "type": "function"395 },396 {397 "inputs": [],398 "name": "nextTokenId",399 "outputs": [400 {401 "internalType": "uint256",402 "name": "",403 "type": "uint256"404 }405 ],406 "stateMutability": "view",407 "type": "function"408 },409 {410 "inputs": [411 {412 "internalType": "uint256",413 "name": "tokenId",414 "type": "uint256"415 }416 ],417 "name": "ownerOf",418 "outputs": [419 {420 "internalType": "address",421 "name": "",422 "type": "address"423 }424 ],425 "stateMutability": "view",426 "type": "function"427 },428 {429 "inputs": [430 {431 "internalType": "uint256",432 "name": "tokenId",433 "type": "uint256"434 },435 {436 "internalType": "string",437 "name": "key",438 "type": "string"439 }440 ],441 "name": "property",442 "outputs": [443 {444 "internalType": "bytes",445 "name": "",446 "type": "bytes"447 }448 ],449 "stateMutability": "view",450 "type": "function"451 },452 {453 "inputs": [454 {455 "internalType": "address",456 "name": "from",457 "type": "address"458 },459 {460 "internalType": "address",461 "name": "to",462 "type": "address"463 },464 {465 "internalType": "uint256",466 "name": "tokenId",467 "type": "uint256"468 }469 ],470 "name": "safeTransferFrom",471 "outputs": [],472 "stateMutability": "nonpayable",473 "type": "function"474 },475 {476 "inputs": [477 {478 "internalType": "address",479 "name": "from",480 "type": "address"481 },482 {483 "internalType": "address",484 "name": "to",485 "type": "address"486 },487 {488 "internalType": "uint256",489 "name": "tokenId",490 "type": "uint256"491 },492 {493 "internalType": "bytes",494 "name": "data",495 "type": "bytes"496 }497 ],498 "name": "safeTransferFromWithData",499 "outputs": [],500 "stateMutability": "nonpayable",501 "type": "function"502 },503 {504 "inputs": [505 {506 "internalType": "address",507 "name": "operator",508 "type": "address"509 },510 {511 "internalType": "bool",512 "name": "approved",513 "type": "bool"514 }515 ],516 "name": "setApprovalForAll",517 "outputs": [],518 "stateMutability": "nonpayable",519 "type": "function"520 },521 {522 "inputs": [523 {524 "internalType": "string",525 "name": "key",526 "type": "string"527 },528 {529 "internalType": "bytes",530 "name": "value",531 "type": "bytes"532 }533 ],534 "name": "setCollectionProperty",535 "outputs": [],536 "stateMutability": "nonpayable",537 "type": "function"538 },539 {540 "inputs": [541 {542 "internalType": "uint256",543 "name": "tokenId",544 "type": "uint256"545 },546 {547 "internalType": "string",548 "name": "key",549 "type": "string"550 },551 {552 "internalType": "bytes",553 "name": "value",554 "type": "bytes"555 }556 ],557 "name": "setProperty",558 "outputs": [],559 "stateMutability": "nonpayable",560 "type": "function"561 },562 {563 "inputs": [564 {565 "internalType": "string",566 "name": "key",567 "type": "string"568 },569 {570 "internalType": "bool",571 "name": "isMutable",572 "type": "bool"573 },574 {575 "internalType": "bool",576 "name": "collectionAdmin",577 "type": "bool"578 },579 {580 "internalType": "bool",581 "name": "tokenOwner",582 "type": "bool"583 }584 ],585 "name": "setTokenPropertyPermission",586 "outputs": [],587 "stateMutability": "nonpayable",588 "type": "function"589 },590 {591 "inputs": [592 {593 "internalType": "bytes4",594 "name": "interfaceID",595 "type": "bytes4"596 }597 ],598 "name": "supportsInterface",599 "outputs": [600 {601 "internalType": "bool",602 "name": "",603 "type": "bool"604 }605 ],606 "stateMutability": "view",607 "type": "function"608 },609 {610 "inputs": [],611 "name": "symbol",612 "outputs": [613 {614 "internalType": "string",615 "name": "",616 "type": "string"617 }618 ],619 "stateMutability": "view",620 "type": "function"621 },622 {623 "inputs": [624 {625 "internalType": "uint256",626 "name": "index",627 "type": "uint256"628 }629 ],630 "name": "tokenByIndex",631 "outputs": [632 {633 "internalType": "uint256",634 "name": "",635 "type": "uint256"636 }637 ],638 "stateMutability": "view",639 "type": "function"640 },641 {642 "inputs": [643 {644 "internalType": "address",645 "name": "owner",646 "type": "address"647 },648 {649 "internalType": "uint256",650 "name": "index",651 "type": "uint256"652 }653 ],654 "name": "tokenOfOwnerByIndex",655 "outputs": [656 {657 "internalType": "uint256",658 "name": "",659 "type": "uint256"660 }661 ],662 "stateMutability": "view",663 "type": "function"664 },665 {666 "inputs": [667 {668 "internalType": "uint256",669 "name": "tokenId",670 "type": "uint256"671 }672 ],673 "name": "tokenURI",674 "outputs": [675 {676 "internalType": "string",677 "name": "",678 "type": "string"679 }680 ],681 "stateMutability": "view",682 "type": "function"683 },684 {685 "inputs": [],686 "name": "totalSupply",687 "outputs": [688 {689 "internalType": "uint256",690 "name": "",691 "type": "uint256"692 }693 ],694 "stateMutability": "view",695 "type": "function"696 },697 {698 "inputs": [699 {700 "internalType": "address",701 "name": "to",702 "type": "address"703 },704 {705 "internalType": "uint256",706 "name": "tokenId",707 "type": "uint256"708 }709 ],710 "name": "transfer",711 "outputs": [],712 "stateMutability": "nonpayable",713 "type": "function"714 },715 {716 "inputs": [717 {718 "internalType": "address",719 "name": "from",720 "type": "address"721 },722 {723 "internalType": "address",724 "name": "to",725 "type": "address"726 },727 {728 "internalType": "uint256",729 "name": "tokenId",730 "type": "uint256"731 }732 ],733 "name": "transferFrom",734 "outputs": [],735 "stateMutability": "nonpayable",736 "type": "function"737 }738]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 "name": "MintingFinished",56 "type": "event"57 },58 {59 "anonymous": false,60 "inputs": [61 {62 "indexed": true,63 "internalType": "address",64 "name": "from",65 "type": "address"66 },67 {68 "indexed": true,69 "internalType": "address",70 "name": "to",71 "type": "address"72 },73 {74 "indexed": true,75 "internalType": "uint256",76 "name": "tokenId",77 "type": "uint256"78 }79 ],80 "name": "Transfer",81 "type": "event"82 },83 {84 "inputs": [85 { "internalType": "address", "name": "approved", "type": "address" },86 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }87 ],88 "name": "approve",89 "outputs": [],90 "stateMutability": "nonpayable",91 "type": "function"92 },93 {94 "inputs": [95 { "internalType": "address", "name": "owner", "type": "address" }96 ],97 "name": "balanceOf",98 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],99 "stateMutability": "view",100 "type": "function"101 },102 {103 "inputs": [104 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }105 ],106 "name": "burn",107 "outputs": [],108 "stateMutability": "nonpayable",109 "type": "function"110 },111 {112 "inputs": [113 { "internalType": "address", "name": "from", "type": "address" },114 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }115 ],116 "name": "burnFrom",117 "outputs": [],118 "stateMutability": "nonpayable",119 "type": "function"120 },121 {122 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],123 "name": "collectionProperty",124 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],125 "stateMutability": "view",126 "type": "function"127 },128 {129 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],130 "name": "deleteCollectionProperty",131 "outputs": [],132 "stateMutability": "nonpayable",133 "type": "function"134 },135 {136 "inputs": [137 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },138 { "internalType": "string", "name": "key", "type": "string" }139 ],140 "name": "deleteProperty",141 "outputs": [],142 "stateMutability": "nonpayable",143 "type": "function"144 },145 {146 "inputs": [],147 "name": "finishMinting",148 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],149 "stateMutability": "nonpayable",150 "type": "function"151 },152 {153 "inputs": [154 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }155 ],156 "name": "getApproved",157 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],158 "stateMutability": "view",159 "type": "function"160 },161 {162 "inputs": [163 { "internalType": "address", "name": "owner", "type": "address" },164 { "internalType": "address", "name": "operator", "type": "address" }165 ],166 "name": "isApprovedForAll",167 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],168 "stateMutability": "view",169 "type": "function"170 },171 {172 "inputs": [173 { "internalType": "address", "name": "to", "type": "address" },174 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }175 ],176 "name": "mint",177 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],178 "stateMutability": "nonpayable",179 "type": "function"180 },181 {182 "inputs": [183 { "internalType": "address", "name": "to", "type": "address" },184 { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }185 ],186 "name": "mintBulk",187 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],188 "stateMutability": "nonpayable",189 "type": "function"190 },191 {192 "inputs": [193 { "internalType": "address", "name": "to", "type": "address" },194 {195 "components": [196 { "internalType": "uint256", "name": "field_0", "type": "uint256" },197 { "internalType": "string", "name": "field_1", "type": "string" }198 ],199 "internalType": "struct Tuple0[]",200 "name": "tokens",201 "type": "tuple[]"202 }203 ],204 "name": "mintBulkWithTokenURI",205 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],206 "stateMutability": "nonpayable",207 "type": "function"208 },209 {210 "inputs": [211 { "internalType": "address", "name": "to", "type": "address" },212 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },213 { "internalType": "string", "name": "tokenUri", "type": "string" }214 ],215 "name": "mintWithTokenURI",216 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],217 "stateMutability": "nonpayable",218 "type": "function"219 },220 {221 "inputs": [],222 "name": "mintingFinished",223 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],224 "stateMutability": "view",225 "type": "function"226 },227 {228 "inputs": [],229 "name": "name",230 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],231 "stateMutability": "view",232 "type": "function"233 },234 {235 "inputs": [],236 "name": "nextTokenId",237 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],238 "stateMutability": "view",239 "type": "function"240 },241 {242 "inputs": [243 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }244 ],245 "name": "ownerOf",246 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],247 "stateMutability": "view",248 "type": "function"249 },250 {251 "inputs": [252 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },253 { "internalType": "string", "name": "key", "type": "string" }254 ],255 "name": "property",256 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],257 "stateMutability": "view",258 "type": "function"259 },260 {261 "inputs": [262 { "internalType": "address", "name": "from", "type": "address" },263 { "internalType": "address", "name": "to", "type": "address" },264 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }265 ],266 "name": "safeTransferFrom",267 "outputs": [],268 "stateMutability": "nonpayable",269 "type": "function"270 },271 {272 "inputs": [273 { "internalType": "address", "name": "from", "type": "address" },274 { "internalType": "address", "name": "to", "type": "address" },275 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },276 { "internalType": "bytes", "name": "data", "type": "bytes" }277 ],278 "name": "safeTransferFromWithData",279 "outputs": [],280 "stateMutability": "nonpayable",281 "type": "function"282 },283 {284 "inputs": [285 { "internalType": "address", "name": "operator", "type": "address" },286 { "internalType": "bool", "name": "approved", "type": "bool" }287 ],288 "name": "setApprovalForAll",289 "outputs": [],290 "stateMutability": "nonpayable",291 "type": "function"292 },293 {294 "inputs": [295 { "internalType": "string", "name": "key", "type": "string" },296 { "internalType": "bytes", "name": "value", "type": "bytes" }297 ],298 "name": "setCollectionProperty",299 "outputs": [],300 "stateMutability": "nonpayable",301 "type": "function"302 },303 {304 "inputs": [305 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },306 { "internalType": "string", "name": "key", "type": "string" },307 { "internalType": "bytes", "name": "value", "type": "bytes" }308 ],309 "name": "setProperty",310 "outputs": [],311 "stateMutability": "nonpayable",312 "type": "function"313 },314 {315 "inputs": [316 { "internalType": "string", "name": "key", "type": "string" },317 { "internalType": "bool", "name": "isMutable", "type": "bool" },318 { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },319 { "internalType": "bool", "name": "tokenOwner", "type": "bool" }320 ],321 "name": "setTokenPropertyPermission",322 "outputs": [],323 "stateMutability": "nonpayable",324 "type": "function"325 },326 {327 "inputs": [328 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }329 ],330 "name": "supportsInterface",331 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],332 "stateMutability": "view",333 "type": "function"334 },335 {336 "inputs": [],337 "name": "symbol",338 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],339 "stateMutability": "view",340 "type": "function"341 },342 {343 "inputs": [344 { "internalType": "uint256", "name": "index", "type": "uint256" }345 ],346 "name": "tokenByIndex",347 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],348 "stateMutability": "view",349 "type": "function"350 },351 {352 "inputs": [353 { "internalType": "address", "name": "owner", "type": "address" },354 { "internalType": "uint256", "name": "index", "type": "uint256" }355 ],356 "name": "tokenOfOwnerByIndex",357 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],358 "stateMutability": "view",359 "type": "function"360 },361 {362 "inputs": [363 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }364 ],365 "name": "tokenURI",366 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],367 "stateMutability": "view",368 "type": "function"369 },370 {371 "inputs": [],372 "name": "totalSupply",373 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],374 "stateMutability": "view",375 "type": "function"376 },377 {378 "inputs": [379 { "internalType": "address", "name": "to", "type": "address" },380 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }381 ],382 "name": "transfer",383 "outputs": [],384 "stateMutability": "nonpayable",385 "type": "function"386 },387 {388 "inputs": [389 { "internalType": "address", "name": "from", "type": "address" },390 { "internalType": "address", "name": "to", "type": "address" },391 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }392 ],393 "name": "transferFrom",394 "outputs": [],395 "stateMutability": "nonpayable",396 "type": "function"397 }398]tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -1,248 +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": [],
- "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"
- }
-]
\ No newline at end of file
+ {
+ "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"
+ }
+]