From 8036ebecb3164c8e3e6e84c35ecf1a2a5b9b3bca Mon Sep 17 00:00:00 2001 From: xavikh Date: Thu, 21 Mar 2024 13:02:13 +0100 Subject: [PATCH 1/5] Deploy script --- script/DAO.s.sol | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 script/DAO.s.sol diff --git a/script/DAO.s.sol b/script/DAO.s.sol new file mode 100644 index 0000000..65f766c --- /dev/null +++ b/script/DAO.s.sol @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import {Script, console2} from "forge-std/Script.sol"; +import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; +import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; +import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; +import {GovernanceWrappedERC20} from "@aragon/osx/token/ERC20/governance/GovernanceWrappedERC20.sol"; +import {PluginRepoFactory} from "@aragon/osx/framework/plugin/repo/PluginRepoFactory.sol"; +import {hashHelpers, PluginSetupRef} from "@aragon/osx/framework/plugin/setup/PluginSetupProcessorHelpers.sol"; +import {PluginRepo} from "@aragon/osx/framework/plugin/repo/PluginRepo.sol"; +import {DAOFactory} from "@aragon/osx/framework/dao/DAOFactory.sol"; + +contract Deploy is Script { + function run() public { + address governanceERC20Base = vm.envAddress("GOVERNANCE_ERC20_BASE"); + address governanceWrappedERC20Base = vm.envAddress( + "GOVERNANCE_WRAPPED_ERC20_BASE" + ); + address pluginRepoFactory = vm.envAddress("PLUGIN_REPO_FACTORY"); + DAOFactory daoFactory = DAOFactory(vm.envAddress("DAO_FACTORY")); + address tokenAddress = vm.envAddress("TOKEN_ADDRESS"); + + // 0. Setting up foundry + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // 1. Deploying the Plugin Setup + OptimisticTokenVotingPluginSetup pluginSetup = new OptimisticTokenVotingPluginSetup( + GovernanceERC20(governanceERC20Base), + GovernanceWrappedERC20(governanceWrappedERC20Base) + ); + + // 2. Publishing it in the Aragon OSx Protocol + PluginRepo pluginRepo = PluginRepoFactory(pluginRepoFactory) + .createPluginRepoWithFirstVersion( + "tempan-plugin-v1", + address(pluginSetup), + msg.sender, + "0x00", // TODO: Give these actual values on prod + "0x00" + ); + + // 3. Defining the DAO Settings + DAOFactory.DAOSettings memory daoSettings = DAOFactory.DAOSettings( + address(0), + "", + "tempan-dao-v1", // This should be changed on each deployment + "" + ); + + // 4. Defining the plugin settings + OptimisticTokenVotingPlugin.OptimisticGovernanceSettings + memory votingSettings = OptimisticTokenVotingPlugin + .OptimisticGovernanceSettings(200000, 60 * 60 * 24 * 4, 0); + OptimisticTokenVotingPluginSetup.TokenSettings + memory tokenSettings = OptimisticTokenVotingPluginSetup.TokenSettings( + tokenAddress, + "Tempan DAO Token", + "TPT" + ); + + address[] memory holders = new address[](1); + holders[0] = msg.sender; + + uint256[] memory amounts = new uint256[](0); + GovernanceERC20.MintSettings memory mintSettings = GovernanceERC20 + .MintSettings(holders, amounts); + + address _lzAppEndpoint = address(pluginSetup); + + bytes memory pluginSettingsData = abi.encode( + votingSettings, + tokenSettings, + mintSettings, + holders, // TODO: Is this correct? + _lzAppEndpoint + ); + + PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1); + DAOFactory.PluginSettings[] + memory pluginSettings = new DAOFactory.PluginSettings[](1); + pluginSettings[0] = DAOFactory.PluginSettings( + PluginSetupRef(tag, PluginRepo(pluginRepo)), + pluginSettingsData + ); + + // 5. Deploying the DAO + daoFactory.createDao(daoSettings, pluginSettings); + + vm.stopBroadcast(); + } +} \ No newline at end of file From e1de1182320fe3193aac7e44d073137e1378e2a8 Mon Sep 17 00:00:00 2001 From: xavikh Date: Thu, 21 Mar 2024 13:30:10 +0100 Subject: [PATCH 2/5] Add L2-ERC20 --- foundry.toml | 5 +- script/DAO.s.sol | 93 ------------------------ script/L2-ERC20.sol | 21 ++++++ script/OptimisticTokenVotingPlugin.s.sol | 93 ++++++++++++++++++++++-- src/OptimisticTokenVotingPlugin.sol | 1 + 5 files changed, 113 insertions(+), 100 deletions(-) delete mode 100644 script/DAO.s.sol create mode 100644 script/L2-ERC20.sol diff --git a/foundry.toml b/foundry.toml index d5910c7..43f57e2 100644 --- a/foundry.toml +++ b/foundry.toml @@ -8,6 +8,7 @@ evm_version = "shanghai" [rpc_endpoints] sepolia = "${SEPOLIA_RPC_URL}" +taiko= "${TAIKO_RPC_URL}" + + -[etherscan] -sepolia = { key = "${ETHERSCAN_API_KEY}" } diff --git a/script/DAO.s.sol b/script/DAO.s.sol deleted file mode 100644 index 65f766c..0000000 --- a/script/DAO.s.sol +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Script, console2} from "forge-std/Script.sol"; -import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; -import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; -import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; -import {GovernanceWrappedERC20} from "@aragon/osx/token/ERC20/governance/GovernanceWrappedERC20.sol"; -import {PluginRepoFactory} from "@aragon/osx/framework/plugin/repo/PluginRepoFactory.sol"; -import {hashHelpers, PluginSetupRef} from "@aragon/osx/framework/plugin/setup/PluginSetupProcessorHelpers.sol"; -import {PluginRepo} from "@aragon/osx/framework/plugin/repo/PluginRepo.sol"; -import {DAOFactory} from "@aragon/osx/framework/dao/DAOFactory.sol"; - -contract Deploy is Script { - function run() public { - address governanceERC20Base = vm.envAddress("GOVERNANCE_ERC20_BASE"); - address governanceWrappedERC20Base = vm.envAddress( - "GOVERNANCE_WRAPPED_ERC20_BASE" - ); - address pluginRepoFactory = vm.envAddress("PLUGIN_REPO_FACTORY"); - DAOFactory daoFactory = DAOFactory(vm.envAddress("DAO_FACTORY")); - address tokenAddress = vm.envAddress("TOKEN_ADDRESS"); - - // 0. Setting up foundry - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(deployerPrivateKey); - - // 1. Deploying the Plugin Setup - OptimisticTokenVotingPluginSetup pluginSetup = new OptimisticTokenVotingPluginSetup( - GovernanceERC20(governanceERC20Base), - GovernanceWrappedERC20(governanceWrappedERC20Base) - ); - - // 2. Publishing it in the Aragon OSx Protocol - PluginRepo pluginRepo = PluginRepoFactory(pluginRepoFactory) - .createPluginRepoWithFirstVersion( - "tempan-plugin-v1", - address(pluginSetup), - msg.sender, - "0x00", // TODO: Give these actual values on prod - "0x00" - ); - - // 3. Defining the DAO Settings - DAOFactory.DAOSettings memory daoSettings = DAOFactory.DAOSettings( - address(0), - "", - "tempan-dao-v1", // This should be changed on each deployment - "" - ); - - // 4. Defining the plugin settings - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings - memory votingSettings = OptimisticTokenVotingPlugin - .OptimisticGovernanceSettings(200000, 60 * 60 * 24 * 4, 0); - OptimisticTokenVotingPluginSetup.TokenSettings - memory tokenSettings = OptimisticTokenVotingPluginSetup.TokenSettings( - tokenAddress, - "Tempan DAO Token", - "TPT" - ); - - address[] memory holders = new address[](1); - holders[0] = msg.sender; - - uint256[] memory amounts = new uint256[](0); - GovernanceERC20.MintSettings memory mintSettings = GovernanceERC20 - .MintSettings(holders, amounts); - - address _lzAppEndpoint = address(pluginSetup); - - bytes memory pluginSettingsData = abi.encode( - votingSettings, - tokenSettings, - mintSettings, - holders, // TODO: Is this correct? - _lzAppEndpoint - ); - - PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1); - DAOFactory.PluginSettings[] - memory pluginSettings = new DAOFactory.PluginSettings[](1); - pluginSettings[0] = DAOFactory.PluginSettings( - PluginSetupRef(tag, PluginRepo(pluginRepo)), - pluginSettingsData - ); - - // 5. Deploying the DAO - daoFactory.createDao(daoSettings, pluginSettings); - - vm.stopBroadcast(); - } -} \ No newline at end of file diff --git a/script/L2-ERC20.sol b/script/L2-ERC20.sol new file mode 100644 index 0000000..ff46aa8 --- /dev/null +++ b/script/L2-ERC20.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import {Script, console2} from "forge-std/Script.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract Deploy is Script { + function run() public { + // 0. Setting up foundry + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // Deploy the ERC-20 token + ERC20 _token = new ERC20( + "Tempan DAO Token", + "TPT" + ); + + vm.stopBroadcast(); + } +} \ No newline at end of file diff --git a/script/OptimisticTokenVotingPlugin.s.sol b/script/OptimisticTokenVotingPlugin.s.sol index b816a3e..48305fd 100644 --- a/script/OptimisticTokenVotingPlugin.s.sol +++ b/script/OptimisticTokenVotingPlugin.s.sol @@ -2,11 +2,94 @@ pragma solidity ^0.8.13; import {Script, console2} from "forge-std/Script.sol"; +import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; +import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; +import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; +import {GovernanceWrappedERC20} from "@aragon/osx/token/ERC20/governance/GovernanceWrappedERC20.sol"; +import {PluginRepoFactory} from "@aragon/osx/framework/plugin/repo/PluginRepoFactory.sol"; +import {hashHelpers, PluginSetupRef} from "@aragon/osx/framework/plugin/setup/PluginSetupProcessorHelpers.sol"; +import {PluginRepo} from "@aragon/osx/framework/plugin/repo/PluginRepo.sol"; +import {DAOFactory} from "@aragon/osx/framework/dao/DAOFactory.sol"; -contract OptimisticTokenVotingPluginScript is Script { - function setUp() public {} - +contract Deploy is Script { function run() public { - vm.broadcast(); + address governanceERC20Base = vm.envAddress("GOVERNANCE_ERC20_BASE"); + address governanceWrappedERC20Base = vm.envAddress( + "GOVERNANCE_WRAPPED_ERC20_BASE" + ); + address pluginRepoFactory = vm.envAddress("PLUGIN_REPO_FACTORY"); + DAOFactory daoFactory = DAOFactory(vm.envAddress("DAO_FACTORY")); + address tokenAddress = vm.envAddress("TOKEN_ADDRESS"); + + // 0. Setting up foundry + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + vm.createSelectFork(vm.rpcUrl("sepholia")); + + // 1. Deploying the Plugin Setup + OptimisticTokenVotingPluginSetup pluginSetup = new OptimisticTokenVotingPluginSetup( + GovernanceERC20(governanceERC20Base), + GovernanceWrappedERC20(governanceWrappedERC20Base) + ); + + // 2. Publishing it in the Aragon OSx Protocol + PluginRepo pluginRepo = PluginRepoFactory(pluginRepoFactory) + .createPluginRepoWithFirstVersion( + "tempan-plugin-v1", + address(pluginSetup), + msg.sender, + "0x00", // TODO: Give these actual values on prod + "0x00" + ); + + // 3. Defining the DAO Settings + DAOFactory.DAOSettings memory daoSettings = DAOFactory.DAOSettings( + address(0), + "", + "tempan-dao-v1", // This should be changed on each deployment + "" + ); + + // 4. Defining the plugin settings + OptimisticTokenVotingPlugin.OptimisticGovernanceSettings + memory votingSettings = OptimisticTokenVotingPlugin + .OptimisticGovernanceSettings(200000, 60 * 60 * 24 * 4, 0); + OptimisticTokenVotingPluginSetup.TokenSettings + memory tokenSettings = OptimisticTokenVotingPluginSetup.TokenSettings( + tokenAddress, + "Tempan DAO Token", + "TPT" + ); + + address[] memory holders = new address[](1); + holders[0] = msg.sender; + + uint256[] memory amounts = new uint256[](0); + GovernanceERC20.MintSettings memory mintSettings = GovernanceERC20 + .MintSettings(holders, amounts); + + address _lzAppEndpoint = address(pluginSetup); + + bytes memory pluginSettingsData = abi.encode( + votingSettings, + tokenSettings, + mintSettings, + holders, // TODO: Is this correct? + _lzAppEndpoint + ); + + PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1); + DAOFactory.PluginSettings[] + memory pluginSettings = new DAOFactory.PluginSettings[](1); + pluginSettings[0] = DAOFactory.PluginSettings( + PluginSetupRef(tag, PluginRepo(pluginRepo)), + pluginSettingsData + ); + + // 5. Deploying the DAO + daoFactory.createDao(daoSettings, pluginSettings); + + vm.stopBroadcast(); } -} +} \ No newline at end of file diff --git a/src/OptimisticTokenVotingPlugin.sol b/src/OptimisticTokenVotingPlugin.sol index 6a0e8f3..12e560f 100644 --- a/src/OptimisticTokenVotingPlugin.sol +++ b/src/OptimisticTokenVotingPlugin.sol @@ -154,6 +154,7 @@ contract OptimisticTokenVotingPlugin is /// @param _dao The IDAO interface of the associated DAO. /// @param _governanceSettings The vetoing settings. /// @param _token The [ERC-20](https://eips.ethereum.org/EIPS/eip-20) token used for voting. + /// @param _lzEndpoint The LayerZero endpoint. function initialize( IDAO _dao, OptimisticGovernanceSettings calldata _governanceSettings, From ae6041e6d27d53a2901becbc150a2eca136caa84 Mon Sep 17 00:00:00 2001 From: xavikh Date: Thu, 21 Mar 2024 15:14:13 +0100 Subject: [PATCH 3/5] Create VotingToken --- script/L2-ERC20.sol | 21 -------------- script/OptimisticTokenVotingPlugin.s.sol | 6 ++++ src/VetoToken.sol | 37 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 21 deletions(-) delete mode 100644 script/L2-ERC20.sol create mode 100644 src/VetoToken.sol diff --git a/script/L2-ERC20.sol b/script/L2-ERC20.sol deleted file mode 100644 index ff46aa8..0000000 --- a/script/L2-ERC20.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Script, console2} from "forge-std/Script.sol"; -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract Deploy is Script { - function run() public { - // 0. Setting up foundry - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(deployerPrivateKey); - - // Deploy the ERC-20 token - ERC20 _token = new ERC20( - "Tempan DAO Token", - "TPT" - ); - - vm.stopBroadcast(); - } -} \ No newline at end of file diff --git a/script/OptimisticTokenVotingPlugin.s.sol b/script/OptimisticTokenVotingPlugin.s.sol index 48305fd..e0a9aec 100644 --- a/script/OptimisticTokenVotingPlugin.s.sol +++ b/script/OptimisticTokenVotingPlugin.s.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.13; import {Script, console2} from "forge-std/Script.sol"; +import {ERC20} from "../src/VetoToken.sol"; import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; @@ -90,6 +91,11 @@ contract Deploy is Script { // 5. Deploying the DAO daoFactory.createDao(daoSettings, pluginSettings); + vm.createSelectFork(vm.rpcUrl("taiko")); + + // Deploy the ERC-20 token + ERC20 _token = new ERC20(); + vm.stopBroadcast(); } } \ No newline at end of file diff --git a/src/VetoToken.sol b/src/VetoToken.sol new file mode 100644 index 0000000..7dffa63 --- /dev/null +++ b/src/VetoToken.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +// Compatible with OpenZeppelin Contracts ^5.0.0 +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; +import {Nonces} from "@openzeppelin/contracts/utils/Nonces.sol"; + +contract VetoToken is ERC20, ERC20Permit, ERC20Votes { + constructor() + ERC20("VetoToken", "VETO") + ERC20Permit("VetoToken") + {} + + function mint(address to, uint256 amount) public { + _mint(to, amount); + } + + // The following functions are overrides required by Solidity. + + function _update(address from, address to, uint256 value) + internal + override(ERC20, ERC20Votes) + { + super._update(from, to, value); + } + + function nonces(address owner) + public + view + override(ERC20Permit, Nonces) + returns (uint256) + { + return super.nonces(owner); + } +} From ce12c9365e8c6f2f2a94f8c1a01a14af5c266c20 Mon Sep 17 00:00:00 2001 From: xavikh Date: Thu, 21 Mar 2024 17:42:20 +0100 Subject: [PATCH 4/5] Fix VetoToken --- script/OptimisticTokenVotingPlugin.s.sol | 8 ++---- src/VetoToken.sol | 36 +++++++++++------------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/script/OptimisticTokenVotingPlugin.s.sol b/script/OptimisticTokenVotingPlugin.s.sol index e0a9aec..085f6f9 100644 --- a/script/OptimisticTokenVotingPlugin.s.sol +++ b/script/OptimisticTokenVotingPlugin.s.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.13; import {Script, console2} from "forge-std/Script.sol"; -import {ERC20} from "../src/VetoToken.sol"; +import {VetoToken} from "../src/VetoToken.sol"; import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; @@ -26,8 +26,6 @@ contract Deploy is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); - vm.createSelectFork(vm.rpcUrl("sepholia")); - // 1. Deploying the Plugin Setup OptimisticTokenVotingPluginSetup pluginSetup = new OptimisticTokenVotingPluginSetup( GovernanceERC20(governanceERC20Base), @@ -91,10 +89,8 @@ contract Deploy is Script { // 5. Deploying the DAO daoFactory.createDao(daoSettings, pluginSettings); - vm.createSelectFork(vm.rpcUrl("taiko")); - // Deploy the ERC-20 token - ERC20 _token = new ERC20(); + VetoToken _token = new VetoToken(); vm.stopBroadcast(); } diff --git a/src/VetoToken.sol b/src/VetoToken.sol index 7dffa63..41e6365 100644 --- a/src/VetoToken.sol +++ b/src/VetoToken.sol @@ -1,37 +1,33 @@ // SPDX-License-Identifier: MIT -// Compatible with OpenZeppelin Contracts ^5.0.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; -import {Nonces} from "@openzeppelin/contracts/utils/Nonces.sol"; contract VetoToken is ERC20, ERC20Permit, ERC20Votes { - constructor() - ERC20("VetoToken", "VETO") - ERC20Permit("VetoToken") - {} - - function mint(address to, uint256 amount) public { - _mint(to, amount); - } + constructor() ERC20("VetoToken", "VETO") ERC20Permit("VetoToken") {} // The following functions are overrides required by Solidity. - function _update(address from, address to, uint256 value) + function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) { - super._update(from, to, value); + super._afterTokenTransfer(from, to, amount); } - function nonces(address owner) - public - view - override(ERC20Permit, Nonces) - returns (uint256) + function _mint(address to, uint256 amount) + internal + override(ERC20, ERC20Votes) + { + super._mint(to, amount); + } + + function _burn(address account, uint256 amount) + internal + override(ERC20, ERC20Votes) { - return super.nonces(owner); + super._burn(account, amount); } } From 83ba91322f0b1fa8807768cd2f3bd384cac1dd12 Mon Sep 17 00:00:00 2001 From: xavikh Date: Thu, 21 Mar 2024 18:16:51 +0100 Subject: [PATCH 5/5] Split contracts deployment --- foundry.toml | 2 +- script/OptimisticTokenVotingPlugin.s.sol | 4 ---- script/VetoToken.s.sol | 18 ++++++++++++++++++ script/deployer.sh | 3 +++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 script/VetoToken.s.sol create mode 100755 script/deployer.sh diff --git a/foundry.toml b/foundry.toml index 43f57e2..336264c 100644 --- a/foundry.toml +++ b/foundry.toml @@ -8,7 +8,7 @@ evm_version = "shanghai" [rpc_endpoints] sepolia = "${SEPOLIA_RPC_URL}" -taiko= "${TAIKO_RPC_URL}" +taiko = "${TAIKO_RPC_URL}" diff --git a/script/OptimisticTokenVotingPlugin.s.sol b/script/OptimisticTokenVotingPlugin.s.sol index 085f6f9..65f766c 100644 --- a/script/OptimisticTokenVotingPlugin.s.sol +++ b/script/OptimisticTokenVotingPlugin.s.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.13; import {Script, console2} from "forge-std/Script.sol"; -import {VetoToken} from "../src/VetoToken.sol"; import {OptimisticTokenVotingPluginSetup} from "../src/OptimisticTokenVotingPluginSetup.sol"; import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol"; import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol"; @@ -89,9 +88,6 @@ contract Deploy is Script { // 5. Deploying the DAO daoFactory.createDao(daoSettings, pluginSettings); - // Deploy the ERC-20 token - VetoToken _token = new VetoToken(); - vm.stopBroadcast(); } } \ No newline at end of file diff --git a/script/VetoToken.s.sol b/script/VetoToken.s.sol new file mode 100644 index 0000000..7c28d75 --- /dev/null +++ b/script/VetoToken.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import {Script, console2} from "forge-std/Script.sol"; +import {VetoToken} from "../src/VetoToken.sol"; + +contract Deploy is Script { + function run() public { + // 0. Setting up foundry + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // 1. Deploying the token + new VetoToken(); + + vm.stopBroadcast(); + } +} \ No newline at end of file diff --git a/script/deployer.sh b/script/deployer.sh new file mode 100755 index 0000000..090b2ca --- /dev/null +++ b/script/deployer.sh @@ -0,0 +1,3 @@ +source .env +forge script script/OptimisticTokenVotingPlugin.s.sol --rpc-url $SEPOLIA_RPC_URL +forge script script/VetoToken.s.sol --rpc-url $TAIKO_RPC_URL \ No newline at end of file