diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index c5cb701..adfb07f 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -237,14 +237,16 @@ contract Deploy is Script { GovernanceERC20.MintSettings(new address[](0), new uint256[](0)); settingsData = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - ITaikoEssentialContract(taikoL1), - taikoBridge, - minStdProposalDelay, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + ITaikoEssentialContract(taikoL1), + taikoBridge, + minStdProposalDelay, + stdProposer, + emergencyProposer + ) ); } diff --git a/src/setup/OptimisticTokenVotingPluginSetup.sol b/src/setup/OptimisticTokenVotingPluginSetup.sol index 440b5e1..838d600 100644 --- a/src/setup/OptimisticTokenVotingPluginSetup.sol +++ b/src/setup/OptimisticTokenVotingPluginSetup.sol @@ -48,6 +48,18 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { string symbol; } + struct InstallationParameters { + OptimisticTokenVotingPlugin.OptimisticGovernanceSettings votingSettings; + TokenSettings tokenSettings; + // only used for GovernanceERC20 (when token is not passed) + GovernanceERC20.MintSettings mintSettings; + ITaikoEssentialContract taikoL1; + address taikoBridge; + uint64 stdProposalMinDelay; + address stdProposer; + address emergencyProposer; + } + /// @notice Thrown if token address is passed which is not a token. /// @param token The token address error TokenNotContract(address token); @@ -76,19 +88,9 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { { // Decode `_installParameters` to extract the params needed for deploying and initializing `OptimisticTokenVoting` plugin, // and the required helpers - ( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings memory votingSettings, - TokenSettings memory tokenSettings, - // only used for GovernanceERC20 (when token is not passed) - GovernanceERC20.MintSettings memory mintSettings, - ITaikoEssentialContract _taikoL1, - address _taikoBridge, - uint64 stdProposalMinDelay, - address stdProposer, - address emergencyProposer - ) = decodeInstallationParams(_installParameters); - - address token = tokenSettings.addr; + InstallationParameters memory installationParams = decodeInstallationParams(_installParameters); + + address token = installationParams.tokenSettings.addr; // Prepare helpers. address[] memory helpers = new address[](1); @@ -119,13 +121,20 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { // GovernanceWrappedERC20 in order to make the token // include governance functionality. GovernanceWrappedERC20(token).initialize( - IERC20Upgradeable(tokenSettings.addr), tokenSettings.name, tokenSettings.symbol + IERC20Upgradeable(installationParams.tokenSettings.addr), + installationParams.tokenSettings.name, + installationParams.tokenSettings.symbol ); } } else { // Clone a `GovernanceERC20`. token = governanceERC20Base.clone(); - GovernanceERC20(token).initialize(IDAO(_dao), tokenSettings.name, tokenSettings.symbol, mintSettings); + GovernanceERC20(token).initialize( + IDAO(_dao), + installationParams.tokenSettings.name, + installationParams.tokenSettings.symbol, + installationParams.mintSettings + ); } helpers[0] = token; @@ -135,13 +144,19 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { address(optimisticTokenVotingPluginBase), abi.encodeCall( OptimisticTokenVotingPlugin.initialize, - (IDAO(_dao), votingSettings, IVotesUpgradeable(token), _taikoL1, _taikoBridge) + ( + IDAO(_dao), + installationParams.votingSettings, + IVotesUpgradeable(token), + installationParams.taikoL1, + installationParams.taikoBridge + ) ) ); // Prepare permissions PermissionLib.MultiTargetPermission[] memory permissions = - new PermissionLib.MultiTargetPermission[](tokenSettings.addr != address(0) ? 5 : 6); + new PermissionLib.MultiTargetPermission[](installationParams.tokenSettings.addr != address(0) ? 5 : 6); // Request the permissions to be granted @@ -174,13 +189,13 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { { // Deploy the Std proposal condition StandardProposalCondition stdProposalCondition = - new StandardProposalCondition(address(_dao), stdProposalMinDelay); + new StandardProposalCondition(address(_dao), installationParams.stdProposalMinDelay); // Proposer plugins can create proposals permissions[3] = PermissionLib.MultiTargetPermission({ operation: PermissionLib.Operation.Grant, where: plugin, - who: stdProposer, + who: installationParams.stdProposer, condition: address(stdProposalCondition), permissionId: optimisticTokenVotingPluginBase.PROPOSER_PERMISSION_ID() }); @@ -188,12 +203,12 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { permissions[4] = PermissionLib.MultiTargetPermission({ operation: PermissionLib.Operation.Grant, where: plugin, - who: emergencyProposer, + who: installationParams.emergencyProposer, condition: PermissionLib.NO_CONDITION, permissionId: optimisticTokenVotingPluginBase.PROPOSER_PERMISSION_ID() }); - if (tokenSettings.addr == address(0x0)) { + if (installationParams.tokenSettings.addr == address(0x0)) { // The DAO can mint ERC20 tokens permissions[5] = PermissionLib.MultiTargetPermission({ operation: PermissionLib.Operation.Grant, @@ -277,67 +292,21 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup { } /// @notice Encodes the given installation parameters into a byte array - function encodeInstallationParams( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings calldata _votingSettings, - TokenSettings calldata _tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - GovernanceERC20.MintSettings calldata _mintSettings, - ITaikoEssentialContract _taikoL1, - address _taikoBridge, - uint64 _stdProposalMinDelay, - address _stdProposer, - address _emergencyProposer - ) external pure returns (bytes memory) { - return abi.encode( - _votingSettings, - _tokenSettings, - _mintSettings, - _taikoL1, - _taikoBridge, - _stdProposalMinDelay, - _stdProposer, - _emergencyProposer - ); + function encodeInstallationParams(InstallationParameters memory installationParams) + external + pure + returns (bytes memory) + { + return abi.encode(installationParams); } /// @notice Decodes the given byte array into the original installation parameters function decodeInstallationParams(bytes memory _data) public pure - returns ( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings memory votingSettings, - TokenSettings memory tokenSettings, - // only used for GovernanceERC20 (when token is not passed) - GovernanceERC20.MintSettings memory mintSettings, - ITaikoEssentialContract _taikoL1, - address _taikoBridge, - uint64 _stdProposalMinDelay, - address _stdProposer, - address _emergencyProposer - ) + returns (InstallationParameters memory installationParams) { - ( - votingSettings, - tokenSettings, - mintSettings, - _taikoL1, - _taikoBridge, - _stdProposalMinDelay, - _stdProposer, - _emergencyProposer - ) = abi.decode( - _data, - ( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings, - TokenSettings, - GovernanceERC20.MintSettings, - ITaikoEssentialContract, - address, - uint64, - address, - address - ) - ); + installationParams = abi.decode(_data, (InstallationParameters)); } /// @notice Retrieves the interface identifiers supported by the token contract. diff --git a/test/OptimisticTokenVotingPluginSetup.t.sol b/test/OptimisticTokenVotingPluginSetup.t.sol index 9cdb02b..31323f1 100644 --- a/test/OptimisticTokenVotingPluginSetup.t.sol +++ b/test/OptimisticTokenVotingPluginSetup.t.sol @@ -75,14 +75,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { function test_ShouldEncodeInstallationParams_Default() public view { // Default bytes memory output = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); bytes memory expected = @@ -97,14 +99,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { minDuration: 60 * 60 * 24 * 5 }); bytes memory output = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); bytes memory expected = @@ -120,14 +124,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { symbol: "wNCN" }); bytes memory output = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); bytes memory expected = @@ -144,14 +150,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { mintSettings = GovernanceERC20.MintSettings({receivers: receivers, amounts: amounts}); bytes memory output = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - ITaikoEssentialContract(address(0x1234)), - address(0x5678), // taikoBridge - 5 days, // stdProposalMinDuration - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + ITaikoEssentialContract(address(0x1234)), + address(0x5678), // taikoBridge + 5 days, // stdProposalMinDuration + stdProposer, + emergencyProposer + ) ); bytes memory expected = @@ -164,14 +172,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { stdProposer = address(0x567890); bytes memory output = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - ITaikoEssentialContract(address(0x1111)), - address(0x2222), // taikoBridge - 15 days, // stdProposalMinDuration - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + ITaikoEssentialContract(address(0x1111)), + address(0x2222), // taikoBridge + 15 days, // stdProposalMinDuration + stdProposer, + emergencyProposer + ) ); bytes memory expected = @@ -201,54 +211,50 @@ contract OptimisticTokenVotingPluginSetupTest is Test { emergencyProposer = address(0x7890); bytes memory _installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - ITaikoEssentialContract(address(0x9999)), - address(0xaaaa), - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + ITaikoEssentialContract(address(0x9999)), + address(0xaaaa), + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); // Decode - ( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings memory _votingSettings, - OptimisticTokenVotingPluginSetup.TokenSettings memory _tokenSettings, - GovernanceERC20.MintSettings memory _mintSettings, - ITaikoEssentialContract _taikoL1, - address _taikoBridge, - uint64 _stdMinDuration, - address _stdProposer, - address _emergencyProposer - ) = pluginSetup.decodeInstallationParams(_installationParams); + OptimisticTokenVotingPluginSetup.InstallationParameters memory _decodedInstallationParams = + pluginSetup.decodeInstallationParams(_installationParams); // Voting - assertEq(_votingSettings.minVetoRatio, uint32(RATIO_BASE / 4), "Incorrect ratio"); - assertEq(_votingSettings.minDuration, 10 days, "Incorrect min duration"); + assertEq(_decodedInstallationParams.votingSettings.minVetoRatio, uint32(RATIO_BASE / 4), "Incorrect ratio"); + assertEq(_decodedInstallationParams.votingSettings.minDuration, 10 days, "Incorrect min duration"); // Token - assertEq(_tokenSettings.addr, address(governanceWrappedERC20Base), "Incorrect token address"); - assertEq(_tokenSettings.name, "Super wToken", "Incorrect token address"); - assertEq(_tokenSettings.symbol, "SwTK", "Incorrect token address"); + assertEq( + _decodedInstallationParams.tokenSettings.addr, + address(governanceWrappedERC20Base), + "Incorrect token address" + ); + assertEq(_decodedInstallationParams.tokenSettings.name, "Super wToken", "Incorrect token address"); + assertEq(_decodedInstallationParams.tokenSettings.symbol, "SwTK", "Incorrect token address"); // Mint - assertEq(_mintSettings.receivers.length, 2, "Incorrect receivers.length"); - assertEq(_mintSettings.receivers[0], address(0x1234), "Incorrect receivers[0]"); - assertEq(_mintSettings.receivers[1], address(0x5678), "Incorrect receivers[1]"); - assertEq(_mintSettings.amounts.length, 2, "Incorrect amounts.length"); - assertEq(_mintSettings.amounts[0], 2000, "Incorrect amounts[0]"); - assertEq(_mintSettings.amounts[1], 5000, "Incorrect amounts[1]"); + assertEq(_decodedInstallationParams.mintSettings.receivers.length, 2, "Incorrect receivers.length"); + assertEq(_decodedInstallationParams.mintSettings.receivers[0], address(0x1234), "Incorrect receivers[0]"); + assertEq(_decodedInstallationParams.mintSettings.receivers[1], address(0x5678), "Incorrect receivers[1]"); + assertEq(_decodedInstallationParams.mintSettings.amounts.length, 2, "Incorrect amounts.length"); + assertEq(_decodedInstallationParams.mintSettings.amounts[0], 2000, "Incorrect amounts[0]"); + assertEq(_decodedInstallationParams.mintSettings.amounts[1], 5000, "Incorrect amounts[1]"); // Proposals - assertEq(_stdMinDuration, stdProposalMinDuration, "Incorrect stdMinDuration"); - assertEq(_stdProposer, stdProposer, "Incorrect standard proposer"); - assertEq(_emergencyProposer, emergencyProposer, "Incorrect emergency proposer"); + assertEq(_decodedInstallationParams.stdProposalMinDelay, 6 days, "Incorrect stdProposalMinDelay"); + assertEq(_decodedInstallationParams.stdProposer, address(0x3456), "Incorrect standard proposer"); + assertEq(_decodedInstallationParams.emergencyProposer, address(0x7890), "Incorrect emergency proposer"); - assertEq(_stdMinDuration, 6 days, "Incorrect stdMinDuration"); - assertEq(stdProposer, address(0x3456), "Incorrect stdProposer"); - assertEq(emergencyProposer, address(0x7890), "Incorrect emergencyProposer"); + assertEq(_decodedInstallationParams.stdProposalMinDelay, 6 days, "Incorrect stdProposalMinDelay"); } function test_ShouldDecodeInstallationParams_2() public { @@ -277,71 +283,67 @@ contract OptimisticTokenVotingPluginSetupTest is Test { emergencyProposer = address(0x8888); bytes memory _installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - ITaikoEssentialContract(address(0xbbbb)), - address(0xcccc), - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + ITaikoEssentialContract(address(0xbbbb)), + address(0xcccc), + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); // Decode - ( - OptimisticTokenVotingPlugin.OptimisticGovernanceSettings memory _votingSettings, - OptimisticTokenVotingPluginSetup.TokenSettings memory _tokenSettings, - GovernanceERC20.MintSettings memory _mintSettings, - ITaikoEssentialContract _taikoL1, - address _taikoBridge, - uint64 _stdMinDuration, - address _stdProposer, - address _emergencyProposer - ) = pluginSetup.decodeInstallationParams(_installationParams); + OptimisticTokenVotingPluginSetup.InstallationParameters memory _decodedInstallationParams = + pluginSetup.decodeInstallationParams(_installationParams); // Voting - assertEq(_votingSettings.minVetoRatio, uint32(RATIO_BASE / 5), "Incorrect ratio"); - assertEq(_votingSettings.minDuration, 12 days, "Incorrect min duration"); + assertEq(_decodedInstallationParams.votingSettings.minVetoRatio, uint32(RATIO_BASE / 5), "Incorrect ratio"); + assertEq(_decodedInstallationParams.votingSettings.minDuration, 12 days, "Incorrect min duration"); // Token - assertEq(_tokenSettings.addr, address(governanceWrappedERC20Base), "Incorrect token address"); - assertEq(_tokenSettings.name, "Mega wToken", "Incorrect token address"); - assertEq(_tokenSettings.symbol, "MwTK", "Incorrect token address"); + assertEq( + _decodedInstallationParams.tokenSettings.addr, + address(governanceWrappedERC20Base), + "Incorrect token address" + ); + assertEq(_decodedInstallationParams.tokenSettings.name, "Mega wToken", "Incorrect token address"); + assertEq(_decodedInstallationParams.tokenSettings.symbol, "MwTK", "Incorrect token address"); // Mint - assertEq(_mintSettings.receivers.length, 4, "Incorrect receivers.length"); - assertEq(_mintSettings.receivers[0], address(0x1111), "Incorrect receivers[0]"); - assertEq(_mintSettings.receivers[1], address(0x2222), "Incorrect receivers[1]"); - assertEq(_mintSettings.receivers[2], address(0x3333), "Incorrect receivers[2]"); - assertEq(_mintSettings.receivers[3], address(0x4444), "Incorrect receivers[3]"); - assertEq(_mintSettings.amounts.length, 4, "Incorrect amounts.length"); - assertEq(_mintSettings.amounts[0], 1000, "Incorrect amounts[0]"); - assertEq(_mintSettings.amounts[1], 2000, "Incorrect amounts[1]"); - assertEq(_mintSettings.amounts[2], 3000, "Incorrect amounts[2]"); - assertEq(_mintSettings.amounts[3], 4000, "Incorrect amounts[3]"); + assertEq(_decodedInstallationParams.mintSettings.receivers.length, 4, "Incorrect receivers.length"); + assertEq(_decodedInstallationParams.mintSettings.receivers[0], address(0x1111), "Incorrect receivers[0]"); + assertEq(_decodedInstallationParams.mintSettings.receivers[1], address(0x2222), "Incorrect receivers[1]"); + assertEq(_decodedInstallationParams.mintSettings.receivers[2], address(0x3333), "Incorrect receivers[2]"); + assertEq(_decodedInstallationParams.mintSettings.receivers[3], address(0x4444), "Incorrect receivers[3]"); + assertEq(_decodedInstallationParams.mintSettings.amounts.length, 4, "Incorrect amounts.length"); + assertEq(_decodedInstallationParams.mintSettings.amounts[0], 1000, "Incorrect amounts[0]"); + assertEq(_decodedInstallationParams.mintSettings.amounts[1], 2000, "Incorrect amounts[1]"); + assertEq(_decodedInstallationParams.mintSettings.amounts[2], 3000, "Incorrect amounts[2]"); + assertEq(_decodedInstallationParams.mintSettings.amounts[3], 4000, "Incorrect amounts[3]"); // Proposal - assertEq(_stdMinDuration, stdProposalMinDuration, "Incorrect stdMinDuration"); - assertEq(_stdProposer, stdProposer, "Incorrect standard proposer"); - assertEq(_emergencyProposer, emergencyProposer, "Incorrect emergency proposer"); - - assertEq(_stdMinDuration, 9 days, "Incorrect stdMinDuration"); - assertEq(stdProposer, address(0x6666), "Incorrect stdProposer"); - assertEq(emergencyProposer, address(0x8888), "Incorrect emergencyProposer"); + assertEq(_decodedInstallationParams.stdProposalMinDelay, 9 days, "Incorrect stdProposalMinDelay"); + assertEq(_decodedInstallationParams.stdProposer, address(0x6666), "Incorrect standard proposer"); + assertEq(_decodedInstallationParams.emergencyProposer, address(0x8888), "Incorrect emergency proposer"); } function test_PrepareInstallationReturnsTheProperPermissions_Default() public { bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (address _plugin, IPluginSetup.PreparedSetupData memory _preparedSetupData) = @@ -425,15 +427,17 @@ contract OptimisticTokenVotingPluginSetupTest is Test { emergencyProposer = address(0x7890); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (address _plugin, IPluginSetup.PreparedSetupData memory _preparedSetupData) = @@ -524,15 +528,17 @@ contract OptimisticTokenVotingPluginSetupTest is Test { emergencyProposer = address(0x7890); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (address _plugin, IPluginSetup.PreparedSetupData memory _preparedSetupData) = @@ -614,14 +620,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { function test_PrepareUninstallationReturnsTheProperPermissions_1() public { // Prepare a dummy install bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (address _dummyPlugin, IPluginSetup.PreparedSetupData memory _preparedSetupData) = pluginSetup.prepareInstallation(address(dao), installationParams); @@ -673,14 +681,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { tokenSettings = OptimisticTokenVotingPluginSetup.TokenSettings({addr: address(0x0), name: "Dummy Token", symbol: "DTK"}); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (address _dummyPlugin, IPluginSetup.PreparedSetupData memory _preparedSetupData) = pluginSetup.prepareInstallation(address(dao), installationParams); @@ -738,15 +748,17 @@ contract OptimisticTokenVotingPluginSetupTest is Test { amounts[0] = 100; mintSettings = GovernanceERC20.MintSettings({receivers: receivers, amounts: amounts}); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - // only used for GovernanceERC20 (when a token is not passed) - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + // only used for GovernanceERC20 (when a token is not passed) + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (, IPluginSetup.PreparedSetupData memory _preparedSetupData) = pluginSetup.prepareInstallation(address(dao), installationParams); @@ -774,14 +786,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { symbol: "wMTK" }); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (, IPluginSetup.PreparedSetupData memory _preparedSetupData) = pluginSetup.prepareInstallation(address(dao), installationParams); @@ -828,14 +842,16 @@ contract OptimisticTokenVotingPluginSetupTest is Test { ); tokenSettings = OptimisticTokenVotingPluginSetup.TokenSettings({addr: address(_token), name: "", symbol: ""}); bytes memory installationParams = pluginSetup.encodeInstallationParams( - votingSettings, - tokenSettings, - mintSettings, - taikoL1, - taikoBridge, - stdProposalMinDuration, - stdProposer, - emergencyProposer + OptimisticTokenVotingPluginSetup.InstallationParameters( + votingSettings, + tokenSettings, + mintSettings, + taikoL1, + taikoBridge, + stdProposalMinDuration, + stdProposer, + emergencyProposer + ) ); (, IPluginSetup.PreparedSetupData memory _preparedSetupData) = pluginSetup.prepareInstallation(address(dao), installationParams);