Address Contract Partially Verified
Address
0xDA1DF6442aFD2EC36aBEa91029794B9b2156ADD0
Balance
0 ETH
Nonce
237
Code Size
2496 bytes
Creator
0xEd1DF67C...0c92 at tx 0x4b16de9d...357837
Indexed Transactions
0
Contract Bytecode
2496 bytes
0x6003361161000c5761083c565b60003560e01c3461096e5763f90795678118610039576064361061096e57426060526040366080376100aa565b639ec5cc74811861005d576084361061096e576064356060526040366080376100aa565b6354eb54c781186100815760a4361061096e5760406064606037600060a0526100aa565b63bb89e57d81186104865760c4361061096e576040606460603760a4358060011c61096e5760a0525b6024358060a01c61096e5760405260443561011c57601a60c0527f696e636f72726563742076657374696e67206475726174696f6e00000000000060e05260c05060c0518060e001601f826000031636823750506308c379a0608052602060a052601f19601f60c0510116604401609cfd5b604435608051111561018557601760c0527f696e636f72726563742076657374696e6720636c69666600000000000000000060e05260c05060c0518060e001601f826000031636823750506308c379a0608052602060a052601f19601f60c0510116604401609cfd5b6040516101e957600e60c0527f7a65726f20726563697069656e7400000000000000000000000000000000000060e05260c05060c0518060e001601f826000031636823750506308c379a0608052602060a052601f19601f60c0510116604401609cfd5b60043561024d57601060c0527f696e636f727265637420616d6f756e740000000000000000000000000000000060e05260c05060c0518060e001601f826000031636823750506308c379a0608052602060a052601f19601f60c0510116604401609cfd5b7f602d3d8160093d39f3363d3d373d3d3d363d730000000000000000000000000060e052602061098060003960005160601b60f3527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000061010752603660e06000f0801561096e5760c05260206109a06000396000516323b872dd60e052336101005260c0516101205260043561014052602060e0606460fc6000855af16102f9573d600060003e3d6000fd5b3d61031057803b1561096e57600161016052610328565b60203d1061096e5760e0518060011c61096e57610160525b6101609050516103bd576026610180527f7472616e7366657246726f6d206465706c6f79657220746f20657363726f77206101a0527f6661696c656400000000000000000000000000000000000000000000000000006101c0526101805061018051806101a001601f826000031636823750506308c379a061014052602061016052601f19601f61018051011660440161015cfd5b60c051633d4da16d60e05260206109a06000396000516101005260043561012052604051610140526060516101605260605160443580820182811061096e5790509050610180526080516101a05260a0516101c052306101e052602060e061010460fc6000855af1610434573d600060003e3d6000fd5b60203d1061096e5760e0518060011c61096e57610200526102005050604051337f659e7063929179b65f98fbe698cafb1002b78dce1bc9d24be13c2db289d9dd4760c05160e052602060e0a3602060c0f35b6323a50d3c81186105ac576044361061096e576004358060a01c61096e57604052602435156105aa5760405163a9059cbb60605260015460805260243560a052602060606044607c6000855af16104e2573d600060003e3d6000fd5b3d6104f857803b1561096e57600160c05261050f565b60203d1061096e576060518060011c61096e5760c0525b60c090505161057757600f60e0527f7472616e73666572206661696c656400000000000000000000000000000000006101005260e05060e0518061010001601f826000031636823750506308c379a060a052602060c052601f19601f60e051011660440160bcfd5b7f505b28e6941631badc363841ecbf8e1214b9379c643936458e87be718e15799960405160605260243560805260406060a15b005b63644613468118610614576004361061096e574761012052610120511561061257600154604052610120516060526105e2610842565b7f0296f2c4dbc8c0e53c0ffab63f84aeebd5c28aa143475a37346bf15ac003f32761012051610140526020610140a15b005b6341ae7c0c8118610671576024361061096e576004358060a01c61096e5760805261063d610905565b6080516000557fff77725eff1df9ae1e638351c3d1a3801f223349bb7cf17735fd580813cfc0f960805160a052602060a0a1005b63253c8bd48118610732576024361061096e576004358060a01c61096e5760805261069a610905565b6080516106fe57601260a0527f7a65726f206f776e65722061646472657373000000000000000000000000000060c05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b6080516001557fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3660805160a052602060a0a1005b63e87f26bd811861078f576024361061096e576004358060a01c61096e5760805261075b610905565b6080516002557f198db6e425fb8aafd1823c6ca50be2d51e5764571a5ae0f0f21c6812e45def0b60805160a052602060a0a1005b63fc0c546a81186107b6576004361061096e5760206109a060003960005160405260206040f35b63d4b8399281186107dd576004361061096e57602061098060003960005160405260206040f35b6336e4461281186107fc576004361061096e5760005460405260206040f35b638da5cb5b811861081b576004361061096e5760015460405260206040f35b63481c6a75811861083a576004361061096e5760025460405260206040f35b505b60006000fd5b600060c05260c050602061010060c05160e06060516040515af161086b573d600060003e3d6000fd5b3d602081183d602010021860e05260e080518060805260208201805160a052505050608051156109035760a05160805160200360031b1c61090357601360c0527f455448207472616e73666572206661696c65640000000000000000000000000060e05260c05060c0518060e001601f826000031636823750506308c379a0608052602060a052601f19601f60c0510116604401609cfd5b565b60015433181561096c5760146040527f6d73672e73656e646572206e6f74206f776e657200000000000000000000000060605260405060405180606001601f826000031636823750506308c379a06000526020602052601f19601f6040510116604401601cfd5b565b600080fda165767970657283000307000b000000000000000000000000484fd04c598a095360df89bf85ab34c37127aa390000000000000000000000005a98fcbea516cf06857215779fd812ca3bef1b32
Verified Source Code Partial Match
Compiler: v0.3.7+commit.6020b8bb
EVM: paris
VestingEscrowFactory.vy 223 lines
# @version 0.3.7
"""
@title Vesting Escrow Factory
@author Curve Finance, Yearn Finance, Lido Finance
@license GPL-3.0
@notice Stores and distributes ERC20 tokens by deploying `VestingEscrow` contracts
"""
from vyper.interfaces import ERC20
interface IVestingEscrow:
def initialize(
token: address,
amount: uint256,
recipient: address,
start_time: uint256,
end_time: uint256,
cliff_length: uint256,
is_fully_revokable: bool,
voting_adapter_addr: address,
) -> bool: nonpayable
event VestingEscrowCreated:
creator: indexed(address)
recipient: indexed(address)
escrow: address
event ERC20Recovered:
token: address
amount: uint256
event ETHRecovered:
amount: uint256
event VotingAdapterUpgraded:
voting_adapter: address
event OwnerChanged:
owner: address
event ManagerChanged:
manager: address
TARGET: immutable(address)
TOKEN: immutable(address)
voting_adapter: public(address)
owner: public(address)
manager: public(address)
@external
def __init__(
target: address,
token: address,
owner: address,
manager: address,
voting_adapter: address,
):
"""
@notice Contract constructor
@dev Prior to deployment you must deploy one copy of `VestingEscrow` which
is used as a library for vesting contracts deployed by this factory
@param target `VestingEscrow` contract address
@param token Address of the ERC20 token being distributed using escrows
@param owner Address of the owner of the deployed escrows
@param manager Address of the manager of the deployed escrows
@param voting_adapter Address of the Lido Voting Adapter
"""
assert target != empty(address), "zero target"
assert owner != empty(address), "zero owner"
assert token != empty(address), "zero token"
TARGET = target
TOKEN = token
self.owner = owner
self.manager = manager
self.voting_adapter = voting_adapter
@external
def deploy_vesting_contract(
amount: uint256,
recipient: address,
vesting_duration: uint256,
vesting_start: uint256 = block.timestamp,
cliff_length: uint256 = 0,
is_fully_revokable: bool = False, # use ordinary escrow by default
) -> address:
"""
@notice Deploy and fund a new vesting contract
@param amount Amount of the tokens to be vested after fundings
@param recipient Address to vest tokens for
@param vesting_duration Time period over which tokens are released
@param vesting_start Epoch time when tokens begin to vest
@param cliff_length Duration after which the first portion vests
@param is_fully_revokable Fully revockable flag
"""
assert vesting_duration > 0, "incorrect vesting duration"
assert cliff_length <= vesting_duration, "incorrect vesting cliff"
assert recipient != empty(address), "zero recipient"
assert amount > 0, "incorrect amount"
escrow: address = create_minimal_proxy_to(TARGET)
assert ERC20(TOKEN).transferFrom(
msg.sender, escrow, amount, default_return_value=True
), "transferFrom deployer to escrow failed"
IVestingEscrow(escrow).initialize(
TOKEN,
amount,
recipient,
vesting_start,
vesting_start + vesting_duration,
cliff_length,
is_fully_revokable,
self,
)
log VestingEscrowCreated(
msg.sender,
recipient,
escrow,
)
return escrow
@external
def recover_erc20(token: address, amount: uint256):
"""
@notice Recover ERC20 tokens to owner
@param token Address of the ERC20 token to be recovered
"""
if amount != 0:
assert ERC20(token).transfer(
self.owner, amount, default_return_value=True
), "transfer failed"
log ERC20Recovered(token, amount)
@external
def recover_ether():
"""
@notice Recover Ether to owner
"""
amount: uint256 = self.balance
if amount != 0:
self._safe_send_ether(self.owner, amount)
log ETHRecovered(amount)
@external
def update_voting_adapter(voting_adapter: address):
"""
@notice Update voting_adapter to be used by vestings
@param voting_adapter Address of the new VotingAdapter implementation
"""
self._check_sender_is_owner()
self.voting_adapter = voting_adapter
log VotingAdapterUpgraded(voting_adapter)
@external
def change_owner(owner: address):
"""
@notice Change contract owner.
@param owner Address of the new owner. Must be non-zero.
"""
self._check_sender_is_owner()
assert owner != empty(address), "zero owner address"
self.owner = owner
log OwnerChanged(owner)
@external
def change_manager(manager: address):
"""
@notice Set contract manager.
Can update manager if it is already set.
Can be called only by the owner.
@param manager Address of the new manager
"""
self._check_sender_is_owner()
self.manager = manager
log ManagerChanged(manager)
@external
@view
def token() -> address:
return TOKEN
@external
@view
def target() -> address:
return TARGET
@internal
def _check_sender_is_owner():
assert msg.sender == self.owner, "msg.sender not owner"
@internal
def _safe_send_ether(_to: address, _value: uint256):
"""
@notice Overcome 2300 gas limit on simple send
"""
_response: Bytes[32] = raw_call(
_to, empty(bytes32), value=_value, max_outsize=32
)
if len(_response) > 0:
assert convert(_response, bool), "ETH transfer failed"
Vyper_contract.vy 223 lines
# @version 0.3.7
"""
@title Vesting Escrow Factory
@author Curve Finance, Yearn Finance, Lido Finance
@license GPL-3.0
@notice Stores and distributes ERC20 tokens by deploying `VestingEscrow` contracts
"""
from vyper.interfaces import ERC20
interface IVestingEscrow:
def initialize(
token: address,
amount: uint256,
recipient: address,
start_time: uint256,
end_time: uint256,
cliff_length: uint256,
is_fully_revokable: bool,
voting_adapter_addr: address,
) -> bool: nonpayable
event VestingEscrowCreated:
creator: indexed(address)
recipient: indexed(address)
escrow: address
event ERC20Recovered:
token: address
amount: uint256
event ETHRecovered:
amount: uint256
event VotingAdapterUpgraded:
voting_adapter: address
event OwnerChanged:
owner: address
event ManagerChanged:
manager: address
TARGET: immutable(address)
TOKEN: immutable(address)
voting_adapter: public(address)
owner: public(address)
manager: public(address)
@external
def __init__(
target: address,
token: address,
owner: address,
manager: address,
voting_adapter: address,
):
"""
@notice Contract constructor
@dev Prior to deployment you must deploy one copy of `VestingEscrow` which
is used as a library for vesting contracts deployed by this factory
@param target `VestingEscrow` contract address
@param token Address of the ERC20 token being distributed using escrows
@param owner Address of the owner of the deployed escrows
@param manager Address of the manager of the deployed escrows
@param voting_adapter Address of the Lido Voting Adapter
"""
assert target != empty(address), "zero target"
assert owner != empty(address), "zero owner"
assert token != empty(address), "zero token"
TARGET = target
TOKEN = token
self.owner = owner
self.manager = manager
self.voting_adapter = voting_adapter
@external
def deploy_vesting_contract(
amount: uint256,
recipient: address,
vesting_duration: uint256,
vesting_start: uint256 = block.timestamp,
cliff_length: uint256 = 0,
is_fully_revokable: bool = False, # use ordinary escrow by default
) -> address:
"""
@notice Deploy and fund a new vesting contract
@param amount Amount of the tokens to be vested after fundings
@param recipient Address to vest tokens for
@param vesting_duration Time period over which tokens are released
@param vesting_start Epoch time when tokens begin to vest
@param cliff_length Duration after which the first portion vests
@param is_fully_revokable Fully revockable flag
"""
assert vesting_duration > 0, "incorrect vesting duration"
assert cliff_length <= vesting_duration, "incorrect vesting cliff"
assert recipient != empty(address), "zero recipient"
assert amount > 0, "incorrect amount"
escrow: address = create_minimal_proxy_to(TARGET)
assert ERC20(TOKEN).transferFrom(
msg.sender, escrow, amount, default_return_value=True
), "transferFrom deployer to escrow failed"
IVestingEscrow(escrow).initialize(
TOKEN,
amount,
recipient,
vesting_start,
vesting_start + vesting_duration,
cliff_length,
is_fully_revokable,
self,
)
log VestingEscrowCreated(
msg.sender,
recipient,
escrow,
)
return escrow
@external
def recover_erc20(token: address, amount: uint256):
"""
@notice Recover ERC20 tokens to owner
@param token Address of the ERC20 token to be recovered
"""
if amount != 0:
assert ERC20(token).transfer(
self.owner, amount, default_return_value=True
), "transfer failed"
log ERC20Recovered(token, amount)
@external
def recover_ether():
"""
@notice Recover Ether to owner
"""
amount: uint256 = self.balance
if amount != 0:
self._safe_send_ether(self.owner, amount)
log ETHRecovered(amount)
@external
def update_voting_adapter(voting_adapter: address):
"""
@notice Update voting_adapter to be used by vestings
@param voting_adapter Address of the new VotingAdapter implementation
"""
self._check_sender_is_owner()
self.voting_adapter = voting_adapter
log VotingAdapterUpgraded(voting_adapter)
@external
def change_owner(owner: address):
"""
@notice Change contract owner.
@param owner Address of the new owner. Must be non-zero.
"""
self._check_sender_is_owner()
assert owner != empty(address), "zero owner address"
self.owner = owner
log OwnerChanged(owner)
@external
def change_manager(manager: address):
"""
@notice Set contract manager.
Can update manager if it is already set.
Can be called only by the owner.
@param manager Address of the new manager
"""
self._check_sender_is_owner()
self.manager = manager
log ManagerChanged(manager)
@external
@view
def token() -> address:
return TOKEN
@external
@view
def target() -> address:
return TARGET
@internal
def _check_sender_is_owner():
assert msg.sender == self.owner, "msg.sender not owner"
@internal
def _safe_send_ether(_to: address, _value: uint256):
"""
@notice Overcome 2300 gas limit on simple send
"""
_response: Bytes[32] = raw_call(
_to, empty(bytes32), value=_value, max_outsize=32
)
if len(_response) > 0:
assert convert(_response, bool), "ETH transfer failed"
Read Contract
manager 0x481c6a75 → address
owner 0x8da5cb5b → address
target 0xd4b83992 → address
token 0xfc0c546a → address
voting_adapter 0x36e44612 → address
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
change_manager 0xe87f26bd
address manager
change_owner 0x253c8bd4
address owner
deploy_vesting_contract 0xf9079567
uint256 amount
address recipient
uint256 vesting_duration
returns: address
deploy_vesting_contract 0x9ec5cc74
uint256 amount
address recipient
uint256 vesting_duration
uint256 vesting_start
returns: address
deploy_vesting_contract 0x54eb54c7
uint256 amount
address recipient
uint256 vesting_duration
uint256 vesting_start
uint256 cliff_length
returns: address
deploy_vesting_contract 0xbb89e57d
uint256 amount
address recipient
uint256 vesting_duration
uint256 vesting_start
uint256 cliff_length
bool is_fully_revokable
returns: address
recover_erc20 0x23a50d3c
address token
uint256 amount
recover_ether 0x64461346
No parameters
update_voting_adapter 0x41ae7c0c
address voting_adapter
Recent Transactions
No transactions found for this address