Skip to content

Commit

Permalink
updated bash script to deploy and verify
Browse files Browse the repository at this point in the history
  • Loading branch information
dan13ram committed Sep 15, 2024
1 parent 7a28a2d commit 71e1fd0
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 172 deletions.
53 changes: 0 additions & 53 deletions broadcast/DeployMultiChainDeployer.s.sol/2522/9352fad2-latest.json

This file was deleted.

30 changes: 0 additions & 30 deletions broadcast/DeployMultiChainDeployer.s.sol/2522/run-1726382993.json

This file was deleted.

23 changes: 0 additions & 23 deletions deployments/ynETH-1.json

This file was deleted.

23 changes: 0 additions & 23 deletions deployments/ynETH-17000(original).json

This file was deleted.

14 changes: 0 additions & 14 deletions deployments/ynETH-17000.json

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
"repository": "https://github.com/yieldnest/yieldnest-cross-chain",
"scripts": {
"build": "forge build",
"clean": "forge clean",
"compile": "forge compile",
"format": "forge fmt --root .",
"lint": "solhint \"src/**/*.sol\" && solhint \"test/**/*.sol\" && solhint \"script/**/*.sol\"",
"prepare": "husky",
"test": "forge test -vvv",
"script-manager": "./script/scriptManager.sh"
"script-manager": "./script/scriptManager.sh",
"test": "forge test -vvv"
}
}
}
3 changes: 3 additions & 0 deletions script/BaseData.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ contract BaseData is Script {
});

function setUp() public virtual {
// NOTE: All the LZ Addresses and EIDs are picked up from their docs
// at https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts

// mainnets
__addresses[true] = Addresses({
OFT_DELEGATE: 0xfcad670592a3b24869C0b51a6c6FDED4F95D6975, // yn security council
Expand Down
11 changes: 5 additions & 6 deletions script/DeployL1OFTAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,19 @@ contract DeployL1OFTAdapter is BaseScript {

if (l1OFTAdapter.owner() == CURRENT_SIGNER) {
console.log("Setting peers");
for (uint256 i = 0; i < deployment.chains.length; i++) {
if (deployment.chains[i].chainId == block.chainid) {
continue;
}
uint32 eid = deployment.chains[i].lzEID;
for (uint256 i = 0; i < baseInput.l2ChainIds.length; i++) {
uint256 chainId = baseInput.l2ChainIds[i];
uint32 eid = getEID(chainId);
address adapter = predictions.l2OftAdapter;
bytes32 adapterBytes32 = addressToBytes32(adapter);
if (l1OFTAdapter.peers(eid) == adapterBytes32) {
console.log("Adapter already set for chain %d", deployment.chains[i].chainId);
console.log("Adapter already set for chain %d", chainId);
continue;
}

vm.broadcast();
l1OFTAdapter.setPeer(eid, adapterBytes32);
console.log("Set Peer %s for eid %d", adapter, eid);
}

vm.broadcast();
Expand Down
Loading

0 comments on commit 71e1fd0

Please sign in to comment.