Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ The bridges have the same address across all supported chains. The address is `0
| Ethereum | 1 | `0x74D1984A64F447371Be4019920180b52A33aDAdD` | _True_ |
| BSC | 56 | `0xB2B446386633C6746B0a2735FB57edBb066c5878` | _False_ |

---

`inwstETHs`

| Chain Name | ChainId | Address | Source Chain |
| ---------- | ------- | -------------------------------------------- | ------------ |
| Ethereum | 1 | `0x8E0789d39db454DBE9f4a77aCEF6dc7c69f6D552` | _True_ |
| Zircuit | 48900 | `0x9eFdE41A87fa4dD47BAa584954e8Abd5b8bdBfE7` | _False_ |

#### Rate Providers

| Asset | Chain Name | ChainId | Address |
Expand Down
107 changes: 6 additions & 101 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require("@openzeppelin/hardhat-upgrades");

require("./tasks/setup-bridge");
require("./tasks/deploy-xerc20");
require("./tasks/deploy-xerc20-i");
require("./tasks/deploy-rate-provider");

/** @type import('hardhat/config').HardhatUserConfig */
Expand All @@ -25,108 +26,12 @@ module.exports = {
chainId: 1,
gas: 8000000,
},
holesky: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_HOLESKY}`,
chainId: 17000,
zircuit: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`, `0x${process.env.DEPLOYER_PRIVATE_KEY_FACTORY}`],
url: `${process.env.RPC_URL_ZIRCUIT}`,
chainId: 48900,
gas: 8000000,
},
arbitrum: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_ARBITRUM}`,
chainId: 42161,
gas: 8000000,
},
arbitrum_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_ARBITRUM_TESTNET}`,
chainId: 421614,
gas: 8000000,
},
mode: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_MODE}`,
chainId: 34443,
gas: 8000000,
},
mode_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_MODE_TESTNET}`,
chainId: 919,
gas: 8000000,
},
xlayer: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_XLAYER}`,
chainId: 196,
gas: 8000000,
},
xlayer_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_XLAYER_TESTNET}`,
chainId: 195,
gas: 8000000,
},
linea: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_LINEA}`,
chainId: 59144,
gas: 8000000,
},
linea_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_LINEA_TESTNET}`,
chainId: 59141,
gas: 8000000,
},
blast: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_BLAST}`,
chainId: 81457,
gas: 8000000,
},
blast_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_BLAST_TESTNET}`,
chainId: 168587773,
gas: 8000000,
},
bsc: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_BSC}`,
chainId: 56,
gas: 8000000,
},
bsc_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_BSC_TESTNET}`,
chainId: 97,
gas: 8000000,
},
optimism: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_OPTIMISM}`,
chainId: 10,
gas: 8000000,
},
optimism_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_OPTIMISM_TESTNET}`,
chainId: 11155420,
gas: 8000000,
},
base: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY}`],
url: `${process.env.RPC_URL_BASE}`,
chainId: 8453,
gas: 8000000,
},
base_testnet: {
accounts: [`0x${process.env.DEPLOYER_PRIVATE_KEY_TESTNET}`],
url: `${process.env.RPC_URL_BASE_TESTNET}`,
chainId: 84532,
gas: 8000000,
},
}
},
solidity: {
compilers: [
Expand Down
8 changes: 4 additions & 4 deletions scripts/migration/deploy-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ async function deployBridge(implementationAddress, factoryAddress, notaryAddress
const factory = await ethers.getContractAt("BridgeFactory", factoryAddress);

/// Deploy ProxyAdmin
const proxyAdmin = await ethers.deployContract("ProxyAdmin");
await proxyAdmin.waitForDeployment();
const proxyAdminAddress = await proxyAdmin.getAddress();
// const proxyAdmin = await ethers.deployContract("ProxyAdmin");
// await proxyAdmin.waitForDeployment();
const proxyAdminAddress = "0xB81e55e7Ee6B286aF6abFEa4eFad83f7BA4D1f1e";
console.log(`ProxyAdmin address: ${proxyAdminAddress}`);

/// Deploy TransparentUpgradeableProxy
Expand Down Expand Up @@ -91,7 +91,7 @@ async function main() {
console.error("factory address is null");
}

const bridgeImplAddress = await deployBridgeImpl();
const bridgeImplAddress = "0xB2F44773e99cfFeCb00AE9ba62913EA14C3B6163";
const bridgeProxyAddress = await deployBridge(bridgeImplAddress, factoryAddress, notaryAddress);

// Save the Bridge Impl address
Expand Down
8 changes: 4 additions & 4 deletions scripts/migration/deploy-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deployFactory = async () => {
console.log("###################### Factory deployment #######################");
console.log("##################################################################\n");

const [deployer] = await ethers.getSigners();
const [normalDeployer, deployer] = await ethers.getSigners();
await printBalance(deployer);

if ((await deployer.getNonce()).toString() != DEPLOYER_NONCE) {
Expand All @@ -22,7 +22,8 @@ const deployFactory = async () => {
return;
}

const factory = await ethers.deployContract("BridgeFactory");
const Factory = await ethers.getContractFactory("BridgeFactory");
const factory = await Factory.connect(deployer).deploy();
await factory.waitForDeployment();

const factoryAddress = await factory.getAddress();
Expand All @@ -46,5 +47,4 @@ main()
.catch((error) => {
console.error(error);
process.exit(1);
});

});
34 changes: 34 additions & 0 deletions scripts/migration/ownerships_e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const fs = require("fs");
const { ethers } = require("hardhat");
const { printBalance } = require("../utils");

const deployFactory = async () => {
console.log("##################################################################");
console.log("###################### Transfering Ownerhips #####################");
console.log("##################################################################\n");

const [deployer] = await ethers.getSigners();
await printBalance(deployer);

if (hre.network.name == "ethereum") {

console.log("ethereum");

let tx;
let xerc20 = await ethers.getContractAt("XERC20", "0x9eFdE41A87fa4dD47BAa584954e8Abd5b8bdBfE7");

tx = await xerc20.transferOwnership("0x8e6C8799B542E507bfDDCA1a424867e885D96e79"); await tx.wait(); console.log("1");

} else throw ("Incorrect Network");
};

async function main() {
await deployFactory();
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
41 changes: 41 additions & 0 deletions scripts/migration/ownerships_z.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const fs = require("fs");
const { ethers } = require("hardhat");
const { printBalance } = require("../utils");

const deployFactory = async () => {
console.log("##################################################################");
console.log("###################### Transfering Ownerhips #####################");
console.log("##################################################################\n");

const [deployer] = await ethers.getSigners();
await printBalance(deployer);
let multisig = "0x76668e48f6D6b304Cf17a970C474942115AAAEB6";

if (hre.network.name == "zircuit") {

console.log("zircuit");

let tx;
let pa1 = await ethers.getContractAt("InceptionBridge", "0xB81e55e7Ee6B286aF6abFEa4eFad83f7BA4D1f1e");
let pa2 = await ethers.getContractAt("InceptionBridge", "0x67f199841416388eeAd3bc48178c36651579FA3A");
let b = await ethers.getContractAt("InceptionBridge", "0xC00cD5599F7E128FC5Ed5563147a45B12e83B3ac");
let x = await ethers.getContractAt("InceptionBridge", "0x9eFdE41A87fa4dD47BAa584954e8Abd5b8bdBfE7");

tx = await pa1.transferOwnership(multisig); await tx.wait(); console.log("1");
tx = await pa2.transferOwnership(multisig); await tx.wait(); console.log("2");
tx = await b.transferOwnership(multisig); await tx.wait(); console.log("3");
tx = await x.transferOwnership(multisig); await tx.wait(); console.log("4");

} else throw ("Incorrect Network");
};

async function main() {
await deployFactory();
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
8 changes: 4 additions & 4 deletions scripts/setup-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ async function setupBridge(bridgeConfig) {
if (bridgesToAdd !== undefined) {
for (let i = 0; i < bridgesToAdd.length; i++) {
try {
tx = await bridge.addBridge(bridgesToAdd[i].address, bridgesToAdd[i].destinationChainID);
await tx.wait();
// tx = await bridge.addBridge(bridgesToAdd[i].address, bridgesToAdd[i].destinationChainID);
// await tx.wait();
console.log(`new bridge address: ${bridgesToAdd[i].address}; chainID: ${bridgesToAdd[i].destinationChainID} was added\n`);
} catch (e) {
console.warn(`the bridge ${bridgesToAdd[i].address} to ${bridgesToAdd[i].destinationChainID} was skipped`);
Expand All @@ -43,8 +43,8 @@ async function setupBridge(bridgeConfig) {

const destination = (await bridge.getDestination(originalTokenAddress, tokenToAdd[i].destinationChainID)).toString();
if (destination == "0x0000000000000000000000000000000000000000") {
tx = await bridge.addDestination(originalTokenAddress, tokenToAdd[i].destinationChainID, tokenToAdd[i].destinationAddress);
await tx.wait();
// tx = await bridge.addDestination(originalTokenAddress, tokenToAdd[i].destinationChainID, tokenToAdd[i].destinationAddress);
// await tx.wait();
}

const currentShortCap = (await bridge.shortCaps(originalTokenAddress)).toString();
Expand Down
Loading