Contract 0x78e49a32af08BEa7EA5abBe053E1D675641d0cf3

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x71d605cf6d9aa31cd90e99ddec5edbf1159ae976123cb50b903d33a037a5de410x60206103328920092022-09-09 15:11:2188 days 11 hrs ago0x4210b1803f7cb057435ff1135f5dfdfbee086c27 IN  Create: Vyper_contract0 MATIC0.01325150
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.3

Optimization Enabled:
N/A

Other Settings:
, MIT license

Contract Source Code (Vyper language format)

# @version 0.3.3
"""
@title Voting Escrow Delegation Proxy
@author Angle Protocol
@license MIT
"""

# Full fork from:
# Curve Finance's veBoostProxy

from vyper.interfaces import ERC20

interface VeDelegation:
    def adjusted_balance_of(_account: address) -> uint256: view


event CommitAdmin:
    admin: address

event ApplyAdmin:
    admin: address

event DelegationSet:
    delegation: address


voting_escrow: public(address)


delegation: public(address)

admin: public(address)
future_admin: public(address)


@external
def __init__(_voting_escrow: address, _delegation: address, _admin: address):

    assert _voting_escrow != ZERO_ADDRESS
    assert _admin != ZERO_ADDRESS

    self.voting_escrow = _voting_escrow

    self.delegation = _delegation

    self.admin = _admin

    log DelegationSet(_delegation)


@view
@external
def adjusted_balance_of(_account: address) -> uint256:
    """
    @notice Get the adjusted veCRV balance from the active boost delegation contract
    @param _account The account to query the adjusted veCRV balance of
    @return veCRV balance
    """
    _delegation: address = self.delegation
    if _delegation == ZERO_ADDRESS:
        return ERC20(self.voting_escrow).balanceOf(_account)
    return VeDelegation(_delegation).adjusted_balance_of(_account)


@external
def kill_delegation():
    """
    @notice Set delegation contract to 0x00, disabling boost delegation
    @dev Callable by the emergency admin in case of an issue with the delegation logic
    """
    assert msg.sender == self.admin

    self.delegation = ZERO_ADDRESS
    log DelegationSet(ZERO_ADDRESS)


@external
def set_delegation(_delegation: address):
    """
    @notice Set the delegation contract
    @dev Only callable by the ownership admin
    @param _delegation `VotingEscrowDelegation` deployment address
    """
    assert msg.sender == self.admin

    # call `adjusted_balance_of` to make sure it works
    VeDelegation(_delegation).adjusted_balance_of(msg.sender)

    self.delegation = _delegation
    log DelegationSet(_delegation)


@external
def commit_admin(_admin: address):
    """
    @notice Set admin to `_admin`
    @param _admin Ownership admin
    """
    assert msg.sender == self.admin, "Access denied"

    self.future_admin = _admin

    log CommitAdmin(_admin)


@external
def accept_transfer_ownership():
    """
    @notice Accept a pending ownership transfer
    """
    _admin: address = self.future_admin
    assert msg.sender == _admin  # dev: future admin only

    self.admin = _admin

    log ApplyAdmin(_admin)

Contract Security Audit

Contract ABI

[{"name":"CommitAdmin","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"ApplyAdmin","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"DelegationSet","inputs":[{"name":"delegation","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_voting_escrow","type":"address"},{"name":"_delegation","type":"address"},{"name":"_admin","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"adjusted_balance_of","inputs":[{"name":"_account","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"kill_delegation","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_delegation","inputs":[{"name":"_delegation","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"commit_admin","inputs":[{"name":"_admin","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"accept_transfer_ownership","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"voting_escrow","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"delegation","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"future_admin","inputs":[],"outputs":[{"name":"","type":"address"}]}]

602061039d6000396000518060a01c6103985760405260206103bd6000396000518060a01c6103985760605260206103dd6000396000518060a01c6103985760805260006040511461039857600060805114610398576040516000556060516001556080516002557f963001cf3a0c5cdcfc26b2710abe2fe859b3565482158b7cb34f59b6eaff521260605160a052602060a0a16102eb6100ac6300000000396102eb6000016300000000f3600436101561000d576102e0565b60003560e01c346102e65763bbf7408a81186100b2576004358060a01c6102e6576040526001546060526060516100795760206370a0823160805260405160a052602060806024609c6000545afa61006a573d600060003e3d6000fd5b60203d106102e65760806100b0565b602063bbf7408a60805260405160a052602060806024609c6060515afa6100a5573d600060003e3d6000fd5b60203d106102e65760805bf35b634b74efb781186100f85760025433186102e65760006001557f963001cf3a0c5cdcfc26b2710abe2fe859b3565482158b7cb34f59b6eaff5212600060405260206040a1005b63f4b446a38118610181576004358060a01c6102e65760405260025433186102e65763bbf7408a60605233608052602060606024607c6040515afa610142573d600060003e3d6000fd5b60203d106102e6576060506040516001557f963001cf3a0c5cdcfc26b2710abe2fe859b3565482158b7cb34f59b6eaff521260405160605260206060a1005b63b1d3db758118610234576004358060a01c6102e657604052600254331461020057600d6060527f4163636573732064656e696564000000000000000000000000000000000000006080526060506060518060800181600003601f1636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b6040516003557f59a407284ae6e2986675fa1400d6498af928ed01f4fd2dd6be4a2a8b4fc35b3460405160605260206060a1005b63e5ea47b881186102825760035460405260405133186102e6576040516002557f756f845176805c8ebf249854e909627308157f63c96e470e44a9e8549ba6fb1e60405160605260206060a1005b63dfe0503181186102995760005460405260206040f35b63df5cf72381186102b05760015460405260206040f35b63f851a44081186102c75760025460405260206040f35b6317f7182a81186102de5760035460405260206040f35b505b60006000fd5b600080fd005b600080fd000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e639500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004210b1803f7cb057435ff1135f5dfdfbee086c27

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

000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e639500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004210b1803f7cb057435ff1135f5dfdfbee086c27

-----Decoded View---------------
Arg [0] : _voting_escrow (address): 0xe7804d91dfcde7f776c90043e03eaa6df87e6395
Arg [1] : _delegation (address): 0x0000000000000000000000000000000000000000
Arg [2] : _admin (address): 0x4210b1803f7cb057435ff1135f5dfdfbee086c27

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e6395
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000004210b1803f7cb057435ff1135f5dfdfbee086c27


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