This mono repo contains the source code for the smart contracts of our Open NFT Marketplace on NEAR.
- Install
rustup
via https://rustup.rs/ - Run the following:
rustup default stable
rustup target add wasm32-unknown-unknown
You can build release version by running script:
./build.sh
To deploy to Mainnet, you can use next command:
near deploy 8o8.near --accountId 8o8.near --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
- Create store using:
near call jpn.near migrate '{}' --accountId jpn.near --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
- Create store using:
near call 8o8.near new '{}' --accountId 8o8.near --gas 250000000000000 --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
- Create store using:
near call 8o8.near create_market '{"prefix": "aa", "contract_metadata": {"spec": "nft-1.0.0", "name": "NAME", "symbol": "SYM"}}' --accountId turk.near --deposit 5 --gas 250000000000000 --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
- Check total supply:
near view aa.8o8.near nft_total_supply '{}'
- Mint NFT:
near call aa.8o8.near nft_mint '{"token_id": "1", "token_owner_id": "turk.near", "token_metadata": {"title": "TITILE"}}' --accountId turk.near --deposit 0.1
- Mint NFT with payouts (sum of payouts MUST be less than 10000):
near call aa.8o8.near nft_mint
'{"token_id": "1", "token_owner_id": "turk.near", "token_metadata": {"title": "TITILE"}}, "payout": {"payout": {"bobrik.near": "100", "danielto.near": "500"}}'
--accountId turk.near
--deposit 0.1
- Get payouts:
near call aa.8o8.near nft_payout
'{"token_id": "1", "balance": "228322", "max_len_payout": 10}'
--accountId turk.near
--depositYocto 1
- Migrate:
near call mjol.near migrate '{}' --accountId mjol.near
- Create collection:
near call mjol.near create_collection '{"metadata" : {"title":"NPunks", "desc":"NPunks are NFTs on the Near blockchain. Each of these 10,000 NPunks has attributes that make them unique according to a defined rarity system.", "media": "https://ipfs.io/ipfs/bafybeicumf3colv5hyzk2orbtei7akcx6zgwku3oymf2sq2dm4ikpdmreu/E2pQm1oUUAI3_2z-1.jpg"}}' --accountId turk.near --deposit 0.1 --gas 250000000000000
- Get collection info:
near call mjol.near get_collection_info '{"collection_id" : "collection-3"}' --accountId mjol.near
- Get collection NFTs:
near call mjol.near get_nfts_from_collection '{"collection_id" : "collection-3", "from" : 0, "limit" : 20}' --accountId mjol.near
To deploy to Testnet, you can use next command:
near dev-deploy
This will output on the contract ID it deployed.
To deploy to Mainnet, you can use next command:
export NEAR_ENV=mainnet
near deploy mjol.near --accountId mjol.near