S Price: $0.60623 (+0.07%)

Contract

0xA588Cf5e85851f8234AA89DA0aBe7D3DE2Adfa30

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x0094Ad02...8B15fe0E5
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Minter

Compiler Version
vyper:0.3.10

Optimization Enabled:
N/A

Other Settings:
default evmVersion, MIT license

Contract Source Code (Vyper language format)

# @version 0.3.10
"""
@title Minter
@license MIT
@author Curve Finance
"""

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

interface Gauge:
    def user_checkpoint(_user: address) -> bool: nonpayable
    def integrate_fraction(_user: address) -> uint256: view

interface GaugeTypeOracle:
    def get_gauge_type(_gauge: address) -> uint256: view


event Minted:
    receiver: indexed(address)
    gauge: indexed(address)
    amount: uint256


N_GAUGES: constant(uint256) = 64


TOKEN: public(immutable(address))
GAUGE_TYPE_ORACLE: public(immutable(address))
NETWORK_TYPE_ID: public(immutable(uint256))


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


@external
def __init__(_token: address, _gauge_type_oracle: address, _network_type_id: uint256):
    TOKEN = _token
    GAUGE_TYPE_ORACLE = _gauge_type_oracle
    NETWORK_TYPE_ID = _network_type_id


@internal
def _mint(_gauge: address, _for: address):
    assert GaugeTypeOracle(GAUGE_TYPE_ORACLE).get_gauge_type(_gauge) == NETWORK_TYPE_ID  # dev: not permitted

    Gauge(_gauge).user_checkpoint(_for)
    total: uint256 = Gauge(_gauge).integrate_fraction(_for)
    dx: uint256 = total - self.minted[_for][_gauge]

    if dx != 0:
        self.minted[_for][_gauge] = total
        ERC20(TOKEN).mint(_for, dx)

        log Minted(_for, _gauge, total)


@external
@nonreentrant('lock')
def mint(_gauge: address, _for: address = msg.sender):
    """
    @notice Mint all tokens earned by `_for` in the gauge `_gauge`.
    """
    self._mint(_gauge, _for)


@external
@nonreentrant('lock')
def mint_many(_gauges: DynArray[address, N_GAUGES], _for: address = msg.sender):
    """
    @notice Mint all tokens earned by `_for` in the gauges `_gauges`.
    """
    for gauge in _gauges:
        self._mint(gauge, _for)

Contract Security Audit

Contract ABI

[{"name":"Minted","inputs":[{"name":"receiver","type":"address","indexed":true},{"name":"gauge","type":"address","indexed":true},{"name":"amount","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_token","type":"address"},{"name":"_gauge_type_oracle","type":"address"},{"name":"_network_type_id","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"_gauge","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"_gauge","type":"address"},{"name":"_for","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint_many","inputs":[{"name":"_gauges","type":"address[]"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint_many","inputs":[{"name":"_gauges","type":"address[]"},{"name":"_for","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"TOKEN","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"GAUGE_TYPE_ORACLE","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"NETWORK_TYPE_ID","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"minted","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]}]

Deployed Bytecode

0x5f3560e01c60026007820660011b6103f201601e395f51565b6382bfefc8811861003657346103ee57602061040060403960206040f35b634470ccf58118610244576044361034176103ee57336109605261019a56610244565b630c715165811861007757346103ee57602061042060403960206040f35b63ee1fe2ad8118610244576044361034176103ee576024358060a01c6103ee57610160525b6004358060a01c6103ee57610140525f546002146103ee5760025f5561014051604052610160516060526100ce610248565b60035f5500610244565b631ef7cf21811861024457346103ee57602061044060403960206040f3610244565b638b752bb08118610244576044361034176103ee576004358060a01c6103ee576040526024358060a01c6103ee5760605260016040516020525f5260405f20806060516020525f5260405f2090505460805260206080f3610244565b636a6278428118610175576024361034176103ee57336101605261009c565b63063f3a248118610244576064361034176103ee576024358060a01c6103ee57610960525b60043560040160408135116103ee5780355f81604081116103ee5780156101e357905b8060051b6020850101358060a01c6103ee578160051b61016001526001018181186101bd575b5050806101405250505f546002146103ee5760025f555f61014051604081116103ee57801561023c57905b8060051b6101600151610980526109805160405261096051606052610231610248565b60010181811861020e575b505060035f55005b5f5ffd5b60206104405f395f5160206104205f395f516325fa5d1360805260405160a052602060806024609c845afa61027f573d5f5f3e3d5ffd5b60203d106103ee576080905051186103ee57604051634b82009360805260605160a052602060806024609c5f855af16102ba573d5f5f3e3d5ffd5b60203d106103ee576080518060011c6103ee5760c05260c05050604051630940070760a05260605160c052602060a0602460bc845afa6102fc573d5f5f3e3d5ffd5b60203d106103ee5760a090505160805260805160016060516020525f5260405f20806040516020525f5260405f209050548082038281116103ee579050905060a05260a051156103ec5760805160016060516020525f5260405f20806040516020525f5260405f2090505560206104005f395f516340c10f1960c05260605160e05260a05161010052602060c0604460dc5f855af161039d573d5f5f3e3d5ffd5b60203d106103ee5760c0518060011c6103ee576101205261012050506040516060517f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f060805160c052602060c0a35b565b5f80fd00fa0156001802440244005900d800000000000000000000000009f8d940ead55853c51045bcbfe67341b686c07100000000000000000000000074d6aabd6197e83d963f0b48be9c034f93e8e66d0000000000000000000000000000000000000000000000000000000000000003

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.