added base info e6a373d9
Steve · 2023-10-11 23:11 2 file(s) · +26 −4
hardhat.config.js +19 −3
14 14
      accounts:
15 15
        process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
16 16
    },
17 -
    baseGoerli: {
17 +
    'base-goerli': {
18 18
      url: `${process.env.ALCHEMY_URL_BASE}`,
19 -
      accounts: [process.env.PRIVATE_KEY]
19 +
      accounts: [process.env.PRIVATE_KEY],
20 +
      gasPrice: 2000000000,
20 21
    }
21 22
  },
22 23
  etherscan: {
24 +
    apiKey: {
25 +
      "base-goerli": "PLACEHOLDER_STRING"
26 +
    },
27 +
    customChains: [
28 +
      {
29 +
        network: "base-goerli",
30 +
        chainId: 84531,
31 +
        urls: {
32 +
          apiURL: "https://api-goerli.basescan.org/api",
33 +
          browserURL: "https://goerli.basescan.org"
34 +
        }
35 +
      }
36 +
    ]
37 +
  },
38 +
  /* etherscan: {
23 39
    apiKey: process.env.ETHERSCAN_API_KEY
24 -
  }
40 +
  } */
25 41
26 42
};
scripts/deployContractsBase.js +7 −1
1 1
// Import the ethers library
2 2
const { ethers } = require("hardhat");
3 -
const provider = new ethers.AlchemyProvider("base-goerli", process.env.ALCHEMY_KEY_BASE)
3 +
const provider = new ethers.JsonRpcProvider(process.env.ALCHEMY_URL_BASE)
4 4
const { TokenboundClient } = require("@tokenbound/sdk");
5 +
function wait(ms) {
6 +
  return new Promise(resolve => setTimeout(resolve, ms));
7 +
}
8 +
5 9
6 10
async function Operator() {
7 11
63 67
    const npcTx = await operatorContract.createNPC(wallet.address, `ipfs://QmQbwCMwDETHHZ1g8YaSHqLBwCRgVHqFuRNRfiGyNqCcXj/${i}.json`)
64 68
    const npcTxReceipt = await npcTx.wait()
65 69
    console.log("NPC Created")
70 +
    wait(2000)
66 71
67 72
    // After the NPC is created
68 73
    const latestTokenId = await operatorContract.getLatestTokenId();
73 78
      tokenId: latestTokenId,
74 79
    })
75 80
    console.log("TBA:", tba)
81 +
    wait(4000)
76 82
77 83
    // equip NPC via TBA
78 84