| 13 | const proxyRegistryAddressMainnet = '0xa5409ec958c83c3f309868babaca7c86dcb077c1' |
| 14 | |
| 15 | async function main() { |
| 16 | // Calculate merkle root from the whitelist array |
| 17 | const leafNodes = whitelist.map((addr) => keccak256(addr)) |
| 18 | const merkleTree = new MerkleTree(leafNodes, keccak256, { sortPairs: true }) |
| 19 | const root = merkleTree.getRoot() |
| 20 | |
| 21 | // Deploy the contract |
| 22 | const BoredApes = await hre.ethers.getContractFactory('BoredApe') |
| 23 | const boredApes = await BoredApes.deploy( |
| 24 | BASE_URI, |
| 25 | root, |
| 26 | proxyRegistryAddressRinkeby |
| 27 | ) |
| 28 | |
| 29 | await boredApes.deployed() |
| 30 | |
| 31 | console.log('BoredApes deployed to:', boredApes.address) |
| 32 | } |
| 33 | |
| 34 | // We recommend this pattern to be able to use async/await everywhere |
| 35 | // and properly handle errors. |