Skip to content

Commit

Permalink
refresh flatten file
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Oct 17, 2023
1 parent 847c4bb commit cf3c083
Show file tree
Hide file tree
Showing 45 changed files with 1,268 additions and 59,167 deletions.
44 changes: 44 additions & 0 deletions helix-contract/deploy/deploy_ln_create2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const ethUtil = require('ethereumjs-util');
const abi = require('ethereumjs-abi');
const secp256k1 = require('secp256k1');

var Create2 = require("./create2.js");

const privateKey = process.env.PRIKEY

function wallet(url) {
const provider = new ethers.providers.JsonRpcProvider(url);
const wallet = new ethers.Wallet(privateKey, provider);
return wallet;
}

async function deployCreate2Deployer(networkUrl, version) {
const salt = ethers.utils.hexZeroPad(ethers.utils.hexlify(ethers.utils.toUtf8Bytes(version)), 32);
const create2Contract = await ethers.getContractFactory("Create2Deployer", wallet);
const bytecode = Create2.getDeployedBytecode(create2Contract, [], []);
const w = wallet(networkUrl);
const unsignedTransaction = {
from: w.address,
to: "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7",
data: `${salt}${bytecode.slice(2)}`
};
const tx = await w.sendTransaction(unsignedTransaction);
console.log(`deploy create2 tx: ${tx.hash}, salt: ${salt}`);
return;
}

// 2. deploy mapping token factory
async function main() {
//await deployCreate2Deployer('https://rpc.ankr.com/eth_goerli', 'v1.0.0');
//await deployCreate2Deployer('https://goerli-rollup.arbitrum.io/rpc', 'v1.0.0');
await deployCreate2Deployer('https://rpc.testnet.mantle.xyz', 'v1.0.0');
await deployCreate2Deployer('https://rpc.goerli.linea.build', 'v1.0.0');
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

4 changes: 2 additions & 2 deletions helix-contract/deploy/deploy_ln_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ async function main() {
const networks = [goerliNetwork, mantleNetwork, arbitrumNetwork, lineaNetwork];
for (const network of networks) {
const w = wallet(network.url);
//const logicAddress = await deployLnDefaultBridge(w, network.deployer, "ln-default-logic-v1.1.0");
const logicAddress = await deployLnOppositeBridge(w, network.deployer, "ln-opposite-logic-v1.1.0");
//const logicAddress = await deployLnDefaultBridge(w, network.deployer, "ln-default-logic-v1.0.0");
const logicAddress = await deployLnOppositeBridge(w, network.deployer, "ln-opposite-logic-v1.0.0");
console.log("finish to deploy logic contract, network is: ", network.url);
}
return;
Expand Down
2 changes: 2 additions & 0 deletions helix-contract/deploy/flatten-ln.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ yarn flat contracts/ln/LnDefaultBridge.sol --output $path/LnDefaultBridge.sol
yarn flat contracts/ln/LnOppositeBridge.sol --output $path/LnOppositeBridge.sol
yarn flat contracts/ln/messager/Eth2LineaSendService.sol --output $path/Eth2LineaSendService.sol
yarn flat contracts/ln/messager/Eth2LineaReceiveService.sol --output $path/Eth2LineaReceiveService.sol
yarn flat contracts/ln/messager/Eth2ArbSendService.sol --output $path/Eth2ArbSendService.sol
yarn flat contracts/ln/messager/Eth2ArbReceiveService.sol --output $path/Eth2ArbReceiveService.sol
yarn flat contracts/ln/messager/LayerZeroMessager.sol --output $path/LayerZeroMessager.sol
yarn flat contracts/ln/messager/debugMessager.sol --output $path/debugMessager.sol
yarn flat contracts/ln/test/TestToken.sol --output $path/TestToken.sol
Loading

0 comments on commit cf3c083

Please sign in to comment.