Skip to content

Commit

Permalink
fix deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Aug 28, 2023
1 parent a39dc16 commit 5186a9c
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
31 changes: 31 additions & 0 deletions deploy/00_deploy_ERC6551Registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DeployFunction } from "hardhat-deploy/types"

const deployERC6551Registry: DeployFunction = async (hre) => {
// const [signer] = await hre.ethers.getSigners()

const ERC6551Registry = await hre.ethers.getContractFactory("ERC6551Registry")
const erc6551Registry = await ERC6551Registry.deploy()

try {
await hre.run("verify:verify", {
address: await erc6551Registry.getAddress(),
constructorArguments: [],
})
} catch (e) {
if (
e instanceof Error &&
e.stack &&
(e.stack.indexOf("Reason: Already Verified") > -1 ||
e.stack.indexOf("Contract source code already verified") > -1)
) {
console.log(" ✔ Contract is already verified")
} else {
console.log(
" ✘ Verifying the contract failed. This is probably because Etherscan is still indexing the contract. Try running this same command again in a few seconds."
)
throw e
}
}
}

export default deployERC6551Registry
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { DeployFunction } from "hardhat-deploy/types"
import { createWalletClient, custom as customTransport } from "viem"

import {
calculateERC721TokenboundMechMastercopyAddress,
deployERC721TokenboundMechMastercopy,
} from "../sdk/build/cjs/sdk/src"
} from "../sdk"

const deployMastercopyERC721Tokenbound: DeployFunction = async (hre) => {
const [signer] = await hre.ethers.getSigners()
const deployer = hre.ethers.provider.getSigner(signer.address)
const deployer = await hre.ethers.provider.getSigner(signer.address)

await deployERC721TokenboundMechMastercopy(deployer)
const deployerClient = createWalletClient({
account: deployer.address as `0x${string}`,
transport: customTransport({
async request({ method, params }) {
return deployer.provider.send(method, params)
},
}),
})

await deployERC721TokenboundMechMastercopy(deployerClient)
const address = calculateERC721TokenboundMechMastercopyAddress()

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DeployFunction } from "hardhat-deploy/types"
import { createWalletClient, custom as customTransport } from "viem"

import {
calculateERC1155TokenboundMechMastercopyAddress,
Expand All @@ -7,9 +8,18 @@ import {

const deployMastercopyERC1155Tokenbound: DeployFunction = async (hre) => {
const [signer] = await hre.ethers.getSigners()
const deployer = hre.ethers.provider.getSigner(signer.address)
const deployer = await hre.ethers.provider.getSigner(signer.address)

await deployERC1155TokenboundMechMastercopy(deployer)
const deployerClient = createWalletClient({
account: deployer.address as `0x${string}`,
transport: customTransport({
async request({ method, params }) {
return deployer.provider.send(method, params)
},
}),
})

await deployERC1155TokenboundMechMastercopy(deployerClient)
const address = calculateERC1155TokenboundMechMastercopyAddress()

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DeployFunction } from "hardhat-deploy/types"
import { createWalletClient, custom as customTransport } from "viem"

import {
calculateZodiacMechMastercopyAddress,
deployZodiacMechMastercopy,
} from "../sdk"
} from "../sdk/build/cjs/sdk/src"

const deployMastercopyZodiac: DeployFunction = async (hre) => {
// TODO disabled for now
Expand All @@ -12,7 +13,16 @@ const deployMastercopyZodiac: DeployFunction = async (hre) => {
const [signer] = await hre.ethers.getSigners()
const deployer = await hre.ethers.provider.getSigner(signer.address)

await deployZodiacMechMastercopy(deployer)
const deployerClient = createWalletClient({
account: deployer.address as `0x${string}`,
transport: customTransport({
async request({ method, params }) {
return deployer.provider.send(method, params)
},
}),
})

await deployZodiacMechMastercopy(deployerClient)
const address = calculateZodiacMechMastercopyAddress()

try {
Expand Down
2 changes: 1 addition & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function deployFactories() {

const ERC6551Registry = await ethers.getContractFactory("ERC6551Registry")
const erc6551Registry = await ERC6551Registry.deploy()
deployer.populateTransaction

const deployerClient = createTestClient({
account: deployer.address as `0x${string}`,
chain: hardhat,
Expand Down

0 comments on commit 5186a9c

Please sign in to comment.