Skip to content

Commit

Permalink
chore: update ConduitController address
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMasayoshi committed Sep 15, 2022
1 parent 6a5dba4 commit 5a06090
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 62 deletions.
6 changes: 3 additions & 3 deletions constants/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChainId } from "@sushiswap/core-sdk";

export const CONDUIT_CONTROLLER_ADDRESS: { [chainId: number]: string } = {
[ChainId.ETHEREUM]: "0x00000000006ce100a8b5ed8edf18ceef9e500697",
[ChainId.RINKEBY]: "0x00000000006ce100a8b5ed8edf18ceef9e500697",
[ChainId.GÖRLI]: "0x00000000006ce100a8b5ed8edf18ceef9e500697",
[ChainId.ETHEREUM]: "0x00000000F9490004C11Cef243f5400493c00Ad63",
[ChainId.RINKEBY]: "0x00000000F9490004C11Cef243f5400493c00Ad63",
[ChainId.GÖRLI]: "0x00000000F9490004C11Cef243f5400493c00Ad63",
};

export const SEAPORT_ADDRESS: { [chainId: number]: string } = {
Expand Down
32 changes: 26 additions & 6 deletions deploy/Conduit.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { CONDUIT_CONTROLLER_ADDRESS } from "../constants/addresses";
import {
CONDUIT_CONTROLLER_ADDRESS,
SEAPORT_ADDRESS,
} from "../constants/addresses";

const NONCE = "555555555555555";
const NONCE = "000000000000000";

const deployFunction: DeployFunction = async function ({
ethers,
Expand All @@ -18,15 +21,20 @@ const deployFunction: DeployFunction = async function ({

const chainId = Number(await getChainId());

let conduitController;
let conduitController, seaportAddress;

if (chainId === 31337) {
conduitController = await ethers.getContract("ConduitController");
} else if (chainId in CONDUIT_CONTROLLER_ADDRESS) {
seaportAddress = (await ethers.getContract("Seaport")).address;
} else if (
chainId in CONDUIT_CONTROLLER_ADDRESS &&
chainId in SEAPORT_ADDRESS
) {
conduitController = await ethers.getContractAt(
"ConduitController",
CONDUIT_CONTROLLER_ADDRESS[chainId]
);
seaportAddress = SEAPORT_ADDRESS[chainId];
} else {
throw Error("No CONDUITCONTROLLER!");
}
Expand All @@ -47,12 +55,24 @@ const deployFunction: DeployFunction = async function ({
} else {
const { gasLimit } = await ethers.provider.getBlock("latest");

const tx = await conduitController.createConduit(conduitKey, deployer, {
let tx = await conduitController.createConduit(conduitKey, deployer, {
gasLimit,
});
await tx.wait();

await conduitController.updateChannel(conduitAddress, shoyu.address, true);
tx = await conduitController.updateChannel(
conduitAddress,
seaportAddress,
true
);
await tx.wait();

tx = await conduitController.updateChannel(
conduitAddress,
shoyu.address,
true
);
await tx.wait();

console.log("Conduit deployed at address", conduitAddress);
}
Expand Down
34 changes: 17 additions & 17 deletions deployments/goerli/AdapterRegistry.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions deployments/goerli/Conduit.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deployments/goerli/Seaport.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions deployments/goerli/Shoyu.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions deployments/goerli/TransformationAdapter.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoyunft/contracts",
"version": "2.0.3",
"version": "2.0.4",
"description": "ShoyuNFT",
"main": "contracts/Shoyu.sol",
"author": "0xMasayoshi",
Expand Down

0 comments on commit 5a06090

Please sign in to comment.