Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0xebA06639750BADcDf5EE100D72F3C93f2D1918A7
Balance 0 ETH
Nonce 1
Code Size 3732 bytes
Indexed Transactions 0 (1 on-chain, 1.4% indexed)
External Etherscan · Sourcify

Contract Bytecode

3732 bytes
0x6080604052600436106100c25760003560e01c80639fd6db121161007f578063da682aeb11610059578063da682aeb146100f3578063df8de3e71461022c578063f2fde38b1461025f578063f48c305414610292576100c2565b80639fd6db12146101ba578063a0712d68146101cf578063c4d66de8146101f9576100c2565b806342966c68146100c75780634a393149146100f3578063715018a61461014a5780637e5cd5c11461015f5780638da5cb5b146101745780638f0c1cc7146101a5575b600080fd5b3480156100d357600080fd5b506100f1600480360360208110156100ea57600080fd5b50356102b8565b005b3480156100ff57600080fd5b506101366004803603606081101561011657600080fd5b506001600160a01b03813581169160208101359091169060400135610434565b604080519115158252519081900360200190f35b34801561015657600080fd5b506100f1610496565b34801561016b57600080fd5b506100f1610538565b34801561018057600080fd5b5061018961059f565b604080516001600160a01b039092168252519081900360200190f35b3480156101b157600080fd5b506101896105ae565b3480156101c657600080fd5b506101366105bd565b3480156101db57600080fd5b506100f1600480360360208110156101f257600080fd5b50356105cd565b34801561020557600080fd5b506100f16004803603602081101561021c57600080fd5b50356001600160a01b0316610746565b34801561023857600080fd5b506100f16004803603602081101561024f57600080fd5b50356001600160a01b031661081b565b34801561026b57600080fd5b506100f16004803603602081101561028257600080fd5b50356001600160a01b0316610a18565b610136600480360360208110156102a857600080fd5b50356001600160a01b0316610b11565b6102c0610b71565b6033546001600160a01b03908116911614610310576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b606554600160a01b900460ff161515600114610366576040805162461bcd60e51b815260206004820152601060248201526f1b5a5b9d1a5b99c8191a5cd8589b195960821b604482015290519081900360640190fd5b6065546001600160a01b031663d3ce77fe61037f61059f565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156103c657600080fd5b505af11580156103da573d6000803e3d6000fd5b505050506040513d60208110156103f057600080fd5b5051610431576040805162461bcd60e51b815260206004820152600b60248201526a189d5c9b8819985a5b195960aa1b604482015290519081900360640190fd5b50565b6065546000906001600160a01b0316331461048c576040805162461bcd60e51b81526020600482015260136024820152722a26afa1a0a62622a92fa727aa2faa27a5a2a760691b604482015290519081900360640190fd5b5060019392505050565b61049e610b71565b6033546001600160a01b039081169116146104ee576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b610540610b71565b6033546001600160a01b03908116911614610590576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b6065805460ff60a01b19169055565b6033546001600160a01b031690565b6065546001600160a01b031681565b606554600160a01b900460ff1681565b6105d5610b71565b6033546001600160a01b03908116911614610625576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b606554600160a01b900460ff16151560011461067b576040805162461bcd60e51b815260206004820152601060248201526f1b5a5b9d1a5b99c8191a5cd8589b195960821b604482015290519081900360640190fd5b6065546001600160a01b031663827f32c061069461059f565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156106db57600080fd5b505af11580156106ef573d6000803e3d6000fd5b505050506040513d602081101561070557600080fd5b5051610431576040805162461bcd60e51b815260206004820152600b60248201526a1b5a5b9d0819985a5b195960aa1b604482015290519081900360640190fd5b600054610100900460ff168061075f575061075f610b75565b8061076d575060005460ff16155b6107a85760405162461bcd60e51b815260040180806020018281038252602e815260200180610dec602e913960400191505060405180910390fd5b600054610100900460ff161580156107d3576000805460ff1961ff0019909116610100171660011790555b6107db610b7b565b60658054600160a01b6001600160a01b03199091166001600160a01b0385161760ff60a01b19161790558015610817576000805461ff00191690555b5050565b610823610b71565b6033546001600160a01b03908116911614610873576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b6065546040805163df8de3e760e01b81526001600160a01b0384811660048301529151919092169163df8de3e791602480830192600092919082900301818387803b1580156108c157600080fd5b505af11580156108d5573d6000803e3d6000fd5b50505050806001600160a01b031663a9059cbb6108f061059f565b604080516370a0823160e01b815230600482015290516001600160a01b038616916370a08231916024808301926020929190829003018186803b15801561093657600080fd5b505afa15801561094a573d6000803e3d6000fd5b505050506040513d602081101561096057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156109b157600080fd5b505af11580156109c5573d6000803e3d6000fd5b505050506040513d60208110156109db57600080fd5b50516104315760405162461bcd60e51b8152600401808060200182810382526025815260200180610e3a6025913960400191505060405180910390fd5b610a20610b71565b6033546001600160a01b03908116911614610a70576040805162461bcd60e51b81526020600482018190526024820152600080516020610e1a833981519152604482015290519081900360640190fd5b6001600160a01b038116610ab55760405162461bcd60e51b8152600401808060200182810382526026815260200180610dc66026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6065546000906001600160a01b03163314610b69576040805162461bcd60e51b81526020600482015260136024820152722a26afa1a0a62622a92fa727aa2faa27a5a2a760691b604482015290519081900360640190fd5b506000919050565b3390565b303b1590565b600054610100900460ff1680610b945750610b94610b75565b80610ba2575060005460ff16155b610bdd5760405162461bcd60e51b815260040180806020018281038252602e815260200180610dec602e913960400191505060405180910390fd5b600054610100900460ff16158015610c08576000805460ff1961ff0019909116610100171660011790555b610c10610c2c565b610c18610ccc565b8015610431576000805461ff001916905550565b600054610100900460ff1680610c455750610c45610b75565b80610c53575060005460ff16155b610c8e5760405162461bcd60e51b815260040180806020018281038252602e815260200180610dec602e913960400191505060405180910390fd5b600054610100900460ff16158015610c18576000805460ff1961ff0019909116610100171660011790558015610431576000805461ff001916905550565b600054610100900460ff1680610ce55750610ce5610b75565b80610cf3575060005460ff16155b610d2e5760405162461bcd60e51b815260040180806020018281038252602e815260200180610dec602e913960400191505060405180910390fd5b600054610100900460ff16158015610d59576000805460ff1961ff0019909116610100171660011790555b6000610d63610b71565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610431576000805461ff00191690555056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572636c61696d20746f6b656e73207472616e7366657220746f206f776e6572206661696c6564a2646970667358221220f7107d3a7ef43ddffa21831ad8e0fb7788cd4b6b5fc91dc01952eab05f08f2ac64736f6c634300060c0033

Verified Source Code Full Match

Compiler: v0.6.12+commit.27d51765 EVM: istanbul Optimization: Yes (200 runs)
1_Storage.sol 395 lines
// Sources flattened with hardhat v2.6.0 https://hardhat.org

// File deps/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.4.24 <0.7.0;


/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 * 
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 * 
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        // solhint-disable-next-line no-inline-assembly
        assembly { cs := extcodesize(self) }
        return cs == 0;
    }
}


// File deps/@openzeppelin/contracts-upgradeable/GSN/ContextUpgradeable.sol



pragma solidity ^0.6.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}


// File deps/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol



pragma solidity ^0.6.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}


// File interfaces/badger/IMiniMe.sol




pragma solidity >=0.5.0 <0.8.0;

interface IMiniMe {
    event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);
    event Transfer(address indexed _from, address indexed _to, uint256 _amount);
    event NewCloneToken(address indexed _cloneToken, uint256 _snapshotBlock);
    event Approval(address indexed _owner, address indexed _spender, uint256 _amount);

    function claimTokens(address _token) external;

    function controller() external view returns (address);

    function enableTransfers(bool _transfersEnabled) external;

    function generateTokens(address _owner, uint256 _amount) external returns (bool);

    function destroyTokens(address _owner, uint256 _amount) external returns (bool);

    function changeController(address _newController) external returns (address);
}


// File interfaces/erc20/IERC20.sol



pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

interface ITokenController {
    /// @notice Called when `_owner` sends ether to the MiniMe Token contract
    /// @param _owner The address that sent the ether to create tokens
    /// @return True if the ether is accepted, false if it throws
    function proxyPayment(address _owner) external payable returns(bool);

    /// @notice Notifies the controller about a token transfer allowing the
    ///  controller to react if desired
    /// @param _from The origin of the transfer
    /// @param _to The destination of the transfer
    /// @param _amount The amount of the transfer
    /// @return False if the controller does not authorize the transfer
    function onTransfer(address _from, address _to, uint _amount) external returns(bool);

    /// @notice Notifies the controller about an approval allowing the
    ///  controller to react if desired
    /// @param _owner The address that calls `approve()`
    /// @param _spender The spender in the `approve()` call
    /// @param _amount The amount in the `approve()` call
    /// @return False if the controller does not authorize the approval
    function onApprove(address _owner, address _spender, uint _amount) external returns(bool);
}


// File contracts/badger-core/GatedMiniMeController.sol

pragma solidity 0.6.12;

/*
    === Gated MiniMe Controller ===
    Limits the functinality of the MiniMe controller address by serving as an intermediate contract.

    The owner maintains the ability to mint and burn tokens from it's own balance, losing the ability to mint and burn to/from arbitrary accounts.
    The MiniMe controller can no longer be changed.
    The owner maintains the ability to claim other tokens sent to the MiniMe contract.

    This contract is designed to be upgradeable, this ability can be removed by transferring the proxyAdmin to 0x0.
    Minting and burning can be permanently removed by the disableMinting() function.

    claimTokens() is designed to be retained. It ability can be removed (along with minting and burning), by burning the owner() address.
*/
contract GatedMiniMeController is OwnableUpgradeable {
    IMiniMe public minime;
    bool public mintingEnabled;
    function initialize(address token_) external initializer {
        __Ownable_init();
        minime = IMiniMe(token_);
        mintingEnabled = true;
    }

    modifier onlyWhenMintingEnabled() {
        require(mintingEnabled == true, "minting disabled");
        _;
    }

    modifier onlyToken() {
        require(msg.sender == address(minime), "TM_CALLER_NOT_TOKEN");
        _;
    }

    /// @dev Minting and burning can be permanently disabled by the owner
    function disableMinting() external onlyOwner {
        mintingEnabled = false;
    }

    /// @dev Mint tokens to governance
    function mint(uint256 amount) external onlyOwner onlyWhenMintingEnabled {
        require(minime.generateTokens(owner(), amount), "mint failed");
    }
    
    /// @dev Burn tokens from governance
    function burn(uint256 amount) external onlyOwner onlyWhenMintingEnabled {
        require(minime.destroyTokens(owner(), amount), "burn failed");
    }

    function onTransfer(address, address, uint256) external onlyToken returns (bool) {
        return true;
    }

    /**
    * @dev Notifies the controller about an approval allowing the controller to react if desired
    *      Initialization check is implicitly provided by `onlyToken()`.
    * @return False if the controller does not authorize the approval
    */
    function onApprove(address, address, uint) external onlyToken returns (bool) {
        return true;
    }

    /**
    * @dev Called when ether is sent to the MiniMe Token contract
    *      Initialization check is implicitly provided by `onlyToken()`.
    * @return True if the ether is accepted, false for it to throw
    */
    function proxyPayment(address) external payable onlyToken returns (bool) {
        return false;
    }

    /// @dev Claim other tokens
    function claimTokens(address token) external onlyOwner {
        minime.claimTokens(token);
        require(IERC20(token).transfer(owner(), IERC20(token).balanceOf(address(this))), "claim tokens transfer to owner failed");
    }
}

Read Contract

minime 0x8f0c1cc7 → address
mintingEnabled 0x9fd6db12 → bool
owner 0x8da5cb5b → address

Write Contract 10 functions

These functions modify contract state and require a wallet transaction to execute.

burn 0x42966c68
uint256 amount
claimTokens 0xdf8de3e7
address token
disableMinting 0x7e5cd5c1
No parameters
initialize 0xc4d66de8
address token_
mint 0xa0712d68
uint256 amount
onApprove 0xda682aeb
address
address
uint256
returns: bool
onTransfer 0x4a393149
address
address
uint256
returns: bool
proxyPayment 0xf48c3054
address
returns: bool
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

This address has 1 on-chain transactions, but only 1.4% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →