Skip to content
Verified contractExactMIT

ArbifyTeamVesting

Address0x5d8dd9de0f467384f37f41e606ac1ef16f415bc8
Balance

0 ETH

 

Transactions

6

 

Compiler

solc 0.8.23

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.23+commit.f704f362
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
22,498,988
Creation transaction
0x1b8a4b8c5a…2d41aa81a0

contracts/ArbifyTeamVesting.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

/**
 * @title ArbifyTeamVesting
 * @notice Vesting contract for team, advisors, marketing, and reserve tokens with TGE and step-based release.
 */
contract ArbifyTeamVesting {
    struct Vesting {
        uint256 totalAmount;
        uint256 claimed;
        uint256 tgePercent; // expressed as percent (20 = 20%)
        uint256 stepPercent; // percent released at each interval
        uint256 stepInterval; // seconds between each vesting step
    }

    address public immutable arbifyToken;
    address public owner;
    uint256 public vestingStartTime;

    mapping(address => Vesting) public vestings;

    modifier onlyOwner() {
        require(msg.sender == owner, "Not owner");
        _;
    }

    event VestingAdded(address indexed user, uint256 totalAmount);
    event TokensClaimed(address indexed user, uint256 amount);
    event VestingStarted(uint256 timestamp);

    constructor(address _token) {
        require(_token != address(0), "Invalid token");
        arbifyToken = _token;
        owner = msg.sender;
    }

    function setupVestingSchedule(
        address user,
        uint256 totalAmount,
        uint256 tgePercent,
        uint256 stepPercent,
        uint256 stepInterval
    ) external onlyOwner {
        require(user != address(0), "Zero address");
        require(totalAmount > 0, "Zero amount");
        require(vestings[user].totalAmount == 0, "Already vested");

        vestings[user] = Vesting({
            totalAmount: totalAmount,
            claimed: 0,
            tgePercent: tgePercent,
            stepPercent: stepPercent,
            stepInterval: stepInterval
        });

        emit VestingAdded(user, totalAmount);
    }

    function startVesting() external onlyOwner {
        require(vestingStartTime == 0, "Already started");
        vestingStartTime = block.timestamp;
        emit VestingStarted(vestingStartTime);
    }

    function claimable(address user) public view returns (uint256) {
        Vesting memory v = vestings[user];
        if (v.totalAmount == 0 || vestingStartTime == 0 || block.timestamp < vestingStartTime) return 0;

        uint256 tgeAmount = (v.totalAmount * v.tgePercent) / 100;
        uint256 stepsPassed = (block.timestamp - vestingStartTime) / v.stepInterval;
        uint256 stepAmount = (v.totalAmount * v.stepPercent * stepsPassed) / 100;

        uint256 unlocked = tgeAmount + stepAmount;
        if (unlocked > v.totalAmount) {
            unlocked = v.totalAmount;
        }

        return unlocked - v.claimed;
    }

    function claim() external {
        uint256 amount = claimable(msg.sender);
        require(amount > 0, "Nothing to claim");

        vestings[msg.sender].claimed += amount;
        require(IERC20(arbifyToken).transfer(msg.sender, amount), "Transfer failed");

        emit TokensClaimed(msg.sender, amount);
    }

    function recoverToken(address token, uint256 amount) external onlyOwner {
        require(token != arbifyToken, "Protected token");
        require(IERC20(token).transfer(owner, amount), "Recovery failed");
    }

    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "Zero address");
        owner = newOwner;
    }
}

interface IERC20 {
    function transfer(address recipient, uint256 amount) external returns (bool);
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.