File size: 31,172 Bytes
f998fcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  "language": "Solidity",
  "settings": {
    "evmVersion": "london",
    "libraries": {},
    "metadata": {
      "bytecodeHash": "ipfs",
      "useLiteralContent": true
    },
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "remappings": [],
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    }
  },
  "sources": {
    "contracts/GovernorBravoDelegate.sol": {
      "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.9;\n\nimport \"./GovernorBravoInterfaces.sol\";\n\ncontract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoEvents {\n    uint private constant MAX_BPS = 10000;\n\n    /// @notice The name of this contract\n    string public constant name = \"Vesper Governor\";\n\n    /// @notice The minimum setable proposal threshold\n    uint public constant MIN_PROPOSAL_THRESHOLD = 25000e18; // 25,000 VSP\n\n    /// @notice The maximum setable proposal threshold\n    uint public constant MAX_PROPOSAL_THRESHOLD = 100000e18; //100,000 VSP\n\n    /// @notice The minimum setable voting period\n    uint public constant MIN_VOTING_PERIOD = 5760; // About 24 hours\n\n    /// @notice The max setable voting period\n    uint public constant MAX_VOTING_PERIOD = 80640; // About 2 weeks\n\n    /// @notice The min setable voting delay\n    uint public constant MIN_VOTING_DELAY = 1;\n\n    /// @notice The max setable voting delay\n    uint public constant MAX_VOTING_DELAY = 40320; // About 1 week\n\n    /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed\n    uint public constant quorumVotesPercent = 400; // 4% of VSP + esVSP totalSupply\n\n    /// @notice The maximum number of actions that can be included in a proposal\n    uint public constant proposalMaxOperations = 10; // 10 actions\n\n    /// @notice The EIP-712 typehash for the contract's domain\n    bytes32 public constant DOMAIN_TYPEHASH = keccak256(\"EIP712Domain(string name,uint256 chainId,address verifyingContract)\");\n\n    /// @notice The EIP-712 typehash for the ballot struct used by the contract\n    bytes32 public constant BALLOT_TYPEHASH = keccak256(\"Ballot(uint256 proposalId,uint8 support)\");\n\n    /**\n      * @notice Used to initialize the contract during delegator constructor\n      * @param timelock_ The address of the Timelock\n      * @param vsp_ The address of the VSP token\n      * @param esVSP_ The address of the Escrowed VSP token\n      * @param votingPeriod_ The initial voting period\n      * @param votingDelay_ The initial voting delay\n      * @param proposalThreshold_ The initial proposal threshold\n      */\n    function initialize(address timelock_, address vsp_, address esVSP_, uint votingPeriod_, uint votingDelay_, uint proposalThreshold_) virtual public {\n        require(address(timelock) == address(0), \"GovernorBravo::initialize: can only initialize once\");\n        require(msg.sender == admin, \"GovernorBravo::initialize: admin only\");\n        require(timelock_ != address(0), \"GovernorBravo::initialize: invalid timelock address\");\n        require(vsp_ != address(0), \"GovernorBravo::initialize: invalid VSP address\");\n        require(esVSP_ != address(0), \"GovernorBravo::initialize: invalid esVSP address\");\n        require(votingPeriod_ >= MIN_VOTING_PERIOD && votingPeriod_ <= MAX_VOTING_PERIOD, \"GovernorBravo::initialize: invalid voting period\");\n        require(votingDelay_ >= MIN_VOTING_DELAY && votingDelay_ <= MAX_VOTING_DELAY, \"GovernorBravo::initialize: invalid voting delay\");\n        require(proposalThreshold_ >= MIN_PROPOSAL_THRESHOLD && proposalThreshold_ <= MAX_PROPOSAL_THRESHOLD, \"GovernorBravo::initialize: invalid proposal threshold\");\n\n        timelock = TimelockInterface(timelock_);\n        vsp = VspInterface(vsp_);\n        esVSP = EsVspInterface(esVSP_);\n        votingPeriod = votingPeriod_;\n        votingDelay = votingDelay_;\n        proposalThreshold = proposalThreshold_;\n    }\n\n    /**\n      * @notice Function used to propose a new proposal. Sender must have delegates above the proposal threshold\n      * @param targets Target addresses for proposal calls\n      * @param values Eth values for proposal calls\n      * @param signatures Function signatures for proposal calls\n      * @param calldatas Calldatas for proposal calls\n      * @param description String description of the proposal\n      * @return Proposal id of new proposal\n      */\n    function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {\n        // Reject proposals before initiating as Governor\n        require(initialProposalId != 0, \"GovernorBravo::propose: Governor Bravo not active\");\n        // Allow addresses above proposal threshold and whitelisted addresses to propose\n        require(getPriorVotesInternal(msg.sender, sub256(block.number, 1)) > proposalThreshold || isWhitelisted(msg.sender), \"GovernorBravo::propose: proposer votes below proposal threshold\");\n        require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, \"GovernorBravo::propose: proposal function information arity mismatch\");\n        require(targets.length != 0, \"GovernorBravo::propose: must provide actions\");\n        require(targets.length <= proposalMaxOperations, \"GovernorBravo::propose: too many actions\");\n\n        uint latestProposalId = latestProposalIds[msg.sender];\n        if (latestProposalId != 0) {\n          ProposalState proposersLatestProposalState = state(latestProposalId);\n          require(proposersLatestProposalState != ProposalState.Active, \"GovernorBravo::propose: one live proposal per proposer, found an already active proposal\");\n          require(proposersLatestProposalState != ProposalState.Pending, \"GovernorBravo::propose: one live proposal per proposer, found an already pending proposal\");\n        }\n\n        uint startBlock = add256(block.number, votingDelay);\n        uint endBlock = add256(startBlock, votingPeriod);\n\n        proposalCount++;\n        uint newProposalID = proposalCount;\n        Proposal storage newProposal = proposals[newProposalID];\n        // This should never happen but add a check in case.\n        require(newProposal.id == 0, \"GovernorBravo::propose: ProposalID collision\");\n        newProposal.id = newProposalID;\n        newProposal.proposer = msg.sender;\n        newProposal.eta = 0;\n        newProposal.targets = targets;\n        newProposal.values = values;\n        newProposal.signatures = signatures;\n        newProposal.calldatas = calldatas;\n        newProposal.startBlock = startBlock;\n        newProposal.endBlock = endBlock;\n        newProposal.forVotes = 0;\n        newProposal.againstVotes = 0;\n        newProposal.abstainVotes = 0;\n        newProposal.canceled = false;\n        newProposal.executed = false;\n\n        latestProposalIds[newProposal.proposer] = newProposal.id;\n\n        emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);\n        return newProposal.id;\n    }\n\n    /**\n      * @notice Queues a proposal of state succeeded\n      * @param proposalId The id of the proposal to queue\n      */\n    function queue(uint proposalId) external {\n        require(state(proposalId) == ProposalState.Succeeded, \"GovernorBravo::queue: proposal can only be queued if it is succeeded\");\n        Proposal storage proposal = proposals[proposalId];\n        uint eta = add256(block.timestamp, timelock.delay());\n        for (uint i = 0; i < proposal.targets.length; i++) {\n            queueOrRevertInternal(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);\n        }\n        proposal.eta = eta;\n        emit ProposalQueued(proposalId, eta);\n    }\n\n    function queueOrRevertInternal(address target, uint value, string memory signature, bytes memory data, uint eta) internal {\n        require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), \"GovernorBravo::queueOrRevertInternal: identical proposal action already queued at eta\");\n        timelock.queueTransaction(target, value, signature, data, eta);\n    }\n\n    /**\n      * @notice Executes a queued proposal if eta has passed\n      * @param proposalId The id of the proposal to execute\n      */\n    function execute(uint proposalId) external payable {\n        require(state(proposalId) == ProposalState.Queued, \"GovernorBravo::execute: proposal can only be executed if it is queued\");\n        Proposal storage proposal = proposals[proposalId];\n        proposal.executed = true;\n        for (uint i = 0; i < proposal.targets.length; i++) {\n            timelock.executeTransaction{value: proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);\n        }\n        emit ProposalExecuted(proposalId);\n    }\n\n    /**\n      * @notice Cancels a proposal only if sender is the proposer, or proposer delegates dropped below proposal threshold\n      * @param proposalId The id of the proposal to cancel\n      */\n    function cancel(uint proposalId) external {\n        require(state(proposalId) != ProposalState.Executed, \"GovernorBravo::cancel: cannot cancel executed proposal\");\n\n        Proposal storage proposal = proposals[proposalId];\n\n        // Proposer and admin can cancel\n        if(msg.sender != proposal.proposer && msg.sender != admin) {\n            // Whitelisted proposers can't be canceled for falling below proposal threshold\n            if(isWhitelisted(proposal.proposer)) {\n                require((getPriorVotesInternal(proposal.proposer, sub256(block.number, 1)) < proposalThreshold) && msg.sender == whitelistGuardian, \"GovernorBravo::cancel: whitelisted proposer\");\n            }\n            else {\n                require((getPriorVotesInternal(proposal.proposer, sub256(block.number, 1)) < proposalThreshold), \"GovernorBravo::cancel: proposer above threshold\");\n            }\n        }\n\n        proposal.canceled = true;\n        for (uint i = 0; i < proposal.targets.length; i++) {\n            timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);\n        }\n\n        emit ProposalCanceled(proposalId);\n    }\n\n    /**\n      * @notice Gets actions of a proposal\n      * @param proposalId the id of the proposal\n      * @return targets of the proposal actions\n      * @return values of the proposal actions\n      * @return signatures of the proposal actions\n      * @return calldatas of the proposal actions\n      */\n    function getActions(uint proposalId) external view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {\n        Proposal storage p = proposals[proposalId];\n        return (p.targets, p.values, p.signatures, p.calldatas);\n    }\n\n    /**\n      * @notice Gets the receipt for a voter on a given proposal\n      * @param proposalId the id of proposal\n      * @param voter The address of the voter\n      * @return The voting receipt\n      */\n    function getReceipt(uint proposalId, address voter) external view returns (Receipt memory) {\n        return proposals[proposalId].receipts[voter];\n    }\n\n    /**\n      * @notice Gets the quorum votes for a given block\n      * @param block_ The block number (e.g. proposal.startBlock)\n      * @return The quorum votes\n      */\n    function quorumVotes(uint256 block_) public view returns (uint256) {\n        // To avoid double counting VSP tokens that are locked into esVSP contract, we subtract its balance from the overall supply\n        // In summary: Total voting power = VSP supply + esVSP boost supply\n        return (vsp.totalSupply() + esVSP.getPriorTotalSupply(block_) - vsp.getPriorVotes(address(esVSP), block_)) * quorumVotesPercent / MAX_BPS;\n    }\n\n    /**\n      * @notice Gets the state of a proposal\n      * @param proposalId The id of the proposal\n      * @return Proposal state\n      */\n    function state(uint proposalId) public view returns (ProposalState) {\n        require(proposalCount >= proposalId && proposalId > initialProposalId, \"GovernorBravo::state: invalid proposal id\");\n        Proposal storage proposal = proposals[proposalId];\n        if (proposal.canceled) {\n            return ProposalState.Canceled;\n        } else if (block.number <= proposal.startBlock) {\n            return ProposalState.Pending;\n        } else if (block.number <= proposal.endBlock) {\n            return ProposalState.Active;\n        } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes(proposal.startBlock)) {\n            return ProposalState.Defeated;\n        } else if (proposal.eta == 0) {\n            return ProposalState.Succeeded;\n        } else if (proposal.executed) {\n            return ProposalState.Executed;\n        } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {\n            return ProposalState.Expired;\n        } else {\n            return ProposalState.Queued;\n        }\n    }\n\n    /**\n      * @notice Cast a vote for a proposal\n      * @param proposalId The id of the proposal to vote on\n      * @param support The support value for the vote. 0=against, 1=for, 2=abstain\n      */\n    function castVote(uint proposalId, uint8 support) external {\n        emit VoteCast(msg.sender, proposalId, support, castVoteInternal(msg.sender, proposalId, support), \"\");\n    }\n\n    /**\n      * @notice Cast a vote for a proposal with a reason\n      * @param proposalId The id of the proposal to vote on\n      * @param support The support value for the vote. 0=against, 1=for, 2=abstain\n      * @param reason The reason given for the vote by the voter\n      */\n    function castVoteWithReason(uint proposalId, uint8 support, string calldata reason) external {\n        emit VoteCast(msg.sender, proposalId, support, castVoteInternal(msg.sender, proposalId, support), reason);\n    }\n\n    /**\n      * @notice Cast a vote for a proposal by signature\n      * @dev External function that accepts EIP-712 signatures for voting on proposals.\n      */\n    function castVoteBySig(uint proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s) external {\n        bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainIdInternal(), address(this)));\n        bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));\n        bytes32 digest = keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n        address signatory = ecrecover(digest, v, r, s);\n        require(signatory != address(0), \"GovernorBravo::castVoteBySig: invalid signature\");\n        emit VoteCast(signatory, proposalId, support, castVoteInternal(signatory, proposalId, support), \"\");\n    }\n\n    /**\n      * @notice Internal function that caries out voting logic\n      * @param voter The voter that is casting their vote\n      * @param proposalId The id of the proposal to vote on\n      * @param support The support value for the vote. 0=against, 1=for, 2=abstain\n      * @return The number of votes cast\n      */\n    function castVoteInternal(address voter, uint proposalId, uint8 support) internal returns (uint256) {\n        require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n        require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n        Proposal storage proposal = proposals[proposalId];\n        Receipt storage receipt = proposal.receipts[voter];\n        require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n        uint256 votes = getPriorVotesInternal(voter, proposal.startBlock);\n\n        if (support == 0) {\n            proposal.againstVotes = add256(proposal.againstVotes, votes);\n        } else if (support == 1) {\n            proposal.forVotes = add256(proposal.forVotes, votes);\n        } else if (support == 2) {\n            proposal.abstainVotes = add256(proposal.abstainVotes, votes);\n        }\n\n        receipt.hasVoted = true;\n        receipt.support = support;\n        receipt.votes = votes;\n\n        return votes;\n    }\n\n    function getPriorVotesInternal(address account, uint256 blockNumber) internal view returns (uint256) {\n        return vsp.getPriorVotes(account, blockNumber) + esVSP.getPriorVotes(account, blockNumber);\n    }\n\n    /**\n     * @notice View function which returns if an account is whitelisted\n     * @param account Account to check white list status of\n     * @return If the account is whitelisted\n     */\n    function isWhitelisted(address account) public view returns (bool) {\n        return (whitelistAccountExpirations[account] > block.timestamp);\n    }\n\n    /**\n      * @notice Admin function for setting the voting delay\n      * @param newVotingDelay new voting delay, in blocks\n      */\n    function _setVotingDelay(uint newVotingDelay) external {\n        require(msg.sender == admin, \"GovernorBravo::_setVotingDelay: admin only\");\n        require(newVotingDelay >= MIN_VOTING_DELAY && newVotingDelay <= MAX_VOTING_DELAY, \"GovernorBravo::_setVotingDelay: invalid voting delay\");\n        uint oldVotingDelay = votingDelay;\n        votingDelay = newVotingDelay;\n\n        emit VotingDelaySet(oldVotingDelay,votingDelay);\n    }\n\n    /**\n      * @notice Admin function for setting the voting period\n      * @param newVotingPeriod new voting period, in blocks\n      */\n    function _setVotingPeriod(uint newVotingPeriod) external {\n        require(msg.sender == admin, \"GovernorBravo::_setVotingPeriod: admin only\");\n        require(newVotingPeriod >= MIN_VOTING_PERIOD && newVotingPeriod <= MAX_VOTING_PERIOD, \"GovernorBravo::_setVotingPeriod: invalid voting period\");\n        uint oldVotingPeriod = votingPeriod;\n        votingPeriod = newVotingPeriod;\n\n        emit VotingPeriodSet(oldVotingPeriod, votingPeriod);\n    }\n\n    /**\n      * @notice Admin function for setting the proposal threshold\n      * @dev newProposalThreshold must be greater than the hardcoded min\n      * @param newProposalThreshold new proposal threshold\n      */\n    function _setProposalThreshold(uint newProposalThreshold) external {\n        require(msg.sender == admin, \"GovernorBravo::_setProposalThreshold: admin only\");\n        require(newProposalThreshold >= MIN_PROPOSAL_THRESHOLD && newProposalThreshold <= MAX_PROPOSAL_THRESHOLD, \"GovernorBravo::_setProposalThreshold: invalid proposal threshold\");\n        uint oldProposalThreshold = proposalThreshold;\n        proposalThreshold = newProposalThreshold;\n\n        emit ProposalThresholdSet(oldProposalThreshold, proposalThreshold);\n    }\n\n    /**\n     * @notice Admin function for setting the whitelist expiration as a timestamp for an account. Whitelist status allows accounts to propose without meeting threshold\n     * @param account Account address to set whitelist expiration for\n     * @param expiration Expiration for account whitelist status as timestamp (if now < expiration, whitelisted)\n     */\n    function _setWhitelistAccountExpiration(address account, uint expiration) external {\n        require(msg.sender == admin || msg.sender == whitelistGuardian, \"GovernorBravo::_setWhitelistAccountExpiration: admin only\");\n        whitelistAccountExpirations[account] = expiration;\n\n        emit WhitelistAccountExpirationSet(account, expiration);\n    }\n\n    /**\n     * @notice Admin function for setting the whitelistGuardian. WhitelistGuardian can cancel proposals from whitelisted addresses\n     * @param account Account to set whitelistGuardian to (0x0 to remove whitelistGuardian)\n     */\n     function _setWhitelistGuardian(address account) external {\n        require(msg.sender == admin, \"GovernorBravo::_setWhitelistGuardian: admin only\");\n        address oldGuardian = whitelistGuardian;\n        whitelistGuardian = account;\n\n        emit WhitelistGuardianSet(oldGuardian, whitelistGuardian);\n     }\n\n    /**\n      * @notice Initiate the GovernorBravo contract\n      * @dev Admin only. Sets initial proposal id which initiates the contract, ensuring a continuous proposal id count\n      */\n    function _initiate() external {\n        require(msg.sender == admin, \"GovernorBravo::_initiate: admin only\");\n        require(initialProposalId == 0, \"GovernorBravo::_initiate: can only initiate once\");\n        proposalCount = 1;\n        initialProposalId = 1;\n        timelock.acceptAdmin();\n    }\n\n    /**\n      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n      * @param newPendingAdmin New pending admin.\n      */\n    function _setPendingAdmin(address newPendingAdmin) external {\n        // Check caller = admin\n        require(msg.sender == admin, \"GovernorBravo:_setPendingAdmin: admin only\");\n\n        // Save current value, if any, for inclusion in log\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store pendingAdmin with value newPendingAdmin\n        pendingAdmin = newPendingAdmin;\n\n        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)\n        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);\n    }\n\n    /**\n      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin\n      * @dev Admin function for pending admin to accept role and update admin\n      */\n    function _acceptAdmin() external {\n        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)\n        require(msg.sender == pendingAdmin && msg.sender != address(0), \"GovernorBravo:_acceptAdmin: pending admin only\");\n\n        // Save current values for inclusion in log\n        address oldAdmin = admin;\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store admin with value pendingAdmin\n        admin = pendingAdmin;\n\n        // Clear the pending value\n        pendingAdmin = address(0);\n\n        emit NewAdmin(oldAdmin, admin);\n        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\n    }\n\n    function add256(uint256 a, uint256 b) internal pure returns (uint) {\n        uint c = a + b;\n        require(c >= a, \"addition overflow\");\n        return c;\n    }\n\n    function sub256(uint256 a, uint256 b) internal pure returns (uint) {\n        require(b <= a, \"subtraction underflow\");\n        return a - b;\n    }\n\n    function getChainIdInternal() internal view returns (uint) {\n        uint chainId;\n        assembly { chainId := chainid() }\n        return chainId;\n    }\n}\n"
    },
    "contracts/GovernorBravoInterfaces.sol": {
      "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.9;\n\n\ncontract GovernorBravoEvents {\n    /// @notice An event emitted when a new proposal is created\n    event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);\n\n    /// @notice An event emitted when a vote has been cast on a proposal\n    /// @param voter The address which casted a vote\n    /// @param proposalId The proposal id which was voted on\n    /// @param support Support value for the vote. 0=against, 1=for, 2=abstain\n    /// @param votes Number of votes which were cast by the voter\n    /// @param reason The reason given for the vote by the voter\n    event VoteCast(address indexed voter, uint proposalId, uint8 support, uint votes, string reason);\n\n    /// @notice An event emitted when a proposal has been canceled\n    event ProposalCanceled(uint id);\n\n    /// @notice An event emitted when a proposal has been queued in the Timelock\n    event ProposalQueued(uint id, uint eta);\n\n    /// @notice An event emitted when a proposal has been executed in the Timelock\n    event ProposalExecuted(uint id);\n\n    /// @notice An event emitted when the voting delay is set\n    event VotingDelaySet(uint oldVotingDelay, uint newVotingDelay);\n\n    /// @notice An event emitted when the voting period is set\n    event VotingPeriodSet(uint oldVotingPeriod, uint newVotingPeriod);\n\n    /// @notice Emitted when implementation is changed\n    event NewImplementation(address oldImplementation, address newImplementation);\n\n    /// @notice Emitted when proposal threshold is set\n    event ProposalThresholdSet(uint oldProposalThreshold, uint newProposalThreshold);\n\n    /// @notice Emitted when pendingAdmin is changed\n    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\n\n    /// @notice Emitted when pendingAdmin is accepted, which means admin is updated\n    event NewAdmin(address oldAdmin, address newAdmin);\n\n    /// @notice Emitted when whitelist account expiration is set\n    event WhitelistAccountExpirationSet(address account, uint expiration);\n\n    /// @notice Emitted when the whitelistGuardian is set\n    event WhitelistGuardianSet(address oldGuardian, address newGuardian);\n}\n\ncontract GovernorBravoDelegatorStorage {\n    /// @notice Administrator for this contract\n    address public admin;\n\n    /// @notice Pending administrator for this contract\n    address public pendingAdmin;\n\n    /// @notice Active brains of Governor\n    address public implementation;\n}\n\n\n/**\n * @title Storage for Governor Bravo Delegate\n * @notice For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new\n * contract which implements GovernorBravoDelegateStorageV1 and following the naming convention\n * GovernorBravoDelegateStorageVX.\n */\ncontract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {\n\n    /// @notice The delay before voting on a proposal may take place, once proposed, in blocks\n    uint public votingDelay;\n\n    /// @notice The duration of voting on a proposal, in blocks\n    uint public votingPeriod;\n\n    /// @notice The number of votes required in order for a voter to become a proposer\n    uint public proposalThreshold;\n\n    /// @notice Initial proposal id set at become\n    uint public initialProposalId;\n\n    /// @notice The total number of proposals\n    uint public proposalCount;\n\n    /// @notice The address of the Vesper Protocol Timelock\n    TimelockInterface public timelock;\n\n    /// @notice The address of the Vesper governance token\n    VspInterface public vsp;\n\n    /// @notice The official record of all proposals ever proposed\n    mapping (uint => Proposal) public proposals;\n\n    /// @notice The latest proposal for each proposer\n    mapping (address => uint) public latestProposalIds;\n\n\n    struct Proposal {\n        /// @notice Unique id for looking up a proposal\n        uint id;\n\n        /// @notice Creator of the proposal\n        address proposer;\n\n        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds\n        uint eta;\n\n        /// @notice the ordered list of target addresses for calls to be made\n        address[] targets;\n\n        /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made\n        uint[] values;\n\n        /// @notice The ordered list of function signatures to be called\n        string[] signatures;\n\n        /// @notice The ordered list of calldata to be passed to each call\n        bytes[] calldatas;\n\n        /// @notice The block at which voting begins: holders must delegate their votes prior to this block\n        uint startBlock;\n\n        /// @notice The block at which voting ends: votes must be cast prior to this block\n        uint endBlock;\n\n        /// @notice Current number of votes in favor of this proposal\n        uint forVotes;\n\n        /// @notice Current number of votes in opposition to this proposal\n        uint againstVotes;\n\n        /// @notice Current number of votes for abstaining for this proposal\n        uint abstainVotes;\n\n        /// @notice Flag marking whether the proposal has been canceled\n        bool canceled;\n\n        /// @notice Flag marking whether the proposal has been executed\n        bool executed;\n\n        /// @notice Receipts of ballots for the entire set of voters\n        mapping (address => Receipt) receipts;\n    }\n\n    /// @notice Ballot receipt record for a voter\n    struct Receipt {\n        /// @notice Whether or not a vote has been cast\n        bool hasVoted;\n\n        /// @notice Whether or not the voter supports the proposal or abstains\n        uint8 support;\n\n        /// @notice The number of votes the voter had, which were cast\n        uint256 votes;\n    }\n\n    /// @notice Possible states that a proposal may be in\n    enum ProposalState {\n        Pending,\n        Active,\n        Canceled,\n        Defeated,\n        Succeeded,\n        Queued,\n        Expired,\n        Executed\n    }\n}\n\ncontract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {\n    /// @notice Stores the expiration of account whitelist status as a timestamp\n    mapping (address => uint) public whitelistAccountExpirations;\n\n    /// @notice Address which manages whitelisted proposals and whitelist accounts\n    address public whitelistGuardian;\n\n    /// @notice The address of the Escrowed VSP token\n    EsVspInterface public esVSP;\n}\n\ninterface TimelockInterface {\n    function delay() external view returns (uint);\n    function GRACE_PERIOD() external view returns (uint);\n    function acceptAdmin() external;\n    function queuedTransactions(bytes32 hash) external view returns (bool);\n    function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);\n    function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;\n    function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);\n}\n\ninterface VspInterface {\n    function getPriorVotes(address account, uint blockNumber) external view returns (uint256);\n\n    function totalSupply() external view returns (uint256);\n}\n\ninterface EsVspInterface {\n    function getPriorVotes(address account, uint blockNumber) external view returns (uint256);\n\n    function getPriorTotalSupply(uint blockNumber) external view returns (uint256);\n}\n"
    }
  }
}