Skip to content

Commit

Permalink
chore: goerli to sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
kupermind committed Feb 27, 2024
1 parent 8bdc020 commit cab06d9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celoAlfajores","gasPriceInGwei":"10","networkURL":"https://alfajores-forno.celo-testnet.org","L1WormholeRelayerAddress":"0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a","timelockAddress":"0xE5Da5F4d8644A271226161a859c1177C5214c54e","L2WormholeRelayerAddress":"0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84","wormholeMessengerAddress":"0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celoAlfajores","gasPriceInGwei":"10","networkURL":"https://alfajores-forno.celo-testnet.org","L1WormholeRelayerAddress":"0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470","timelockAddress":"0x14CF2e543AB75B321bcf84C3AcC88d570Ccf9106","L2WormholeRelayerAddress":"0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84","wormholeMessengerAddress":"0x9dEc6B62c197268242A768dc3b153AE7a2701396"}
2 changes: 1 addition & 1 deletion scripts/deployment/bridges/celo/globals_celo_mainnet.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celo","gasPriceInGwei":"2","networkURL":"https://forno.celo.org","L1WormholeRelayerAddress":"","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","wormholeMessengerAddress":""}
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celo","gasPriceInGwei":"2","networkURL":"https://forno.celo.org","L1WormholeRelayerAddress":"0x27428DD2d3DD32A4D7f7C497eAaa23130d894911","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","wormholeMessengerAddress":""}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function main() {
let parsedData = JSON.parse(dataFromJSON);
const useLedger = parsedData.useLedger;
const derivationPath = parsedData.derivationPath;
const providerName = "goerli";
const providerName = "sepolia";
const gasPriceInGwei = parsedData.gasPriceInGwei;

Check warning on line 14 in scripts/deployment/bridges/celo/test/deploy_00_mock_timelock.js

View workflow job for this annotation

GitHub Actions / build

'gasPriceInGwei' is assigned a value but never used
let EOA;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function main() {
console.log("EOA is:", deployer);

// Transaction signing and execution
console.log("2. EOA to deploy child mock ERC20 contract and change its owner to the FxGovernorTunnel");
console.log("2. EOA to deploy child mock ERC20 contract and change its owner to the WormholeMessenger");
const ChildMockERC20 = await ethers.getContractFactory("ChildMockERC20");
console.log("You are signing the following transaction: ChildMockERC20.connect(EOA).deploy()");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/bridges/celo/test/globals.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celoAlfajores","gasPriceInGwei":"10","networkURL":"https://alfajores-forno.celo-testnet.org","L1WormholeRelayerAddress":"0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a","timelockAddress":"0xE5Da5F4d8644A271226161a859c1177C5214c54e","L2WormholeRelayerAddress":"0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84","wormholeMessengerAddress":"0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee","childMockERC20Address":"0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"celoAlfajores","gasPriceInGwei":"10","networkURL":"https://alfajores-forno.celo-testnet.org","L1WormholeRelayerAddress":"0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470","timelockAddress":"0x14CF2e543AB75B321bcf84C3AcC88d570Ccf9106","L2WormholeRelayerAddress":"0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84","wormholeMessengerAddress":"0x9dEc6B62c197268242A768dc3b153AE7a2701396","childMockERC20Address":"0xB575dd20281c63288428DD58e5f579CC7d6aae4d"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const { ethers } = require("ethers");
const sendFundsFromL1 = false;

async function main() {
const ALCHEMY_API_KEY_GOERLI = process.env.ALCHEMY_API_KEY_GOERLI;
const goerliURL = "https://eth-goerli.g.alchemy.com/v2/" + ALCHEMY_API_KEY_GOERLI;
const goerliProvider = new ethers.providers.JsonRpcProvider(goerliURL);
await goerliProvider.getBlockNumber().then((result) => {
console.log("Current block number goerli: " + result);
const ALCHEMY_API_KEY_SEPOLIA = process.env.ALCHEMY_API_KEY_SEPOLIA;
const sepoliaURL = "https://eth-sepolia.g.alchemy.com/v2/" + ALCHEMY_API_KEY_SEPOLIA;
const sepoliaProvider = new ethers.providers.JsonRpcProvider(sepoliaURL);
await sepoliaProvider.getBlockNumber().then((result) => {
console.log("Current block number sepolia: " + result);
});

const celoAlfajoresURL = "https://alfajores-forno.celo-testnet.org";
Expand All @@ -19,31 +19,31 @@ async function main() {
});

const fs = require("fs");
// WormholeRelayer address on goerli
const wormholeRelayerAddress = "0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a";
// WormholeRelayer address on sepolia
const wormholeRelayerAddress = "0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470";
const wormholeRelayerJSON = "abis/test/WormholeRelayer.json";
let contractFromJSON = fs.readFileSync(wormholeRelayerJSON, "utf8");
const wormholeRelayerABI = JSON.parse(contractFromJSON);
const wormholeRelayer = new ethers.Contract(wormholeRelayerAddress, wormholeRelayerABI, goerliProvider);
const wormholeRelayer = new ethers.Contract(wormholeRelayerAddress, wormholeRelayerABI, sepoliaProvider);

// Test deployed WormholeMessenger address on celoAlfajores
const wormholeMessengerAddress = "0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"; // payable process on L2
const wormholeMessengerAddress = "0x9dEc6B62c197268242A768dc3b153AE7a2701396"; // payable process on L2
const wormholeMessengerJSON = "artifacts/contracts/bridges/WormholeMessenger.sol/WormholeMessenger.json";
contractFromJSON = fs.readFileSync(wormholeMessengerJSON, "utf8");
let parsedFile = JSON.parse(contractFromJSON);
const wormholeMessengerABI = parsedFile["abi"];
const wormholeMessenger = new ethers.Contract(wormholeMessengerAddress, wormholeMessengerABI, celoAlfajoresProvider);

// Mock Timelock contract address on goerli (has WormholeRelayer address in it already)
const mockTimelockAddress = "0xE5Da5F4d8644A271226161a859c1177C5214c54e"; // payable
// Mock Timelock contract address on sepolia (has WormholeRelayer address in it already)
const mockTimelockAddress = "0x14CF2e543AB75B321bcf84C3AcC88d570Ccf9106"; // payable
const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json";
contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8");
parsedFile = JSON.parse(contractFromJSON);
const mockTimelockABI = parsedFile["abi"];
const mockTimelock = new ethers.Contract(mockTimelockAddress, mockTimelockABI, goerliProvider);
const mockTimelock = new ethers.Contract(mockTimelockAddress, mockTimelockABI, sepoliaProvider);

// ChildMockERC20 address on celoAlfajores
const mockChildERC20Address = "0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77";
const mockChildERC20Address = "0xB575dd20281c63288428DD58e5f579CC7d6aae4d";
const mockChildERC20JSON = "artifacts/contracts/bridges/test/ChildMockERC20.sol/ChildMockERC20.json";
contractFromJSON = fs.readFileSync(mockChildERC20JSON, "utf8");
parsedFile = JSON.parse(contractFromJSON);
Expand All @@ -52,10 +52,10 @@ async function main() {

// Get the EOA
const account = ethers.utils.HDNode.fromMnemonic(process.env.TESTNET_MNEMONIC).derivePath("m/44'/60'/0'/0/0");
const EOAgoerli = new ethers.Wallet(account, goerliProvider);
const EOAsepolia = new ethers.Wallet(account, sepoliaProvider);
const EOAceloAlfajores = new ethers.Wallet(account, celoAlfajoresProvider);
console.log("EOA address",EOAgoerli.address);
if (EOAceloAlfajores.address == EOAgoerli.address) {
console.log("EOA address",EOAsepolia.address);
if (EOAceloAlfajores.address == EOAsepolia.address) {
console.log("Correct wallet setup");
}

Expand Down Expand Up @@ -108,7 +108,7 @@ async function main() {
wormholeMessengerAddress, data, 0, minGasLimit]);

// Send the message to celoAlfajores receiver
tx = await mockTimelock.connect(EOAgoerli).execute(timelockPayload, { value: transferCost.nativePriceQuote });
tx = await mockTimelock.connect(EOAsepolia).execute(timelockPayload, { value: transferCost.nativePriceQuote });
console.log("Timelock data execution hash", tx.hash);
await tx.wait();

Expand Down

0 comments on commit cab06d9

Please sign in to comment.