Address Details
contract
proxy

0xb91a5Ee2E9329B90C249fef89e3a922F4782Cad3

Contract Name
MoolaGovernorBravoDelegator
Creator
0x007e71–f37016 at 0x51c988–98b706
Implementation
MoolaGovernorBravoDelegate | 0x4bb7b74d7e6b03862dba0785e54e687c01ecffc8
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
21 Transactions
Transfers
0 Transfers
Gas Used
3,443,177
Last Balance Update
13842373
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
MoolaGovernorBravoDelegator




Optimization enabled
true
Compiler version
v0.8.17+commit.8df45f5f




Optimization runs
200
EVM Version
london




Verified at
2022-09-30T12:12:54.689892Z

contracts/governance/MoolaGovernorBravoDelegator.sol

// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;

import "./interfaces/GovernorBravoInterfaces.sol";

contract MoolaGovernorBravoDelegator is
  GovernorBravoDelegatorStorage,
  GovernorBravoEvents
{
  constructor(
    address timelock_,
    address comp_,
    address admin_,
    address implementation_,
    uint256 votingPeriod_,
    uint256 votingDelay_,
    uint256 proposalThreshold_
  ) public {
    // Admin set to msg.sender for initialization
    admin = msg.sender;

    delegateTo(
      implementation_,
      abi.encodeWithSignature(
        "initialize(address,address,uint256,uint256,uint256)",
        timelock_,
        comp_,
        votingPeriod_,
        votingDelay_,
        proposalThreshold_
      )
    );

    _setImplementation(implementation_);

    admin = admin_;
  }

  /**
   * @notice Called by the admin to update the implementation of the delegator
   * @param implementation_ The address of the new implementation for delegation
   */
  function _setImplementation(address implementation_) public {
    require(
      msg.sender == admin,
      "GovernorBravoDelegator::_setImplementation: admin only"
    );
    require(
      implementation_ != address(0),
      "GovernorBravoDelegator::_setImplementation: invalid implementation address"
    );

    address oldImplementation = implementation;
    implementation = implementation_;

    emit NewImplementation(oldImplementation, implementation);
  }

  /**
   * @notice Internal method to delegate execution to another contract
   * @dev It returns to the external caller whatever the implementation returns or forwards reverts
   * @param callee The contract to delegatecall
   * @param data The raw data to delegatecall
   */
  function delegateTo(address callee, bytes memory data) internal {
    (bool success, bytes memory returnData) = callee.delegatecall(data);
    assembly {
      if eq(success, 0) {
        revert(add(returnData, 0x20), returndatasize())
      }
    }
  }

  /**
   * @dev Delegates execution to an implementation contract.
   * It returns to the external caller whatever the implementation returns
   * or forwards reverts.
   */
  fallback() external payable {
    // delegate all other functions to current implementation
    (bool success, ) = implementation.delegatecall(msg.data);

    assembly {
      let free_mem_ptr := mload(0x40)
      returndatacopy(free_mem_ptr, 0, returndatasize())

      switch success
      case 0 {
        revert(free_mem_ptr, returndatasize())
      }
      default {
        return(free_mem_ptr, returndatasize())
      }
    }
  }
}
        

/contracts/governance/interfaces/GovernorBravoInterfaces.sol

// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;

contract GovernorBravoEvents {
  /// @notice An event emitted when a new proposal is created
  event ProposalCreated(
    uint256 id,
    address proposer,
    address[] targets,
    uint256[] values,
    string[] signatures,
    bytes[] calldatas,
    uint256 startBlock,
    uint256 endBlock,
    string description
  );

  /// @notice An event emitted when a vote has been cast on a proposal
  /// @param voter The address which casted a vote
  /// @param proposalId The proposal id which was voted on
  /// @param support Support value for the vote. 0=against, 1=for, 2=abstain
  /// @param votes Number of votes which were cast by the voter
  /// @param reason The reason given for the vote by the voter
  event VoteCast(
    address indexed voter,
    uint256 proposalId,
    uint8 support,
    uint256 votes,
    string reason
  );

  /// @notice An event emitted when a proposal has been canceled
  event ProposalCanceled(uint256 id);

  /// @notice An event emitted when a proposal has been queued in the Timelock
  event ProposalQueued(uint256 id, uint256 eta);

  /// @notice An event emitted when a proposal has been executed in the Timelock
  event ProposalExecuted(uint256 id);

  /// @notice An event emitted when the voting delay is set
  event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);

  /// @notice An event emitted when the voting period is set
  event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);

  /// @notice Emitted when implementation is changed
  event NewImplementation(address oldImplementation, address newImplementation);

  /// @notice Emitted when proposal threshold is set
  event ProposalThresholdSet(
    uint256 oldProposalThreshold,
    uint256 newProposalThreshold
  );

  /// @notice Emitted when pendingAdmin is changed
  event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

  /// @notice Emitted when pendingAdmin is accepted, which means admin is updated
  event NewAdmin(address oldAdmin, address newAdmin);

  /// @notice Emitted when whitelist account expiration is set
  event WhitelistAccountExpirationSet(address account, uint256 expiration);

  /// @notice Emitted when the whitelistGuardian is set
  event WhitelistGuardianSet(address oldGuardian, address newGuardian);
}

contract GovernorBravoDelegatorStorage {
  /// @notice Administrator for this contract
  address public admin;

  /// @notice Pending administrator for this contract
  address public pendingAdmin;

  /// @notice Active brains of Governor
  address public implementation;
}

/**
 * @title Storage for Governor Bravo Delegate
 * @notice For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new
 * contract which implements GovernorBravoDelegateStorageV1 and following the naming convention
 * GovernorBravoDelegateStorageVX.
 */
contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {
  /// @notice The delay before voting on a proposal may take place, once proposed, in blocks
  uint256 public votingDelay;

  /// @notice The duration of voting on a proposal, in blocks
  uint256 public votingPeriod;

  /// @notice The number of votes required in order for a voter to become a proposer
  uint256 public proposalThreshold;

  /// @notice Initial proposal id set at become
  uint256 public initialProposalId;

  /// @notice The total number of proposals
  uint256 public proposalCount;

  /// @notice The address of the Moola Protocol Timelock
  TimelockInterface public timelock;

  /// @notice The address of the Moola governance token
  CompInterface public moo;

  /// @notice The official record of all proposals ever proposed
  mapping(uint256 => Proposal) public proposals;

  /// @notice The latest proposal for each proposer
  mapping(address => uint256) public latestProposalIds;

  struct Proposal {
    /// @notice Unique id for looking up a proposal
    uint256 id;
    /// @notice Creator of the proposal
    address proposer;
    /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
    uint256 eta;
    /// @notice the ordered list of target addresses for calls to be made
    address[] targets;
    /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
    uint256[] values;
    /// @notice The ordered list of function signatures to be called
    string[] signatures;
    /// @notice The ordered list of calldata to be passed to each call
    bytes[] calldatas;
    /// @notice The block at which voting begins: holders must delegate their votes prior to this block
    uint256 startBlock;
    /// @notice The block at which voting ends: votes must be cast prior to this block
    uint256 endBlock;
    /// @notice Current number of votes in favor of this proposal
    uint256 forVotes;
    /// @notice Current number of votes in opposition to this proposal
    uint256 againstVotes;
    /// @notice Current number of votes for abstaining for this proposal
    uint256 abstainVotes;
    /// @notice Flag marking whether the proposal has been canceled
    bool canceled;
    /// @notice Flag marking whether the proposal has been executed
    bool executed;
    /// @notice Receipts of ballots for the entire set of voters
    mapping(address => Receipt) receipts;
  }

  /// @notice Ballot receipt record for a voter
  struct Receipt {
    /// @notice Whether or not a vote has been cast
    bool hasVoted;
    /// @notice Whether or not the voter supports the proposal or abstains
    uint8 support;
    /// @notice The number of votes the voter had, which were cast
    uint96 votes;
  }

  /// @notice Possible states that a proposal may be in
  enum ProposalState {
    Pending,
    Active,
    Canceled,
    Defeated,
    Succeeded,
    Queued,
    Expired,
    Executed
  }
}

contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {
  /// @notice Stores the expiration of account whitelist status as a timestamp
  mapping(address => uint256) public whitelistAccountExpirations;

  /// @notice Address which manages whitelisted proposals and whitelist accounts
  address public whitelistGuardian;
}

interface TimelockInterface {
  function delay() external view returns (uint256);

  function GRACE_PERIOD() external view returns (uint256);

  function acceptAdmin() external;

  function queuedTransactions(bytes32 hash) external view returns (bool);

  function queueTransaction(
    address target,
    uint256 value,
    string calldata signature,
    bytes calldata data,
    uint256 eta
  ) external returns (bytes32);

  function cancelTransaction(
    address target,
    uint256 value,
    string calldata signature,
    bytes calldata data,
    uint256 eta
  ) external;

  function executeTransaction(
    address target,
    uint256 value,
    string calldata signature,
    bytes calldata data,
    uint256 eta
  ) external payable returns (bytes memory);
}

interface CompInterface {
  function getPriorVotes(address account, uint256 blockNumber)
    external
    view
    returns (uint96);
}

interface GovernorAlpha {
  /// @notice The total number of proposals
  function proposalCount() external returns (uint256);
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"timelock_","internalType":"address"},{"type":"address","name":"comp_","internalType":"address"},{"type":"address","name":"admin_","internalType":"address"},{"type":"address","name":"implementation_","internalType":"address"},{"type":"uint256","name":"votingPeriod_","internalType":"uint256"},{"type":"uint256","name":"votingDelay_","internalType":"uint256"},{"type":"uint256","name":"proposalThreshold_","internalType":"uint256"}]},{"type":"event","name":"NewAdmin","inputs":[{"type":"address","name":"oldAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NewImplementation","inputs":[{"type":"address","name":"oldImplementation","internalType":"address","indexed":false},{"type":"address","name":"newImplementation","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NewPendingAdmin","inputs":[{"type":"address","name":"oldPendingAdmin","internalType":"address","indexed":false},{"type":"address","name":"newPendingAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalCanceled","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalCreated","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false},{"type":"address","name":"proposer","internalType":"address","indexed":false},{"type":"address[]","name":"targets","internalType":"address[]","indexed":false},{"type":"uint256[]","name":"values","internalType":"uint256[]","indexed":false},{"type":"string[]","name":"signatures","internalType":"string[]","indexed":false},{"type":"bytes[]","name":"calldatas","internalType":"bytes[]","indexed":false},{"type":"uint256","name":"startBlock","internalType":"uint256","indexed":false},{"type":"uint256","name":"endBlock","internalType":"uint256","indexed":false},{"type":"string","name":"description","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalExecuted","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalQueued","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false},{"type":"uint256","name":"eta","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalThresholdSet","inputs":[{"type":"uint256","name":"oldProposalThreshold","internalType":"uint256","indexed":false},{"type":"uint256","name":"newProposalThreshold","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"VoteCast","inputs":[{"type":"address","name":"voter","internalType":"address","indexed":true},{"type":"uint256","name":"proposalId","internalType":"uint256","indexed":false},{"type":"uint8","name":"support","internalType":"uint8","indexed":false},{"type":"uint256","name":"votes","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"VotingDelaySet","inputs":[{"type":"uint256","name":"oldVotingDelay","internalType":"uint256","indexed":false},{"type":"uint256","name":"newVotingDelay","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"VotingPeriodSet","inputs":[{"type":"uint256","name":"oldVotingPeriod","internalType":"uint256","indexed":false},{"type":"uint256","name":"newVotingPeriod","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WhitelistAccountExpirationSet","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false},{"type":"uint256","name":"expiration","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WhitelistGuardianSet","inputs":[{"type":"address","name":"oldGuardian","internalType":"address","indexed":false},{"type":"address","name":"newGuardian","internalType":"address","indexed":false}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_setImplementation","inputs":[{"type":"address","name":"implementation_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"admin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"implementation","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingAdmin","inputs":[]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b506040516106cd3803806106cd83398101604081905261002f916102c2565b600080546001600160a01b031916331790556040516001600160a01b03888116602483015287166044820152606481018490526084810183905260a481018290526100ac90859060c40160408051601f198184030181529190526020810180516001600160e01b0390811663344fe42d60e21b179091526100e216565b6100b584610155565b5050600080546001600160a01b0319166001600160a01b0394909416939093179092555061036292505050565b600080836001600160a01b0316836040516100fd9190610333565b600060405180830381855af49150503d8060008114610138576040519150601f19603f3d011682016040523d82523d6000602084013e61013d565b606091505b5090925090508161014f573d60208201fd5b50505050565b6000546001600160a01b031633146101c85760405162461bcd60e51b815260206004820152603660248201526000805160206106ad83398151915260448201527f656d656e746174696f6e3a2061646d696e206f6e6c790000000000000000000060648201526084015b60405180910390fd5b6001600160a01b0381166102455760405162461bcd60e51b815260206004820152604a60248201526000805160206106ad83398151915260448201527f656d656e746174696f6e3a20696e76616c696420696d706c656d656e746174696064820152696f6e206164647265737360b01b608482015260a4016101bf565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a15050565b80516001600160a01b03811681146102bd57600080fd5b919050565b600080600080600080600060e0888a0312156102dd57600080fd5b6102e6886102a6565b96506102f4602089016102a6565b9550610302604089016102a6565b9450610310606089016102a6565b93506080880151925060a0880151915060c0880151905092959891949750929550565b6000825160005b81811015610354576020818601810151858301520161033a565b506000920191825250919050565b61033c806103716000396000f3fe60806040526004361061003f5760003560e01c806326782247146100bc5780635c60da1b146100f8578063bb913f4114610118578063f851a44014610138575b6002546040516000916001600160a01b03169061005f90839036906102c6565b600060405180830381855af49150503d806000811461009a576040519150601f19603f3d011682016040523d82523d6000602084013e61009f565b606091505b505090506040513d6000823e8180156100b6573d82f35b3d82fd5b005b3480156100c857600080fd5b506001546100dc906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561010457600080fd5b506002546100dc906001600160a01b031681565b34801561012457600080fd5b506100ba6101333660046102d6565b610158565b34801561014457600080fd5b506000546100dc906001600160a01b031681565b6000546001600160a01b031633146101d65760405162461bcd60e51b815260206004820152603660248201527f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c604482015275656d656e746174696f6e3a2061646d696e206f6e6c7960501b60648201526084015b60405180910390fd5b6001600160a01b0381166102655760405162461bcd60e51b815260206004820152604a60248201527f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c60448201527f656d656e746174696f6e3a20696e76616c696420696d706c656d656e746174696064820152696f6e206164647265737360b01b608482015260a4016101cd565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a15050565b8183823760009101908152919050565b6000602082840312156102e857600080fd5b81356001600160a01b03811681146102ff57600080fd5b939250505056fea26469706673582212206d68c65bf6d40a05f7c576ace353dae77662a1f814bee0f7ea39cc39d3d7ee0064736f6c63430008110033476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c00000000000000000000000096afb3c771f36001185d3ad0fea57b25f850df240000000000000000000000001b3d91a6f6a7beb0149bde9fa08785a741b09028000000000000000000000000007e71f8f069884d9dc3aa1f8d8e7fc112f370160000000000000000000000004bb7b74d7e6b03862dba0785e54e687c01ecffc800000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000

Deployed ByteCode

0x60806040526004361061003f5760003560e01c806326782247146100bc5780635c60da1b146100f8578063bb913f4114610118578063f851a44014610138575b6002546040516000916001600160a01b03169061005f90839036906102c6565b600060405180830381855af49150503d806000811461009a576040519150601f19603f3d011682016040523d82523d6000602084013e61009f565b606091505b505090506040513d6000823e8180156100b6573d82f35b3d82fd5b005b3480156100c857600080fd5b506001546100dc906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561010457600080fd5b506002546100dc906001600160a01b031681565b34801561012457600080fd5b506100ba6101333660046102d6565b610158565b34801561014457600080fd5b506000546100dc906001600160a01b031681565b6000546001600160a01b031633146101d65760405162461bcd60e51b815260206004820152603660248201527f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c604482015275656d656e746174696f6e3a2061646d696e206f6e6c7960501b60648201526084015b60405180910390fd5b6001600160a01b0381166102655760405162461bcd60e51b815260206004820152604a60248201527f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c60448201527f656d656e746174696f6e3a20696e76616c696420696d706c656d656e746174696064820152696f6e206164647265737360b01b608482015260a4016101cd565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a15050565b8183823760009101908152919050565b6000602082840312156102e857600080fd5b81356001600160a01b03811681146102ff57600080fd5b939250505056fea26469706673582212206d68c65bf6d40a05f7c576ace353dae77662a1f814bee0f7ea39cc39d3d7ee0064736f6c63430008110033