Skip to content

Commit

Permalink
Addidional cleanup touches
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Apr 19, 2024
1 parent 555a0ec commit 7095c22
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/conditions/StandardProposalCondition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ import {OptimisticTokenVotingPlugin} from "../OptimisticTokenVotingPlugin.sol";
/// @notice An abstract contract for non-upgradeable contracts instantiated via the `new` keyword to inherit from to support customary permissions depending on arbitrary on-chain state.
contract StandardProposalCondition is ERC165, IPermissionCondition {
address dao;
address targetPlugin;
uint256 minDelay;

constructor(address _dao, address _targetPlugin, uint256 _minDelay) {
/**
*
* @param _dao The address of the DAO on which permissions are defined
* @param _minDelay The minimum amount of seconds to enforce for proposals created
*/
constructor(address _dao, uint256 _minDelay) {
dao = _dao;
targetPlugin = _targetPlugin;
minDelay = _minDelay;
}

Expand Down
1 change: 0 additions & 1 deletion src/setup/OptimisticTokenVotingPluginSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ contract OptimisticTokenVotingPluginSetup is PluginSetup {
// Deploy the Std proposal condition
StandardProposalCondition stdProposalCondition = new StandardProposalCondition(
address(_dao),
address(plugin),
MIN_DELAY
);

Expand Down
17 changes: 14 additions & 3 deletions test/OptimisticTokenVotingPlugin.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.so
import {IOptimisticTokenVoting} from "../src/IOptimisticTokenVoting.sol";
import {DAO} from "@aragon/osx/core/dao/DAO.sol";
import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";
import {IPlugin} from "@aragon/osx/core/plugin/IPlugin.sol";
import {IProposal} from "@aragon/osx/core/plugin/proposal/IProposal.sol";
import {IMembership} from "@aragon/osx/core/plugin/membership/IMembership.sol";
import {RATIO_BASE, RatioOutOfBounds} from "@aragon/osx/plugins/utils/Ratio.sol";
import {DaoUnauthorized} from "@aragon/osx/core/utils/auth.sol";
import {ERC20VotesMock} from "./mocks/ERC20VotesMock.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";
import {IERC1822ProxiableUpgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol";

contract OptimisticTokenVotingPluginTest is Test {
address immutable daoBase = address(new DAO());
Expand Down Expand Up @@ -315,10 +317,19 @@ contract OptimisticTokenVotingPluginTest is Test {
supported = plugin.supportsInterface(bytes4(0xffffffff));
assertEq(supported, false, "Should not support any other interface");

// Some fuzzing values are expected to be true
if (_randomInterfaceId == bytes4(0x52d1902d)) {
// Certain fuzzing values are expected to be true
if (
_randomInterfaceId == plugin.OPTIMISTIC_GOVERNANCE_INTERFACE_ID() ||
_randomInterfaceId == type(IERC165Upgradeable).interfaceId ||
_randomInterfaceId == type(IPlugin).interfaceId ||
_randomInterfaceId == type(IProposal).interfaceId ||
_randomInterfaceId ==
type(IERC1822ProxiableUpgradeable).interfaceId ||
_randomInterfaceId == type(IOptimisticTokenVoting).interfaceId ||
_randomInterfaceId == type(IMembership).interfaceId
) {
supported = plugin.supportsInterface(_randomInterfaceId);
assertEq(supported, true, "proxiableUUID should be supported");
assertEq(supported, true, "Interface should be supported");
return;
}

Expand Down

0 comments on commit 7095c22

Please sign in to comment.