ETH Price: $2,625.03 (+1.38%)

Contract

0xAbB442A07955e778900B2B312F0C389a4969Ee8E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim204922962024-08-09 16:40:1112 days ago1723221611IN
0xAbB442A0...a4969Ee8E
0 ETH0.000380414.24689578
Claim204913902024-08-09 13:37:4712 days ago1723210667IN
0xAbB442A0...a4969Ee8E
0 ETH0.0007918910.92627278
Claim203341132024-07-18 14:50:2334 days ago1721314223IN
0xAbB442A0...a4969Ee8E
0 ETH0.001579721.7998431
Claim203102852024-07-15 7:00:5938 days ago1721026859IN
0xAbB442A0...a4969Ee8E
0 ETH0.000292114.0304959
Claim202692572024-07-09 13:33:3543 days ago1720532015IN
0xAbB442A0...a4969Ee8E
0 ETH0.00030624.2249606
Claim202679282024-07-09 9:04:4744 days ago1720515887IN
0xAbB442A0...a4969Ee8E
0 ETH0.000221734.00409989
Claim202675422024-07-09 7:47:1144 days ago1720511231IN
0xAbB442A0...a4969Ee8E
0 ETH0.000187053.37796409
Claim202392302024-07-05 8:52:1148 days ago1720169531IN
0xAbB442A0...a4969Ee8E
0 ETH0.000728478.13248968
Claim202391062024-07-05 8:27:1148 days ago1720168031IN
0xAbB442A0...a4969Ee8E
0 ETH0.0009526413.14650718
Claim202341132024-07-04 15:42:2348 days ago1720107743IN
0xAbB442A0...a4969Ee8E
0 ETH0.0008303411.43187482
Claim202265142024-07-03 14:15:2349 days ago1720016123IN
0xAbB442A0...a4969Ee8E
0 ETH0.0016177622.26909311
Claim201459772024-06-22 8:13:1161 days ago1719043991IN
0xAbB442A0...a4969Ee8E
0 ETH0.000153252.75908181
Claim200674542024-06-11 8:40:2372 days ago1718095223IN
0xAbB442A0...a4969Ee8E
0 ETH0.000556547.65978926
Claim198956882024-05-18 8:38:2396 days ago1716021503IN
0xAbB442A0...a4969Ee8E
0 ETH0.000222153.99938996
Claim198675142024-05-14 9:59:47100 days ago1715680787IN
0xAbB442A0...a4969Ee8E
0 ETH0.000609656.79401391
Claim198418512024-05-10 19:53:35103 days ago1715370815IN
0xAbB442A0...a4969Ee8E
0 ETH0.000571867.87059342
Claim197388332024-04-26 10:07:23118 days ago1714126043IN
0xAbB442A0...a4969Ee8E
0 ETH0.000422087.59882252
Claim194137442024-03-11 18:49:23163 days ago1710182963IN
0xAbB442A0...a4969Ee8E
0 ETH0.0043895579.0254979
Claim193824412024-03-07 9:36:59168 days ago1709804219IN
0xAbB442A0...a4969Ee8E
0 ETH0.0044975750.11449577
Claim193822982024-03-07 9:08:23168 days ago1709802503IN
0xAbB442A0...a4969Ee8E
0 ETH0.0044531249.62580923
Claim193802422024-03-07 2:13:59168 days ago1709777639IN
0xAbB442A0...a4969Ee8E
0 ETH0.0050087655.81040456
Claim193777102024-03-06 17:45:59168 days ago1709747159IN
0xAbB442A0...a4969Ee8E
0 ETH0.0069092995.10903111
Claim193775782024-03-06 17:19:35168 days ago1709745575IN
0xAbB442A0...a4969Ee8E
0 ETH0.00948035105.62123045
Claim193766482024-03-06 14:12:23168 days ago1709734343IN
0xAbB442A0...a4969Ee8E
0 ETH0.00675692121.61921987
Claim193333922024-02-29 13:12:47174 days ago1709212367IN
0xAbB442A0...a4969Ee8E
0 ETH0.0047775386.01047266
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DolzVault

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 5000 runs

Other Settings:
default evmVersion
File 1 of 6 : DolzVault.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

struct Lock {
    address token;
    uint256 amount;
    uint128 withdrawalStart;
    uint64 withdrawPeriodDuration;
    uint64 withdrawPeriodNumber;
    uint256 withdrewAmount;
}

struct UserLock {
    address user;
    Lock lock;
}

interface IERC20Burnable {
    function burn(uint256 amount) external;
}

contract DolzVault {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    EnumerableSet.AddressSet private users;

    mapping(address => Lock[]) private userToLocks;

    event Locked(
        address token,
        uint256 amount,
        uint256 cliffEnd,
        uint256 vestingPeriodDuration,
        uint256 vestingPeriodNumber,
        uint256 id
    );

    event Claimed(address user, address token, uint256 amount);

    event Burnt(address user, address token, uint256 amount);

    event BurntToDead(address user, address token, uint256 amount);

    event Transfered(address user, address token, uint256 amount, address to);

    /**
     * @notice Lock the user's token in the vault
     * @dev The tokens must have been approved first
     * @param token Address of the token being locked
     * @param amount Amount to be locked in the vault
     * @param cliffInDays Cliff duration before tokens can be unlocked
     * @param vestingPeriodInDays Vesting period duration
     * @param vestingPeriodNumber Number of periods required to unlock 100%
     */
    function lock(
        address token,
        uint256 amount,
        uint256 cliffInDays,
        uint256 vestingPeriodInDays,
        uint256 vestingPeriodNumber
    ) external {
        // Avoids dead lock
        require(
            (vestingPeriodInDays > 0 && vestingPeriodNumber > 0) ||
                vestingPeriodInDays == 0,
            "Vault : invalid params"
        );

        // Add the user to the enumerable set
        users.add(msg.sender);

        createLock(
            token,
            amount,
            uint128(block.timestamp + cliffInDays * 24 * 3600),
            uint64(vestingPeriodInDays * 24 * 3600),
            uint64(vestingPeriodNumber),
            msg.sender
        );

        // Actually transfer the locked funds
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
    }

    function createLock(
        address token,
        uint256 amount,
        uint128 withdrawalStart,
        uint64 withdrawPeriodDuration,
        uint64 withdrawPeriodNumber,
        address user
    ) private {
        // Add the lock datas to the user's locks list
        userToLocks[user].push(
            Lock({
                token: token,
                amount: amount,
                withdrawalStart: withdrawalStart,
                withdrawPeriodDuration: withdrawPeriodDuration,
                withdrawPeriodNumber: withdrawPeriodNumber,
                withdrewAmount: 0
            })
        );

        // Emit the lock even
        emit Locked(
            token,
            amount,
            withdrawalStart,
            withdrawalStart,
            withdrawPeriodDuration,
            userToLocks[user].length - 1
        );
    }

    /**
     * @notice Returns the number of token that can be claimed back
     * @param _user Address of the user
     * @param lockId The index of the lock for this user
     * @dev lockId starts at 0
     * @return balance The amount that can be unlocked
     */
    function claimable(address _user, uint256 lockId)
        public
        view
        returns (uint256 balance)
    {
        Lock memory _lock = userToLocks[_user][lockId];

        if (block.timestamp < _lock.withdrawalStart) return 0;

        // In case just for cliff
        if (_lock.withdrawPeriodDuration == 0)
            return _lock.amount - _lock.withdrewAmount;

        // Computes the number of withdrawal periods that have passed
        uint256 periodsElapsed = (block.timestamp - _lock.withdrawalStart) /
            _lock.withdrawPeriodDuration +
            1;

        // Checks if all the withdrawal periods have passed
        if (periodsElapsed >= _lock.withdrawPeriodNumber) {
            // All the withdrawal periods have passed, so we send all the remaining claimable balance
            balance = _lock.amount - _lock.withdrewAmount;
        } else {
            // Computes how many tokens the user can withdraw per period
            uint256 withdrawableAmountPerPeriod = _lock.amount /
                _lock.withdrawPeriodNumber;

            // Computes how much the user can withdraw since the begining, minest the amount it already withdrew
            balance =
                withdrawableAmountPerPeriod *
                periodsElapsed -
                _lock.withdrewAmount;
        }
    }

    /**
     * @notice Allow to unlock some tokens
     * @param lockId The index of the lock for this user
     * @dev lockId starts at 0
     * @param _amount Amount to be unlocked from the vault
     */
    function claim(uint256 lockId, uint256 _amount) external {
        // Calculate how much can be retrieved by the user
        uint256 _claimable = claimable(msg.sender, lockId);
        // Check the amount is legit
        require(_amount <= _claimable, "Vault: Requested amount too high");

        // Load the lock
        Lock storage _lock = userToLocks[msg.sender][lockId];

        // Add the amount sent back to the user's withdrawn balance
        _lock.withdrewAmount += _amount;

        // Send the tokens back
        IERC20(_lock.token).safeTransfer(msg.sender, _amount);

        // Notify for monitoring
        emit Claimed(msg.sender, _lock.token, _amount);
    }

    /**
     * @notice Transfer from one lock to another owner
     * @param to Address of the user that will receive le lock (bob)
     * @param lockId The index of the lock to take the tokens from
     * @param amount The amount withdrawn from alice to bob
     * @dev lockId starts at 0
     */
    function transfer(
        address to,
        uint256 lockId,
        uint256 amount
    ) external {
        // Load Alice's lock
        Lock storage _lock = userToLocks[msg.sender][lockId];

        // Check Alice didn't claim yet, otherwise this will be a mess in the numbers
        require(_lock.withdrewAmount == 0, "Already started to claim");

        // We don't need to check if amout < locked since this would fail anyway
        _lock.amount -= amount;

        // Add the user to the enumerable set
        users.add(to);

        // Notify for monitoring
        emit Transfered(msg.sender, _lock.token, amount, to);

        // Create the lock for Bob
        createLock(
            _lock.token,
            amount,
            _lock.withdrawalStart,
            _lock.withdrawPeriodDuration,
            _lock.withdrawPeriodNumber,
            to
        );
    }

    /**
     * @notice Burn token by using the token's burn method
     * @param lockId The index of the lock to burn the tokens from
     * @param amount The amount to burn
     * @dev lockId starts at 0
     */
    function burn(uint256 lockId, uint256 amount) external {
        // Load Alice's lock
        Lock storage _lock = userToLocks[msg.sender][lockId];

        // Check Alice didn't claim yet, otherwise this will be a mess in the numbers
        require(_lock.withdrewAmount == 0, "Already started to claim");

        // We don't need to check if amout < locked since this would fail anyway
        _lock.amount -= amount;

        // Effectively burn the token
        IERC20Burnable(_lock.token).burn(amount);

        // Notify for monitoring
        emit Burnt(msg.sender, _lock.token, amount);
    }

    /**
     * @notice Burn token by sending them to the dead address
     * @param lockId The index of the lock to burn the tokens from
     * @param amount The amount to burn
     * @dev lockId starts at 0
     */
    function burnToDead(uint256 lockId, uint256 amount) external {
        // Load Alice's lock
        Lock storage _lock = userToLocks[msg.sender][lockId];

        // Check Alice didn't claim yet, otherwise this will be a mess in the numbers
        require(_lock.withdrewAmount == 0, "Already started to claim");

        // We don't need to check if amout < locked since this would fail anyway
        _lock.amount -= amount;

        // Effectively transfer the tokens to the dead address
        IERC20(_lock.token).safeTransfer(
            0x000000000000000000000000000000000000dEaD,
            amount
        );

        // Notify for monitoring
        emit BurntToDead(msg.sender, _lock.token, amount);
    }

    /**
     * @notice Returns the list of all users who locked at least once
     * @return The list of all users who locked at least once
     */
    function listAllUsers() external view returns (address[] memory) {
        return users.values();
    }

    /**
     * @notice Returns the list of all locks
     * @return The list of all locks
     */
    function listAllLocks() external view returns (UserLock[] memory) {
        uint256 size = 0;

        // Calculate size to allocate memory
        for (uint256 i = 0; i < users.length(); i++) {
            size += userToLocks[users.at(i)].length;
        }

        UserLock[] memory results = new UserLock[](size);

        // Iterate over all users
        uint256 counter = 0;
        for (uint256 i = 0; i < users.length(); i++) {
            Lock[] memory locks = userToLocks[users.at(i)];
            for (uint256 j = 0; j < locks.length; j++) {
                results[counter++] = UserLock({
                    user: users.at(i),
                    lock: locks[j]
                });
            }
        }

        return results;
    }

    /**
     * @notice Returns the list of all locks for a specific user
     * @param _user Address of the user
     * @return The list of locks
     */
    function listLocks(address _user) public view returns (Lock[] memory) {
        return userToLocks[_user];
    }

    /**
     * @notice Returns the list of all locks for the caller
     * @return The list of locks
     */
    function listMyLocks() external view returns (Lock[] memory) {
        return listLocks(msg.sender);
    }
}

File 2 of 6 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 4 of 6 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 6 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 6 of 6 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

Settings
{
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "optimizer": {
    "enabled": true,
    "runs": 5000
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Burnt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BurntToDead","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cliffEnd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vestingPeriodDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vestingPeriodNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Transfered","type":"event"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnToDead","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"lockId","type":"uint256"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listAllLocks","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"withdrawalStart","type":"uint128"},{"internalType":"uint64","name":"withdrawPeriodDuration","type":"uint64"},{"internalType":"uint64","name":"withdrawPeriodNumber","type":"uint64"},{"internalType":"uint256","name":"withdrewAmount","type":"uint256"}],"internalType":"struct Lock","name":"lock","type":"tuple"}],"internalType":"struct UserLock[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listAllUsers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"listLocks","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"withdrawalStart","type":"uint128"},{"internalType":"uint64","name":"withdrawPeriodDuration","type":"uint64"},{"internalType":"uint64","name":"withdrawPeriodNumber","type":"uint64"},{"internalType":"uint256","name":"withdrewAmount","type":"uint256"}],"internalType":"struct Lock[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listMyLocks","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"withdrawalStart","type":"uint128"},{"internalType":"uint64","name":"withdrawPeriodDuration","type":"uint64"},{"internalType":"uint64","name":"withdrawPeriodNumber","type":"uint64"},{"internalType":"uint256","name":"withdrewAmount","type":"uint256"}],"internalType":"struct Lock[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"cliffInDays","type":"uint256"},{"internalType":"uint256","name":"vestingPeriodInDays","type":"uint256"},{"internalType":"uint256","name":"vestingPeriodNumber","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"lockId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506118a3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a8b09a7e11610076578063b92e798e1161005b578063b92e798e14610165578063c34902631461017a578063f83727271461018d57600080fd5b8063a8b09a7e1461013d578063b390c0ab1461015257600080fd5b806360efe334116100a757806360efe334146100f65780637c759d0d1461011757806399d5ba561461012a57600080fd5b8063095bcdb6146100c35780630d7087e9146100d8575b600080fd5b6100d66100d1366004611409565b6101a0565b005b6100e0610316565b6040516100ed91906114de565b60405180910390f35b6101096101043660046113df565b610327565b6040519081526020016100ed565b6100d661012536600461143c565b6104ff565b6100d66101383660046114a0565b6105d0565b6101456106d7565b6040516100ed91906115cd565b6100d66101603660046114a0565b610996565b61016d610af3565b6040516100ed919061152b565b6100d66101883660046114a0565b610afe565b61016d61019b3660046113c4565b610c0d565b3360009081526002602052604081208054849081106101c1576101c161180f565b90600052602060002090600402019050806003015460001461022a5760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d000000000000000060448201526064015b60405180910390fd5b8181600101600082825461023e9190611764565b9091555061024f9050600085610d09565b508054604080513381526001600160a01b0392831660208201528082018590529186166060830152517fcd978ea28d6cceacbece086b200d4917e1c78581be17714b5bde6c048b481f7a9181900360800190a180546002820154610310916001600160a01b03169084906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041689610d25565b50505050565b60606103226000610f16565b905090565b6001600160a01b03821660009081526002602052604081208054829190849081106103545761035461180f565b60009182526020918290206040805160c081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301546fffffffffffffffffffffffffffffffff811691830182905267ffffffffffffffff700100000000000000000000000000000000820481166060850152780100000000000000000000000000000000000000000000000090910416608083015260039092015460a0820152915042101561040d5760009150506104f9565b606081015167ffffffffffffffff1661043c578060a0015181602001516104349190611764565b9150506104f9565b6000816060015167ffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff164261046f9190611764565b61047991906116ec565b6104849060016116d4565b9050816080015167ffffffffffffffff1681106104b6578160a0015182602001516104af9190611764565b92506104f6565b6000826080015167ffffffffffffffff1683602001516104d691906116ec565b60a08401519091506104e88383611727565b6104f29190611764565b9350505b50505b92915050565b60008211801561050f5750600081115b80610518575081155b6105645760405162461bcd60e51b815260206004820152601660248201527f5661756c74203a20696e76616c696420706172616d73000000000000000000006044820152606401610221565b61056f600033610d09565b506105b48585610580866018611727565b61058c90610e10611727565b61059690426116d4565b6105a1866018611727565b6105ad90610e10611727565b8533610d25565b6105c96001600160a01b038616333087610f23565b5050505050565b3360009081526002602052604081208054849081106105f1576105f161180f565b9060005260206000209060040201905080600301546000146106555760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d00000000000000006044820152606401610221565b818160010160008282546106699190611764565b90915550508054610686906001600160a01b031661dead84610ff2565b8054604080513381526001600160a01b03909216602083015281018390527f16ed36781b924409f09842b1e262a9508627fb3681ccb4b784724475aa9aedc9906060015b60405180910390a1505050565b60606000805b6106e76000611040565b81101561073457600260006106fc818461104a565b6001600160a01b0316815260208101919091526040016000205461072090836116d4565b91508061072c816117a7565b9150506106dd565b5060008167ffffffffffffffff8111156107505761075061183e565b6040519080825280602002602001820160405280156107c957816020015b6107b66040805180820182526000808252825160c0810184528181526020818101839052938101829052606081018290526080810182905260a0810191909152909182015290565b81526020019060019003908161076e5790505b5090506000805b6107da6000611040565b81101561098d5760006002816107f0818561104a565b6001600160a01b03166001600160a01b03168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156108e95760008481526020908190206040805160c0810182526004860290920180546001600160a01b031683526001808201548486015260028201546fffffffffffffffffffffffffffffffff81169385019390935267ffffffffffffffff700100000000000000000000000000000000840481166060860152780100000000000000000000000000000000000000000000000090930490921660808401526003015460a08301529083529092019101610830565b50505050905060005b815181101561097857604080518082019091528061091160008661104a565b6001600160a01b031681526020018383815181106109315761093161180f565b6020026020010151815250858580610948906117a7565b96508151811061095a5761095a61180f565b60200260200101819052508080610970906117a7565b9150506108f2565b50508080610985906117a7565b9150506107d0565b50909392505050565b3360009081526002602052604081208054849081106109b7576109b761180f565b906000526020600020906004020190508060030154600014610a1b5760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d00000000000000006044820152606401610221565b81816001016000828254610a2f9190611764565b909155505080546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015610a9257600080fd5b505af1158015610aa6573d6000803e3d6000fd5b50508254604080513381526001600160a01b03909216602083015281018590527fe8a89cc6e5096f9d9f43de82c077c1f4cfe707c0e0c2032176c68813b9ae6a5c925060600190506106ca565b606061032233610c0d565b6000610b0a3384610327565b905080821115610b5c5760405162461bcd60e51b815260206004820181905260248201527f5661756c743a2052657175657374656420616d6f756e7420746f6f20686967686044820152606401610221565b336000908152600260205260408120805485908110610b7d57610b7d61180f565b9060005260206000209060040201905082816003016000828254610ba191906116d4565b90915550508054610bbc906001600160a01b03163385610ff2565b8054604080513381526001600160a01b03909216602083015281018490527ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd39926839060600160405180910390a150505050565b6001600160a01b0381166000908152600260209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610cfe5760008481526020908190206040805160c0810182526004860290920180546001600160a01b031683526001808201548486015260028201546fffffffffffffffffffffffffffffffff81169385019390935267ffffffffffffffff700100000000000000000000000000000000840481166060860152780100000000000000000000000000000000000000000000000090930490921660808401526003015460a08301529083529092019101610c45565b505050509050919050565b6000610d1e836001600160a01b038416611056565b9392505050565b6001600160a01b038082166000818152600260208181526040808420815160c0810183528d881681528084018d81526fffffffffffffffffffffffffffffffff808e1694830194855267ffffffffffffffff808e16606085019081528d82166080860190815260a086018b8152875460018181018a55898e528b8e2098516004909202909801805491909f167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116178e5594518d87015596518c8a01805492519851841678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff99909416700100000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009093169190941617179590951694909417909355915160039097019690965593909252905290547fa0b15b5afbd8adc1efc429bc38aa12b0f04d6b9b7ab93f6ec76d54603b4be0ee9188918891889182918991610eb49190611764565b604080516001600160a01b03909716875260208701959095526fffffffffffffffffffffffffffffffff938416948601949094529116606084015267ffffffffffffffff16608083015260a082015260c00160405180910390a1505050505050565b60606000610d1e836110a5565b6040516001600160a01b03808516602483015283166044820152606481018290526103109085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611101565b6040516001600160a01b03831660248201526044810182905261103b9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401610f70565b505050565b60006104f9825490565b6000610d1e83836111e6565b600081815260018301602052604081205461109d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104f9565b5060006104f9565b6060816000018054806020026020016040519081016040528092919081815260200182805480156110f557602002820191906000526020600020905b8154815260200190600101908083116110e1575b50505050509050919050565b6000611156826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112109092919063ffffffff16565b80519091501561103b5780806020019051810190611174919061147e565b61103b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610221565b60008260000182815481106111fd576111fd61180f565b9060005260206000200154905092915050565b606061121f8484600085611227565b949350505050565b60608247101561129f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610221565b6001600160a01b0385163b6112f65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610221565b600080866001600160a01b0316858760405161131291906114c2565b60006040518083038185875af1925050503d806000811461134f576040519150601f19603f3d011682016040523d82523d6000602084013e611354565b606091505b509150915061136482828661136f565b979650505050505050565b6060831561137e575081610d1e565b82511561138e5782518084602001fd5b8160405162461bcd60e51b81526004016102219190611683565b80356001600160a01b03811681146113bf57600080fd5b919050565b6000602082840312156113d657600080fd5b610d1e826113a8565b600080604083850312156113f257600080fd5b6113fb836113a8565b946020939093013593505050565b60008060006060848603121561141e57600080fd5b611427846113a8565b95602085013595506040909401359392505050565b600080600080600060a0868803121561145457600080fd5b61145d866113a8565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561149057600080fd5b81518015158114610d1e57600080fd5b600080604083850312156114b357600080fd5b50508035926020909101359150565b600082516114d481846020870161177b565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561151f5783516001600160a01b0316835292840192918401916001016114fa565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561151f576115ba8385516001600160a01b038151168252602081015160208301526fffffffffffffffffffffffffffffffff6040820151166040830152606081015167ffffffffffffffff8082166060850152806080840151166080850152505060a081015160a08301525050565b9284019260c09290920191600101611547565b6020808252825182820181905260009190848201906040850190845b8181101561151f57835180516001600160a01b0316845285015161166f868501826001600160a01b038151168252602081015160208301526fffffffffffffffffffffffffffffffff6040820151166040830152606081015167ffffffffffffffff8082166060850152806080840151166080850152505060a081015160a08301525050565b509284019260e092909201916001016115e9565b60208152600082518060208401526116a281604085016020870161177b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156116e7576116e76117e0565b500190565b600082611722577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175f5761175f6117e0565b500290565b600082821015611776576117766117e0565b500390565b60005b8381101561179657818101518382015260200161177e565b838111156103105750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156117d9576117d96117e0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122080bfa39e2997969d5299bc1e11e3bf5099ba7c54a98c992812f35c1e43d39cda64736f6c63430008070033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a8b09a7e11610076578063b92e798e1161005b578063b92e798e14610165578063c34902631461017a578063f83727271461018d57600080fd5b8063a8b09a7e1461013d578063b390c0ab1461015257600080fd5b806360efe334116100a757806360efe334146100f65780637c759d0d1461011757806399d5ba561461012a57600080fd5b8063095bcdb6146100c35780630d7087e9146100d8575b600080fd5b6100d66100d1366004611409565b6101a0565b005b6100e0610316565b6040516100ed91906114de565b60405180910390f35b6101096101043660046113df565b610327565b6040519081526020016100ed565b6100d661012536600461143c565b6104ff565b6100d66101383660046114a0565b6105d0565b6101456106d7565b6040516100ed91906115cd565b6100d66101603660046114a0565b610996565b61016d610af3565b6040516100ed919061152b565b6100d66101883660046114a0565b610afe565b61016d61019b3660046113c4565b610c0d565b3360009081526002602052604081208054849081106101c1576101c161180f565b90600052602060002090600402019050806003015460001461022a5760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d000000000000000060448201526064015b60405180910390fd5b8181600101600082825461023e9190611764565b9091555061024f9050600085610d09565b508054604080513381526001600160a01b0392831660208201528082018590529186166060830152517fcd978ea28d6cceacbece086b200d4917e1c78581be17714b5bde6c048b481f7a9181900360800190a180546002820154610310916001600160a01b03169084906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041689610d25565b50505050565b60606103226000610f16565b905090565b6001600160a01b03821660009081526002602052604081208054829190849081106103545761035461180f565b60009182526020918290206040805160c081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301546fffffffffffffffffffffffffffffffff811691830182905267ffffffffffffffff700100000000000000000000000000000000820481166060850152780100000000000000000000000000000000000000000000000090910416608083015260039092015460a0820152915042101561040d5760009150506104f9565b606081015167ffffffffffffffff1661043c578060a0015181602001516104349190611764565b9150506104f9565b6000816060015167ffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff164261046f9190611764565b61047991906116ec565b6104849060016116d4565b9050816080015167ffffffffffffffff1681106104b6578160a0015182602001516104af9190611764565b92506104f6565b6000826080015167ffffffffffffffff1683602001516104d691906116ec565b60a08401519091506104e88383611727565b6104f29190611764565b9350505b50505b92915050565b60008211801561050f5750600081115b80610518575081155b6105645760405162461bcd60e51b815260206004820152601660248201527f5661756c74203a20696e76616c696420706172616d73000000000000000000006044820152606401610221565b61056f600033610d09565b506105b48585610580866018611727565b61058c90610e10611727565b61059690426116d4565b6105a1866018611727565b6105ad90610e10611727565b8533610d25565b6105c96001600160a01b038616333087610f23565b5050505050565b3360009081526002602052604081208054849081106105f1576105f161180f565b9060005260206000209060040201905080600301546000146106555760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d00000000000000006044820152606401610221565b818160010160008282546106699190611764565b90915550508054610686906001600160a01b031661dead84610ff2565b8054604080513381526001600160a01b03909216602083015281018390527f16ed36781b924409f09842b1e262a9508627fb3681ccb4b784724475aa9aedc9906060015b60405180910390a1505050565b60606000805b6106e76000611040565b81101561073457600260006106fc818461104a565b6001600160a01b0316815260208101919091526040016000205461072090836116d4565b91508061072c816117a7565b9150506106dd565b5060008167ffffffffffffffff8111156107505761075061183e565b6040519080825280602002602001820160405280156107c957816020015b6107b66040805180820182526000808252825160c0810184528181526020818101839052938101829052606081018290526080810182905260a0810191909152909182015290565b81526020019060019003908161076e5790505b5090506000805b6107da6000611040565b81101561098d5760006002816107f0818561104a565b6001600160a01b03166001600160a01b03168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156108e95760008481526020908190206040805160c0810182526004860290920180546001600160a01b031683526001808201548486015260028201546fffffffffffffffffffffffffffffffff81169385019390935267ffffffffffffffff700100000000000000000000000000000000840481166060860152780100000000000000000000000000000000000000000000000090930490921660808401526003015460a08301529083529092019101610830565b50505050905060005b815181101561097857604080518082019091528061091160008661104a565b6001600160a01b031681526020018383815181106109315761093161180f565b6020026020010151815250858580610948906117a7565b96508151811061095a5761095a61180f565b60200260200101819052508080610970906117a7565b9150506108f2565b50508080610985906117a7565b9150506107d0565b50909392505050565b3360009081526002602052604081208054849081106109b7576109b761180f565b906000526020600020906004020190508060030154600014610a1b5760405162461bcd60e51b815260206004820152601860248201527f416c7265616479207374617274656420746f20636c61696d00000000000000006044820152606401610221565b81816001016000828254610a2f9190611764565b909155505080546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015610a9257600080fd5b505af1158015610aa6573d6000803e3d6000fd5b50508254604080513381526001600160a01b03909216602083015281018590527fe8a89cc6e5096f9d9f43de82c077c1f4cfe707c0e0c2032176c68813b9ae6a5c925060600190506106ca565b606061032233610c0d565b6000610b0a3384610327565b905080821115610b5c5760405162461bcd60e51b815260206004820181905260248201527f5661756c743a2052657175657374656420616d6f756e7420746f6f20686967686044820152606401610221565b336000908152600260205260408120805485908110610b7d57610b7d61180f565b9060005260206000209060040201905082816003016000828254610ba191906116d4565b90915550508054610bbc906001600160a01b03163385610ff2565b8054604080513381526001600160a01b03909216602083015281018490527ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd39926839060600160405180910390a150505050565b6001600160a01b0381166000908152600260209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610cfe5760008481526020908190206040805160c0810182526004860290920180546001600160a01b031683526001808201548486015260028201546fffffffffffffffffffffffffffffffff81169385019390935267ffffffffffffffff700100000000000000000000000000000000840481166060860152780100000000000000000000000000000000000000000000000090930490921660808401526003015460a08301529083529092019101610c45565b505050509050919050565b6000610d1e836001600160a01b038416611056565b9392505050565b6001600160a01b038082166000818152600260208181526040808420815160c0810183528d881681528084018d81526fffffffffffffffffffffffffffffffff808e1694830194855267ffffffffffffffff808e16606085019081528d82166080860190815260a086018b8152875460018181018a55898e528b8e2098516004909202909801805491909f167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116178e5594518d87015596518c8a01805492519851841678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff99909416700100000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009093169190941617179590951694909417909355915160039097019690965593909252905290547fa0b15b5afbd8adc1efc429bc38aa12b0f04d6b9b7ab93f6ec76d54603b4be0ee9188918891889182918991610eb49190611764565b604080516001600160a01b03909716875260208701959095526fffffffffffffffffffffffffffffffff938416948601949094529116606084015267ffffffffffffffff16608083015260a082015260c00160405180910390a1505050505050565b60606000610d1e836110a5565b6040516001600160a01b03808516602483015283166044820152606481018290526103109085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611101565b6040516001600160a01b03831660248201526044810182905261103b9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401610f70565b505050565b60006104f9825490565b6000610d1e83836111e6565b600081815260018301602052604081205461109d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104f9565b5060006104f9565b6060816000018054806020026020016040519081016040528092919081815260200182805480156110f557602002820191906000526020600020905b8154815260200190600101908083116110e1575b50505050509050919050565b6000611156826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112109092919063ffffffff16565b80519091501561103b5780806020019051810190611174919061147e565b61103b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610221565b60008260000182815481106111fd576111fd61180f565b9060005260206000200154905092915050565b606061121f8484600085611227565b949350505050565b60608247101561129f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610221565b6001600160a01b0385163b6112f65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610221565b600080866001600160a01b0316858760405161131291906114c2565b60006040518083038185875af1925050503d806000811461134f576040519150601f19603f3d011682016040523d82523d6000602084013e611354565b606091505b509150915061136482828661136f565b979650505050505050565b6060831561137e575081610d1e565b82511561138e5782518084602001fd5b8160405162461bcd60e51b81526004016102219190611683565b80356001600160a01b03811681146113bf57600080fd5b919050565b6000602082840312156113d657600080fd5b610d1e826113a8565b600080604083850312156113f257600080fd5b6113fb836113a8565b946020939093013593505050565b60008060006060848603121561141e57600080fd5b611427846113a8565b95602085013595506040909401359392505050565b600080600080600060a0868803121561145457600080fd5b61145d866113a8565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561149057600080fd5b81518015158114610d1e57600080fd5b600080604083850312156114b357600080fd5b50508035926020909101359150565b600082516114d481846020870161177b565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561151f5783516001600160a01b0316835292840192918401916001016114fa565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561151f576115ba8385516001600160a01b038151168252602081015160208301526fffffffffffffffffffffffffffffffff6040820151166040830152606081015167ffffffffffffffff8082166060850152806080840151166080850152505060a081015160a08301525050565b9284019260c09290920191600101611547565b6020808252825182820181905260009190848201906040850190845b8181101561151f57835180516001600160a01b0316845285015161166f868501826001600160a01b038151168252602081015160208301526fffffffffffffffffffffffffffffffff6040820151166040830152606081015167ffffffffffffffff8082166060850152806080840151166080850152505060a081015160a08301525050565b509284019260e092909201916001016115e9565b60208152600082518060208401526116a281604085016020870161177b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156116e7576116e76117e0565b500190565b600082611722577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175f5761175f6117e0565b500290565b600082821015611776576117766117e0565b500390565b60005b8381101561179657818101518382015260200161177e565b838111156103105750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156117d9576117d96117e0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122080bfa39e2997969d5299bc1e11e3bf5099ba7c54a98c992812f35c1e43d39cda64736f6c63430008070033

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.