Contract 0x5835d6a367ded86dbc33ce796ed5013488d205c0 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xaa2e39ee64da642fe449c40ff006333b94d154f139cbc36eca065c9a1b4899e80x6040610479594842022-03-15 22:04:17198 days 17 hrs ago0x8286dc6df929c4bfa4f6951cab4dae2ec02d4d72 IN  Create: Vyper_contract0 ETH0.001630129468 ETH
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xc050f06e6b68f1a5fceb6e2689d2e7bb527d0f9894afc365c41a29fad527b3e679599742022-03-15 22:16:18198 days 16 hrs ago 0x98f6edf7a9f2f9d1e9e5e8b04747c910683e14fc 0x5835d6a367ded86dbc33ce796ed5013488d205c00 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.15

Optimization Enabled:
N/A

Other Settings:
, MIT license

Contract Source Code (Vyper language format)

# @version 0.2.15
"""
@title Token Minter
@author Hundred Finance
@license MIT
"""

interface LiquidityGauge:
    # Presumably, other gauges will provide the same interfaces
    def integrate_fraction(addr: address) -> uint256: view
    def user_checkpoint(addr: address) -> bool: nonpayable

interface MERC20:
    def mint(_to: address, _value: uint256) -> bool: nonpayable

interface GaugeController:
    def gauge_types(addr: address) -> int128: view


event Minted:
    recipient: indexed(address)
    gauge: address
    minted: uint256


treasury: public(address)
controller: public(address)

# user -> gauge -> value
minted: public(HashMap[address, HashMap[address, uint256]])

# minter -> user -> can mint?
allowed_to_mint_for: public(HashMap[address, HashMap[address, bool]])


@external
def __init__(_treasury: address, _controller: address):
    self.treasury = _treasury
    self.controller = _controller


@internal
def _mint_for(gauge_addr: address, _for: address):
    assert GaugeController(self.controller).gauge_types(gauge_addr) >= 0  # dev: gauge is not added

    LiquidityGauge(gauge_addr).user_checkpoint(_for)
    total_mint: uint256 = LiquidityGauge(gauge_addr).integrate_fraction(_for)
    to_mint: uint256 = total_mint - self.minted[_for][gauge_addr]

    if to_mint != 0:
        MERC20(self.treasury).mint(_for, to_mint)
        self.minted[_for][gauge_addr] = total_mint

        log Minted(_for, gauge_addr, total_mint)


@external
@nonreentrant('lock')
def mint(gauge_addr: address):
    """
    @notice Mint everything which belongs to `msg.sender` and send to them
    @param gauge_addr `LiquidityGauge` address to get mintable amount from
    """
    self._mint_for(gauge_addr, msg.sender)


@external
@nonreentrant('lock')
def mint_many(gauge_addrs: address[8]):
    """
    @notice Mint everything which belongs to `msg.sender` across multiple gauges
    @param gauge_addrs List of `LiquidityGauge` addresses
    """
    for i in range(8):
        if gauge_addrs[i] == ZERO_ADDRESS:
            break
        self._mint_for(gauge_addrs[i], msg.sender)


@external
@nonreentrant('lock')
def mint_for(gauge_addr: address, _for: address):
    """
    @notice Mint tokens for `_for`
    @dev Only possible when `msg.sender` has been approved via `toggle_approve_mint`
    @param gauge_addr `LiquidityGauge` address to get mintable amount from
    @param _for Address to mint to
    """
    if self.allowed_to_mint_for[msg.sender][_for]:
        self._mint_for(gauge_addr, _for)


@external
def toggle_approve_mint(minting_user: address):
    """
    @notice allow `minting_user` to mint for `msg.sender`
    @param minting_user Address to toggle permission for
    """
    self.allowed_to_mint_for[minting_user][msg.sender] = not self.allowed_to_mint_for[minting_user][msg.sender]

Contract ABI

[{"name":"Minted","inputs":[{"name":"recipient","type":"address","indexed":true},{"name":"gauge","type":"address","indexed":false},{"name":"minted","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_treasury","type":"address"},{"name":"_controller","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"gauge_addr","type":"address"}],"outputs":[],"gas":112051},{"stateMutability":"nonpayable","type":"function","name":"mint_many","inputs":[{"name":"gauge_addrs","type":"address[8]"}],"outputs":[],"gas":495727},{"stateMutability":"nonpayable","type":"function","name":"mint_for","inputs":[{"name":"gauge_addr","type":"address"},{"name":"_for","type":"address"}],"outputs":[],"gas":114593},{"stateMutability":"nonpayable","type":"function","name":"toggle_approve_mint","inputs":[{"name":"minting_user","type":"address"}],"outputs":[],"gas":37994},{"stateMutability":"view","type":"function","name":"treasury","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2508},{"stateMutability":"view","type":"function","name":"controller","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2538},{"stateMutability":"view","type":"function","name":"minted","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":2998},{"stateMutability":"view","type":"function","name":"allowed_to_mint_for","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":3028}]

60406104c56101403960206104c560c03960c05160a01c6104c057602060206104c50160c03960c05160a01c6104c05761014051600355610160516004556104a856600436101561000d576102b8565b600035601c526000513461046157636a6278428114156100645760005461046157600160005560043560a01c610461576004356101405233610160526101605161014051600658016102be565b6000506000600055005b63a51e190481141561012b576001546104615760016001556000610120525b610120516004013560a01c6104615760206101205101610120526101006101205110156100af57610083565b61014060006008818352015b60046101405160088110156104615760200201356100d857610122565b6101405160046101405160088110156104615760200201356101605233610180526101805161016051600658016102be565b610140526000505b81516001018083528114156100bb575b50506000600155005b6327f18ae38114156101a35760025461046157600160025560043560a01c6104615760243560a01c6104615760063360e05260c052604060c02060243560e05260c052604060c020541561019c5760043561014052602435610160526101605161014051600658016102be565b6000505b6000600255005b63dd289d608114156101f65760043560a01c61046157600660043560e05260c052604060c0203360e05260c052604060c0205415600660043560e05260c052604060c0203360e05260c052604060c02055005b6361d027b381141561020e5760035460005260206000f35b63f77c47918114156102265760045460005260206000f35b638b752bb081141561026e5760043560a01c6104615760243560a01c61046157600560043560e05260c052604060c02060243560e05260c052604060c0205460005260206000f35b63a09900338114156102b65760043560a01c6104615760243560a01c61046157600660043560e05260c052604060c02060243560e05260c052604060c0205460005260206000f35b505b60006000fd5b610180526101405261016052600060206102206024633f9095b76101a052610140516101c0526101bc6004545afa1561046157601f3d11156104615760005061022051126104615760206102206024634b8200936101a052610160516101c0526101bc6000610140515af11561046157601f3d111561046157600050610220506020610240602463094007076101c052610160516101e0526101dc610140515afa1561046157601f3d111561046157600050610240516101a0526101a05160056101605160e05260c052604060c0206101405160e05260c052604060c0205480821061046157808203905090506101c05260006101c051181561045b57602061028060446340c10f196101e05261016051610200526101c051610220526101fc60006003545af11561046157601f3d111561046157600050610280506101a05160056101605160e05260c052604060c0206101405160e05260c052604060c02055610140516101e0526101a05161020052610160517f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f060406101e0a25b61018051565b600080fd5b6100426104a8036100426000396100426104a8036000f35b600080fd0000000000000000000000006a0e5dd021db29b5869630c4cbcb5b6e7a7b3ed6000000000000000000000000b9b4e69925bcdf4ff0cb3805cfcf477bbc5d3ef8

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000006a0e5dd021db29b5869630c4cbcb5b6e7a7b3ed6000000000000000000000000b9b4e69925bcdf4ff0cb3805cfcf477bbc5d3ef8

-----Decoded View---------------
Arg [0] : _treasury (address): 0x6a0e5dd021db29b5869630c4cbcb5b6e7a7b3ed6
Arg [1] : _controller (address): 0xb9b4e69925bcdf4ff0cb3805cfcf477bbc5d3ef8

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000006a0e5dd021db29b5869630c4cbcb5b6e7a7b3ed6
Arg [1] : 000000000000000000000000b9b4e69925bcdf4ff0cb3805cfcf477bbc5d3ef8


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.