diff --git a/src/script/DeployFraxtalLZCurveComposer.s.sol b/src/script/1DeployFraxtal.s.sol similarity index 52% rename from src/script/DeployFraxtalLZCurveComposer.s.sol rename to src/script/1DeployFraxtal.s.sol index a67ee18..a563257 100644 --- a/src/script/DeployFraxtalLZCurveComposer.s.sol +++ b/src/script/1DeployFraxtal.s.sol @@ -4,14 +4,24 @@ pragma solidity ^0.8.19; import { BaseScript } from "frax-std/BaseScript.sol"; import { console } from "frax-std/FraxTest.sol"; import { FraxtalLZCurveComposer } from "../contracts/composers/FraxtalLZCurveComposer.sol"; +import { FraxtalLZCurveAMO } from "../contracts/amos/FraxtalLZCurveAMO.sol"; import { FraxProxy } from "../contracts/FraxProxy.sol"; // Run this with source .env && forge script --broadcast --rpc-url $MAINNET_URL DeployFraxtalLZCurveComposer.s.sol contract DeployFraxtalLZCurveComposer is BaseScript { address endpoint = 0x1a44076050125825900e736c501f859c50fE728c; // fraxtal endpoint v2 + address multisig = address(0); // TODO function run() public broadcaster { + + // deploy FraxtalLzCurveComposer address implementation = address(new FraxtalLZCurveComposer()); - new FraxProxy(implementation, msg.sender, abi.encodeCall(FraxtalLZCurveComposer.initialize, (endpoint))); + FraxProxy proxy = new FraxProxy(implementation, multisig, abi.encodeCall(FraxtalLZCurveComposer.initialize, (endpoint))); + console.log("FraxtalLZCurveComposer @ ", address(proxy)); + + // deploy FraxtalLZCurveAmo + implementation = address(new FraxtalLZCurveAMO()); + proxy = new FraxProxy(implementation, multisig, abi.encodeCall(FraxtalLZCurveAMO.initialize, (deployer))); + console.log("FraxtalLZCurveAMO @ ", address(proxy)); } } diff --git a/src/script/2DeployEthereum.s.sol b/src/script/2DeployEthereum.s.sol new file mode 100644 index 0000000..de4282f --- /dev/null +++ b/src/script/2DeployEthereum.s.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: ISC +pragma solidity ^0.8.19; + +import { BaseScript } from "frax-std/BaseScript.sol"; +import { console } from "frax-std/FraxTest.sol"; +import { EthereumNativeBridgeComposer } from "../contracts/composers/EthereumNativeBridgeComposer.sol"; +import { EthereumLZSenderAMO } from "../contracts/amos/EthereumLZSenderAMO.sol"; +import { FraxProxy } from "../contracts/FraxProxy.sol"; + +// Run this with source .env && forge script --broadcast --rpc-url $MAINNET_URL DeployFraxtalL.s.sol +contract DeployFraxtalL is BaseScript { + + address multisig = address(0); // TODO + + address endpoint = 0x1a44076050125825900e736c501f859c50fE728c; + address l1Bridge = 0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2; + address fraxtalLzCurveAmo = address(0); // TODO + + address fraxOft = 0x909DBdE1eBE906Af95660033e478D59EFe831fED; + address sFraxOft = 0xe4796cCB6bB5DE2290C417Ac337F2b66CA2E770E; + address sFrxEthOft = 0x1f55a02A049033E3419a8E2975cF3F572F4e6E9A; + address fxsOft = 0x23432452B720C80553458496D4D9d7C5003280d0; + address fpiOft = 0x6Eca253b102D41B6B69AC815B9CC6bD47eF1979d; + + function run() public broadcaster { + + // deploy EthereumNativeBridgeComposer + address implementation = address(new EthereumNativeBridgeComposer()); + FraxProxy proxy = new FraxProxy(implementation, multisig, abi.encodeCall(EthereumNativeBridgeComposer.initialize, (endpoint, l1Bridge, fraxtalLzCurveAmo))); + console.log("EthereumNativeBridgeComposer @ ", address(proxy)); + + // Deploy EthereumLZSenderAMO + implementation = address(new EthereumLZSenderAMO()); + proxy = new FraxProxy(implementation, multisig, abi.encodeCall(EthereumLZSenderAMO.initialize, (fraxtalLzCurveAmo, fraxOft, sFraxOft, sFrxEthOft, fxsOft, fpiOft))); + console.log("EthereumLZSenderAMO @ ", address(proxy)); + } +} diff --git a/src/script/3SetupFraxtal.s.sol b/src/script/3SetupFraxtal.s.sol new file mode 100644 index 0000000..3cdf691 --- /dev/null +++ b/src/script/3SetupFraxtal.s.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: ISC +pragma solidity ^0.8.19; + +import { BaseScript } from "frax-std/BaseScript.sol"; +import { console } from "frax-std/FraxTest.sol"; +import { FraxtalLZCurveAMO } from "../contracts/amos/FraxtalLZCurveAMO.sol"; +import { FraxProxy } from "../contracts/FraxProxy.sol"; + +// Run this with source .env && forge script --broadcast --rpc-url $MAINNET_URL DeployFraxtalL.s.sol +contract SetupFraxtal is BaseScript { + + FraxtalLZCurveAMO fraxtalLzCurveAmo = FraxtalLZCurveAMO(address(0)); // TODO + address ethereumComposer = address(0); // TODO + address ethereumLzSenderAmo = address(0); // TODO + address multisig = address(0); // TODO + + bytes32 DEFAULT_ADMIN_ROLE = 0x00; + + function run() public broadcaster { + fraxtalLzCurveAmo.setStorage({ + _ethereumComposer: ethereumComposer, + _ethereumLzSenderAmo: ethereumLzSenderAmo + }); + fraxtalLzCurveAmo.grantRole(DEFAULT_ADMIN_ROLE, multisig); + fraxtalLzCurveAmo.renounceRole(DEFAULT_ADMIN_ROLE, deployer); + } +}