Springboarding Your Ethereum NFT Collection With Artacle | by Artacle | Feb, 2022

Creating an NFT group just got a lot easier

Artacle
Photo from Unsplash
NFT project template structure

Step 1: Environment

Step 2: Prepare images and metadata

{
"description": "This is our mind-blowing NFT collection of 10000 gold-covered gelo worms",
"name": "Golden worm",
"image": "ipfs://<your stub image CID>",
"attributes": []
}
{
“description”: “This is our mind-blowing NFT collection of 10000 gold-covered gelo worms”,
“name”: “Golden worm”,
“attributes”: [
{
“trait_type”: “Background”,
“value”: “Red”
},
{
“trait_type”: “Body”,
“value”: “Yellow”
},
{
“trait_type”: “Hat”,
“value”: “Black”
},
{
“trait_type”: “Sunglasses”,
“value”: “MIB-style”
}
]
}

Step 3: Install (non-exposed) images and metadata to IPFS

{
“PINATA_API_KEY”: “your api key”,
“PINATA_API_SECRET”: “your api secret”
}
Create a source hash
Install images on IPFS

Step 4: Deploy and initialize the contract with the correct parameters

async function main () {
const [deployer] = await ethers.getSigners();
console.log(“Deploying contracts with the account:”, deployer.address);
console.log(“Account balance:”, (await deployer.getBalance()).toString());
const ArtacleNFT = await ethers.getContractFactory(‘ArtacleNFT’);
console.log(‘Deploying ArtacleNFT…’);
// USER CUSTOMIZATION BLOCKconst NAME = ‘MyCustomNFT’;
const CODE = ‘MCN’;
const PRICE = ethers.utils.parseEther(‘0.05’);
const PRESALE_AMOUNT = 5;
const TOTAL_AMOUNT = 20;
const PROVENANCE_HASH = ‘9405e8109583fe1ca86110866f9e1ac26df40bab339be5dd54cf3e99bdd8af85’;
const MAX_TOKENS_PER_ADDRESS = 2;
const GIVE_FREE_PER_BATCH = 0;
const META_URI = ‘ipfs://<my unrevealed meta CID from pin_to_ipfs.py output/’
// USER CUSTOMIZATION BLOCK ENDif (NAME == ‘’ || CODE == ‘’ || PROVENANCE_HASH == ‘’) {
console.log(‘ERROR: parameters must be filled’);
}
if (PRESALE_AMOUNT >= TOTAL_AMOUNT) {
console.log(‘ERROR: invalid contract parameters’);
}
const contract = await ArtacleNFT.deploy(NAME, CODE, PRICE, PRESALE_AMOUNT, TOTAL_AMOUNT, PROVENANCE_HASH);
await contract.deployed();
console.log(‘Contract deployed to:’, contract.address);
let tx = await contract.setMintingLimits(MAX_TOKENS_PER_ADDRESS, GIVE_FREE_PER_BATCH);
await tx.wait();
tx = await contract.setBaseURI(META_URI);
await tx.wait();
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});

Step 5: Implement the collection flow using the published contract

Step 6: Detecting tokens

Connect icons to their pictures
async function main () {
const [deployer] = await ethers.getSigners();
const ArtacleNFT = await ethers.getContractFactory(‘ArtacleNFT’);
const address = ‘your contract address’
const contract = await ArtacleNFT.attach(address);
const META_URI = ‘ipfs://<your updated meta CID from the update_and_pin_meta.py/’let tx = await contract.setBaseURI(META_URI);
await tx.wait();
tx = await contract.setRevealedState(true);
await tx.wait();
console.log(‘Revealed’)}main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
Want to Connect?Join our Discord, follow our Twitter https://twitter.com/artacleio, and feel free to ask any questions there!

Leave a Comment