Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgcyx committed Dec 13, 2023
1 parent b58a234 commit 3ea5908
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions scripts/deploy/child_deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function deployChildContracts() {
wrappedIMX = await deployChildContract("WIMX", childDeployerWallet, null);
console.log("Transaction submitted: ", JSON.stringify(wrappedIMX.deployTransaction, null, 2));
await waitForReceipt(wrappedIMX.deployTransaction.hash, childProvider);
verifyChildContract("WIMX", wrappedIMX.address);
await verifyChildContract("WIMX", wrappedIMX.address);
}
childContracts.WRAPPED_IMX_ADDRESS = wrappedIMX.address;
saveChildContracts(childContracts);
Expand All @@ -61,7 +61,7 @@ export async function deployChildContracts() {
childBridgeImpl = await deployChildContract("ChildERC20Bridge", childDeployerWallet, null, deployerAddr);
console.log("Transaction submitted: ", JSON.stringify(childBridgeImpl.deployTransaction, null, 2));
await waitForReceipt(childBridgeImpl.deployTransaction.hash, childProvider);
verifyChildContract("ChildERC20Bridge", childBridgeImpl.address);
await verifyChildContract("ChildERC20Bridge", childBridgeImpl.address);
}
childContracts.CHILD_BRIDGE_IMPL_ADDRESS = childBridgeImpl.address;
saveChildContracts(childContracts);
Expand All @@ -77,7 +77,7 @@ export async function deployChildContracts() {
childAdaptorImpl = await deployChildContract("ChildAxelarBridgeAdaptor", childDeployerWallet, null, childGatewayAddr, deployerAddr);
console.log("Transaction submitted: ", JSON.stringify(childAdaptorImpl.deployTransaction, null, 2));
await waitForReceipt(childAdaptorImpl.deployTransaction.hash, childProvider);
verifyChildContract("ChildAxelarBridgeAdaptor", childAdaptorImpl.address);
await verifyChildContract("ChildAxelarBridgeAdaptor", childAdaptorImpl.address);
}
childContracts.CHILD_ADAPTOR_IMPL_ADDRESS = childAdaptorImpl.address;
saveChildContracts(childContracts);
Expand Down Expand Up @@ -114,7 +114,7 @@ export async function deployChildContracts() {
childTokenTemplate = await deployChildContract("ChildERC20", reservedDeployerWallet, nonceReserved);
console.log("Transaction submitted: ", JSON.stringify(childTokenTemplate.deployTransaction, null, 2));
await waitForReceipt(childTokenTemplate.deployTransaction.hash, childProvider);
verifyChildContract("ChildERC20", childTokenTemplate.address);
await verifyChildContract("ChildERC20", childTokenTemplate.address);
}
childContracts.CHILD_TOKEN_TEMPLATE = childTokenTemplate.address;
saveChildContracts(childContracts);
Expand Down Expand Up @@ -150,7 +150,7 @@ export async function deployChildContracts() {
proxyAdmin = await deployChildContract("ProxyAdmin", reservedDeployerWallet, null);
console.log("Transaction submitted: ", JSON.stringify(proxyAdmin.deployTransaction, null, 2));
await waitForReceipt(proxyAdmin.deployTransaction.hash, childProvider);
verifyChildContract("ProxyAdmin", proxyAdmin.address);
await verifyChildContract("ProxyAdmin", proxyAdmin.address);
}
childContracts.CHILD_PROXY_ADMIN = proxyAdmin.address;
saveChildContracts(childContracts);
Expand All @@ -171,7 +171,7 @@ export async function deployChildContracts() {
childBridgeProxy = await deployChildContract("TransparentUpgradeableProxy", reservedDeployerWallet, null, childBridgeImpl.address, proxyAdmin.address, []);
console.log("Transaction submitted: ", JSON.stringify(childBridgeProxy.deployTransaction, null, 2));
await waitForReceipt(childBridgeProxy.deployTransaction.hash, childProvider);
verifyChildContract("TransparentUpgradeableProxy", childBridgeProxy.address);
await verifyChildContract("TransparentUpgradeableProxy", childBridgeProxy.address);
}
childContracts.CHILD_BRIDGE_PROXY_ADDRESS = childBridgeProxy.address;
saveChildContracts(childContracts);
Expand All @@ -192,7 +192,7 @@ export async function deployChildContracts() {
childAdaptorProxy = await deployChildContract("TransparentUpgradeableProxy", reservedDeployerWallet, null, childAdaptorImpl.address, proxyAdmin.address, []);
console.log("Transaction submitted: ", JSON.stringify(childAdaptorProxy.deployTransaction, null, 2));
await waitForReceipt(childAdaptorProxy.deployTransaction.hash, childProvider);
verifyChildContract("TransparentUpgradeableProxy", childAdaptorProxy.address);
await verifyChildContract("TransparentUpgradeableProxy", childAdaptorProxy.address);
}
childContracts.CHILD_ADAPTOR_PROXY_ADDRESS = childAdaptorProxy.address;
saveChildContracts(childContracts);
Expand Down
12 changes: 6 additions & 6 deletions scripts/deploy/root_deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function deployRootContracts() {
rootBridgeImpl = await deployRootContract("RootERC20BridgeFlowRate", rootDeployerWallet, null, deployerAddr);
console.log("Transaction submitted: ", JSON.stringify(rootBridgeImpl.deployTransaction, null, 2));
await waitForReceipt(rootBridgeImpl.deployTransaction.hash, rootProvider);
verifyRootContract("RootERC20BridgeFlowRate", rootBridgeImpl.address);
await verifyRootContract("RootERC20BridgeFlowRate", rootBridgeImpl.address);
}
rootContracts.ROOT_BRIDGE_IMPL_ADDRESS = rootBridgeImpl.address;
saveRootContracts(rootContracts);
Expand All @@ -61,7 +61,7 @@ export async function deployRootContracts() {
rootAdaptorImpl = await deployRootContract("RootAxelarBridgeAdaptor", rootDeployerWallet, null, rootGatewayAddr, deployerAddr);
console.log("Transaction submitted: ", JSON.stringify(rootAdaptorImpl.deployTransaction, null, 2));
await waitForReceipt(rootAdaptorImpl.deployTransaction.hash, rootProvider);
verifyRootContract("RootAxelarBridgeAdaptor", rootAdaptorImpl.address);
await verifyRootContract("RootAxelarBridgeAdaptor", rootAdaptorImpl.address);
}
rootContracts.ROOT_ADAPTOR_IMPL_ADDRESS = rootAdaptorImpl.address;
saveRootContracts(rootContracts);
Expand Down Expand Up @@ -98,7 +98,7 @@ export async function deployRootContracts() {
rootTokenTemplate = await deployRootContract("ChildERC20", reservedDeployerWallet, nonceReserved);
console.log("Transaction submitted: ", JSON.stringify(rootTokenTemplate.deployTransaction, null, 2));
await waitForReceipt(rootTokenTemplate.deployTransaction.hash, rootProvider);
verifyRootContract("ChildERC20", rootTokenTemplate.address);
await verifyRootContract("ChildERC20", rootTokenTemplate.address);
}
rootContracts.ROOT_TOKEN_TEMPLATE = rootTokenTemplate.address;
saveRootContracts(rootContracts);
Expand Down Expand Up @@ -130,7 +130,7 @@ export async function deployRootContracts() {
proxyAdmin = await deployRootContract("ProxyAdmin", reservedDeployerWallet, null);
console.log("Transaction submitted: ", JSON.stringify(proxyAdmin.deployTransaction, null, 2));
await waitForReceipt(proxyAdmin.deployTransaction.hash, rootProvider);
verifyRootContract("ProxyAdmin", proxyAdmin.address);
await verifyRootContract("ProxyAdmin", proxyAdmin.address);
}
rootContracts.ROOT_PROXY_ADMIN = proxyAdmin.address;
saveRootContracts(rootContracts);
Expand All @@ -151,7 +151,7 @@ export async function deployRootContracts() {
rootBridgeProxy = await deployRootContract("TransparentUpgradeableProxy", reservedDeployerWallet, null, rootBridgeImpl.address, proxyAdmin.address, []);
console.log("Transaction submitted: ", JSON.stringify(rootBridgeProxy.deployTransaction, null, 2));
await waitForReceipt(rootBridgeProxy.deployTransaction.hash, rootProvider);
verifyRootContract("TransparentUpgradeableProxy", rootBridgeProxy.address);
await verifyRootContract("TransparentUpgradeableProxy", rootBridgeProxy.address);
}
rootContracts.ROOT_BRIDGE_PROXY_ADDRESS = rootBridgeProxy.address;
saveRootContracts(rootContracts);
Expand All @@ -172,7 +172,7 @@ export async function deployRootContracts() {
rootAdaptorProxy = await deployRootContract("TransparentUpgradeableProxy", reservedDeployerWallet, null, rootAdaptorImpl.address, proxyAdmin.address, []);
console.log("Transaction submitted: ", JSON.stringify(rootAdaptorProxy.deployTransaction, null, 2));
await waitForReceipt(rootAdaptorProxy.deployTransaction.hash, rootProvider);
verifyRootContract("TransparentUpgradeableProxy", rootAdaptorProxy.address);
await verifyRootContract("TransparentUpgradeableProxy", rootAdaptorProxy.address);
}
rootContracts.ROOT_ADAPTOR_PROXY_ADDRESS = rootAdaptorProxy.address;
saveRootContracts(rootContracts);
Expand Down
5 changes: 3 additions & 2 deletions scripts/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export async function waitUntilSucceed(axelarURL: string, txHash: any) {

export async function verifyChildContract(contract: string, contractAddr: string) {
let url = process.env["CHILD_CHAIN_BLOCKSCOUT_API_URL"];
if (url == null) {
if (url == null || url == undefined) {
console.log("CHILD_CHAIN_BLOCKSCOUT_API_URL not set, skip contract verification...");
return;
}
Expand All @@ -204,8 +204,9 @@ export async function verifyChildContract(contract: string, contractAddr: string

export async function verifyRootContract(contract: string, contractAddr: string) {
let key = process.env["ROOT_CHAIN_ETHERSCAN_API_KEY"];
if (key == null) {
if (key == null || key == undefined) {
console.log("ROOT_CHAIN_ETHERSCAN_API_KEY not set, skip contract verification...");
return;
}
let chainID = requireEnv("ROOT_CHAIN_ID");
let cmd = `ETHER_SCAN_API_KEY=${key} forge verify-contract ${contractAddr} ${contract} --chain-id ${chainID}`;
Expand Down

0 comments on commit 3ea5908

Please sign in to comment.