ETH Price: $2,403.47 (-0.87%)

Contract

0xa36B11Ac72F0899A7DC3fcb812a42F610Bbd3f1C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw198156332024-05-07 3:52:35151 days ago1715053955IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.000339414.85072965
Withdraw198156332024-05-07 3:52:35151 days ago1715053955IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.000339414.85072965
Withdraw198156332024-05-07 3:52:35151 days ago1715053955IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.000339414.85072965
Withdraw196904842024-04-19 15:50:35169 days ago1713541835IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0008632716.32773464
Withdraw194553462024-03-17 15:06:59202 days ago1710688019IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0026895138.4370095
Withdraw194445172024-03-16 2:32:11203 days ago1710556331IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0019303236.50943316
Withdraw193924332024-03-08 19:07:47211 days ago1709924867IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0031841260.22333423
Withdraw193827592024-03-07 10:40:35212 days ago1709808035IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.002843453.77903473
Withdraw193618462024-03-04 12:37:59215 days ago1709555879IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0054086777.29769581
Withdraw193324282024-02-29 9:58:47219 days ago1709200727IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0060463114.35732654
Withdraw191199552024-01-30 14:35:11249 days ago1706625311IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0013927826.34249129
Withdraw189710992024-01-09 18:09:59270 days ago1704823799IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0015304128.94567634
Withdraw189635882024-01-08 16:50:47271 days ago1704732647IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0014282520.41174782
Withdraw189259132024-01-03 9:22:35276 days ago1704273755IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0012968718.53426113
Withdraw189108672024-01-01 6:39:47278 days ago1704091187IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0006627312.5347415
Withdraw188921752023-12-29 15:38:11281 days ago1703864291IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0027516239.32468901
Withdraw188397882023-12-22 7:05:59288 days ago1703228759IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0018178734.3824867
Withdraw187980112023-12-16 10:24:11294 days ago1702722251IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0030869144.11650116
Withdraw187506982023-12-09 19:18:35301 days ago1702149515IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0016864931.89775442
Withdraw187279202023-12-06 14:35:59304 days ago1701873359IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0033535463.42758219
Withdraw186919232023-12-01 13:40:59309 days ago1701438059IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.00263337.62941187
Withdraw186734982023-11-28 23:48:35311 days ago1701215315IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0017731233.53613046
Withdraw186648772023-11-27 18:51:11313 days ago1701111071IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0029805342.59606785
Withdraw186602872023-11-27 3:25:35313 days ago1701055535IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0013021324.62807756
Withdraw186555282023-11-26 11:23:35314 days ago1700997815IN
0xa36B11Ac...10Bbd3f1C
0 ETH0.0013475525.48703081
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 0x454Bb57b...5CA3Be309
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.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "Ownable.sol";
import "ERC20Burnable.sol";
contract Staking is Ownable {
    address public stakeToken;
    address public treasure;

    uint public unHoldFee;
    uint public minStakeAmount;
    uint public zeroRewardTimePercent;
    bool public paused=true;

    struct StakeData {
        uint stakeAmount;
        uint startTimestamp;
        uint stakeTime;
        bool active;
    }

    mapping(address => StakeData) public stakes;

    event Stake(address indexed staker, uint stakeAmountIn, uint stakeTime);
    event Withdraw(address indexed staker, uint stakeAmountOut);

    // stakeTime => reward in %, 100e18 is 100%
    mapping (uint => uint) public timeReward;

    constructor(address stakeToken_, address treasure_, uint zeroRewardTimePercent_, uint minStakeAmount_) {
        require(
            stakeToken_ != address(0)
            && treasure_ != address(0),
            "Staking::initialize: address is 0"
        );

        stakeToken = stakeToken_;
        treasure = treasure_;

        minStakeAmount = minStakeAmount_;
        unHoldFee = 30e18; // 30%
        zeroRewardTimePercent = zeroRewardTimePercent_;
        timeReward[90 days]  = 20e18; // 20%
        timeReward[180 days] = 40e18; // 40%
        timeReward[360 days] = 60e18; // 60%
        timeReward[720 days] = 60e18; // 60%
    }

    function updateZeroRewardTimePercent(uint _newPercent) public onlyOwner returns (bool) {
        zeroRewardTimePercent = _newPercent;
        return true;
    }
    function updateTimeReward(uint stakeTime, uint percentReward) public onlyOwner returns (bool) {
        timeReward[stakeTime] = percentReward;

        return true;
    }

    function setTreasure(address treasure_) public onlyOwner returns (bool) {
        treasure = treasure_;

        return true;
    }

    function setPause(bool paused_) public onlyOwner returns (bool) {
        paused = paused_;

        return true;
    }

    function updateMinStakeAmount(uint amount_) public onlyOwner returns (bool) {
        minStakeAmount = amount_;

        return true;
    }

    // transfer stake tokens from user to pool
    function stake(uint tokenAmount, uint stakeTime) public returns (bool) {
        require(!paused, "Staking::stake: stake is paused");

        uint rewardPercent = timeReward[stakeTime];
        require(rewardPercent != 0, "Staking::stake:rewardPercent must be more than 0");

        address staker = msg.sender;
        require(!stakes[staker].active, "Staking::stake:stake must be not active");

        stakes[staker].active = true;
        uint amountIn = doTransferIn(staker, stakeToken, tokenAmount);
        require(amountIn > minStakeAmount, "Staking::stake: stake amount must be more than minStakeAmount");

        uint timestamp = getBlockTimestamp();
        stakes[staker].startTimestamp = timestamp;
        stakes[staker].stakeTime = stakeTime;
        stakes[staker].stakeAmount = amountIn;

        emit Stake(staker, amountIn, stakeTime);

        return true;
    }

    // transfer stake tokens from pool to user
    function withdraw() external {
        address staker = msg.sender;
        require(stakes[staker].active, "Staking::withdraw: stake must be active");
        stakes[staker].active = false;

        (uint amountOut, uint feeAmount) = calcOutAmount(staker);
        if (feeAmount > 0) {
            uint transferOutAmount = feeAmount / 2;

            ERC20Burnable(stakeToken).burn(transferOutAmount);
            ERC20Burnable(stakeToken).transfer(treasure, transferOutAmount);
        } 
        doTransferOut(stakeToken, staker, amountOut);

        emit Withdraw(staker, amountOut);
    }

    function calcFee(uint stakeAmount, uint currentTimestamp, uint startTimestamp, uint stakeTime) public view returns (uint) {
        uint delta = (currentTimestamp - startTimestamp);
        if (stakeTime <= delta) {
            return 0;
        }

        return stakeAmount * unHoldFee * (stakeTime - delta) / stakeTime / 100e18;
    }

    function getStake(address user) public view returns (StakeData memory) {
        return stakes[user];
    }

    function calcOutAmount(address staker) public view returns (uint, uint) {
        uint stakeAmount = stakes[staker].stakeAmount;
        uint startTimestamp = stakes[staker].startTimestamp;
        uint stakeTime = stakes[staker].stakeTime;
        uint currentTimestamp = getBlockTimestamp();

        uint feeAmount = calcFee(stakeAmount, currentTimestamp, startTimestamp, stakeTime);
        uint amountOut;

        if (feeAmount > 0) {
            amountOut = stakeAmount - feeAmount;
         }
        else {
            uint endZeroRewardPeriod = (startTimestamp + stakeTime) + stakeTime * zeroRewardTimePercent / 100;
            if(currentTimestamp <= endZeroRewardPeriod) {
                amountOut = stakeAmount;
            }
            else {
                amountOut = stakeAmount + (stakeAmount * timeReward[stakeTime] / 100e18);
            }
        }    
        return(amountOut, feeAmount);
    }

    /**
     * @dev Function to simply retrieve block number
     *  This exists mainly for inheriting test contracts to stub this result.
     */
    function getBlockTimestamp() internal virtual view returns (uint) {
        return block.timestamp;
    }

    function doTransferIn(address from, address token, uint amount) internal returns (uint) {
        uint balanceBefore = ERC20(token).balanceOf(address(this));
        ERC20(token).transferFrom(from, address(this), amount);

        bool success;
        assembly {
            switch returndatasize()
            case 0 {                       // This is a non-standard ERC-20
                success := not(0)          // set success to true
            }
            case 32 {                      // This is a compliant ERC-20
                returndatacopy(0, 0, 32)
                success := mload(0)        // Set `success = returndata` of external call
            }
            default {                      // This is an excessively non-compliant ERC-20, revert.
                revert(0, 0)
            }
        }
        require(success, "TOKEN_TRANSFER_IN_FAILED");

        // Calculate the amount that was *actually* transferred
        uint balanceAfter = ERC20(token).balanceOf(address(this));
        require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
        return balanceAfter - balanceBefore;   // underflow already checked above, just subtract
    }

    function doTransferOut(address token, address to, uint amount) internal {
        ERC20(token).transfer(to, amount);

        bool success;
        assembly {
            switch returndatasize()
            case 0 {                      // This is a non-standard ERC-20
                success := not(0)          // set success to true
            }
            case 32 {                     // This is a complaint ERC-20
                returndatacopy(0, 0, 32)
                success := mload(0)        // Set `success = returndata` of external call
            }
            default {                     // This is an excessively non-compliant ERC-20, revert.
                revert(0, 0)
            }
        }
        require(success, "TOKEN_TRANSFER_OUT_FAILED");
    }
}

File 2 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 7 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 4 of 7 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "ERC20.sol";
import "Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 currentAllowance = allowance(account, _msgSender());
        require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
        unchecked {
            _approve(account, _msgSender(), currentAllowance - amount);
        }
        _burn(account, amount);
    }
}

File 5 of 7 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 6 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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);
}

File 7 of 7 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"stakeToken_","type":"address"},{"internalType":"address","name":"treasure_","type":"address"},{"internalType":"uint256","name":"zeroRewardTimePercent_","type":"uint256"},{"internalType":"uint256","name":"minStakeAmount_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakeTime","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeAmountOut","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"stakeTime","type":"uint256"}],"name":"calcFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"calcOutAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getStake","outputs":[{"components":[{"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"stakeTime","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"}],"internalType":"struct Staking.StakeData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minStakeAmount","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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused_","type":"bool"}],"name":"setPause","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasure_","type":"address"}],"name":"setTreasure","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"uint256","name":"stakeTime","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakes","outputs":[{"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"stakeTime","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"timeReward","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":"treasure","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unHoldFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"updateMinStakeAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeTime","type":"uint256"},{"internalType":"uint256","name":"percentReward","type":"uint256"}],"name":"updateTimeReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPercent","type":"uint256"}],"name":"updateZeroRewardTimePercent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"zeroRewardTimePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80637b0472f0116100b8578063d8060cd51161007c578063d8060cd514610302578063df356f7614610315578063e520fc7e14610328578063e522fe011461033b578063f18876841461034e578063f2fde38b1461035757600080fd5b80637b0472f0146102b9578063893adcdc146102cc5780638c5a02f9146102d55780638da5cb5b146102de578063bedb86fb146102ef57600080fd5b806351ed6a30116100ff57806351ed6a30146102095780635c975abb14610234578063688e1c1214610241578063715018a6146102695780637a7664601461027157600080fd5b806304c1325c1461013c57806316934fc4146101625780631d3cd2a6146101bc5780633218809f146101df5780633ccfd60b146101ff575b600080fd5b61014f61014a366004610f18565b61036a565b6040519081526020015b60405180910390f35b61019a610170366004610f4a565b60076020526000908152604090208054600182015460028301546003909301549192909160ff1684565b6040805194855260208501939093529183015215156060820152608001610159565b6101cf6101ca366004610f4a565b6103d6565b6040519015158152602001610159565b61014f6101ed366004610f7a565b60086020526000908152604090205481565b61020761042f565b005b60015461021c906001600160a01b031681565b6040516001600160a01b039091168152602001610159565b6006546101cf9060ff1681565b61025461024f366004610f4a565b610620565b60408051928352602083019190915201610159565b6102076106fc565b61028461027f366004610f4a565b610732565b604051610159919081518152602080830151908201526040808301519082015260609182015115159181019190915260800190565b6101cf6102c7366004610f93565b6107b2565b61014f60035481565b61014f60055481565b6000546001600160a01b031661021c565b6101cf6102fd366004610fc3565b610a17565b6101cf610310366004610f7a565b610a59565b6101cf610323366004610f93565b610a8d565b60025461021c906001600160a01b031681565b6101cf610349366004610f7a565b610ace565b61014f60045481565b610207610365366004610f4a565b610b02565b6000806103778486610ff6565b905080831161038a5760009150506103ce565b68056bc75e2d631000008361039f8382610ff6565b6003546103ac908a61100d565b6103b6919061100d565b6103c0919061102c565b6103ca919061102c565b9150505b949350505050565b600080546001600160a01b0316331461040a5760405162461bcd60e51b81526004016104019061104e565b60405180910390fd5b50600280546001600160a01b0383166001600160a01b03199091161790556001919050565b3360008181526007602052604090206003015460ff166104a15760405162461bcd60e51b815260206004820152602760248201527f5374616b696e673a3a77697468647261773a207374616b65206d7573742062656044820152662061637469766560c81b6064820152608401610401565b6001600160a01b0381166000908152600760205260408120600301805460ff19169055806104ce83610620565b909250905080156105c15760006104e660028361102c565b600154604051630852cd8d60e31b8152600481018390529192506001600160a01b0316906342966c6890602401600060405180830381600087803b15801561052d57600080fd5b505af1158015610541573d6000803e3d6000fd5b505060015460025460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018690529116925063a9059cbb91506044016020604051808303816000875af115801561059a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105be9190611083565b50505b6001546105d8906001600160a01b03168484610b9d565b826001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648360405161061391815260200190565b60405180910390a2505050565b6001600160a01b03811660009081526007602052604081208054600182015460029092015483929042846106568583868661036a565b9050600081156106715761066a8287610ff6565b90506106ef565b6000606460055486610683919061100d565b61068d919061102c565b61069786886110a0565b6106a191906110a0565b90508084116106b2578691506106ed565b60008581526008602052604090205468056bc75e2d63100000906106d6908961100d565b6106e0919061102c565b6106ea90886110a0565b91505b505b9890975095505050505050565b6000546001600160a01b031633146107265760405162461bcd60e51b81526004016104019061104e565b6107306000610c91565b565b61075f60405180608001604052806000815260200160008152602001600081526020016000151581525090565b506001600160a01b031660009081526007602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260039091015460ff161515606082015290565b60065460009060ff16156108085760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e673a3a7374616b653a207374616b6520697320706175736564006044820152606401610401565b6000828152600860205260409020548061087d5760405162461bcd60e51b815260206004820152603060248201527f5374616b696e673a3a7374616b653a72657761726450657263656e74206d757360448201526f074206265206d6f7265207468616e20360841b6064820152608401610401565b3360008181526007602052604090206003015460ff16156108f05760405162461bcd60e51b815260206004820152602760248201527f5374616b696e673a3a7374616b653a7374616b65206d757374206265206e6f746044820152662061637469766560c81b6064820152608401610401565b6001600160a01b038082166000908152600760205260408120600301805460ff1916600190811790915554909161092a9184911688610ce1565b905060045481116109a35760405162461bcd60e51b815260206004820152603d60248201527f5374616b696e673a3a7374616b653a207374616b6520616d6f756e74206d757360448201527f74206265206d6f7265207468616e206d696e5374616b65416d6f756e740000006064820152608401610401565b6001600160a01b0382166000818152600760209081526040918290204260018201819055600282018a905590859055825185815291820189905282519093927f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b6928290030190a25060019695505050505050565b600080546001600160a01b03163314610a425760405162461bcd60e51b81526004016104019061104e565b506006805460ff1916911515919091179055600190565b600080546001600160a01b03163314610a845760405162461bcd60e51b81526004016104019061104e565b50600455600190565b600080546001600160a01b03163314610ab85760405162461bcd60e51b81526004016104019061104e565b5060009182526008602052604090912055600190565b600080546001600160a01b03163314610af95760405162461bcd60e51b81526004016104019061104e565b50600555600190565b6000546001600160a01b03163314610b2c5760405162461bcd60e51b81526004016104019061104e565b6001600160a01b038116610b915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610401565b610b9a81610c91565b50565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c109190611083565b5060003d8015610c275760208114610c3157600080fd5b6000199150610c3d565b60206000803e60005191505b5080610c8b5760405162461bcd60e51b815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c4544000000000000006044820152606401610401565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e91906110b8565b6040516323b872dd60e01b81526001600160a01b03878116600483015230602483015260448201869052919250908516906323b872dd906064016020604051808303816000875af1158015610da7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcb9190611083565b5060003d8015610de25760208114610dec57600080fd5b6000199150610df8565b60206000803e60005191505b5080610e465760405162461bcd60e51b815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c454400000000000000006044820152606401610401565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015610e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb191906110b8565b905082811015610f035760405162461bcd60e51b815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f570000000000006044820152606401610401565b610f0d8382610ff6565b979650505050505050565b60008060008060808587031215610f2e57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215610f5c57600080fd5b81356001600160a01b0381168114610f7357600080fd5b9392505050565b600060208284031215610f8c57600080fd5b5035919050565b60008060408385031215610fa657600080fd5b50508035926020909101359150565b8015158114610b9a57600080fd5b600060208284031215610fd557600080fd5b8135610f7381610fb5565b634e487b7160e01b600052601160045260246000fd5b60008282101561100857611008610fe0565b500390565b600081600019048311821515161561102757611027610fe0565b500290565b60008261104957634e487b7160e01b600052601260045260246000fd5b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561109557600080fd5b8151610f7381610fb5565b600082198211156110b3576110b3610fe0565b500190565b6000602082840312156110ca57600080fd5b505191905056fea26469706673582212201ab5d109c11845499653b1fd5c8f500e0258346fbe4cb69b7ceacf75bb92bcbb64736f6c634300080a0033

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.