Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
- Contract name:
- Vyper_contract
- Optimization enabled
- N/A
- Compiler version
- v0.2.16
- Verified at
- 2022-04-05T12:56:11.601127Z
Constructor Arguments
000000000000000000000000acf68c321726dd6f0d50ea81f75ed22d541a76e1
Arg [0] (address) : 0xacf68c321726dd6f0d50ea81f75ed22d541a76e1
Contract source code
# @version 0.2.16 """ @title Vesting Escrow Factory @author Curve Finance, Yearn Finance @license MIT @notice Stores and distributes ERC20 tokens by deploying `VestingEscrowSimple` contracts """ from vyper.interfaces import ERC20 interface VestingEscrowSimple: def initialize( admin: address, token: address, recipient: address, amount: uint256, start_time: uint256, end_time: uint256, cliff_length: uint256, ) -> bool: nonpayable event VestingEscrowCreated: funder: indexed(address) token: indexed(address) recipient: indexed(address) escrow: address amount: uint256 vesting_start: uint256 vesting_duration: uint256 cliff_length: uint256 target: public(address) @external def __init__(target: address): """ @notice Contract constructor @dev Prior to deployment you must deploy one copy of `VestingEscrowSimple` which is used as a library for vesting contracts deployed by this factory @param target `VestingEscrowSimple` contract address """ self.target = target @external def deploy_vesting_contract( token: address, recipient: address, amount: uint256, vesting_duration: uint256, vesting_start: uint256 = block.timestamp, cliff_length: uint256 = 0, ) -> address: """ @notice Deploy a new vesting contract @param token Address of the ERC20 token being distributed @param recipient Address to vest tokens for @param amount Amount of tokens being vested for `recipient` @param vesting_duration Time period over which tokens are released @param vesting_start Epoch time when tokens begin to vest """ assert cliff_length <= vesting_duration # dev: incorrect vesting cliff escrow: address = create_forwarder_to(self.target) assert ERC20(token).transferFrom(msg.sender, self, amount) # dev: funding failed assert ERC20(token).approve(escrow, amount) # dev: approve failed VestingEscrowSimple(escrow).initialize( msg.sender, token, recipient, amount, vesting_start, vesting_start + vesting_duration, cliff_length, ) log VestingEscrowCreated(msg.sender, token, recipient, escrow, amount, vesting_start, vesting_duration, cliff_length) return escrow
Contract ABI
[{"type":"event","name":"VestingEscrowCreated","inputs":[{"type":"address","name":"funder","indexed":true},{"type":"address","name":"token","indexed":true},{"type":"address","name":"recipient","indexed":true},{"type":"address","name":"escrow","indexed":false},{"type":"uint256","name":"amount","indexed":false},{"type":"uint256","name":"vesting_start","indexed":false},{"type":"uint256","name":"vesting_duration","indexed":false},{"type":"uint256","name":"cliff_length","indexed":false}],"anonymous":false},{"type":"constructor","stateMutability":"nonpayable","outputs":[],"inputs":[{"type":"address","name":"target"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":""}],"name":"deploy_vesting_contract","inputs":[{"type":"address","name":"token"},{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"},{"type":"uint256","name":"vesting_duration"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":""}],"name":"deploy_vesting_contract","inputs":[{"type":"address","name":"token"},{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"},{"type":"uint256","name":"vesting_duration"},{"type":"uint256","name":"vesting_start"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":""}],"name":"deploy_vesting_contract","inputs":[{"type":"address","name":"token"},{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"},{"type":"uint256","name":"vesting_duration"},{"type":"uint256","name":"vesting_start"},{"type":"uint256","name":"cliff_length"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":""}],"name":"target","inputs":[],"gas":2418}]
Deployed ByteCode
0x600436101561000d57610297565b600035601c526000513461029d57630551ebac811415610037574261014052600061016052610082565b63ab5eea59811415610059576000610160526020608461014037600050610082565b63c367cc8081141561007d576020608461014037602060a461016037600050610082565b61027d565b60043560a01c61029d5760243560a01c61029d57606435610160511161029d577f602d3d8160093d39f3363d3d373d3d3d363d73000000000000000000000000006101a05260005460601b6101b3527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006101c75260366101a06000f061018052602061026060646323b872dd6101a052336101c052306101e052604435610200526101bc60006004355af11561029d57601f3d111561029d57600050610260511561029d576020610240604463095ea7b36101a052610180516101c0526044356101e0526101bc60006004355af11561029d57601f3d111561029d57600050610240511561029d5760206102e060e4632b4656c86101a052336101c052606060046101e037610140516102405261014051606435818183011061029d57808201905090506102605261016051610280526101bc6000610180515af11561029d57601f3d111561029d576000506102e050602435600435337f4d924f2be6d90da83be47ca6bc3c90e0f5c5e365d7e9797faeb4b9f823505a786101a08080806101805181525050602081019050808060443581525050602081019050808061014051815250506020810190508080606435815250506020810190508080610160518152505060a0905090506101a0a46101805160005260206000f35b63d4b839928114156102955760005460005260206000f35b505b60006000fd5b600080fd