ETH Price: $2,680.77 (-2.07%)

Contract

0xc8fee8f78aBC7ba5fF314091Dc64240Bdd36b794
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Rewards206165752024-08-27 1:15:117 hrs ago1724721311IN
0xc8fee8f7...Bdd36b794
0 ETH0.000052910.9858325
Unstake206165722024-08-27 1:14:357 hrs ago1724721275IN
0xc8fee8f7...Bdd36b794
0 ETH0.000067361.16034952
Claim Rewards206165662024-08-27 1:13:237 hrs ago1724721203IN
0xc8fee8f7...Bdd36b794
0 ETH0.000049420.9208283
Claim Rewards206165472024-08-27 1:09:357 hrs ago1724720975IN
0xc8fee8f7...Bdd36b794
0 ETH0.000074041.37947776
Claim Rewards206148072024-08-26 19:18:2313 hrs ago1724699903IN
0xc8fee8f7...Bdd36b794
0 ETH0.000077211.43853645
Claim Rewards206148032024-08-26 19:17:3513 hrs ago1724699855IN
0xc8fee8f7...Bdd36b794
0 ETH0.000085821.59904664
Claim Rewards206143022024-08-26 17:36:4714 hrs ago1724693807IN
0xc8fee8f7...Bdd36b794
0 ETH0.000091611.70686674
Claim Rewards206142932024-08-26 17:34:5914 hrs ago1724693699IN
0xc8fee8f7...Bdd36b794
0 ETH0.000098851.84183557
Claim Rewards206132572024-08-26 14:06:5918 hrs ago1724681219IN
0xc8fee8f7...Bdd36b794
0 ETH0.000214814.00220042
Unstake206132542024-08-26 14:06:2318 hrs ago1724681183IN
0xc8fee8f7...Bdd36b794
0 ETH0.000248044.2726698
Claim Rewards205998972024-08-24 17:17:472 days ago1724519867IN
0xc8fee8f7...Bdd36b794
0 ETH0.000141872.08538895
Stake205844912024-08-22 13:37:474 days ago1724333867IN
0xc8fee8f7...Bdd36b794
0 ETH0.000145992.8635536
Stake205785802024-08-21 17:46:475 days ago1724262407IN
0xc8fee8f7...Bdd36b794
0 ETH0.00038452.78419095
Stake205714542024-08-20 17:54:476 days ago1724176487IN
0xc8fee8f7...Bdd36b794
0 ETH0.000302172.26683361
Stake205663382024-08-20 0:44:597 days ago1724114699IN
0xc8fee8f7...Bdd36b794
0 ETH0.000253221.89962647
Claim Rewards205472792024-08-17 8:54:119 days ago1723884851IN
0xc8fee8f7...Bdd36b794
0 ETH0.000062220.91459652
Stake205288922024-08-14 19:14:5912 days ago1723662899IN
0xc8fee8f7...Bdd36b794
0 ETH0.000698885.24281185
Claim Rewards205288112024-08-14 18:58:4712 days ago1723661927IN
0xc8fee8f7...Bdd36b794
0 ETH0.000234194.36331342
Claim Rewards205288052024-08-14 18:57:3512 days ago1723661855IN
0xc8fee8f7...Bdd36b794
0 ETH0.000230564.29570023
Stake205161972024-08-13 0:43:2314 days ago1723509803IN
0xc8fee8f7...Bdd36b794
0 ETH0.000224261.68223966
Stake205151282024-08-12 21:09:3514 days ago1723496975IN
0xc8fee8f7...Bdd36b794
0 ETH0.000624084.68173471
Stake204857342024-08-08 18:42:5918 days ago1723142579IN
0xc8fee8f7...Bdd36b794
0 ETH0.000459995.60951629
Stake204854842024-08-08 17:52:3518 days ago1723139555IN
0xc8fee8f7...Bdd36b794
0 ETH0.000802946.02397628
Claim Rewards204801742024-08-08 0:06:3519 days ago1723075595IN
0xc8fee8f7...Bdd36b794
0 ETH0.00020943.07812321
Stake204795472024-08-07 22:00:4719 days ago1723068047IN
0xc8fee8f7...Bdd36b794
0 ETH0.000555114.16432038
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xE28c1a85...32aA8a0d4
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Staking

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 100000 runs

Other Settings:
paris EvmVersion
File 1 of 9 : Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

using SafeERC20 for IERC20;

// Struct to hold user data
struct UserData {
	uint256 lockStart;       // The time when the user last staked
	int256 lockRemaining;    // The time remaining before unlock
	uint256 balance;         // The balance of staked tokens
	uint256 rewards;         // The balance of rewards
}

contract Staking is Ownable, Pausable, ReentrancyGuard {
	
	// Keep the normalized balance of stake tokens for a user
	mapping(address => uint256) public userBalance;
	
	// Keep the initial balance of stake tokens for a user
	mapping(address => uint256) public userBalanceInitial;
	
	// Keep the time of staking for a user
	mapping(address => uint256) public userLock;
	
	// Address of the vault to hold reward tokens
	address public immutable vault;
	
	// Address of the token to be staked
	IERC20 public immutable token;
	
	// Total amount of tokens staked
	uint256 public totalStaked;
	
	// APY of the rewards (in percentage ex. 20)
	uint16 public apy;
	
	// Lock time (in seconds)
	uint256 public lock;
	
	// Global compound index for calculating compound interest
	uint256 public compoundIndex;
	
	// Last update time for the compound index
	uint256 public lastUpdateTime;

    // compoundIndex precision
	uint256 constant ONE = 1e18;

	// number representing 100% in apy calculations
	uint256 constant APY_ONE = 100;

	// seconds in a year: 365 * 24 * 60 * 60
	uint256 constant YEAR = 31536000;
	
	// Events
	event Stake(address indexed user, uint256 amount);
	event Unstake(address indexed user, uint256 amount);
	event Claim(address indexed user, uint256 amount);
	event Withdraw(address indexed vault, uint256 amount);
	event ApySet(uint256 apy);
	event LockSet(uint256 lock);
	
	constructor(IERC20 _token, address _owner, address _vault, uint16 _apy, uint256 _lock) Ownable(_owner) {
		token = _token;
		apy = _apy;
		lock = _lock;
		vault = _vault;
		compoundIndex = ONE;  // Initialize to 1.0 (scaled by 1e18 for precision)
		lastUpdateTime = block.timestamp;

		emit ApySet(_apy);
		emit LockSet(_lock);
	}
	
	/*
	* Internal function to update the compound index based on the elapsed time
	* @params _amount The amount to stake (in wei)
    */
	function stake(uint256 _amount) external nonReentrant whenNotPaused {
		require(_amount > 0, "Cannot stake 0 tokens");
		require(_amount <= token.balanceOf(msg.sender), "No fund available");
		
		// Update the compound index
		updateIndex();
		
		// Transfer the tokens from the user to the contract
		token.safeTransferFrom(msg.sender, address(this), _amount);
		
		// Calculate the adjusted amount based on the current compound index
		uint256 adjustedAmount = (_amount * ONE) / compoundIndex;
		
		// Update the user
		userBalance[msg.sender] += adjustedAmount;
		userBalanceInitial[msg.sender] += _amount;
		userLock[msg.sender] = block.timestamp;
		
		totalStaked += _amount;
		
		emit Stake(msg.sender, _amount);
	}
	
	/*
	* Function to unstake
    */
	function unstake() external nonReentrant whenNotPaused {
		uint256 _amount = userBalanceInitial[msg.sender];
		
		require(_amount > 0, "Cannot unstake 0 tokens");
		require(block.timestamp - userLock[msg.sender] >= lock, "Tokens are locked");
		
		// Update the compound index
		updateIndex();
		
		// Calculate rewards
		uint256 userCompoundBalance = (userBalance[msg.sender] * compoundIndex) / ONE;
		uint256 rewards = userCompoundBalance - _amount;
		
		// Transfer the total amount back to the user
		require(token.balanceOf(address(this)) - totalStaked >= rewards, "No fund available");
		token.safeTransfer(msg.sender, userCompoundBalance);
		
		// Update the user
		delete userBalance[msg.sender];
		delete userBalanceInitial[msg.sender];
		delete userLock[msg.sender];

		totalStaked -= _amount;
		
		emit Unstake(msg.sender, _amount);
		emit Claim(msg.sender, rewards);
	}
	
	/*
	* Function to claim rewards
	*/
	function claimRewards() external nonReentrant whenNotPaused {
		uint256 userStakedAmount = userBalanceInitial[msg.sender];
		require(userStakedAmount > 0, "No tokens staked");
		
		// Update the compound index
		updateIndex();
		
		// Calculate the rewards
		uint256 userCompoundBalance = (userBalance[msg.sender] * compoundIndex) / ONE;
		uint256 rewards = userCompoundBalance - userStakedAmount;
		
		require(rewards > 0, "No rewards available");
		require(token.balanceOf(address(this)) - totalStaked >= rewards, "No fund available");
		
		// Transfer the rewards to the user
		token.safeTransfer(msg.sender, rewards);
		
		// Update the balance
		userBalance[msg.sender] = userStakedAmount * ONE / compoundIndex;
		
		emit Claim(msg.sender, rewards);
	}
	
	/*
	* Function to check the balance of a user
	* @params _user Address of the user to check
	*/
	function balanceOf(address _user) public view returns (UserData memory) {
		int256 remaining = int256(userLock[_user] + lock) - int256(block.timestamp);
		
		UserData memory data;
		
		data.lockStart = userLock[_user];
		data.lockRemaining = remaining;
		data.balance = userBalanceInitial[msg.sender];
		data.rewards = pendingRewards(_user);
		
		return data;
	}
	
	// HELPERS
	
	/*
	* Internal function to update the compound index based on the elapsed time
    */
	function updateIndex() internal {
		if (block.timestamp > lastUpdateTime) {
			compoundIndex = calculateUpdatedIndex();
			lastUpdateTime = block.timestamp;
		}
	}
	
	/*
	* Internal function to calculate the pending rewards of a user
	* @param _user user to calculate rewards for
    */
	function pendingRewards(address _user) internal view returns (uint256) {
		uint256 userStakedAmount = userBalanceInitial[_user];
		if (userStakedAmount == 0) return 0;

		uint256 currentCompoundIndex = calculateUpdatedIndex();		
		uint256 userCompoundBalance = (userBalance[_user] * currentCompoundIndex) / ONE;
		uint256 rewards = userCompoundBalance - userStakedAmount;
		
		return rewards;
	}

	function calculateUpdatedIndex() internal view returns (uint256 indexUpdated) {
		uint256 timeElapsed = block.timestamp - lastUpdateTime;
		uint256 _compoundIndex = compoundIndex;
		indexUpdated = _compoundIndex + _compoundIndex * uint256(apy) * timeElapsed / (APY_ONE * YEAR);
	}
	
	// ADMIN
	
	/*
	* Function to withdraw rewards
	* Only the fund added for the rewards can be withdrawn.
	*/
	function withdraw() external onlyOwner {
		require(token.balanceOf(address(this)) - totalStaked > 0, "No rewards to withdraw");
		
		uint256 balance = token.balanceOf(address(this)) - totalStaked;
		token.safeTransfer(vault, balance);
		
		emit Withdraw(vault, balance);
	}
	
	/*
	* Function to set the APY
	* @params _apy The new apy. Effective immediately. in percent, like 20 (meaning 20%)
	*/
	function setApy(uint16 _apy) external onlyOwner {
		updateIndex();
		apy = _apy;
		
		emit ApySet(_apy);
	}
	
	/*
	* Function to set lock period
	* @params _lock The new lock period (in seconds). Effective immediately. 1 day = 86 400 seconds
	*/
	function setLock(uint256 _lock) external onlyOwner {
		lock = _lock;
		
		emit LockSet(_lock);
	}
	
	/*
	* Function to pause the staking
	*/
	function pause() external onlyOwner {
		require(!paused(), "Staking is already paused");
		_pause();
	}
	
	/*
	* Function to unpause the staking
	*/
	function unpause() external onlyOwner {
		require(paused(), "Staking is not paused");
		_unpause();
	}
}

File 2 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 9 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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 4 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 5 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../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;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 6 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // 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 FailedInnerCall();
        }
    }
}

File 7 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 8 of 9 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 9 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint16","name":"_apy","type":"uint16"},{"internalType":"uint256","name":"_lock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"apy","type":"uint256"}],"name":"ApySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lock","type":"uint256"}],"name":"LockSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"apy","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOf","outputs":[{"components":[{"internalType":"uint256","name":"lockStart","type":"uint256"},{"internalType":"int256","name":"lockRemaining","type":"int256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"rewards","type":"uint256"}],"internalType":"struct UserData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"compoundIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_apy","type":"uint16"}],"name":"setApy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lock","type":"uint256"}],"name":"setLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBalanceInitial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063817b1cd2116100e3578063c8f33c911161008c578063f83d08ba11610066578063f83d08ba14610372578063fbfa77cf1461037b578063fc0c546a146103a257600080fd5b8063c8f33c9114610343578063d3e157471461034c578063f2fde38b1461035f57600080fd5b8063a3f21105116100bd578063a3f21105146102fd578063a694fc3a14610310578063b4b69cba1461032357600080fd5b8063817b1cd2146102ad5780638456cb59146102b65780638da5cb5b146102be57600080fd5b80633f4ba83a116101455780635c975abb1161011f5780635c975abb1461023157806370a082311461025f578063715018a6146102a557600080fd5b80633f4ba83a146102005780634277766a146102085780635617a6e81461021157600080fd5b8063372500ab11610176578063372500ab146101cf5780633bcfc4b8146101d75780633ccfd60b146101f857600080fd5b80630103c92b146101925780632def6620146101c5575b600080fd5b6101b26101a03660046119d5565b60026020526000908152604090205481565b6040519081526020015b60405180910390f35b6101cd6103c9565b005b6101cd610745565b6006546101e59061ffff1681565b60405161ffff90911681526020016101bc565b6101cd610a4d565b6101cd610d10565b6101b260085481565b6101b261021f3660046119d5565b60046020526000908152604090205481565b60005474010000000000000000000000000000000000000000900460ff1660405190151581526020016101bc565b61027261026d3660046119d5565b610da4565b6040516101bc91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101cd610e94565b6101b260055481565b6101cd610ea6565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101bc565b6101cd61030b366004611a0b565b610f3b565b6101cd61031e366004611a2f565b610fb3565b6101b26103313660046119d5565b60036020526000908152604090205481565b6101b260095481565b6101cd61035a366004611a2f565b611268565b6101cd61036d3660046119d5565b6112a5565b6101b260075481565b6102d87f0000000000000000000000004fbc79d384235e59574a2ebb6c721e4b939ce18881565b6102d87f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246381565b6103d1611306565b6103d9611349565b3360009081526003602052604090205480610455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f7420756e7374616b65203020746f6b656e7300000000000000000060448201526064015b60405180910390fd5b600754336000908152600460205260409020546104729042611a77565b10156104da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f546f6b656e7320617265206c6f636b6564000000000000000000000000000000604482015260640161044c565b6104e261139e565b600854336000908152600260205260408120549091670de0b6b3a76400009161050b9190611a8a565b6105159190611aa1565b905060006105238383611a77565b6005546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246316906370a0823190602401602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190611adc565b6105e39190611a77565b101561064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e6f2066756e6420617661696c61626c65000000000000000000000000000000604482015260640161044c565b61068c73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c24631633846113b9565b3360009081526002602090815260408083208390556003825280832083905560049091528120819055600580548592906106c7908490611a77565b909155505060405183815233907f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd9060200160405180910390a260405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4906020015b60405180910390a250505061074360018055565b565b61074d611306565b610755611349565b33600090815260036020526040902054806107cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4e6f20746f6b656e73207374616b656400000000000000000000000000000000604482015260640161044c565b6107d461139e565b600854336000908152600260205260408120549091670de0b6b3a7640000916107fd9190611a8a565b6108079190611aa1565b905060006108158383611a77565b905060008111610881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4e6f207265776172647320617661696c61626c65000000000000000000000000604482015260640161044c565b6005546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282919073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246316906370a0823190602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190611adc565b61093f9190611a77565b10156109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e6f2066756e6420617661696c61626c65000000000000000000000000000000604482015260640161044c565b6109e873ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c24631633836113b9565b6008546109fd670de0b6b3a764000085611a8a565b610a079190611aa1565b33600081815260026020526040908190209290925590517f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49061072f9084815260200190565b610a5561143f565b6005546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000919073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246316906370a0823190602401602060405180830381865afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190611adc565b610b149190611a77565b11610b7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4e6f207265776172647320746f20776974686472617700000000000000000000604482015260640161044c565b6005546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000919073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246316906370a0823190602401602060405180830381865afa158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c309190611adc565b610c3a9190611a77565b9050610c9d73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c2463167f0000000000000000000000004fbc79d384235e59574a2ebb6c721e4b939ce188836113b9565b7f0000000000000000000000004fbc79d384235e59574a2ebb6c721e4b939ce18873ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436482604051610d0591815260200190565b60405180910390a250565b610d1861143f565b60005474010000000000000000000000000000000000000000900460ff16610d9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5374616b696e67206973206e6f74207061757365640000000000000000000000604482015260640161044c565b610743611492565b610dcf6040518060800160405280600081526020016000815260200160008152602001600081525090565b60075473ffffffffffffffffffffffffffffffffffffffff831660009081526004602052604081205490914291610e069190611af5565b610e109190611b08565b9050610e3d6040518060800160405280600081526020016000815260200160008152602001600081525090565b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083205484528382018590523383526003909152908190205490820152610e888461150f565b60608201529392505050565b610e9c61143f565b61074360006115b0565b610eae61143f565b60005474010000000000000000000000000000000000000000900460ff1615610f33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5374616b696e6720697320616c72656164792070617573656400000000000000604482015260640161044c565b610743611625565b610f4361143f565b610f4b61139e565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff83169081179091556040519081527feb96c2afe223f01218957822de6a706141023973470929f7cdff34537ac43694906020015b60405180910390a150565b610fbb611306565b610fc3611349565b6000811161102d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616e6e6f74207374616b65203020746f6b656e730000000000000000000000604482015260640161044c565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246373ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156110b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110db9190611adc565b811115611144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e6f2066756e6420617661696c61626c65000000000000000000000000000000604482015260640161044c565b61114c61139e565b61118e73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004123a133ae3c521fd134d7b13a2dec35b56c246316333084611694565b6008546000906111a6670de0b6b3a764000084611a8a565b6111b09190611aa1565b336000908152600260205260408120805492935083929091906111d4908490611af5565b909155505033600090815260036020526040812080548492906111f8908490611af5565b909155505033600090815260046020526040812042905560058054849290611221908490611af5565b909155505060405182815233907febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a9060200160405180910390a25061126560018055565b50565b61127061143f565b60078190556040518181527fc96ac8f962bbb0ee952304839108c72982a49173fa73e62ede62c943e10f574290602001610fa8565b6112ad61143f565b73ffffffffffffffffffffffffffffffffffffffff81166112fd576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240161044c565b611265816115b0565b600260015403611342576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b60005474010000000000000000000000000000000000000000900460ff1615610743576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600954421115610743576113b06116e0565b60085542600955565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261143a91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061173e565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610743576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161044c565b61149a6117d4565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120548082036115455750600092915050565b600061154f6116e0565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602052604081205491925090670de0b6b3a76400009061158e908490611a8a565b6115989190611aa1565b905060006115a68483611a77565b9695505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61162d611349565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114e53390565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526116da9186918216906323b872dd906084016113f3565b50505050565b600080600954426116f19190611a77565b6008549091506117066301e133806064611a8a565b60065483906117199061ffff1684611a8a565b6117239190611a8a565b61172d9190611aa1565b6117379082611af5565b9250505090565b600061176073ffffffffffffffffffffffffffffffffffffffff841683611828565b905080516000141580156117855750808060200190518101906117839190611b2f565b155b1561143a576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161044c565b60005474010000000000000000000000000000000000000000900460ff16610743576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606118368383600061183f565b90505b92915050565b60608147101561187d576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240161044c565b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516118a69190611b51565b60006040518083038185875af1925050503d80600081146118e3576040519150601f19603f3d011682016040523d82523d6000602084013e6118e8565b606091505b50915091506118f8868383611904565b925050505b9392505050565b6060826119195761191482611993565b6118fd565b815115801561193d575073ffffffffffffffffffffffffffffffffffffffff84163b155b1561198c576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161044c565b50806118fd565b8051156119a35780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156119e757600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146118fd57600080fd5b600060208284031215611a1d57600080fd5b813561ffff811681146118fd57600080fd5b600060208284031215611a4157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561183957611839611a48565b808202811582820484141761183957611839611a48565b600082611ad7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215611aee57600080fd5b5051919050565b8082018082111561183957611839611a48565b8181036000831280158383131683831282161715611b2857611b28611a48565b5092915050565b600060208284031215611b4157600080fd5b815180151581146118fd57600080fd5b6000825160005b81811015611b725760208186018101518583015201611b58565b50600092019182525091905056fea26469706673582212205ca6172fe17032c76f09079f3c59b38982dde4d10a5e4faeba859e3e402811cb64736f6c63430008180033

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.