added scroll branch 237676c3
Steve · 2023-10-17 11:41 2 file(s) · +17 −26
hardhat.config.js +1 −1
22 22
    scrollSepolia: {
23 23
      url: "https://sepolia-rpc.scroll.io/" || "",
24 24
      accounts:
25 -
        process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
25 +
        process.env.TEST_PRIVATE_KEY !== undefined ? [process.env.TEST_PRIVATE_KEY] : [],
26 26
      gasPrice: 1500000000,
27 27
28 28
    },
scripts/deployContractsScroll.js +16 −25
1 1
// Import the ethers library
2 2
const { ethers } = require("hardhat");
3 -
const axios = require('axios')
4 -
//const provider = new ethers.AlchemyProvider("sepolia", process.env.SEPOLIA_KEY)
5 -
const provider = new ethers.getDefaultProvider("https://rpc.scroll.io")
3 +
const provider = new ethers.getDefaultProvider("https://sepolia-rpc.scroll.io/")
6 4
const { TokenboundClient } = require("@tokenbound/sdk");
7 5
8 6
async function Main() {
9 -
  const feeData = await provider.getFeeData()
10 7
11 8
  // Get the signers from ethers
12 -
  const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider)
13 -
  console.log(`SERVER_WALLET_PRIVATE_KEY=${process.env.PRIVATE_KEY}`)
9 +
  const wallet = new ethers.Wallet(process.env.TEST_PRIVATE_KEY, provider)
10 +
  //const tokenboundClient = new TokenboundClient({ signer: wallet, chainId: 534351 })
11 +
  console.log(`SERVER_WALLET_PRIVATE_KEY=${process.env.TEST_PRIVATE_KEY}`)
14 12
  console.log(`SERVER_WALLET_ADDRESS=${wallet.address}`)
15 13
16 14
  // Deploy NPC contract
17 15
  const NPCContract = await ethers.getContractFactory("CosmicCowboys");
18 -
  const npcContract = await NPCContract.deploy(wallet.address, { gasPrice: feeData.gasPrice })
16 +
  const npcContract = await NPCContract.deploy(wallet.address);
19 17
  const npcContractAddress = await npcContract.getAddress()
20 18
  console.log(`NPC_CONTRACT_ADDRESS=${npcContractAddress}`);
21 19
22 20
  // Deploy ERC-20 Contract
23 21
  const CurrencyContract = await ethers.getContractFactory("GoldenCorn");
24 -
  const currencyContract = await CurrencyContract.deploy(wallet.address, { gasPrice: feeData.gasPrice })
22 +
  const currencyContract = await CurrencyContract.deploy(wallet.address);
25 23
  const currencyContractAddress = await currencyContract.getAddress()
26 24
  console.log(`CURRENCY_CONTRACT_ADDRESS=${currencyContractAddress}`)
27 25
28 26
  // Deploy 1155 Contracts
29 27
  const FoodContract = await ethers.getContractFactory("SpaceSlop");
30 -
  const foodContract = await FoodContract.deploy(wallet.address, { gasPrice: feeData.gasPrice })
28 +
  const foodContract = await FoodContract.deploy(wallet.address);
31 29
  const foodContractAddress = await foodContract.getAddress()
32 30
  console.log(`FOOD_CONTRACT_ADDRESS=${foodContractAddress}`);
33 31
34 32
  const SupplyContract = await ethers.getContractFactory("JupiterJunk");
35 -
  const supplyContract = await SupplyContract.deploy(wallet.address, { gasPrice: feeData.gasPrice })
33 +
  const supplyContract = await SupplyContract.deploy(wallet.address);
36 34
  const supplyContractAddress = await supplyContract.getAddress()
37 35
  console.log(`SUPPLY_CONTRACT_ADDRESS=${supplyContractAddress}`);
38 36
39 37
  // Deploy ERC6551
40 -
  const RegistryContract = await ethers.getContractFactory("ERC6551Registry");
41 -
  const registryContract = await RegistryContract.deploy({ gasPrice: feeData.gasPrice })
38 +
  /* const RegistryContract = await ethers.getContractFactory("ERC6551Registry");
39 +
  const registryContract = await RegistryContract.deploy();
42 40
  const registryContractAddress = await registryContract.getAddress()
43 41
  console.log("Registry Contract deployed to address:", registryContractAddress);
44 42
45 43
  const AccountContract = await ethers.getContractFactory("ERC6551Account");
46 -
  const accountContract = await AccountContract.deploy({ gasPrice: feeData.gasPrice })
44 +
  const accountContract = await AccountContract.deploy();
47 45
  const accountContractAddress = await accountContract.getAddress()
48 -
  console.log("Account Contract deployed to address:", accountContractAddress);
46 +
  console.log("Account Contract deployed to address:", accountContractAddress); */
49 47
50 -
  /* const tokenboundClient = new TokenboundClient({
51 -
    walletClient: wallet,
52 -
    chainId: 534352,
53 -
    implementationAddress: accountContractAddress,
54 -
    registryAddress: registryContractAddress,
55 -
  })
56 48
  // Deploy Operator Contract
57 49
  const OperatorContract = await ethers.getContractFactory("Operator");
58 50
  const operatorContract = await OperatorContract.deploy(wallet.address, npcContractAddress, currencyContractAddress, foodContractAddress, supplyContractAddress)
65 57
  await foodContract.transferOwnership(operatorContractAddress);
66 58
  await supplyContract.transferOwnership(operatorContractAddress);
67 59
68 -
  for (let i = 0; i < 19; i++) {
60 +
  /* for (let i = 0; i < 19; i++) {
69 61
    // create NPC
70 62
    const npcTx = await operatorContract.createNPC(wallet.address, `ipfs://QmQbwCMwDETHHZ1g8YaSHqLBwCRgVHqFuRNRfiGyNqCcXj/${i}.json`)
71 63
    const npcTxReceipt = await npcTx.wait()
93 85
94 86
    const supplyNpcTx = await operatorContract.supplyNPC(tba, 5)
95 87
    const supplyNpcTxReceipt = await supplyNpcTx.wait()
96 -
    console.log("NPC Supplied") 
88 +
    console.log("NPC Supplied")
97 89
98 -
    } */
99 -
100 -
90 +
  } */
101 91
}
102 92
103 93
Main()
94 +