ETH Price: $2,595.06 (-3.05%)
Gas: 4 Gwei

Contract

0x367eB1D2da765d552b03F193EEc6696329D9a166
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw138364542021-12-19 15:34:05966 days ago1639928045IN
0x367eB1D2...329D9a166
0 ETH0.0046843234.82740417
Compensation135271092021-10-31 21:11:431015 days ago1635714703IN
0x367eB1D2...329D9a166
0 ETH0.05133271143.81772791
Compensation135179982021-10-30 10:43:561016 days ago1635590636IN
0x367eB1D2...329D9a166
0 ETH0.02768067143.5801726
Add P Token135106272021-10-29 6:49:231018 days ago1635490163IN
0x367eB1D2...329D9a166
0 ETH0.00819373111.17078718
Compensation133464182021-10-03 13:13:321043 days ago1633266812IN
0x367eB1D2...329D9a166
0 ETH0.0111385454.80435014
Compensation133464002021-10-03 13:08:581043 days ago1633266538IN
0x367eB1D2...329D9a166
0 ETH0.0176867252.376555
Transfer Ownersh...133463552021-10-03 12:59:531043 days ago1633265993IN
0x367eB1D2...329D9a166
0 ETH0.0011738741.06601266
Add User Balance133462212021-10-03 12:29:371043 days ago1633264177IN
0x367eB1D2...329D9a166
0 ETH0.0047029636
Add P Token133460692021-10-03 11:55:151043 days ago1633262115IN
0x367eB1D2...329D9a166
0 ETH0.0029491240
Add P Token133460692021-10-03 11:55:151043 days ago1633262115IN
0x367eB1D2...329D9a166
0 ETH0.0029486440
Add P Token133460692021-10-03 11:55:151043 days ago1633262115IN
0x367eB1D2...329D9a166
0 ETH0.0029500840
Add P Token133460692021-10-03 11:55:151043 days ago1633262115IN
0x367eB1D2...329D9a166
0 ETH0.0029491240
Add P Token133460692021-10-03 11:55:151043 days ago1633262115IN
0x367eB1D2...329D9a166
0 ETH0.0029491240
Add P Token133460672021-10-03 11:55:081043 days ago1633262108IN
0x367eB1D2...329D9a166
0 ETH0.0029491240
Add P Token133460662021-10-03 11:55:031043 days ago1633262103IN
0x367eB1D2...329D9a166
0 ETH0.0029491240
Add P Token133460632021-10-03 11:54:451043 days ago1633262085IN
0x367eB1D2...329D9a166
0 ETH0.0036340840
0x60806040133460622021-10-03 11:54:411043 days ago1633262081IN
 Create: Compensation
0 ETH0.059381240

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Compensation

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

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

import "./Services/Blacklist.sol";
import "./Services/Transfers.sol";

contract Compensation is Transfers, BlackList {

    address public stableCoin;
    uint public startTimestamp;

    uint public constant year = 365 days;
    uint public rewardRatePerSec;
    uint public lastApyTimestamp;

    mapping(address => uint) public pTokenPrices;
    address[] public pTokensList;

    struct Balance {
        uint amount;
        uint out;
    }

    mapping(address => Balance) public balances;
    mapping(address => mapping(address => uint)) public pTokenAmounts;

    uint[] public checkpoints;
    uint public totalAmount;

    constructor(
        address stableCoin_,
        uint startTimestamp_,
        uint rewardAPY_,
        uint lastApyTimestamp_
    ) {
        require(stableCoin_ != address(0), "Compensation::Constructor: stableCoin_ is 0");

        require(
            startTimestamp_ != 0
            && lastApyTimestamp_ !=0,
            "Compensation::Constructor: timestamp is 0"
        );

        require(
            startTimestamp_ > getBlockTimestamp()
            && lastApyTimestamp_ > startTimestamp_,
            "Compensation::Constructor: start timestamp must be more than current timestamp and less than lastApyTimestamp"
        );

        stableCoin = stableCoin_;
        startTimestamp = startTimestamp_;
        rewardRatePerSec = rewardAPY_ / year;
        lastApyTimestamp = lastApyTimestamp_;
    }

    function addPToken(address pToken, uint price) public onlyOwner returns (bool) {
        require(pTokenPrices[pToken] == 0, "pToken has already been added");

        pTokenPrices[pToken] = price;
        pTokensList.push(pToken);

        return true;
    }

    function addCheckpoint(uint stableCoinAmount) public onlyOwner returns (bool) {
        uint amountIn = doTransferIn(msg.sender, stableCoin, stableCoinAmount);

        if (amountIn > 0 ) {
            checkpoints.push(amountIn);
        }

        return true;
    }

    function withdraw(address token, uint amount) public onlyOwner returns (bool) {
        doTransferOut(token, msg.sender, amount);

        return true;
    }

    function addUserBalance(address user, address pToken, uint amount) public onlyOwner returns (bool) {
        compensationInternal(user, pToken, amount);

        return true;
    }

    function compensation(address pToken, uint pTokenAmount) public returns (bool) {
        require(getBlockTimestamp() < startTimestamp, "Compensation::compensation: you can convert pTokens before start timestamp only");
        require(pTokenPrices[pToken] != 0, "Compensation::compensation: pToken is not allowed");

        uint amount = doTransferIn(msg.sender, pToken, pTokenAmount);
        compensationInternal(msg.sender, pToken, amount);
        return true;
    }

    function compensationInternal(address user, address pToken, uint amount) internal returns (bool) {
        pTokenAmounts[user][pToken] += amount;
        uint stableTokenAmount = calcCompensationAmount(pToken, amount);
        balances[user].amount += stableTokenAmount;
        totalAmount += stableTokenAmount;

        return true;
    }

    function calcCompensationAmount(address pToken, uint amount) public view returns (uint) {
        uint price = pTokenPrices[pToken];

        uint pTokenDecimals = ERC20(pToken).decimals();
        uint stableDecimals = ERC20(stableCoin).decimals();
        uint factor;

        if (pTokenDecimals >= stableDecimals) {
            factor = 10**(pTokenDecimals - stableDecimals);
            return amount * price / factor / 1e18;
        } else {
            factor = 10**(stableDecimals - pTokenDecimals);
            return amount * price * factor / 1e18;
        }
    }

    function claimToken() public returns (bool) {
        require(getBlockTimestamp() > startTimestamp, "Compensation::claimToken: bad timing for the request");
        require(!isBlackListed[msg.sender], "Compensation::claimToken: user in black list");

        uint amount = calcClaimAmount(msg.sender);

        balances[msg.sender].out += amount;

        doTransferOut(stableCoin, msg.sender, amount);

        return true;
    }

    function calcUserAdditionAmount(address user) public view returns (uint) {
        uint amount = balances[user].amount;
        return calcAdditionAmount(amount);
    }

    function calcAdditionAmount(uint amount) public view returns (uint) {
        uint currentTimestamp = getBlockTimestamp();
        uint duration;

        if (currentTimestamp <= startTimestamp) {
            return 0;
        } else if (currentTimestamp > lastApyTimestamp) {
            duration = lastApyTimestamp - startTimestamp;
        } else if (lastApyTimestamp <= startTimestamp) {
            duration = 0;
        } else {
            duration = currentTimestamp - startTimestamp;
        }

        return amount * rewardRatePerSec * duration / 1e18;
    }

    function calcClaimAmount(address user) public view returns (uint) {
        uint amount = balances[user].amount;
        uint currentTimestamp = getBlockTimestamp();

        if (amount == 0 || amount == balances[user].out || currentTimestamp <= startTimestamp) {
            return 0;
        }

        uint additionalAmount = calcAdditionAmount(amount);
        uint additionalTotalAmount = calcAdditionAmount(totalAmount);

        uint allAmount = amount + additionalAmount;
        uint allTotalAmount = totalAmount + additionalTotalAmount;

        if (allAmount == 0 || allAmount == balances[user].out) {
            return 0;
        }

        uint claimAmount;

        for (uint i = 0; i < checkpoints.length; i++) {
            claimAmount += allAmount * checkpoints[i] / allTotalAmount;
        }

        if (claimAmount > allAmount) {
            return allAmount - balances[user].out;
        } else {
            return claimAmount - balances[user].out;
        }
    }

    function getCheckpointsLength() public view returns (uint) {
        return checkpoints.length;
    }

    function getPTokenList() public view returns (address[] memory) {
        return pTokensList;
    }

    function getPTokenListLength() public view returns (uint) {
        return pTokensList.length;
    }

    function getBlockTimestamp() public view virtual returns (uint) {
        return block.timestamp;
    }
}

File 2 of 9 : Blacklist.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "openzeppelin-solidity/contracts/access/Ownable.sol";

contract BlackList is Ownable {
    mapping (address => bool) public isBlackListed;

    event AddedBlackList(address _user);

    event RemovedBlackList(address _user);

    function addBlackList(address _evilUser) public onlyOwner {
        isBlackListed[_evilUser] = true;

        emit AddedBlackList(_evilUser);
    }

    function removeBlackList(address _clearedUser) public onlyOwner {
        isBlackListed[_clearedUser] = false;

        emit RemovedBlackList(_clearedUser);
    }

    function getBlackListStatus(address _maker) external view returns (bool) {
        return isBlackListed[_maker];
    }
}

File 3 of 9 : Transfers.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "./ERC20.sol";

contract Transfers {
    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 4 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../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.
 *
 * 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 5 of 9 : 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 6 of 9 : ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";

contract ERC20Token is ERC20 {
    constructor(
        uint256 initialSupply,
        string memory name,
        string memory symbol
    ) ERC20(name, symbol) {
        _mint(msg.sender, initialSupply);
    }

    function mint(uint256 amount) external {
        _mint(msg.sender, amount);
    }
}

contract ERC20TokenDec6 is ERC20 {
    constructor(
        uint256 initialSupply,
        string memory name,
        string memory symbol
    ) ERC20(name, symbol) {
        _mint(msg.sender, initialSupply);
    }

    function mint(uint256 amount) external {
        _mint(msg.sender, amount);
    }

    function decimals() public view virtual override returns (uint8) {
        return 6;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/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 8 of 9 : 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 9 of 9 : 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
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"stableCoin_","type":"address"},{"internalType":"uint256","name":"startTimestamp_","type":"uint256"},{"internalType":"uint256","name":"rewardAPY_","type":"uint256"},{"internalType":"uint256","name":"lastApyTimestamp_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_user","type":"address"}],"name":"AddedBlackList","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":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"inputs":[{"internalType":"address","name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stableCoinAmount","type":"uint256"}],"name":"addCheckpoint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pToken","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"addPToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"pToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addUserBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"out","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcAdditionAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"calcClaimAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcCompensationAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"calcUserAdditionAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"checkpoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pToken","type":"address"},{"internalType":"uint256","name":"pTokenAmount","type":"uint256"}],"name":"compensation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCheckpointsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPTokenList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPTokenListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isBlackListed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastApyTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"pTokenAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pTokenPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pTokensList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardRatePerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stableCoin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmount","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":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"year","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162001a9238038062001a9283398101604081905262000034916200026d565b6200003f336200021d565b6001600160a01b038416620000af5760405162461bcd60e51b815260206004820152602b60248201527f436f6d70656e736174696f6e3a3a436f6e7374727563746f723a20737461626c60448201526a065436f696e5f20697320360ac1b60648201526084015b60405180910390fd5b8215801590620000be57508015155b6200011e5760405162461bcd60e51b815260206004820152602960248201527f436f6d70656e736174696f6e3a3a436f6e7374727563746f723a2074696d6573604482015268074616d7020697320360bc1b6064820152608401620000a6565b42831180156200012d57508281115b620001dd5760405162461bcd60e51b815260206004820152606d60248201527f436f6d70656e736174696f6e3a3a436f6e7374727563746f723a20737461727460448201527f2074696d657374616d70206d757374206265206d6f7265207468616e2063757260648201527f72656e742074696d657374616d7020616e64206c657373207468616e206c617360848201526c07441707954696d657374616d7609c1b60a482015260c401620000a6565b600280546001600160a01b0319166001600160a01b03861617905560038390556200020d6301e1338083620002ba565b60045560055550620002dd915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080608085870312156200028457600080fd5b84516001600160a01b03811681146200029c57600080fd5b60208601516040870151606090970151919890975090945092505050565b600082620002d857634e487b7160e01b600052601260045260246000fd5b500490565b6117a580620002ed6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c8063ab0800e31161010f578063e4997dc5116100a2578063f2fde38b11610071578063f2fde38b1461044b578063f32697161461045e578063f3fef3a314610469578063fe13c7461461047c57600080fd5b8063e4997dc5146103f1578063e6fd48bc14610404578063eafdd5da1461040d578063efcbf1501461043857600080fd5b8063bddff592116100de578063bddff5921461039f578063c324845a146103a8578063d90e5d4a146103bb578063e47d6060146103ce57600080fd5b8063ab0800e314610368578063ae81b32914610371578063b77df4e814610384578063b8a242521461038c57600080fd5b806359bf1abe116101875780639435b808116101565780639435b80814610327578063992642e51461032f578063a2befa6414610342578063a465ad5f1461035557600080fd5b806359bf1abe146102c8578063715018a6146102f4578063796b89b9146102fc5780638da5cb5b1461030257600080fd5b806327e235e3116101c357806327e235e31461025c5780633beb7c92146102985780634451d89f146102ab578063574756bf146102b357600080fd5b80630ecb93c0146101f55780631270a02d1461020a578063136f235b146102325780631a39d8ef14610245575b600080fd5b610208610203366004611420565b61049c565b005b61021d6102183660046114f6565b61052b565b60405190151581526020015b60405180910390f35b61021d6102403660046114aa565b6105ba565b61024e600b5481565b604051908152602001610229565b61028361026a366004611420565b6008602052600090815260409020805460019091015482565b60408051928352602083019190915201610229565b61024e6102a63660046114f6565b6106f7565b61021d61078a565b6102bb6108cb565b604051610229919061154b565b61021d6102d6366004611420565b6001600160a01b031660009081526001602052604090205460ff1690565b61020861092d565b4261024e565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610229565b60075461024e565b60025461030f906001600160a01b031681565b61024e610350366004611420565b610963565b61021d61036336600461146e565b610af8565b61024e60055481565b61021d61037f3660046114aa565b610b39565b600a5461024e565b61024e61039a3660046114f6565b610c30565b61024e60045481565b61024e6103b6366004611420565b610c51565b61030f6103c93660046114f6565b610c7a565b61021d6103dc366004611420565b60016020526000908152604090205460ff1681565b6102086103ff366004611420565b610ca4565b61024e60035481565b61024e61041b36600461143b565b600960209081526000928352604080842090915290825290205481565b61024e6104463660046114aa565b610d1f565b610208610459366004611420565b610ed7565b61024e6301e1338081565b61021d6104773660046114aa565b610f72565b61024e61048a366004611420565b60066020526000908152604090205481565b6000546001600160a01b031633146104cf5760405162461bcd60e51b81526004016104c690611598565b60405180910390fd5b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc91015b60405180910390a150565b600080546001600160a01b031633146105565760405162461bcd60e51b81526004016104c690611598565b6002546000906105719033906001600160a01b031685610fb1565b905080156105af57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8018190555b60019150505b919050565b60006003546105c64290565b106106515760405162461bcd60e51b815260206004820152604f60248201527f436f6d70656e736174696f6e3a3a636f6d70656e736174696f6e3a20796f752060448201527f63616e20636f6e766572742070546f6b656e73206265666f726520737461727460648201526e2074696d657374616d70206f6e6c7960881b608482015260a4016104c6565b6001600160a01b0383166000908152600660205260409020546106d05760405162461bcd60e51b815260206004820152603160248201527f436f6d70656e736174696f6e3a3a636f6d70656e736174696f6e3a2070546f6b604482015270195b881a5cc81b9bdd08185b1b1bddd959607a1b60648201526084016104c6565b60006106dd338585610fb1565b90506106ea338583611215565b5060019150505b92915050565b60008042905060006003548211610712575060009392505050565b6005548211156107335760035460055461072c9190611711565b9050610756565b6003546005541161074657506000610756565b6003546107539083611711565b90505b670de0b6b3a7640000816004548661076e91906116f2565b61077891906116f2565b61078291906115e5565b949350505050565b60006003546107964290565b116108005760405162461bcd60e51b815260206004820152603460248201527f436f6d70656e736174696f6e3a3a636c61696d546f6b656e3a206261642074696044820152731b5a5b99c8199bdc881d1a19481c995c5d595cdd60621b60648201526084016104c6565b3360009081526001602052604090205460ff16156108755760405162461bcd60e51b815260206004820152602c60248201527f436f6d70656e736174696f6e3a3a636c61696d546f6b656e3a2075736572206960448201526b1b88189b1858dac81b1a5cdd60a21b60648201526084016104c6565b600061088033610963565b336000908152600860205260408120600101805492935083929091906108a79084906115cd565b90915550506002546108c3906001600160a01b031633836112b6565b600191505090565b6060600780548060200260200160405190810160405280929190818152602001828054801561092357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610905575b5050505050905090565b6000546001600160a01b031633146109575760405162461bcd60e51b81526004016104c690611598565b61096160006113b9565b565b6001600160a01b038116600090815260086020526040812054428115806109a457506001600160a01b03841660009081526008602052604090206001015482145b806109b157506003548111155b156109c0575060009392505050565b60006109cb836106f7565b905060006109da600b546106f7565b905060006109e883866115cd565b9050600082600b546109fa91906115cd565b9050811580610a2357506001600160a01b03881660009081526008602052604090206001015482145b15610a3657506000979650505050505050565b6000805b600a54811015610a965782600a8281548110610a5857610a58611759565b906000526020600020015485610a6e91906116f2565b610a7891906115e5565b610a8290836115cd565b915080610a8e81611728565b915050610a3a565b5082811115610ad2576001600160a01b038916600090815260086020526040902060010154610ac59084611711565b9998505050505050505050565b6001600160a01b038916600090815260086020526040902060010154610ac59082611711565b600080546001600160a01b03163314610b235760405162461bcd60e51b81526004016104c690611598565b610b2e848484611215565b506001949350505050565b600080546001600160a01b03163314610b645760405162461bcd60e51b81526004016104c690611598565b6001600160a01b03831660009081526006602052604090205415610bca5760405162461bcd60e51b815260206004820152601d60248201527f70546f6b656e2068617320616c7265616479206265656e20616464656400000060448201526064016104c6565b506001600160a01b03919091166000818152600660205260408120929092556007805460018082018355919093527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68890920180546001600160a01b031916909117905590565b600a8181548110610c4057600080fd5b600091825260209091200154905081565b6001600160a01b038116600090815260086020526040812054610c73816106f7565b9392505050565b60078181548110610c8a57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b03163314610cce5760405162461bcd60e51b81526004016104c690611598565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9101610520565b60008060066000856001600160a01b03166001600160a01b031681526020019081526020016000205490506000846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8557600080fd5b505afa158015610d99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbd9190611528565b60ff1690506000600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1257600080fd5b505afa158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611528565b60ff1690506000818310610ea257610e628284611711565b610e6d90600a61164a565b9050670de0b6b3a764000081610e8386896116f2565b610e8d91906115e5565b610e9791906115e5565b9450505050506106f1565b610eac8383611711565b610eb790600a61164a565b9050670de0b6b3a764000081610ecd86896116f2565b610e8d91906116f2565b6000546001600160a01b03163314610f015760405162461bcd60e51b81526004016104c690611598565b6001600160a01b038116610f665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c6565b610f6f816113b9565b50565b600080546001600160a01b03163314610f9d5760405162461bcd60e51b81526004016104c690611598565b610fa88333846112b6565b50600192915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a082319060240160206040518083038186803b158015610ff557600080fd5b505afa158015611009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102d919061150f565b6040516323b872dd60e01b81526001600160a01b03878116600483015230602483015260448201869052919250908516906323b872dd90606401602060405180830381600087803b15801561108157600080fd5b505af1158015611095573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b991906114d4565b5060003d80156110d057602081146110da57600080fd5b60001991506110e6565b60206000803e60005191505b50806111345760405162461bcd60e51b815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000060448201526064016104c6565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b15801561117657600080fd5b505afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae919061150f565b9050828110156112005760405162461bcd60e51b815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000060448201526064016104c6565b61120a8382611711565b979650505050505050565b6001600160a01b03808416600090815260096020908152604080832093861683529290529081208054839190839061124e9084906115cd565b90915550600090506112608484610d1f565b6001600160a01b03861660009081526008602052604081208054929350839290919061128d9084906115cd565b9250508190555080600b60008282546112a691906115cd565b9091555060019695505050505050565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561130057600080fd5b505af1158015611314573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133891906114d4565b5060003d801561134f576020811461135957600080fd5b6000199150611365565b60206000803e60005191505b50806113b35760405162461bcd60e51b815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000060448201526064016104c6565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146105b557600080fd5b60006020828403121561143257600080fd5b610c7382611409565b6000806040838503121561144e57600080fd5b61145783611409565b915061146560208401611409565b90509250929050565b60008060006060848603121561148357600080fd5b61148c84611409565b925061149a60208501611409565b9150604084013590509250925092565b600080604083850312156114bd57600080fd5b6114c683611409565b946020939093013593505050565b6000602082840312156114e657600080fd5b81518015158114610c7357600080fd5b60006020828403121561150857600080fd5b5035919050565b60006020828403121561152157600080fd5b5051919050565b60006020828403121561153a57600080fd5b815160ff81168114610c7357600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561158c5783516001600160a01b031683529284019291840191600101611567565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156115e0576115e0611743565b500190565b60008261160257634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561164257816000190482111561162857611628611743565b8085161561163557918102915b93841c939080029061160c565b509250929050565b6000610c738383600082611660575060016106f1565b8161166d575060006106f1565b8160018114611683576002811461168d576116a9565b60019150506106f1565b60ff84111561169e5761169e611743565b50506001821b6106f1565b5060208310610133831016604e8410600b84101617156116cc575081810a6106f1565b6116d68383611607565b80600019048211156116ea576116ea611743565b029392505050565b600081600019048311821515161561170c5761170c611743565b500290565b60008282101561172357611723611743565b500390565b600060001982141561173c5761173c611743565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220180ccefb512de437d5942ce71f666da816bef788b7c902e3e9a2d13280015b0664736f6c63430008070033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000617f2e0000000000000000000000000000000000000000000000000003782dace9d900000000000000000000000000000000000000000000000000000000000063606180

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063ab0800e31161010f578063e4997dc5116100a2578063f2fde38b11610071578063f2fde38b1461044b578063f32697161461045e578063f3fef3a314610469578063fe13c7461461047c57600080fd5b8063e4997dc5146103f1578063e6fd48bc14610404578063eafdd5da1461040d578063efcbf1501461043857600080fd5b8063bddff592116100de578063bddff5921461039f578063c324845a146103a8578063d90e5d4a146103bb578063e47d6060146103ce57600080fd5b8063ab0800e314610368578063ae81b32914610371578063b77df4e814610384578063b8a242521461038c57600080fd5b806359bf1abe116101875780639435b808116101565780639435b80814610327578063992642e51461032f578063a2befa6414610342578063a465ad5f1461035557600080fd5b806359bf1abe146102c8578063715018a6146102f4578063796b89b9146102fc5780638da5cb5b1461030257600080fd5b806327e235e3116101c357806327e235e31461025c5780633beb7c92146102985780634451d89f146102ab578063574756bf146102b357600080fd5b80630ecb93c0146101f55780631270a02d1461020a578063136f235b146102325780631a39d8ef14610245575b600080fd5b610208610203366004611420565b61049c565b005b61021d6102183660046114f6565b61052b565b60405190151581526020015b60405180910390f35b61021d6102403660046114aa565b6105ba565b61024e600b5481565b604051908152602001610229565b61028361026a366004611420565b6008602052600090815260409020805460019091015482565b60408051928352602083019190915201610229565b61024e6102a63660046114f6565b6106f7565b61021d61078a565b6102bb6108cb565b604051610229919061154b565b61021d6102d6366004611420565b6001600160a01b031660009081526001602052604090205460ff1690565b61020861092d565b4261024e565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610229565b60075461024e565b60025461030f906001600160a01b031681565b61024e610350366004611420565b610963565b61021d61036336600461146e565b610af8565b61024e60055481565b61021d61037f3660046114aa565b610b39565b600a5461024e565b61024e61039a3660046114f6565b610c30565b61024e60045481565b61024e6103b6366004611420565b610c51565b61030f6103c93660046114f6565b610c7a565b61021d6103dc366004611420565b60016020526000908152604090205460ff1681565b6102086103ff366004611420565b610ca4565b61024e60035481565b61024e61041b36600461143b565b600960209081526000928352604080842090915290825290205481565b61024e6104463660046114aa565b610d1f565b610208610459366004611420565b610ed7565b61024e6301e1338081565b61021d6104773660046114aa565b610f72565b61024e61048a366004611420565b60066020526000908152604090205481565b6000546001600160a01b031633146104cf5760405162461bcd60e51b81526004016104c690611598565b60405180910390fd5b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc91015b60405180910390a150565b600080546001600160a01b031633146105565760405162461bcd60e51b81526004016104c690611598565b6002546000906105719033906001600160a01b031685610fb1565b905080156105af57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8018190555b60019150505b919050565b60006003546105c64290565b106106515760405162461bcd60e51b815260206004820152604f60248201527f436f6d70656e736174696f6e3a3a636f6d70656e736174696f6e3a20796f752060448201527f63616e20636f6e766572742070546f6b656e73206265666f726520737461727460648201526e2074696d657374616d70206f6e6c7960881b608482015260a4016104c6565b6001600160a01b0383166000908152600660205260409020546106d05760405162461bcd60e51b815260206004820152603160248201527f436f6d70656e736174696f6e3a3a636f6d70656e736174696f6e3a2070546f6b604482015270195b881a5cc81b9bdd08185b1b1bddd959607a1b60648201526084016104c6565b60006106dd338585610fb1565b90506106ea338583611215565b5060019150505b92915050565b60008042905060006003548211610712575060009392505050565b6005548211156107335760035460055461072c9190611711565b9050610756565b6003546005541161074657506000610756565b6003546107539083611711565b90505b670de0b6b3a7640000816004548661076e91906116f2565b61077891906116f2565b61078291906115e5565b949350505050565b60006003546107964290565b116108005760405162461bcd60e51b815260206004820152603460248201527f436f6d70656e736174696f6e3a3a636c61696d546f6b656e3a206261642074696044820152731b5a5b99c8199bdc881d1a19481c995c5d595cdd60621b60648201526084016104c6565b3360009081526001602052604090205460ff16156108755760405162461bcd60e51b815260206004820152602c60248201527f436f6d70656e736174696f6e3a3a636c61696d546f6b656e3a2075736572206960448201526b1b88189b1858dac81b1a5cdd60a21b60648201526084016104c6565b600061088033610963565b336000908152600860205260408120600101805492935083929091906108a79084906115cd565b90915550506002546108c3906001600160a01b031633836112b6565b600191505090565b6060600780548060200260200160405190810160405280929190818152602001828054801561092357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610905575b5050505050905090565b6000546001600160a01b031633146109575760405162461bcd60e51b81526004016104c690611598565b61096160006113b9565b565b6001600160a01b038116600090815260086020526040812054428115806109a457506001600160a01b03841660009081526008602052604090206001015482145b806109b157506003548111155b156109c0575060009392505050565b60006109cb836106f7565b905060006109da600b546106f7565b905060006109e883866115cd565b9050600082600b546109fa91906115cd565b9050811580610a2357506001600160a01b03881660009081526008602052604090206001015482145b15610a3657506000979650505050505050565b6000805b600a54811015610a965782600a8281548110610a5857610a58611759565b906000526020600020015485610a6e91906116f2565b610a7891906115e5565b610a8290836115cd565b915080610a8e81611728565b915050610a3a565b5082811115610ad2576001600160a01b038916600090815260086020526040902060010154610ac59084611711565b9998505050505050505050565b6001600160a01b038916600090815260086020526040902060010154610ac59082611711565b600080546001600160a01b03163314610b235760405162461bcd60e51b81526004016104c690611598565b610b2e848484611215565b506001949350505050565b600080546001600160a01b03163314610b645760405162461bcd60e51b81526004016104c690611598565b6001600160a01b03831660009081526006602052604090205415610bca5760405162461bcd60e51b815260206004820152601d60248201527f70546f6b656e2068617320616c7265616479206265656e20616464656400000060448201526064016104c6565b506001600160a01b03919091166000818152600660205260408120929092556007805460018082018355919093527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68890920180546001600160a01b031916909117905590565b600a8181548110610c4057600080fd5b600091825260209091200154905081565b6001600160a01b038116600090815260086020526040812054610c73816106f7565b9392505050565b60078181548110610c8a57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b03163314610cce5760405162461bcd60e51b81526004016104c690611598565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9101610520565b60008060066000856001600160a01b03166001600160a01b031681526020019081526020016000205490506000846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8557600080fd5b505afa158015610d99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbd9190611528565b60ff1690506000600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1257600080fd5b505afa158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611528565b60ff1690506000818310610ea257610e628284611711565b610e6d90600a61164a565b9050670de0b6b3a764000081610e8386896116f2565b610e8d91906115e5565b610e9791906115e5565b9450505050506106f1565b610eac8383611711565b610eb790600a61164a565b9050670de0b6b3a764000081610ecd86896116f2565b610e8d91906116f2565b6000546001600160a01b03163314610f015760405162461bcd60e51b81526004016104c690611598565b6001600160a01b038116610f665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c6565b610f6f816113b9565b50565b600080546001600160a01b03163314610f9d5760405162461bcd60e51b81526004016104c690611598565b610fa88333846112b6565b50600192915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a082319060240160206040518083038186803b158015610ff557600080fd5b505afa158015611009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102d919061150f565b6040516323b872dd60e01b81526001600160a01b03878116600483015230602483015260448201869052919250908516906323b872dd90606401602060405180830381600087803b15801561108157600080fd5b505af1158015611095573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b991906114d4565b5060003d80156110d057602081146110da57600080fd5b60001991506110e6565b60206000803e60005191505b50806111345760405162461bcd60e51b815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000060448201526064016104c6565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b15801561117657600080fd5b505afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae919061150f565b9050828110156112005760405162461bcd60e51b815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000060448201526064016104c6565b61120a8382611711565b979650505050505050565b6001600160a01b03808416600090815260096020908152604080832093861683529290529081208054839190839061124e9084906115cd565b90915550600090506112608484610d1f565b6001600160a01b03861660009081526008602052604081208054929350839290919061128d9084906115cd565b9250508190555080600b60008282546112a691906115cd565b9091555060019695505050505050565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561130057600080fd5b505af1158015611314573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133891906114d4565b5060003d801561134f576020811461135957600080fd5b6000199150611365565b60206000803e60005191505b50806113b35760405162461bcd60e51b815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000060448201526064016104c6565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146105b557600080fd5b60006020828403121561143257600080fd5b610c7382611409565b6000806040838503121561144e57600080fd5b61145783611409565b915061146560208401611409565b90509250929050565b60008060006060848603121561148357600080fd5b61148c84611409565b925061149a60208501611409565b9150604084013590509250925092565b600080604083850312156114bd57600080fd5b6114c683611409565b946020939093013593505050565b6000602082840312156114e657600080fd5b81518015158114610c7357600080fd5b60006020828403121561150857600080fd5b5035919050565b60006020828403121561152157600080fd5b5051919050565b60006020828403121561153a57600080fd5b815160ff81168114610c7357600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561158c5783516001600160a01b031683529284019291840191600101611567565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156115e0576115e0611743565b500190565b60008261160257634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561164257816000190482111561162857611628611743565b8085161561163557918102915b93841c939080029061160c565b509250929050565b6000610c738383600082611660575060016106f1565b8161166d575060006106f1565b8160018114611683576002811461168d576116a9565b60019150506106f1565b60ff84111561169e5761169e611743565b50506001821b6106f1565b5060208310610133831016604e8410600b84101617156116cc575081810a6106f1565b6116d68383611607565b80600019048211156116ea576116ea611743565b029392505050565b600081600019048311821515161561170c5761170c611743565b500290565b60008282101561172357611723611743565b500390565b600060001982141561173c5761173c611743565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220180ccefb512de437d5942ce71f666da816bef788b7c902e3e9a2d13280015b0664736f6c63430008070033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000617f2e0000000000000000000000000000000000000000000000000003782dace9d900000000000000000000000000000000000000000000000000000000000063606180

-----Decoded View---------------
Arg [0] : stableCoin_ (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : startTimestamp_ (uint256): 1635724800
Arg [2] : rewardAPY_ (uint256): 250000000000000000
Arg [3] : lastApyTimestamp_ (uint256): 1667260800

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 00000000000000000000000000000000000000000000000000000000617f2e00
Arg [2] : 00000000000000000000000000000000000000000000000003782dace9d90000
Arg [3] : 0000000000000000000000000000000000000000000000000000000063606180


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.