ETH Price: $3,257.41 (-0.28%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Unlock190973912024-01-27 10:42:23370 days ago1706352143IN
0xBBB27e84...3F54b9845
0 ETH0.0011510713.68911757

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vesting

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2024-01-14
*/

// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
}

contract Vesting {
    IERC20 private _token = IERC20(0x138fD0c24726C663a14F4Be30a7cD1f3e858e03A);
    address private _deployer;
    uint256 private _creation;
    uint256 private _unlocked = 0;
    uint256 private _unlocks = 24;
    
    constructor() {
        _deployer = msg.sender;
        _creation = block.timestamp;
    }

    function unlock() external {
        // Only the contract deployer is authorized to unlock
        require(msg.sender == _deployer, 'not authorized');

        // Get the current token balance
        uint256 balance = _token.balanceOf(address(this));

        // The contract token balance needs to be positive
        require(balance > 0, 'empty balance');

        // Get the difference in seconds between current timestamp and creation time
        uint256 difference = block.timestamp - _creation;

        // Calculate months that have passed since creation (1 month = 60 seconds * 24 hours * 30 days)
        uint256 months = difference / 60 / 24 / 30;

        // Cap months at max. number of unlocks (the vesting ends when months == _unlocks)
        if (months > _unlocks) months = _unlocks;

        // Calculate the initial amount of locked tokens
        // This is equal to the current token balance of the contract plus tokens that have been unlocked
        uint256 tokens = balance + _unlocked;

        // Calculate the max. unlockable amount based on the number of passed months
        // For example, if months = 6 and _unlocks = 24, this becomes initially locked tokens * 0.25
        uint256 unlockable = tokens * months / _unlocks;

        // Calculate the withdrawable amount, based on previously unlocked tokens
        uint256 withdrawable = unlockable - _unlocked;

        // Update the unlocked amount
        _unlocked += withdrawable;

        // Transfer the withdrawable amount
        _token.transfer(_deployer, withdrawable);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405273138fd0c24726c663a14f4be30a7cd1f3e858e03a6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600355601860045534801561006e57600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504260028190555061070d806100c66000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a69df4b514610030575b600080fd5b61003861003a565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100c190610377565b60405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161012691906103d8565b602060405180830381865afa158015610143573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610167919061042e565b9050600081116101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a3906104a7565b60405180910390fd5b6000600254426101bc91906104f6565b90506000601e6018603c846101d19190610559565b6101db9190610559565b6101e59190610559565b90506004548111156101f75760045490505b600060035484610207919061058a565b90506000600454838361021a91906105e0565b6102249190610559565b905060006003548261023691906104f6565b9050806003600082825461024a919061058a565b9250508190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b81526004016102ce929190610649565b6020604051808303816000875af11580156102ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031191906106aa565b50505050505050565b600082825260208201905092915050565b7f6e6f7420617574686f72697a6564000000000000000000000000000000000000600082015250565b6000610361600e8361031a565b915061036c8261032b565b602082019050919050565b6000602082019050818103600083015261039081610354565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103c282610397565b9050919050565b6103d2816103b7565b82525050565b60006020820190506103ed60008301846103c9565b92915050565b600080fd5b6000819050919050565b61040b816103f8565b811461041657600080fd5b50565b60008151905061042881610402565b92915050565b600060208284031215610444576104436103f3565b5b600061045284828501610419565b91505092915050565b7f656d7074792062616c616e636500000000000000000000000000000000000000600082015250565b6000610491600d8361031a565b915061049c8261045b565b602082019050919050565b600060208201905081810360008301526104c081610484565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610501826103f8565b915061050c836103f8565b92508282101561051f5761051e6104c7565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610564826103f8565b915061056f836103f8565b92508261057f5761057e61052a565b5b828204905092915050565b6000610595826103f8565b91506105a0836103f8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156105d5576105d46104c7565b5b828201905092915050565b60006105eb826103f8565b91506105f6836103f8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561062f5761062e6104c7565b5b828202905092915050565b610643816103f8565b82525050565b600060408201905061065e60008301856103c9565b61066b602083018461063a565b9392505050565b60008115159050919050565b61068781610672565b811461069257600080fd5b50565b6000815190506106a48161067e565b92915050565b6000602082840312156106c0576106bf6103f3565b5b60006106ce84828501610695565b9150509291505056fea264697066735822122079103bf3ba44bf4d3bad66036ed3515b9dfb1104deb194f4003ed84c116f5e3764736f6c634300080c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a69df4b514610030575b600080fd5b61003861003a565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100c190610377565b60405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161012691906103d8565b602060405180830381865afa158015610143573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610167919061042e565b9050600081116101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a3906104a7565b60405180910390fd5b6000600254426101bc91906104f6565b90506000601e6018603c846101d19190610559565b6101db9190610559565b6101e59190610559565b90506004548111156101f75760045490505b600060035484610207919061058a565b90506000600454838361021a91906105e0565b6102249190610559565b905060006003548261023691906104f6565b9050806003600082825461024a919061058a565b9250508190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b81526004016102ce929190610649565b6020604051808303816000875af11580156102ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031191906106aa565b50505050505050565b600082825260208201905092915050565b7f6e6f7420617574686f72697a6564000000000000000000000000000000000000600082015250565b6000610361600e8361031a565b915061036c8261032b565b602082019050919050565b6000602082019050818103600083015261039081610354565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103c282610397565b9050919050565b6103d2816103b7565b82525050565b60006020820190506103ed60008301846103c9565b92915050565b600080fd5b6000819050919050565b61040b816103f8565b811461041657600080fd5b50565b60008151905061042881610402565b92915050565b600060208284031215610444576104436103f3565b5b600061045284828501610419565b91505092915050565b7f656d7074792062616c616e636500000000000000000000000000000000000000600082015250565b6000610491600d8361031a565b915061049c8261045b565b602082019050919050565b600060208201905081810360008301526104c081610484565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610501826103f8565b915061050c836103f8565b92508282101561051f5761051e6104c7565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610564826103f8565b915061056f836103f8565b92508261057f5761057e61052a565b5b828204905092915050565b6000610595826103f8565b91506105a0836103f8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156105d5576105d46104c7565b5b828201905092915050565b60006105eb826103f8565b91506105f6836103f8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561062f5761062e6104c7565b5b828202905092915050565b610643816103f8565b82525050565b600060408201905061065e60008301856103c9565b61066b602083018461063a565b9392505050565b60008115159050919050565b61068781610672565b811461069257600080fd5b50565b6000815190506106a48161067e565b92915050565b6000602082840312156106c0576106bf6103f3565b5b60006106ce84828501610695565b9150509291505056fea264697066735822122079103bf3ba44bf4d3bad66036ed3515b9dfb1104deb194f4003ed84c116f5e3764736f6c634300080c0033

Deployed Bytecode Sourcemap

235:1954:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;583:1603;;;:::i;:::-;;;706:9;;;;;;;;;;;692:23;;:10;:23;;;684:50;;;;;;;;;;;;:::i;:::-;;;;;;;;;789:15;807:6;;;;;;;;;;;:16;;;832:4;807:31;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;789:49;;929:1;919:7;:11;911:37;;;;;;;;;;;;:::i;:::-;;;;;;;;;1047:18;1086:9;;1068:15;:27;;;;:::i;:::-;1047:48;;1213:14;1253:2;1248;1243;1230:10;:15;;;;:::i;:::-;:20;;;;:::i;:::-;:25;;;;:::i;:::-;1213:42;;1373:8;;1364:6;:17;1360:40;;;1392:8;;1383:17;;1360:40;1578:14;1605:9;;1595:7;:19;;;;:::i;:::-;1578:36;;1815:18;1854:8;;1845:6;1836;:15;;;;:::i;:::-;:26;;;;:::i;:::-;1815:47;;1958:20;1994:9;;1981:10;:22;;;;:::i;:::-;1958:45;;2068:12;2055:9;;:25;;;;;;;:::i;:::-;;;;;;;;2138:6;;;;;;;;;;:15;;;2154:9;;;;;;;;;;;2165:12;2138:40;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;610:1576;;;;;;583:1603::o;7:169:1:-;91:11;125:6;120:3;113:19;165:4;160:3;156:14;141:29;;7:169;;;;:::o;182:164::-;322:16;318:1;310:6;306:14;299:40;182:164;:::o;352:366::-;494:3;515:67;579:2;574:3;515:67;:::i;:::-;508:74;;591:93;680:3;591:93;:::i;:::-;709:2;704:3;700:12;693:19;;352:366;;;:::o;724:419::-;890:4;928:2;917:9;913:18;905:26;;977:9;971:4;967:20;963:1;952:9;948:17;941:47;1005:131;1131:4;1005:131;:::i;:::-;997:139;;724:419;;;:::o;1149:126::-;1186:7;1226:42;1219:5;1215:54;1204:65;;1149:126;;;:::o;1281:96::-;1318:7;1347:24;1365:5;1347:24;:::i;:::-;1336:35;;1281:96;;;:::o;1383:118::-;1470:24;1488:5;1470:24;:::i;:::-;1465:3;1458:37;1383:118;;:::o;1507:222::-;1600:4;1638:2;1627:9;1623:18;1615:26;;1651:71;1719:1;1708:9;1704:17;1695:6;1651:71;:::i;:::-;1507:222;;;;:::o;1816:117::-;1925:1;1922;1915:12;2062:77;2099:7;2128:5;2117:16;;2062:77;;;:::o;2145:122::-;2218:24;2236:5;2218:24;:::i;:::-;2211:5;2208:35;2198:63;;2257:1;2254;2247:12;2198:63;2145:122;:::o;2273:143::-;2330:5;2361:6;2355:13;2346:22;;2377:33;2404:5;2377:33;:::i;:::-;2273:143;;;;:::o;2422:351::-;2492:6;2541:2;2529:9;2520:7;2516:23;2512:32;2509:119;;;2547:79;;:::i;:::-;2509:119;2667:1;2692:64;2748:7;2739:6;2728:9;2724:22;2692:64;:::i;:::-;2682:74;;2638:128;2422:351;;;;:::o;2779:163::-;2919:15;2915:1;2907:6;2903:14;2896:39;2779:163;:::o;2948:366::-;3090:3;3111:67;3175:2;3170:3;3111:67;:::i;:::-;3104:74;;3187:93;3276:3;3187:93;:::i;:::-;3305:2;3300:3;3296:12;3289:19;;2948:366;;;:::o;3320:419::-;3486:4;3524:2;3513:9;3509:18;3501:26;;3573:9;3567:4;3563:20;3559:1;3548:9;3544:17;3537:47;3601:131;3727:4;3601:131;:::i;:::-;3593:139;;3320:419;;;:::o;3745:180::-;3793:77;3790:1;3783:88;3890:4;3887:1;3880:15;3914:4;3911:1;3904:15;3931:191;3971:4;3991:20;4009:1;3991:20;:::i;:::-;3986:25;;4025:20;4043:1;4025:20;:::i;:::-;4020:25;;4064:1;4061;4058:8;4055:34;;;4069:18;;:::i;:::-;4055:34;4114:1;4111;4107:9;4099:17;;3931:191;;;;:::o;4128:180::-;4176:77;4173:1;4166:88;4273:4;4270:1;4263:15;4297:4;4294:1;4287:15;4314:185;4354:1;4371:20;4389:1;4371:20;:::i;:::-;4366:25;;4405:20;4423:1;4405:20;:::i;:::-;4400:25;;4444:1;4434:35;;4449:18;;:::i;:::-;4434:35;4491:1;4488;4484:9;4479:14;;4314:185;;;;:::o;4505:305::-;4545:3;4564:20;4582:1;4564:20;:::i;:::-;4559:25;;4598:20;4616:1;4598:20;:::i;:::-;4593:25;;4752:1;4684:66;4680:74;4677:1;4674:81;4671:107;;;4758:18;;:::i;:::-;4671:107;4802:1;4799;4795:9;4788:16;;4505:305;;;;:::o;4816:348::-;4856:7;4879:20;4897:1;4879:20;:::i;:::-;4874:25;;4913:20;4931:1;4913:20;:::i;:::-;4908:25;;5101:1;5033:66;5029:74;5026:1;5023:81;5018:1;5011:9;5004:17;5000:105;4997:131;;;5108:18;;:::i;:::-;4997:131;5156:1;5153;5149:9;5138:20;;4816:348;;;;:::o;5170:118::-;5257:24;5275:5;5257:24;:::i;:::-;5252:3;5245:37;5170:118;;:::o;5294:332::-;5415:4;5453:2;5442:9;5438:18;5430:26;;5466:71;5534:1;5523:9;5519:17;5510:6;5466:71;:::i;:::-;5547:72;5615:2;5604:9;5600:18;5591:6;5547:72;:::i;:::-;5294:332;;;;;:::o;5632:90::-;5666:7;5709:5;5702:13;5695:21;5684:32;;5632:90;;;:::o;5728:116::-;5798:21;5813:5;5798:21;:::i;:::-;5791:5;5788:32;5778:60;;5834:1;5831;5824:12;5778:60;5728:116;:::o;5850:137::-;5904:5;5935:6;5929:13;5920:22;;5951:30;5975:5;5951:30;:::i;:::-;5850:137;;;;:::o;5993:345::-;6060:6;6109:2;6097:9;6088:7;6084:23;6080:32;6077:119;;;6115:79;;:::i;:::-;6077:119;6235:1;6260:61;6313:7;6304:6;6293:9;6289:22;6260:61;:::i;:::-;6250:71;;6206:125;5993:345;;;;:::o

Swarm Source

ipfs://79103bf3ba44bf4d3bad66036ed3515b9dfb1104deb194f4003ed84c116f5e37

Block Transaction Difficulty 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
Loading...
Loading
[ 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.