FRAX Price: $1.03 (+6.53%)
Gas: 1 Gwei

Contract

0x070EBC9F46d0a6A523D31eb4aE7901C56AD97ae2

Overview

FRAX Balance | FXTL Balance

0 FRAX | 58,824 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Withdraw309642432026-01-18 12:26:376 days ago1768739197IN
0x070EBC9F...56AD97ae2
0 FRAX0.000002770.00100025
Withdraw293061362025-12-11 3:16:2344 days ago1765422983IN
0x070EBC9F...56AD97ae2
0 FRAX0.000011720.00100027
Withdraw290227302025-12-04 13:49:3151 days ago1764856171IN
0x070EBC9F...56AD97ae2
0 FRAX0.000003650.001
Deposit280212182025-11-11 9:25:4774 days ago1762853147IN
0x070EBC9F...56AD97ae2
0 FRAX0.000013830.00100025
Withdraw277582462025-11-05 7:20:0380 days ago1762327203IN
0x070EBC9F...56AD97ae2
0 FRAX0.000026030.00100171
Withdraw273630032025-10-27 3:45:1789 days ago1761536717IN
0x070EBC9F...56AD97ae2
0 FRAX0.000009290.00110096
Withdraw270154382025-10-19 2:39:4797 days ago1760841587IN
0x070EBC9F...56AD97ae2
0 FRAX0.000008130.00109923
Withdraw267850502025-10-13 18:40:11103 days ago1760380811IN
0x070EBC9F...56AD97ae2
0 FRAX0.000048180.00100025
Withdraw267850292025-10-13 18:39:29103 days ago1760380769IN
0x070EBC9F...56AD97ae2
0 FRAX0.000049070.00100025
Deposit266777152025-10-11 7:02:21105 days ago1760166141IN
0x070EBC9F...56AD97ae2
0 FRAX0.000080510.0015
Withdraw261727542025-09-29 14:30:19117 days ago1759156219IN
0x070EBC9F...56AD97ae2
0 FRAX0.000899520.00119925
Withdraw250497232025-09-03 14:35:57143 days ago1756910157IN
0x070EBC9F...56AD97ae2
0 FRAX0.000335431.00000025
Withdraw247928952025-08-28 15:55:01149 days ago1756396501IN
0x070EBC9F...56AD97ae2
0 FRAX0.000106840.0012
Withdraw245510002025-08-23 1:31:51154 days ago1755912711IN
0x070EBC9F...56AD97ae2
0 FRAX0.000030130.0015
Withdraw239934172025-08-10 3:45:45167 days ago1754797545IN
0x070EBC9F...56AD97ae2
0 FRAX0.000029840.001125
Withdraw239438872025-08-09 0:14:45168 days ago1754698485IN
0x070EBC9F...56AD97ae2
0 FRAX0.000020010.00100025
Withdraw238461032025-08-06 17:55:17171 days ago1754502917IN
0x070EBC9F...56AD97ae2
0 FRAX0.000051180.001
Withdraw238374352025-08-06 13:06:21171 days ago1754485581IN
0x070EBC9F...56AD97ae2
0 FRAX0.000034240.00100025
Withdraw235820052025-07-31 15:12:01177 days ago1753974721IN
0x070EBC9F...56AD97ae2
0 FRAX0.000436630.0015
Withdraw231247902025-07-21 1:11:31187 days ago1753060291IN
0x070EBC9F...56AD97ae2
0 FRAX0.000053780.00100025
Withdraw231247542025-07-21 1:10:19187 days ago1753060219IN
0x070EBC9F...56AD97ae2
0 FRAX0.00004530.00100025
Withdraw230599882025-07-19 13:11:27189 days ago1752930687IN
0x070EBC9F...56AD97ae2
0 FRAX0.000081970.00110025
Withdraw227079562025-07-11 9:37:03197 days ago1752226623IN
0x070EBC9F...56AD97ae2
0 FRAX0.000302470.00110025
Withdraw227011852025-07-11 5:51:21197 days ago1752213081IN
0x070EBC9F...56AD97ae2
0 FRAX0.00054660.00100025
Withdraw226936742025-07-11 1:40:59197 days ago1752198059IN
0x070EBC9F...56AD97ae2
0 FRAX0.000148960.00100025
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
312423682026-01-24 22:57:273 mins ago1769295447
0x070EBC9F...56AD97ae2
0 FRAX
View All Internal Transactions

Latest 25 Deposits

L2 Txn Hash L1 Deposit Txn Value Token
0xada81a63a6b69b072ec240de25370aa897a2c26bad5f7e6ca1982e8d2f299d312026-01-22 0:06:532 days ago176904041324.805998868805571139 Curve DAO To... (CRV)
0xe2828f6bcd03abfe046981aabaf847953c76213ec622c2ad2dc9b6371918662d2026-01-15 0:06:479 days ago176843560724.804422085970917412 Curve DAO To... (CRV)
0x6d6be8f8b5921d6027e9f924eaf10fba36b2e01cbfde546e5a0e8fdc7e49cde62026-01-08 0:07:3916 days ago17678308591,202.79855380782046907 Curve DAO To... (CRV)
0x6b15b24e4dd5413d87b1f3c544ed5ea9ab071e035ed7879facbdbd3fff0232f12026-01-01 0:07:0323 days ago17672260231,202.574078437273489514 Curve DAO To... (CRV)
0x213a2e88f78010002a15feadab4b5d3055061c98eb84ddfab9a8169be19f49d32025-12-25 0:06:3730 days ago17666211971,415.186514315818443392 Curve DAO To... (CRV)
0x4bf20fdf76ae7f7a5d68803556b5e3282a1f41d1eb4bb9f3275572f6260571892025-12-18 1:06:3737 days ago17660199971,415.504936677670900389 Curve DAO To... (CRV)
0x83e668348c46e4587a5755af2552f64cd2a7f78cc7a9465bd988e2a9236c18c02025-12-11 0:09:4744 days ago17654117871,177.985328723146452065 Curve DAO To... (CRV)
0x97717f281f8f408fa16a6b2df09b42925fc4ca46e374f0c22d8335902155ab472025-12-04 0:29:5151 days ago17648081911,177.63729994569994143 Curve DAO To... (CRV)
0x73490ec47d25e96d09163cdb849f3422a8ebd8509dacfa577ff0282adebc74b72025-11-27 0:17:0358 days ago17642026231,293.350336906295125341 Curve DAO To... (CRV)
0xbc88755009b2c6e403fe33dafd440d2088e3cae48711771554cba81415f6f4222025-11-20 0:07:0165 days ago17635972211,293.038775141965268678 Curve DAO To... (CRV)
0x5811dea220d694024bfe0ed665f49e7c7fdff76f7b259e9e00687bc171aaee8b2025-11-13 0:07:3372 days ago17629924531,291.220005106912596616 Curve DAO To... (CRV)
0xb669ff70e4de3b3b853b33ef69fc89ba389b87cfcafc6d42cb69412aed71cbbc2025-11-06 0:08:4979 days ago17623877291,291.386765036116168534 Curve DAO To... (CRV)
0x5cfe297786de89c816bf8f7d15198ebf0020450ab081c6eb7c4bee3052a8b6862025-10-30 0:08:2186 days ago17617829011,783.156850797868214747 Curve DAO To... (CRV)
0x6b51eda0694dfb447fa3e201eacd28800602ee2bf5c722c3a69418c8f449b43d2025-10-23 0:15:4593 days ago17611785451,782.547515515906538164 Curve DAO To... (CRV)
0x1d5dbdf0ce264195c1c45ad490e39d7056fc9c41bfce02f59a581686f541826b2025-10-16 0:06:39100 days ago17605731992,141.644950984563960977 Curve DAO To... (CRV)
0xef59c0f16ee8b1a430a084f7b57e45a51bfbcb56a65e0f2fe3b6bf42b94cea5f2025-10-09 0:05:35107 days ago17599683352,141.498894601037404547 Curve DAO To... (CRV)
0x20e46e8ec3d997e32a42287247431e375bda943acf490532f22c4372b4ca08bd2025-10-02 0:10:15114 days ago17593638152,371.268472905965666134 Curve DAO To... (CRV)
0x917f17181a026050eb52e5aa37a39a301283903e17ffdb4ca57816e9d29ae7792025-09-25 0:12:59121 days ago17587591792,371.808010774088451905 Curve DAO To... (CRV)
0xe5edd77d81fda1a43b785623e7c8f9d6fe445923e03d39121c024e56b18d601d2025-09-18 0:06:59128 days ago17581540192,121.883431877057964604 Curve DAO To... (CRV)
0x808e479f074a570aab6abcb487058e9ad59837afc84e69acef210d8b2941c8972025-09-11 0:05:43135 days ago17575491432,122.517805899620174194 Curve DAO To... (CRV)
0xeadd2508e485226301a18bc71322a5aff4d3afb13292ce2aa8bd8572c0efed3c2025-09-04 0:07:23142 days ago17569444432,475.235561277665021598 Curve DAO To... (CRV)
0xbf06cfbc8dd2765058d4232bfc2ec731474da2523f48a4bd108494a9a9944e432025-08-28 0:08:31149 days ago17563397112,473.097390063054339007 Curve DAO To... (CRV)
0xfb46d2953e653ddee352b4c81ae5634ae53a7cfbe707369efca283797580003e2025-08-21 0:06:03156 days ago17557347632,112.020259675904031622 Curve DAO To... (CRV)
0x7d29d8d91a86bb184f0c6fbbc4075ff2e3efc0c5fa649a3c6acbf73bf4ad0f1d2025-08-14 0:08:45163 days ago17551301252,451.30292531527023454 Curve DAO To... (CRV)
0x2abb5ea3ccc2e7181d4b5192e87b151e6d1c349d642355cc9dfa04b2000421e92025-08-07 0:10:25170 days ago17545254254,045.927196518935867472 Curve DAO To... (CRV)
View All Deposits

Cross-Chain Transactions
Loading...
Loading

Minimal Proxy Contract for 0x10ac65a9f710c3d607d213784e5b8632c77d5d4f

Contract Name:
Child Liquidity Gauge

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
berlin EvmVersion, None license

Contract Source Code (Vyper language format)

# @version 0.3.1
"""
@title Child Liquidity Gauge
@license MIT
@author Curve Finance
"""
from vyper.interfaces import ERC20

implements: ERC20


interface ERC20Extended:
    def symbol() -> String[26]: view

interface Factory:
    def owner() -> address: view
    def voting_escrow() -> address: view

interface Minter:
    def minted(_user: address, _gauge: address) -> uint256: view

interface ERC1271:
    def isValidSignature(_hash: bytes32, _signature: Bytes[65]) -> bytes32: view


event Approval:
    _owner: indexed(address)
    _spender: indexed(address)
    _value: uint256

event Transfer:
    _from: indexed(address)
    _to: indexed(address)
    _value: uint256

event Deposit:
    _user: indexed(address)
    _value: uint256

event Withdraw:
    _user: indexed(address)
    _value: uint256

event UpdateLiquidityLimit:
    _user: indexed(address)
    _original_balance: uint256
    _original_supply: uint256
    _working_balance: uint256
    _working_supply: uint256


struct Reward:
    distributor: address
    period_finish: uint256
    rate: uint256
    last_update: uint256
    integral: uint256


DOMAIN_TYPE_HASH: constant(bytes32) = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
PERMIT_TYPE_HASH: constant(bytes32) = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")
ERC1271_MAGIC_VAL: constant(bytes32) = 0x1626ba7e00000000000000000000000000000000000000000000000000000000

MAX_REWARDS: constant(uint256) = 8
TOKENLESS_PRODUCTION: constant(uint256) = 40
WEEK: constant(uint256) = 86400 * 7
VERSION: constant(String[8]) = "v0.1.0"


CRV: immutable(address)
FACTORY: immutable(address)


DOMAIN_SEPARATOR: public(bytes32)
nonces: public(HashMap[address, uint256])

name: public(String[64])
symbol: public(String[32])

allowance: public(HashMap[address, HashMap[address, uint256]])
balanceOf: public(HashMap[address, uint256])
totalSupply: public(uint256)

lp_token: public(address)
manager: public(address)

voting_escrow: public(address)
working_balances: public(HashMap[address, uint256])
working_supply: public(uint256)

period: public(uint256)
period_timestamp: public(HashMap[uint256, uint256])

integrate_checkpoint_of: public(HashMap[address, uint256])
integrate_fraction: public(HashMap[address, uint256])
integrate_inv_supply: public(HashMap[uint256, uint256])
integrate_inv_supply_of: public(HashMap[address, uint256])

# For tracking external rewards
reward_count: public(uint256)
reward_tokens: public(address[MAX_REWARDS])
reward_data: public(HashMap[address, Reward])
# claimant -> default reward receiver
rewards_receiver: public(HashMap[address, address])
# reward token -> claiming address -> integral
reward_integral_for: public(HashMap[address, HashMap[address, uint256]])
# user -> token -> [uint128 claimable amount][uint128 claimed amount]
claim_data: HashMap[address, HashMap[address, uint256]]

is_killed: public(bool)
inflation_rate: public(HashMap[uint256, uint256])


@external
def __init__(_crv_token: address, _factory: address):
    self.lp_token = 0x000000000000000000000000000000000000dEaD

    CRV = _crv_token
    FACTORY = _factory


@internal
def _checkpoint(_user: address):
    """
    @notice Checkpoint a user calculating their CRV entitlement
    @param _user User address
    """
    period: uint256 = self.period
    period_time: uint256 = self.period_timestamp[period]
    integrate_inv_supply: uint256 = self.integrate_inv_supply[period]

    if block.timestamp > period_time:

        working_supply: uint256 = self.working_supply
        prev_week_time: uint256 = period_time
        week_time: uint256 = min((period_time + WEEK) / WEEK * WEEK, block.timestamp)

        for i in range(256):
            dt: uint256 = week_time - prev_week_time

            if working_supply != 0:
                # we don't have to worry about crossing inflation epochs
                # and if we miss any weeks, those weeks inflation rates will be 0 for sure
                # but that means no one interacted with the gauge for that long
                integrate_inv_supply += self.inflation_rate[prev_week_time / WEEK] * 10 ** 18 * dt / working_supply

            if week_time == block.timestamp:
                break
            prev_week_time = week_time
            week_time = min(week_time + WEEK, block.timestamp)

    # check CRV balance and increase weekly inflation rate by delta for the rest of the week
    crv_balance: uint256 = ERC20(CRV).balanceOf(self)
    if crv_balance != 0:
        current_week: uint256 = block.timestamp / WEEK
        self.inflation_rate[current_week] += crv_balance / ((current_week + 1) * WEEK - block.timestamp)
        ERC20(CRV).transfer(FACTORY, crv_balance)

    period += 1
    self.period = period
    self.period_timestamp[period] = block.timestamp
    self.integrate_inv_supply[period] = integrate_inv_supply

    working_balance: uint256 = self.working_balances[_user]
    self.integrate_fraction[_user] += working_balance * (integrate_inv_supply - self.integrate_inv_supply_of[_user]) / 10 ** 18
    self.integrate_inv_supply_of[_user] = integrate_inv_supply
    self.integrate_checkpoint_of[_user] = block.timestamp


@internal
def _update_liquidity_limit(_user: address, _user_balance: uint256, _total_supply: uint256):
    """
    @notice Calculate working balances to apply amplification of CRV production.
    @dev https://resources.curve.fi/guides/boosting-your-crv-rewards#formula
    @param _user The user address
    @param _user_balance User's amount of liquidity (LP tokens)
    @param _total_supply Total amount of liquidity (LP tokens)
    """
    working_balance: uint256 = _user_balance * TOKENLESS_PRODUCTION / 100

    ve: address = self.voting_escrow
    if ve != ZERO_ADDRESS:
        ve_ts: uint256 = ERC20(ve).totalSupply()
        if ve_ts != 0:
            working_balance += _total_supply * ERC20(ve).balanceOf(_user) / ve_ts * (100 - TOKENLESS_PRODUCTION) / 100
            working_balance = min(_user_balance, working_balance)

    old_working_balance: uint256 = self.working_balances[_user]
    self.working_balances[_user] = working_balance

    working_supply: uint256 = self.working_supply + working_balance - old_working_balance
    self.working_supply = working_supply

    log UpdateLiquidityLimit(_user, _user_balance, _total_supply, working_balance, working_supply)


@internal
def _checkpoint_rewards(_user: address, _total_supply: uint256, _claim: bool, _receiver: address):
    """
    @notice Claim pending rewards and checkpoint rewards for a user
    """
    user_balance: uint256 = 0
    receiver: address = _receiver
    if _user != ZERO_ADDRESS:
        user_balance = self.balanceOf[_user]
        if _claim and _receiver == ZERO_ADDRESS:
            # if receiver is not explicitly declared, check if a default receiver is set
            receiver = self.rewards_receiver[_user]
            if receiver == ZERO_ADDRESS:
                # if no default receiver is set, direct claims to the user
                receiver = _user

    reward_count: uint256 = self.reward_count
    for i in range(MAX_REWARDS):
        if i == reward_count:
            break
        token: address = self.reward_tokens[i]

        integral: uint256 = self.reward_data[token].integral
        last_update: uint256 = min(block.timestamp, self.reward_data[token].period_finish)
        duration: uint256 = last_update - self.reward_data[token].last_update
        if duration != 0:
            self.reward_data[token].last_update = last_update
            if _total_supply != 0:
                integral += duration * self.reward_data[token].rate * 10**18 / _total_supply
                self.reward_data[token].integral = integral

        if _user != ZERO_ADDRESS:
            integral_for: uint256 = self.reward_integral_for[token][_user]
            new_claimable: uint256 = 0

            if integral_for < integral:
                self.reward_integral_for[token][_user] = integral
                new_claimable = user_balance * (integral - integral_for) / 10**18

            claim_data: uint256 = self.claim_data[_user][token]
            total_claimable: uint256 = shift(claim_data, -128) + new_claimable
            if total_claimable > 0:
                total_claimed: uint256 = claim_data % 2**128
                if _claim:
                    response: Bytes[32] = raw_call(
                        token,
                        _abi_encode(
                            receiver,
                            total_claimable,
                            method_id=method_id("transfer(address,uint256)")
                        ),
                        max_outsize=32,
                    )
                    if len(response) != 0:
                        assert convert(response, bool)
                    self.claim_data[_user][token] = total_claimed + total_claimable
                elif new_claimable > 0:
                    self.claim_data[_user][token] = total_claimed + shift(total_claimable, 128)


@internal
def _transfer(_from: address, _to: address, _value: uint256):
    if _value == 0:
        return
    total_supply: uint256 = self.totalSupply

    has_rewards: bool = self.reward_count != 0
    for addr in [_from, _to]:
        self._checkpoint(addr)
        self._checkpoint_rewards(addr, total_supply, False, ZERO_ADDRESS)

    new_balance: uint256 = self.balanceOf[_from] - _value
    self.balanceOf[_from] = new_balance
    self._update_liquidity_limit(_from, new_balance, total_supply)

    new_balance = self.balanceOf[_to] + _value
    self.balanceOf[_to] = new_balance
    self._update_liquidity_limit(_to, new_balance, total_supply)

    log Transfer(_from, _to, _value)


@external
@nonreentrant("lock")
def deposit(_value: uint256, _user: address = msg.sender, _claim_rewards: bool = False):
    """
    @notice Deposit `_value` LP tokens
    @param _value Number of tokens to deposit
    @param _user The account to send gauge tokens to
    """
    self._checkpoint(_user)
    if _value == 0:
        return

    total_supply: uint256 = self.totalSupply
    new_balance: uint256 = self.balanceOf[_user] + _value

    if self.reward_count != 0:
        self._checkpoint_rewards(_user, total_supply, _claim_rewards, ZERO_ADDRESS)

    total_supply += _value

    self.balanceOf[_user] = new_balance
    self.totalSupply = total_supply

    self._update_liquidity_limit(_user, new_balance, total_supply)

    ERC20(self.lp_token).transferFrom(msg.sender, self, _value)

    log Deposit(_user, _value)
    log Transfer(ZERO_ADDRESS, _user, _value)


@external
@nonreentrant("lock")
def withdraw(_value: uint256, _user: address = msg.sender, _claim_rewards: bool = False):
    """
    @notice Withdraw `_value` LP tokens
    @param _value Number of tokens to withdraw
    @param _user The account to send LP tokens to
    """
    self._checkpoint(_user)
    if _value == 0:
        return

    total_supply: uint256 = self.totalSupply
    new_balance: uint256 = self.balanceOf[msg.sender] - _value

    if self.reward_count != 0:
        self._checkpoint_rewards(_user, total_supply, _claim_rewards, ZERO_ADDRESS)

    total_supply -= _value

    self.balanceOf[msg.sender] = new_balance
    self.totalSupply = total_supply

    self._update_liquidity_limit(msg.sender, new_balance, total_supply)

    ERC20(self.lp_token).transfer(_user, _value)

    log Withdraw(_user, _value)
    log Transfer(msg.sender, ZERO_ADDRESS, _value)


@external
@nonreentrant("lock")
def transferFrom(_from: address, _to: address, _value: uint256) -> bool:
    """
    @notice Transfer tokens from one address to another
    @param _from The address which you want to send tokens from
    @param _to The address which you want to transfer to
    @param _value the amount of tokens to be transferred
    @return bool success
    """
    allowance: uint256 = self.allowance[_from][msg.sender]
    if allowance != MAX_UINT256:
        self.allowance[_from][msg.sender] = allowance - _value

    self._transfer(_from, _to, _value)
    return True


@external
def approve(_spender: address, _value: uint256) -> bool:
    """
    @notice Approve the passed address to transfer the specified amount of
            tokens on behalf of msg.sender
    @dev Beware that changing an allowance via this method brings the risk
         that someone may use both the old and new allowance by unfortunate
         transaction ordering. This may be mitigated with the use of
         {increaseAllowance} and {decreaseAllowance}.
         https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    @param _spender The address which will transfer the funds
    @param _value The amount of tokens that may be transferred
    @return bool success
    """
    self.allowance[msg.sender][_spender] = _value

    log Approval(msg.sender, _spender, _value)
    return True


@external
def permit(
    _owner: address,
    _spender: address,
    _value: uint256,
    _deadline: uint256,
    _v: uint8,
    _r: bytes32,
    _s: bytes32
) -> bool:
    """
    @notice Approves spender by owner's signature to expend owner's tokens.
        See https://eips.ethereum.org/EIPS/eip-2612.
    @dev Inspired by https://github.com/yearn/yearn-vaults/blob/main/contracts/Vault.vy#L753-L793
    @dev Supports smart contract wallets which implement ERC1271
        https://eips.ethereum.org/EIPS/eip-1271
    @param _owner The address which is a source of funds and has signed the Permit.
    @param _spender The address which is allowed to spend the funds.
    @param _value The amount of tokens to be spent.
    @param _deadline The timestamp after which the Permit is no longer valid.
    @param _v The bytes[64] of the valid secp256k1 signature of permit by owner
    @param _r The bytes[0:32] of the valid secp256k1 signature of permit by owner
    @param _s The bytes[32:64] of the valid secp256k1 signature of permit by owner
    @return True, if transaction completes successfully
    """
    assert _owner != ZERO_ADDRESS
    assert block.timestamp <= _deadline

    nonce: uint256 = self.nonces[_owner]
    digest: bytes32 = keccak256(
        concat(
            b"\x19\x01",
            self.DOMAIN_SEPARATOR,
            keccak256(_abi_encode(PERMIT_TYPE_HASH, _owner, _spender, _value, nonce, _deadline))
        )
    )

    if _owner.is_contract:
        sig: Bytes[65] = concat(_abi_encode(_r, _s), slice(convert(_v, bytes32), 31, 1))
        assert ERC1271(_owner).isValidSignature(digest, sig) == ERC1271_MAGIC_VAL
    else:
        assert ecrecover(digest, convert(_v, uint256), convert(_r, uint256), convert(_s, uint256)) == _owner

    self.allowance[_owner][_spender] = _value
    self.nonces[_owner] = nonce + 1

    log Approval(_owner, _spender, _value)
    return True


@external
@nonreentrant("lock")
def transfer(_to: address, _value: uint256) -> bool:
    """
    @notice Transfer token to a specified address
    @param _to The address to transfer to
    @param _value The amount to be transferred
    @return bool success
    """
    self._transfer(msg.sender, _to, _value)
    return True


@external
def increaseAllowance(_spender: address, _added_value: uint256) -> bool:
    """
    @notice Increase the allowance granted to `_spender` by the caller
    @dev This is alternative to {approve} that can be used as a mitigation for
         the potential race condition
    @param _spender The address which will transfer the funds
    @param _added_value The amount of to increase the allowance
    @return bool success
    """
    allowance: uint256 = self.allowance[msg.sender][_spender] + _added_value
    self.allowance[msg.sender][_spender] = allowance

    log Approval(msg.sender, _spender, allowance)
    return True


@external
def decreaseAllowance(_spender: address, _subtracted_value: uint256) -> bool:
    """
    @notice Decrease the allowance granted to `_spender` by the caller
    @dev This is alternative to {approve} that can be used as a mitigation for
         the potential race condition
    @param _spender The address which will transfer the funds
    @param _subtracted_value The amount of to decrease the allowance
    @return bool success
    """
    allowance: uint256 = self.allowance[msg.sender][_spender] - _subtracted_value
    self.allowance[msg.sender][_spender] = allowance

    log Approval(msg.sender, _spender, allowance)
    return True


@external
def user_checkpoint(addr: address) -> bool:
    """
    @notice Record a checkpoint for `addr`
    @param addr User address
    @return bool success
    """
    assert msg.sender in [addr, FACTORY]  # dev: unauthorized
    self._checkpoint(addr)
    self._update_liquidity_limit(addr, self.balanceOf[addr], self.totalSupply)
    return True


@external
def claimable_tokens(addr: address) -> uint256:
    """
    @notice Get the number of claimable tokens per user
    @dev This function should be manually changed to "view" in the ABI
    @return uint256 number of claimable tokens per user
    """
    self._checkpoint(addr)
    return self.integrate_fraction[addr] - Minter(FACTORY).minted(addr, self)


@view
@external
def claimed_reward(_addr: address, _token: address) -> uint256:
    """
    @notice Get the number of already-claimed reward tokens for a user
    @param _addr Account to get reward amount for
    @param _token Token to get reward amount for
    @return uint256 Total amount of `_token` already claimed by `_addr`
    """
    return self.claim_data[_addr][_token] % 2**128


@view
@external
def claimable_reward(_user: address, _reward_token: address) -> uint256:
    """
    @notice Get the number of claimable reward tokens for a user
    @param _user Account to get reward amount for
    @param _reward_token Token to get reward amount for
    @return uint256 Claimable reward token amount
    """
    integral: uint256 = self.reward_data[_reward_token].integral
    total_supply: uint256 = self.totalSupply
    if total_supply != 0:
        last_update: uint256 = min(block.timestamp, self.reward_data[_reward_token].period_finish)
        duration: uint256 = last_update - self.reward_data[_reward_token].last_update
        integral += (duration * self.reward_data[_reward_token].rate * 10**18 / total_supply)

    integral_for: uint256 = self.reward_integral_for[_reward_token][_user]
    new_claimable: uint256 = self.balanceOf[_user] * (integral - integral_for) / 10**18

    return shift(self.claim_data[_user][_reward_token], -128) + new_claimable


@external
def set_rewards_receiver(_receiver: address):
    """
    @notice Set the default reward receiver for the caller.
    @dev When set to ZERO_ADDRESS, rewards are sent to the caller
    @param _receiver Receiver address for any rewards claimed via `claim_rewards`
    """
    self.rewards_receiver[msg.sender] = _receiver


@external
@nonreentrant('lock')
def claim_rewards(_addr: address = msg.sender, _receiver: address = ZERO_ADDRESS):
    """
    @notice Claim available reward tokens for `_addr`
    @param _addr Address to claim for
    @param _receiver Address to transfer rewards to - if set to
                     ZERO_ADDRESS, uses the default reward receiver
                     for the caller
    """
    if _receiver != ZERO_ADDRESS:
        assert _addr == msg.sender  # dev: cannot redirect when claiming for another user
    self._checkpoint_rewards(_addr, self.totalSupply, True, _receiver)


@external
def add_reward(_reward_token: address, _distributor: address):
    """
    @notice Set the active reward contract
    """
    assert msg.sender == self.manager or msg.sender == Factory(FACTORY).owner()

    reward_count: uint256 = self.reward_count
    assert reward_count < MAX_REWARDS
    assert self.reward_data[_reward_token].distributor == ZERO_ADDRESS

    self.reward_data[_reward_token].distributor = _distributor
    self.reward_tokens[reward_count] = _reward_token
    self.reward_count = reward_count + 1


@external
def set_reward_distributor(_reward_token: address, _distributor: address):
    current_distributor: address = self.reward_data[_reward_token].distributor

    assert msg.sender == current_distributor or msg.sender == self.manager or msg.sender == Factory(FACTORY).owner()
    assert current_distributor != ZERO_ADDRESS
    assert _distributor != ZERO_ADDRESS

    self.reward_data[_reward_token].distributor = _distributor


@external
@nonreentrant("lock")
def deposit_reward_token(_reward_token: address, _amount: uint256):
    assert msg.sender == self.reward_data[_reward_token].distributor

    self._checkpoint_rewards(ZERO_ADDRESS, self.totalSupply, False, ZERO_ADDRESS)

    response: Bytes[32] = raw_call(
        _reward_token,
        _abi_encode(
            msg.sender,
            self,
            _amount,
            method_id=method_id("transferFrom(address,address,uint256)")
        ),
        max_outsize=32,
    )
    if len(response) != 0:
        assert convert(response, bool)

    period_finish: uint256 = self.reward_data[_reward_token].period_finish
    if block.timestamp >= period_finish:
        self.reward_data[_reward_token].rate = _amount / WEEK
    else:
        remaining: uint256 = period_finish - block.timestamp
        leftover: uint256 = remaining * self.reward_data[_reward_token].rate
        self.reward_data[_reward_token].rate = (_amount + leftover) / WEEK

    self.reward_data[_reward_token].last_update = block.timestamp
    self.reward_data[_reward_token].period_finish = block.timestamp + WEEK


@external
def set_manager(_manager: address):
    assert msg.sender == Factory(FACTORY).owner()

    self.manager = _manager


@external
def update_voting_escrow():
    """
    @notice Update the voting escrow contract in storage
    """
    self.voting_escrow = Factory(FACTORY).voting_escrow()


@external
def set_killed(_is_killed: bool):
    """
    @notice Set the kill status of the gauge
    @param _is_killed Kill status to put the gauge into
    """
    assert msg.sender == Factory(FACTORY).owner()

    self.is_killed = _is_killed


@view
@external
def decimals() -> uint256:
    """
    @notice Returns the number of decimals the token uses
    """
    return 18


@view
@external
def integrate_checkpoint() -> uint256:
    return self.period_timestamp[self.period]


@view
@external
def version() -> String[8]:
    return VERSION


@view
@external
def factory() -> address:
    return FACTORY


@external
def initialize(_lp_token: address, _manager: address):
    assert self.lp_token == ZERO_ADDRESS  # dev: already initialzed

    self.lp_token = _lp_token
    self.manager = _manager

    self.voting_escrow = Factory(msg.sender).voting_escrow()

    symbol: String[26] = ERC20Extended(_lp_token).symbol()
    name: String[64] = concat("Curve.fi ", symbol, " Gauge Deposit")

    self.name = name
    self.symbol = concat(symbol, "-gauge")

    self.period_timestamp[0] = block.timestamp
    self.DOMAIN_SEPARATOR = keccak256(
        _abi_encode(
            DOMAIN_TYPE_HASH,
            keccak256(name),
            keccak256(VERSION),
            chain.id,
            self
        )
    )

Contract ABI

API
[{"name":"Approval","inputs":[{"name":"_owner","type":"address","indexed":true},{"name":"_spender","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Transfer","inputs":[{"name":"_from","type":"address","indexed":true},{"name":"_to","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Deposit","inputs":[{"name":"_user","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Withdraw","inputs":[{"name":"_user","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateLiquidityLimit","inputs":[{"name":"_user","type":"address","indexed":true},{"name":"_original_balance","type":"uint256","indexed":false},{"name":"_original_supply","type":"uint256","indexed":false},{"name":"_working_balance","type":"uint256","indexed":false},{"name":"_working_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_crv_token","type":"address"},{"name":"_factory","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_user","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_user","type":"address"},{"name":"_claim_rewards","type":"bool"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"},{"name":"_user","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"},{"name":"_user","type":"address"},{"name":"_claim_rewards","type":"bool"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"permit","inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_deadline","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"increaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_added_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"decreaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_subtracted_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"user_checkpoint","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"claimable_tokens","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"claimed_reward","inputs":[{"name":"_addr","type":"address"},{"name":"_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"claimable_reward","inputs":[{"name":"_user","type":"address"},{"name":"_reward_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"set_rewards_receiver","inputs":[{"name":"_receiver","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"},{"name":"_receiver","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_reward","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_reward_distributor","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit_reward_token","inputs":[{"name":"_reward_token","type":"address"},{"name":"_amount","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_manager","inputs":[{"name":"_manager","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"update_voting_escrow","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_killed","inputs":[{"name":"_is_killed","type":"bool"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_checkpoint","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"factory","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"nonpayable","type":"function","name":"initialize","inputs":[{"name":"_lp_token","type":"address"},{"name":"_manager","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"DOMAIN_SEPARATOR","inputs":[],"outputs":[{"name":"","type":"bytes32"}]},{"stateMutability":"view","type":"function","name":"nonces","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"lp_token","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"manager","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"voting_escrow","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"working_balances","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"working_supply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"period","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"period_timestamp","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_checkpoint_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_fraction","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_inv_supply","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_inv_supply_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"reward_count","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"reward_tokens","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"reward_data","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"distributor","type":"address"},{"name":"period_finish","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"last_update","type":"uint256"},{"name":"integral","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"rewards_receiver","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"reward_integral_for","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"inflation_rate","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]}]

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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.