proposal-30-decentralize-so.../test/utils/MockProposal.sol

38 lines
1.5 KiB
Solidity
Raw Normal View History

2023-07-25 18:39:19 +03:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { IGovernance } from "@interfaces/IGovernance.sol";
import { TornadoAddresses } from "@proprietary/TornadoAddresses.sol";
import { Test } from "@forge-std/Test.sol";
import { console2 } from "@forge-std/console2.sol";
contract MockProposal is TornadoAddresses, Test {
uint256 public PROPOSAL_VOTING_DURATION;
uint256 public PROPOSAL_LOCKED_DURATION;
uint256 public PROPOSAL_DURATION;
uint256 public PROPOSAL_EXECUTION_MAX_DURATION;
uint256 public PROPOSAL_QOURUM_THRESHOLD;
uint256 public PROPOSAL_VOTE_EXTEND_TIME;
string public constant PROPOSAL_DESCRIPTION = "{title:'Some proposal',description:''}";
function _fetchConfiguration() internal {
IGovernance governance = IGovernance(governanceAddress);
PROPOSAL_LOCKED_DURATION = governance.EXECUTION_DELAY();
PROPOSAL_EXECUTION_MAX_DURATION = governance.EXECUTION_EXPIRATION();
PROPOSAL_QOURUM_THRESHOLD = governance.QUORUM_VOTES();
PROPOSAL_VOTING_DURATION = governance.VOTING_PERIOD();
PROPOSAL_VOTE_EXTEND_TIME = governance.VOTE_EXTEND_TIME();
PROPOSAL_DURATION = PROPOSAL_VOTING_DURATION + PROPOSAL_LOCKED_DURATION;
}
function setUp() public virtual {
// If fork block number unitialized, then set latest
if (block.number == 1) vm.createSelectFork(vm.rpcUrl("mainnet"));
else vm.createSelectFork(vm.rpcUrl("mainnet"), block.number);
_fetchConfiguration();
}
}