In this fourth entry of the series to build a 3D NFT marketplace on Stacks, we're going to deploy the minter.clar
contract to the Stacks testnet. This contract handles the minting of avatars and serves as the foundation for the marketplace.
🛠️ Requirements
- Have Clarinet installed
- Have a valid seed phrase to sign transactions. You can install stx-cli via
npm i -g @stacks/cli
and generate a new seed phrase withstx make_keychain -t
(-t for Testnet). It will output something like this:
{
"mnemonic": "one visit primary liberty layer turn tattoo love empower save eternal void salmon attitude vault artwork roof habit indoor announce drill train seminar night",
"keyInfo": {
"privateKey": "b88acb1d147707196d70c5a56202fa6dd0ff810e0799dae50a39ad50e391437201",
"publicKey": "02cf9d1eb8c3d31b574fc9ca20782ecba596a00e9671464235fde5dd017fc1fd9a",
"address": "ST3ZFT624V70VXEYAZ51VPKRHXSEQRT6PA51T2SPS",
"btcAddress": "n4mD87ZhBF5DUoRd8gCnU6B2qUV1LsZ6bQ",
"wif": "cTmRkKgzPmMN4LY1mh1YsRoZNq8HemH5k4goDSxN5jczdPfnSaE9",
"index": 0
}
}
- Get test tokens on this Stacks Testnet Faucet and fund the address you're going to deploy the contract to.
🧾 1. Create the Testnet.toml
file
Inside your Clarinet project (/clarity/settings/
):
[accounts.deployer]
mnemonic = "your-mnemonic-here"
[deployments.minter]
path = "contracts/minter.clar"
This file defines the wallet that will sign the deployment and the path to your Clarity contract.
🔍 2. Check balance
You can check balance of the address with this:
stx balance ST..X -t
📦 3. Generate the deployment plan
clarinet deployments generate --testnet --high-cost
This will create the deployments/Testnet.plan.yaml
file, which contains the contracts to be deployed along with their hashes.
☁️ 4. Deploy the contract
Now run:
clarinet deployments apply --testnet
If everything is set up correctly, you'll see output like:
✅ Successfully deployed minter.clar to ST2ABC...XYZ.minter
Save that contract address (ST2ABC...XYZ.minter
) — you’ll need it later in other contracts, such as the marketplace.
✅ 5. Verify on the explorer
You can search for the address in the Stacks Testnet Explorer to confirm it was deployed successfully.
📌 6. What’s next?
In the next post, we’ll code the marketplace contract and link it with this minter
, enabling NFT listings for sale using STX or fungible tokens.