Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

autistic-symposium/loot-storyteller-nft-collection-sol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smart contract for the "on-chain generative storytelling NFT collection"





setting up

  • set an account and project on infura or alchemy
  • set a test account in metamask and copy your private key (i used rinkeby for dev and you can get some funds in this faucet)
  • set up an account at etherscan and grab the API key
cp env_example .env
vim .env
  • install the dependencies:
npm install


deploying on rinkeby

  • set the default network "rinkeby" at hardhat.config.js
  • compile the contract:
npx hardhat compile
  • deploy the contract:
npx hardhat run scripts/deploy.js


interacting with the contract

npx hardhat console --network rinkeby
  • ad-hoc minting:
> const Film = await ethers.getContractFactory('FilmmakerDAO');
> const film = await Film.attach('<contract>')
> await film.mint(<tokenID>)


verifying the smart contract

  • install hardhat etherscan plugin (compatible with etherscan and polygonscan)
npm install --save-dev @nomiclabs/hardhat-etherscan
  • verify the smart contract with the contract address
npx hardhat verify --network rinkeby YOUR_CONTRACT_ADDRESS


useful commands

  • test a smart contract:
npx hardhat test
  • clean artifacts:
npx hardhat clean

deploying on mainnet

  • same steps, simply set the default network to "mainnet" and make sure the private key in .env is from the desired account