diff --git a/scripts/deployment/bridges/near/sepolia/globals.json b/scripts/deployment/bridges/near/sepolia/globals.json new file mode 100644 index 00000000..0095eeec --- /dev/null +++ b/scripts/deployment/bridges/near/sepolia/globals.json @@ -0,0 +1 @@ +{"contractVerification":true,"providerName":"sepolia","gasPriceInGwei":"30","wormholeAddress":"0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78","timelockAddress":"0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"} \ No newline at end of file diff --git a/scripts/deployment/bridges/near/sepolia/timelock_send_view_functions.js b/scripts/deployment/bridges/near/sepolia/timelock_send_view_functions.js new file mode 100644 index 00000000..0cc92c9a --- /dev/null +++ b/scripts/deployment/bridges/near/sepolia/timelock_send_view_functions.js @@ -0,0 +1,55 @@ +/*global process*/ + +const { ethers } = require("ethers"); + +async function main() { + 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 fs = require("fs"); + // Wormhole Core address on sepolia + const wormholeAddress = "0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"; + const wormholeJSON = "abis/test/WormholeCore.json"; + let contractFromJSON = fs.readFileSync(wormholeJSON, "utf8"); + const wormholeABI = JSON.parse(contractFromJSON); + const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); + + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) + const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; + const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; + contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); + const parsedFile = JSON.parse(contractFromJSON); + const mockTimelockABI = parsedFile["abi"]; + const mockTimelock = new ethers.Contract(mockTimelockAddress, mockTimelockABI, sepoliaProvider); + + // Get the EOA + const account = ethers.utils.HDNode.fromMnemonic(process.env.TESTNET_MNEMONIC).derivePath("m/44'/60'/0'/0/0"); + const EOAsepolia = new ethers.Wallet(account, sepoliaProvider); + console.log(EOAsepolia.address); + + // Wrap the data to send over the bridge + // Data: registries contract functions: paused(), version() + const data = "0x5b7b22636f6e74726163745f6964223a22636f6e74726163745f3030302e7375625f6f6c61732e6f6c61735f3030302e746573746e6574222c226465706f736974223a2230222c22676173223a352c226d6574686f645f6e616d65223a2269735f706175736564222c2261726773223a5b5d7d2c7b22636f6e74726163745f6964223a22636f6e74726163745f3030302e7375625f6f6c61732e6f6c61735f3030302e746573746e6574222c226465706f736974223a2230222c22676173223a352c226d6574686f645f6e616d65223a2276657273696f6e222c2261726773223a5b5d7d5d"; + + const wormholeFinality = 0; // 0 = confirmed, 1 = finalized + const payload = wormhole.interface.encodeFunctionData("publishMessage", [0, data, wormholeFinality]); + console.log(payload); + const tx = await mockTimelock.connect(EOAsepolia).execute(payload); + console.log("Timelock data execution hash", tx.hash); + await tx.wait(); + + // 2 view functions: https://wormholescan.io/#/tx/0xfa83667d2226033cfe562ac216875de625fe55b2744fd801a63a8b52645edc64?network=Testnet&view=overview + // 2 view functions and 1 payable: https://wormholescan.io/#/tx/0xebc96800331e6c6b309c8612dbddb14bbf078eb3fa80afdfeaf66ad43969399f?network=Testnet&view=overview + // 2 view functions and 1 payable with gas: https://wormholescan.io/#/tx/0x45c4585ba16c3c4e147e9bbc690954d7455dc6939b220ac0ea5e9a241facbd28?network=Testnet&view=overview +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/deployment/bridges/solana/test/polygon/timelock_send_message.js b/scripts/deployment/bridges/solana/test/polygon/timelock_send_message.js index 3aca88c1..86f7f9fb 100644 --- a/scripts/deployment/bridges/solana/test/polygon/timelock_send_message.js +++ b/scripts/deployment/bridges/solana/test/polygon/timelock_send_message.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, polygonProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x4cEB52802ef86edF8796632546d89e55c87a0901"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); diff --git a/scripts/deployment/bridges/solana/test/sepolia/timelock_set_upgrade_authority.js b/scripts/deployment/bridges/solana/test/sepolia/timelock_set_upgrade_authority.js index e7dbd684..3377a595 100644 --- a/scripts/deployment/bridges/solana/test/sepolia/timelock_set_upgrade_authority.js +++ b/scripts/deployment/bridges/solana/test/sepolia/timelock_set_upgrade_authority.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); diff --git a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_all.js b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_all.js index 2df0add1..359cc461 100644 --- a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_all.js +++ b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_all.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); diff --git a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_sol.js b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_sol.js index eb32ee97..dce57042 100644 --- a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_sol.js +++ b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_sol.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); diff --git a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_token_accounts.js b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_token_accounts.js index abe04d64..b202cd95 100644 --- a/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_token_accounts.js +++ b/scripts/deployment/bridges/solana/test/sepolia/timelock_transfer_token_accounts.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8"); diff --git a/scripts/deployment/bridges/solana/test/sepolia/timelock_upgrade_program.js b/scripts/deployment/bridges/solana/test/sepolia/timelock_upgrade_program.js index 4838a381..4fe705d7 100644 --- a/scripts/deployment/bridges/solana/test/sepolia/timelock_upgrade_program.js +++ b/scripts/deployment/bridges/solana/test/sepolia/timelock_upgrade_program.js @@ -18,7 +18,7 @@ async function main() { const wormholeABI = JSON.parse(contractFromJSON); const wormhole = new ethers.Contract(wormholeAddress, wormholeABI, sepoliaProvider); - // Mock Timelock contract address on goerli (has Wormhole Core address in it already) + // Mock Timelock contract address on sepolia (has Wormhole Core address in it already) const mockTimelockAddress = "0x471B3f60f08C50dd0eCba1bCd113B66FCC02b63d"; const mockTimelockJSON = "artifacts/contracts/bridges/test/MockTimelock.sol/MockTimelock.json"; contractFromJSON = fs.readFileSync(mockTimelockJSON, "utf8");