Skip to content

Commit

Permalink
feat: bttc deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlilley committed Oct 17, 2022
1 parent 4ffe97c commit b36cf2f
Show file tree
Hide file tree
Showing 12 changed files with 3,045 additions and 13 deletions.
20 changes: 14 additions & 6 deletions deploy/MasterDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,27 @@ const deployFunction: DeployFunction = async function ({

const bentoBox = await ethers.getContractOrNull<BentoBoxV1>("BentoBoxV1");

const wnative = await ethers.getContractOrNull<WETH9>("WETH9");
// const wnative = await ethers.getContractOrNull<WETH9>("WETH9");

if (!bentoBox && !(chainId in BENTOBOX_ADDRESS)) {
if (!bentoBox && !(chainId in BENTOBOX_ADDRESS) && !process.env.BENTOBOX_ADDRESS) {
throw Error(`No BENTOBOX on chain #${chainId}!`);
}

if (!wnative && !(chainId in WNATIVE_ADDRESS)) {
throw Error(`No WNATIVE on chain #${chainId}!`);
}
// if (!wnative && !(chainId in WNATIVE_ADDRESS)) {
// throw Error(`No WNATIVE on chain #${chainId}!`);
// }

const { address, newlyDeployed } = await deploy("MasterDeployer", {
from: deployer,
args: [barFee, barFeeTo, bentoBox ? bentoBox.address : BENTOBOX_ADDRESS[chainId]],
args: [
barFee,
barFeeTo,
bentoBox
? bentoBox.address
: chainId in BENTOBOX_ADDRESS
? BENTOBOX_ADDRESS[chainId]
: process.env.BENTOBOX_ADDRESS,
],
deterministicDeployment: false,
waitConfirmations: process.env.VERIFY_ON_DEPLOY === "true" ? 20 : undefined,
});
Expand Down
12 changes: 8 additions & 4 deletions deploy/TridentRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const deployFunction: DeployFunction = async function ({

const wnative = await ethers.getContractOrNull<WETH9>("WETH9");

if (!bentoBox && !(chainId in BENTOBOX_ADDRESS)) {
if (!bentoBox && !(chainId in BENTOBOX_ADDRESS) && !process.env.BENTOBOX_ADDRESS) {
throw Error(`No BENTOBOX on chain #${chainId}!`);
}

if (!wnative && !(chainId in WNATIVE_ADDRESS)) {
if (!wnative && !(chainId in WNATIVE_ADDRESS) && !process.env.WNATIVE_ADDRESS) {
throw Error(`No WNATIVE on chain #${chainId}!`);
}

Expand All @@ -34,9 +34,13 @@ const deployFunction: DeployFunction = async function ({
const { address, newlyDeployed } = await deploy("TridentRouter", {
from: deployer,
args: [
bentoBox ? bentoBox.address : BENTOBOX_ADDRESS[chainId],
bentoBox
? bentoBox.address
: chainId in BENTOBOX_ADDRESS
? BENTOBOX_ADDRESS[chainId]
: process.env.BENTOBOX_ADDRESS,
masterDeployer.address,
wnative ? wnative.address : WNATIVE_ADDRESS[chainId],
wnative ? wnative.address : chainId in WNATIVE_ADDRESS ? WNATIVE_ADDRESS[chainId] : process.env.WNATIVE_ADDRESS,
],
deterministicDeployment: false,
waitConfirmations: process.env.VERIFY_ON_DEPLOY === "true" ? 10 : undefined,
Expand Down
10 changes: 7 additions & 3 deletions deploy/TridentSushiRollCP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const deployFunction: DeployFunction = async function ({

const wnative = await ethers.getContractOrNull<WETH9>("WETH9");

if (!bentoBox && !(chainId in BENTOBOX_ADDRESS)) {
if (!bentoBox && !(chainId in BENTOBOX_ADDRESS) && !process.env.BENTOBOX_ADDRESS) {
throw Error(`No BENTOBOX on chain #${chainId}!`);
}

if (!wnative && !(chainId in WNATIVE_ADDRESS)) {
if (!wnative && !(chainId in WNATIVE_ADDRESS) && !process.env.WNATIVE_ADDRESS) {
throw Error(`No WNATIVE on chain #${chainId}!`);
}

Expand All @@ -36,7 +36,11 @@ const deployFunction: DeployFunction = async function ({
const { address, newlyDeployed } = await deploy("TridentSushiRollCP", {
from: deployer,
args: [
bentoBox ? bentoBox.address : BENTOBOX_ADDRESS[chainId],
bentoBox
? bentoBox.address
: chainId in BENTOBOX_ADDRESS
? BENTOBOX_ADDRESS[chainId]
: process.env.BENTOBOX_ADDRESS,
constantProductPoolFactory.address,
masterDeployer.address,
],
Expand Down
1 change: 1 addition & 0 deletions deployments/bttc/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
199
365 changes: 365 additions & 0 deletions deployments/bttc/ConstantProductPoolFactory.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions deployments/bttc/ConstantProductPoolFactoryHelper.json

Large diffs are not rendered by default.

Loading

0 comments on commit b36cf2f

Please sign in to comment.