Skip to content

Commit

Permalink
feat: update rpc and deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Jul 23, 2024
1 parent 3ea009c commit d0e90b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ runs = 10000

[rpc_endpoints]
sepolia = "https://ethereum-sepolia.publicnode.com"
mainnet = "https://ethereum-rpc.publicnode.com"

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
15 changes: 10 additions & 5 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,34 @@ import {console} from "forge-std/console.sol";
contract DeployScript is Script {
function run() external {
vm.startBroadcast();

address upgrader = vm.envAddress("UPGRADER");
IAvailBridge bridge = IAvailBridge(vm.envAddress("BRIDGE"));
address avail = vm.envAddress("AVAIL");
address updater = vm.envAddress("UPDATER");
address governance = vm.envAddress("GOVERNANCE");
address pauser = vm.envAddress("PAUSER");
address avail = vm.envAddress("AVAIL");
bytes32 availDepository = vm.envBytes32("DEPOSITORY");
address swapRouter = vm.envAddress("SWAP_ROUTER");
address depositoryImpl = address(new AvailDepository(IERC20(avail), bridge));
AvailDepository depository =
AvailDepository(address(new TransparentUpgradeableProxy(depositoryImpl, governance, "")));
AvailDepository(address(new TransparentUpgradeableProxy(depositoryImpl, upgrader, "")));
address withdrawalHelperImpl = address(new AvailWithdrawalHelper(IERC20(avail)));
AvailWithdrawalHelper withdrawalHelper =
AvailWithdrawalHelper(address(new TransparentUpgradeableProxy(withdrawalHelperImpl, governance, "")));
AvailWithdrawalHelper(address(new TransparentUpgradeableProxy(withdrawalHelperImpl, upgrader, "")));
address stAVAILimpl = address(new StakedAvail(IERC20(avail)));
StakedAvail stAVAIL = StakedAvail(address(new TransparentUpgradeableProxy(stAVAILimpl, governance, "")));
StakedAvail stAVAIL = StakedAvail(address(new TransparentUpgradeableProxy(stAVAILimpl, upgrader, "")));
depository.initialize(governance, pauser, updater, availDepository);
withdrawalHelper.initialize(governance, pauser, stAVAIL, 1 ether);
stAVAIL.initialize(governance, pauser, updater, address(depository), withdrawalHelper);
address deqRouterImpl = address(new DeqRouter(IERC20(avail)));
DeqRouter deqRouter = DeqRouter(address(new TransparentUpgradeableProxy(deqRouterImpl, upgrader, "")));
deqRouter.initialize(governance, pauser, swapRouter, StakedAvail(stAVAIL));
vm.stopBroadcast();
console.log(" ############################################################ ");
console.log("Deployed AvailDepository at:", address(depository));
console.log("Deployed AvailWithdrawalHelper at:", address(withdrawalHelper));
console.log("Deployed StakedAvail at:", address(stAVAIL));
console.log("Deployed DeqRouter at:", address(deqRouter));
console.log(" ############################################################ ");
}
}

0 comments on commit d0e90b3

Please sign in to comment.