This is the FrankenPunks NFT smart contract.
- (One-time) Make sure your dev environment is set up with Node and NPM. Then run
npm install
. - You will need
citizens.csv
,governors.csv
, andpeasants.csv
in adata
folder in the root directory. The format of these files does not matter much as long as it's a CSV with one address per row, at the start of every row (no header row). - Make sure that
RANKS_FROM_WORST_TO_BEST
insrc/constants.ts
has the correct values. - Run
npx hardhat run scripts/writeCompactMerkleTreeData.ts
. This will do two things: it will use the CSVs to generate an updateddata/merkle.json
file, and it will log the Merkle root to the console. - The
data/merkle.json
file must be used in the frontend to support proof generation. - The Merkle root must be updated on the contract. This can be done using the
updateMerkleRoot
script (see below).
Example script invocation on Rinkeby:
# Note: RINKEBY_URL and PRIVATE_KEY are also required, and can be configured through .env
export FP_ADDRESS=0x3a2B010392a31db290392057173917ABd8181958
export MERKLE_ROOT=0x50fb338d16773120c91f7c8435411c5618e6c98341b6fb5130c802b879874a9c
npx hardhat run --network rinkeby scripts/updateMerkleRoot.ts