Contract Name | Description |
---|---|
Fixed Price | This contract is for the Listings and Offers. The price stays fixed. It depends on ZRC-6 and ZRC-2. |
Fixed Price Rev 1.1 | This contract is a revision to Fixed Price contract. It allows users to sell and buy in batches. |
English Auction | This contract is for the English auction sale, i.e. sell to the highest bidder at the end. It depends on ZRC-6 and ZRC-2. |
English Auction Rev 1.1 | This contract is a revision to Auction contract. It allows users to sell in batches. |
Allowlist | For the access control, this contract can be used optionally by the Fixed Price and English Auction contract. To use this contract, run SetAllowlist transition in the Fixed Price or English Auction contract. |
Multi-Sig Wallet | This auto-generated contract is a multi-sig wallet for the above contracts. |
Collection | This contract is responsible for managing the user entity brand, collections owned by brands and payouts of commission fees to brands |
npm test
Runs contract tests using Isolated Server container, Jest, and Scilla JSON Utils
Create .env
file, consider .env.example
as reference, update the details and run the test cases.
We run tests sequentially since block numbers are increased with IncreaseBlocknum
.
This section will walk-through how to execute and test the batch selling transition SetBatchOrder
and BatchStart
for Fixed Price Rev 1.1 and Auction Rev 1.1 contracts respectively.
initial_contract_owner: your_wallet_address
initial_base_uri: leave_empty
name: some_random_name
symbol: some_random_symbol
to: you_wallet_address
token_uri: https://api.creature.com
initial_contract_owner
.initial_contract_owner
and the address for the collection contract.initial_contract_owner
and the address for the collection contract.spender: <fixed_price_contract_address>,
token_id: <1>
token_id
to 2
.Now we have our fixed price contract and ZRC-6 contract ready, we can start to sell our NFT in batches (for education purposes). Note, we are using ZilliqaJS to sell the NFT in batches because the IDE does not support custom ADT param yet in the form fields. These scripts are useful especially when we want to implement the sell batch code in any frontend dapp.
npm install
.Edit the scripts/batch/sell-batch-fixed-price.js
to suit to your deployment:
const orderItem1 = createOrderRecord(
`${marketplace}`,
`${nftToken}`,
"1",
"0x0000000000000000000000000000000000000000",
"11000000000000",
"0",
"9999999"
);
const orderItem2 = createOrderRecord(
`${marketplace}`,
`${nftToken}`,
"2",
"0x0000000000000000000000000000000000000000",
"22000000000000",
"0",
"9999999"
);
Please do not share your private keys with others!
Execute the script:
cd scripts/batch
node sell-batch-fixed-price.js <0x_fixed_price_contract_address> <0x_ZRC-6_contract_address> <your_private_key>
Once the transaction is confirmed. You can view the Fixed Price contract's sell orders
state to see the two sell orders for Token #1 and Token #2!.
That's it, you can repeat the same steps from the beginning but this time, to sell the tokens via the English Auction Rev 1.1 contract!.
This project is open source software licensed as GPL-3.0.