lib.js 534 Bytes
Newer Older
George Hotz's avatar
George Hotz committed
1
const fs = require("fs")
George Hotz's avatar
George Hotz committed
2 3 4 5 6 7

async function deploy() {
  const MIPS = await ethers.getContractFactory("MIPS")
  const m = await MIPS.deploy()
  const mm = await ethers.getContractAt("MIPSMemory", await m.m())

George Hotz's avatar
George Hotz committed
8 9 10 11
  let startTrie = JSON.parse(fs.readFileSync("/tmp/cannon/golden.json"))
  let goldenRoot = startTrie["root"]
  console.log("goldenRoot is", goldenRoot)

George Hotz's avatar
George Hotz committed
12 13 14 15 16 17 18
  const Challenge = await ethers.getContractFactory("Challenge")
  const c = await Challenge.deploy(m.address, goldenRoot)

  return [c,m,mm]
}

module.exports = { deploy }