ETH Price: $3,489.85 (-0.28%)
Gas: 6 Gwei

Token

Platinum Staked Theo (pTHEO)
 

Overview

Max Total Supply

5,053,210.02717843 pTHEO

Holders

34

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 9 Decimals)

Balance
4,313.18930654 pTHEO

Value
$0.00
0x1daf8d2315f3df09324c6b3cd3d37f6d0cf37fe4
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

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

Contract Name:
pTheopetra

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
File 1 of 10 : IERC20.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.7.5;

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 2 of 10 : IERC2612Permit.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;

interface IERC2612Permit {
    /**
     * @dev Sets `amount` as the allowance of `spender` over `owner`'s tokens,
     * given `owner`'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

File 3 of 10 : IStakedTHEOToken.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.7.5;

import "./IERC20.sol";

interface IStakedTHEOToken is IERC20 {
    function rebase(uint256 theoProfit_, uint256 epoch_) external returns (uint256);

    function circulatingSupply() external view returns (uint256);

    function balanceOf(address who) external view override returns (uint256);

    function gonsForBalance(uint256 amount) external view returns (uint256);

    function balanceForGons(uint256 gons) external view returns (uint256);

    function index() external view returns (uint256);
}

File 4 of 10 : ITheopetraAuthority.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.7.5;

interface ITheopetraAuthority {
    /* ========== EVENTS ========== */

    event GovernorPushed(address indexed from, address indexed to, bool _effectiveImmediately);
    event GuardianPushed(address indexed from, address indexed to, bool _effectiveImmediately);
    event PolicyPushed(address indexed from, address indexed to, bool _effectiveImmediately);
    event ManagerPushed(address indexed from, address indexed to, bool _effectiveImmediately);
    event VaultPushed(address indexed from, address indexed to, bool _effectiveImmediately);
    event SignerPushed(address indexed from, address indexed to, bool _effectiveImmediately);

    event GovernorPulled(address indexed from, address indexed to);
    event GuardianPulled(address indexed from, address indexed to);
    event PolicyPulled(address indexed from, address indexed to);
    event ManagerPulled(address indexed from, address indexed to);
    event VaultPulled(address indexed from, address indexed to);
    event SignerPulled(address indexed from, address indexed to);

    /* ========== VIEW ========== */

    function governor() external view returns (address);

    function guardian() external view returns (address);

    function policy() external view returns (address);

    function manager() external view returns (address);

    function vault() external view returns (address);

    function whitelistSigner() external view returns (address);
}

File 5 of 10 : Counters.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;

import "./SafeMath.sol";

library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

File 6 of 10 : SafeMath.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrrt(uint256 a) internal pure returns (uint256 c) {
        if (a > 3) {
            c = a;
            uint256 b = add(div(a, 2), 1);
            while (b < c) {
                c = b;
                b = div(add(div(a, b), b), 2);
            }
        } else if (a != 0) {
            c = 1;
        }
    }

    /*
     * Expects percentage to be trailed by 00,
     */
    function percentageAmount(uint256 total_, uint8 percentage_) internal pure returns (uint256 percentAmount_) {
        return div(mul(total_, percentage_), 1000);
    }

    /*
     * Expects percentage to be trailed by 00,
     */
    function substractPercentage(uint256 total_, uint8 percentageToSub_) internal pure returns (uint256 result_) {
        return sub(total_, div(mul(total_, percentageToSub_), 1000));
    }

    function percentageOfTotal(uint256 part_, uint256 total_) internal pure returns (uint256 percent_) {
        return div(mul(part_, 100), total_);
    }

    /**
     * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
    }

    function quadraticPricing(uint256 payment_, uint256 multiplier_) internal pure returns (uint256) {
        return sqrrt(mul(multiplier_, payment_));
    }

    function bondingCurve(uint256 supply_, uint256 multiplier_) internal pure returns (uint256) {
        return mul(multiplier_, supply_);
    }
}

File 7 of 10 : pTheopetraERC20.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.7.5;

import "../Interfaces/IStakedTHEOToken.sol";

import "../Types/ERC20Permit.sol";
import "../Types/TheopetraAccessControlled.sol";

contract pTheopetra is IStakedTHEOToken, ERC20Permit, TheopetraAccessControlled {
    using SafeMath for uint256;

    modifier onlyStakingContract() {
        require(msg.sender == stakingContract, "UNAUTHORIZED");
        _;
    }

    address public stakingContract;
    address public initializer;

    event LogSupply(uint256 indexed epoch, uint256 timestamp, uint256 totalSupply);
    event LogRebase(uint256 indexed epoch, uint256 rebase, uint256 index);
    event LogStakingContractUpdated(address stakingContract);
    event SetIndex(uint256 index);

    struct Rebase {
        uint256 epoch;
        uint256 rebase; // 18 decimals
        uint256 totalStakedBefore;
        uint256 totalStakedAfter;
        uint256 amountRebased;
        uint256 index;
        uint256 blockNumberOccured;
    }
    Rebase[] public rebases;

    uint256 public INDEX;

    uint256 private constant MAX_UINT256 = ~uint256(0);
    uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 5000000 * 10**9;

    // TOTAL_GONS is a multiple of INITIAL_FRAGMENTS_SUPPLY so that _gonsPerFragment is an integer.
    // Use the highest value that fits in a uint256 for max granularity.
    uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);

    // MAX_SUPPLY = maximum integer < (sqrt(4*TOTAL_GONS + 1) - 1) / 2
    uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1

    uint256 private _gonsPerFragment;
    mapping(address => uint256) private _gonBalances;

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

    address public treasury;

    constructor(address _authority)
        ERC20("Platinum Staked Theo", "pTHEO", 9)
        ERC20Permit()
        TheopetraAccessControlled(ITheopetraAuthority(_authority))
    {
        initializer = msg.sender;
        _totalSupply = INITIAL_FRAGMENTS_SUPPLY;
        _gonsPerFragment = TOTAL_GONS.div(_totalSupply);
    }

    function initialize(address stakingContract_) external returns (bool) {
        require(msg.sender == initializer, "UNAUTHORIZED");
        require(stakingContract_ != address(0), "stakingContract cannot be the zero address");
        stakingContract = stakingContract_;
        _gonBalances[stakingContract] = TOTAL_GONS;

        emit Transfer(address(0x0), stakingContract, _totalSupply);
        emit LogStakingContractUpdated(stakingContract_);

        initializer = address(0);
        return true;
    }

    function setIndex(uint256 _INDEX) external onlyGuardian returns (bool) {
        require(INDEX == 0, "Index already set");
        INDEX = gonsForBalance(_INDEX);
        emit SetIndex(INDEX);
        return true;
    }

    /**
        @notice increases sTHEO supply to increase staking balances relative to profit_
        @param profit_ uint256
        @return uint256
     */
    function rebase(uint256 profit_, uint256 epoch_) external override onlyStakingContract returns (uint256) {
        uint256 rebaseAmount;
        uint256 circulatingSupply_ = circulatingSupply();

        if (profit_ == 0) {
            emit LogSupply(epoch_, block.timestamp, _totalSupply);
            emit LogRebase(epoch_, 0, index());
            return _totalSupply;
        } else if (circulatingSupply_ > 0) {
            rebaseAmount = profit_.mul(_totalSupply).div(circulatingSupply_);
        } else {
            rebaseAmount = profit_;
        }

        _totalSupply = _totalSupply.add(rebaseAmount);

        if (_totalSupply > MAX_SUPPLY) {
            _totalSupply = MAX_SUPPLY;
        }

        _gonsPerFragment = TOTAL_GONS.div(_totalSupply);

        _storeRebase(circulatingSupply_, profit_, epoch_);

        return _totalSupply;
    }

    /**
        @notice emits event with data about rebase
        @param previousCirculating_ uint
        @param profit_ uint
        @param epoch_ uint
        @return bool
     */
    function _storeRebase(
        uint256 previousCirculating_,
        uint256 profit_,
        uint256 epoch_
    ) internal returns (bool) {
        uint256 rebasePercent = previousCirculating_ > 0 ? profit_.mul(1e18).div(previousCirculating_) : 0;

        rebases.push(
            Rebase({
                epoch: epoch_,
                rebase: rebasePercent, // 18 decimals
                totalStakedBefore: previousCirculating_,
                totalStakedAfter: circulatingSupply(),
                amountRebased: profit_,
                index: index(),
                blockNumberOccured: block.number
            })
        );

        emit LogSupply(epoch_, block.timestamp, _totalSupply);
        emit LogRebase(epoch_, rebasePercent, index());

        return true;
    }

    function balanceOf(address who) public view override(IStakedTHEOToken, ERC20) returns (uint256) {
        return _gonBalances[who].div(_gonsPerFragment);
    }

    function gonsForBalance(uint256 amount) public view override returns (uint256) {
        return amount.mul(_gonsPerFragment);
    }

    function balanceForGons(uint256 gons) public view override returns (uint256) {
        return gons.div(_gonsPerFragment);
    }

    // Staking contract holds excess sTHEO
    function circulatingSupply() public view override returns (uint256) {
        return _totalSupply.sub(balanceOf(stakingContract));
    }

    function index() public view override returns (uint256) {
        return balanceForGons(INDEX);
    }

    function transfer(address to, uint256 value) external override(ERC20, IERC20) returns (bool) {
        uint256 gonValue = gonsForBalance(value);
        _gonBalances[msg.sender] = _gonBalances[msg.sender].sub(gonValue);
        _gonBalances[to] = _gonBalances[to].add(gonValue);
        emit Transfer(msg.sender, to, value);
        return true;
    }

    function allowance(address owner_, address spender) public view override(ERC20, IERC20) returns (uint256) {
        return _allowedValue[owner_][spender];
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external override(ERC20, IERC20) returns (bool) {
        _allowedValue[from][msg.sender] = _allowedValue[from][msg.sender].sub(value);
        emit Approval(from, msg.sender, _allowedValue[from][msg.sender]);

        uint256 gonValue = gonsForBalance(value);
        _gonBalances[from] = _gonBalances[from].sub(gonValue);
        _gonBalances[to] = _gonBalances[to].add(gonValue);
        emit Transfer(from, to, value);

        return true;
    }

    function approve(address spender, uint256 value) external override(ERC20, IERC20) returns (bool) {
        _allowedValue[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    // What gets called in a permit
    function _approve(
        address owner,
        address spender,
        uint256 value
    ) internal virtual override {
        _allowedValue[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function increaseAllowance(address spender, uint256 addedValue) external override returns (bool) {
        _allowedValue[msg.sender][spender] = _allowedValue[msg.sender][spender].add(addedValue);
        emit Approval(msg.sender, spender, _allowedValue[msg.sender][spender]);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) external override returns (bool) {
        uint256 oldValue = _allowedValue[msg.sender][spender];
        if (subtractedValue >= oldValue) {
            _allowedValue[msg.sender][spender] = 0;
        } else {
            _allowedValue[msg.sender][spender] = oldValue.sub(subtractedValue);
        }
        emit Approval(msg.sender, spender, _allowedValue[msg.sender][spender]);
        return true;
    }
}

File 8 of 10 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.7.5;

import "../Libraries/SafeMath.sol";

import "../Interfaces/IERC20.sol";

abstract contract ERC20 is IERC20 {
    using SafeMath for uint256;

    // TODO comment actual hash value.
    bytes32 private constant ERC20TOKEN_ERC1820_INTERFACE_ID = keccak256("ERC20Token");

    mapping(address => uint256) internal _balances;

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

    uint256 internal _totalSupply;

    string internal _name;

    string internal _symbol;

    uint8 internal immutable _decimals;

    constructor(
        string memory name_,
        string memory symbol_,
        uint8 decimals_
    ) {
        _name = name_;
        _symbol = symbol_;
        _decimals = decimals_;
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

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

    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) external virtual override returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) external virtual override returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(
            sender,
            msg.sender,
            _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")
        );
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
        _approve(
            msg.sender,
            spender,
            _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")
        );
        return true;
    }

    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);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");
        _beforeTokenTransfer(address(0), account, amount);
        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

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

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    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);
    }

    function _beforeTokenTransfer(
        address from_,
        address to_,
        uint256 amount_
    ) internal virtual {}
}

File 9 of 10 : ERC20Permit.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;

import "./ERC20.sol";
import "../Interfaces/IERC2612Permit.sol";
import "../Libraries/Counters.sol";

abstract contract ERC20Permit is ERC20, IERC2612Permit {
    using Counters for Counters.Counter;

    mapping(address => Counters.Counter) private _nonces;

    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

    /**
     * @dev See {IERC2612Permit-permit}.
     *
     */
    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external virtual override {
        require(block.timestamp <= deadline, "Permit: expired deadline");
        uint256 chainID;
        assembly {
            chainID := chainid()
        }

        bytes32 hashStruct = keccak256(
            abi.encode(PERMIT_TYPEHASH, owner, spender, amount, _nonces[owner].current(), deadline)
        );

        bytes32 _hash = keccak256(abi.encodePacked(uint16(0x1901),
        keccak256(
            abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                keccak256(bytes(name())),
                keccak256(bytes("1")), // Version
                chainID,
                address(this)
            )
        ), hashStruct));

        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "invalid signature 's' value");
        require(v == 27 || v == 28, "invalid signature 'v' value");

        address signer = ecrecover(_hash, v, r, s);
        require(signer != address(0) && signer == owner, "ZeroSwapPermit: Invalid signature");

        _nonces[owner].increment();
        _approve(owner, spender, amount);
    }

    /**
     * @dev See {IERC2612Permit-nonces}.
     */
    function nonces(address owner) external view override returns (uint256) {
        return _nonces[owner].current();
    }
}

File 10 of 10 : TheopetraAccessControlled.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.7.5;

import "../Interfaces/ITheopetraAuthority.sol";

abstract contract TheopetraAccessControlled {
    /* ========== EVENTS ========== */

    event AuthorityUpdated(ITheopetraAuthority indexed authority);

    string constant UNAUTHORIZED = "UNAUTHORIZED"; // save gas

    /* ========== STATE VARIABLES ========== */

    ITheopetraAuthority public authority;

    /* ========== Constructor ========== */

    constructor(ITheopetraAuthority _authority) {
        authority = _authority;
        emit AuthorityUpdated(_authority);
    }

    /* ========== MODIFIERS ========== */

    modifier onlyGovernor() {
        require(msg.sender == authority.governor(), UNAUTHORIZED);
        _;
    }

    modifier onlyGuardian() {
        require(msg.sender == authority.guardian(), UNAUTHORIZED);
        _;
    }

    modifier onlyPolicy() {
        require(msg.sender == authority.policy(), UNAUTHORIZED);
        _;
    }

    modifier onlyManager() {
        require(msg.sender == authority.manager(), UNAUTHORIZED);
        _;
    }

    modifier onlyVault() {
        require(msg.sender == authority.vault(), UNAUTHORIZED);
        _;
    }

    /* ========== GOV ONLY ========== */

    function setAuthority(ITheopetraAuthority _newAuthority) external onlyGovernor {
        authority = _newAuthority;
        emit AuthorityUpdated(_newAuthority);
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_authority","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITheopetraAuthority","name":"authority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rebase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"LogRebase","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"}],"name":"LogStakingContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"}],"name":"LogSupply","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"SetIndex","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract ITheopetraAuthority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gons","type":"uint256"}],"name":"balanceForGons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"gonsForBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"index","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakingContract_","type":"address"}],"name":"initialize","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"profit_","type":"uint256"},{"internalType":"uint256","name":"epoch_","type":"uint256"}],"name":"rebase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rebases","outputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"rebase","type":"uint256"},{"internalType":"uint256","name":"totalStakedBefore","type":"uint256"},{"internalType":"uint256","name":"totalStakedAfter","type":"uint256"},{"internalType":"uint256","name":"amountRebased","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"blockNumberOccured","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITheopetraAuthority","name":"_newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_INDEX","type":"uint256"}],"name":"setIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b5060405162001e4538038062001e45833981810160405260208110156200003757600080fd5b5051604080518082018252601481527f506c6174696e756d205374616b6564205468656f000000000000000000000000602082810191825283518085019094526005845264705448454f60d81b9084015281518493916009916200009e916003916200026a565b508151620000b49060049060208501906200026a565b5060f81b7fff00000000000000000000000000000000000000000000000000000000000000166080525050600680546001600160a01b0319166001600160a01b0383169081179091556040517f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad90600090a250600880546001600160a01b031916331790556611c37937e08000600281905562000168908060001906600019036200017260201b620016ad1790919060201c565b600b555062000316565b6000620001bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250620001c360201b60201c565b9392505050565b60008183620002535760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101562000217578181015183820152602001620001fd565b50505050905090810190601f168015620002455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816200026057fe5b0495945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002a25760008555620002ed565b82601f10620002bd57805160ff1916838001178555620002ed565b82800160010185558215620002ed579182015b82811115620002ed578251825591602001919060010190620002d0565b50620002fb929150620002ff565b5090565b5b80821115620002fb576000815560010162000300565b60805160f81c611b1162000334600039806109fa5250611b116000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806373c69eb7116100f9578063a457c2d711610097578063c4d66de811610071578063c4d66de814610517578063d505accf1461053d578063dd62ed3e1461058e578063ee99205c146105bc576101c4565b8063a457c2d7146104b7578063a9059cbb146104e3578063bf7e214f1461050f576101c4565b80637ecebe00116100d35780637ecebe00146104795780639358928b1461049f57806395d89b41146104a75780639ce110d7146104af576101c4565b806373c69eb7146103df5780637965d56d146104345780637a9e5e4b14610451576101c4565b80632df75cb1116101665780633950935111610140578063395093511461034c57806340a5737f1461037857806361d027b31461039557806370a08231146103b9576101c4565b80632df75cb11461031e57806330adf81f14610326578063313ce5671461032e576101c4565b806318160ddd116101a257806318160ddd146102bb5780631bd39674146102c357806323b872dd146102e05780632986c0e514610316576101c4565b8063058ecdb4146101c957806306fdde03146101fe578063095ea7b31461027b575b600080fd5b6101ec600480360360408110156101df57600080fd5b50803590602001356105c4565b60408051918252519081900360200190f35b610206610757565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610240578181015183820152602001610228565b50505050905090810190601f16801561026d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a76004803603604081101561029157600080fd5b506001600160a01b0381351690602001356107ed565b604080519115158252519081900360200190f35b6101ec610853565b6101ec600480360360208110156102d957600080fd5b5035610859565b6102a7600480360360608110156102f657600080fd5b506001600160a01b03813581169160208101359091169060400135610870565b6101ec6109bc565b6101ec6109ce565b6101ec6109d4565b6103366109f8565b6040805160ff9092168252519081900360200190f35b6102a76004803603604081101561036257600080fd5b506001600160a01b038135169060200135610a1c565b6102a76004803603602081101561038e57600080fd5b5035610aaf565b61039d610c8e565b604080516001600160a01b039092168252519081900360200190f35b6101ec600480360360208110156103cf57600080fd5b50356001600160a01b0316610c9d565b6103fc600480360360208110156103f557600080fd5b5035610cc5565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b6101ec6004803603602081101561044a57600080fd5b5035610d17565b6104776004803603602081101561046757600080fd5b50356001600160a01b0316610d2e565b005b6101ec6004803603602081101561048f57600080fd5b50356001600160a01b0316610e7a565b6101ec610e9b565b610206610ec0565b61039d610f21565b6102a7600480360360408110156104cd57600080fd5b506001600160a01b038135169060200135610f30565b6102a7600480360360408110156104f957600080fd5b506001600160a01b038135169060200135611019565b61039d6110cd565b6102a76004803603602081101561052d57600080fd5b50356001600160a01b03166110dc565b610477600480360360e081101561055357600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611258565b6101ec600480360360408110156105a457600080fd5b506001600160a01b0381358116916020013516611673565b61039d61169e565b6007546000906001600160a01b03163314610615576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b600080610620610e9b565b9050846106b657600254604080514281526020810192909252805186927f917acfbe39be6509ccf7fecb66a7e42ce2be1083c2d7dd3b9b7491dabddb8da492908290030190a2837f6012dbce857565c4a40974aa5de8373a761fc429077ef0c8c8611d1e20d63fb260006106926109bc565b6040805192835260208301919091528051918290030190a260025492505050610751565b80156106e2576106db816106d5600254886116f690919063ffffffff16565b906116ad565b91506106e6565b8491505b6002546106f3908361174f565b60028190556fffffffffffffffffffffffffffffffff1015610724576fffffffffffffffffffffffffffffffff6002555b60025461073a90660e3d2cfe61ffff19906116ad565b600b556107488186866117a9565b50600254925050505b92915050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107e35780601f106107b8576101008083540402835291602001916107e3565b820191906000526020600020905b8154815290600101906020018083116107c657829003601f168201915b5050505050905090565b336000818152600d602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b6000610751600b54836116f690919063ffffffff16565b6001600160a01b0383166000908152600d6020908152604080832033845290915281205461089e90836118ff565b6001600160a01b0385166000818152600d60209081526040808320338085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3600061090583610859565b6001600160a01b0386166000908152600c602052604090205490915061092b90826118ff565b6001600160a01b038087166000908152600c6020526040808220939093559086168152205461095a908261174f565b6001600160a01b038086166000818152600c602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60006109c9600a54610d17565b905090565b600a5481565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b7f000000000000000000000000000000000000000000000000000000000000000090565b336000908152600d602090815260408083206001600160a01b0386168452909152812054610a4a908361174f565b336000818152600d602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600654604080517f452a932000000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163452a9320916004808301926020929190829003018186803b158015610b0d57600080fd5b505afa158015610b21573d6000803e3d6000fd5b505050506040513d6020811015610b3757600080fd5b505160408051808201909152600c81526b15539055551213d49256915160a21b6020820152906001600160a01b03163314610bf05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610bb5578181015183820152602001610b9d565b50505050905090810190601f168015610be25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600a5415610c46576040805162461bcd60e51b815260206004820152601160248201527f496e64657820616c726561647920736574000000000000000000000000000000604482015290519081900360640190fd5b610c4f82610859565b600a81905560408051918252517fe0f56ff65799b4f6ff5b24871ec08f73b36d933db31d1452d59d2af94db99a149181900360200190a1506001919050565b600e546001600160a01b031681565b600b546001600160a01b0382166000908152600c6020526040812054909161075191906116ad565b60098181548110610cd557600080fd5b90600052602060002090600702016000915090508060000154908060010154908060020154908060030154908060040154908060050154908060060154905087565b6000610751600b54836116ad90919063ffffffff16565b600660009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7c57600080fd5b505afa158015610d90573d6000803e3d6000fd5b505050506040513d6020811015610da657600080fd5b505160408051808201909152600c81526b15539055551213d49256915160a21b6020820152906001600160a01b03163314610e225760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b506006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad90600090a250565b6001600160a01b038116600090815260056020526040812061075190611941565b6007546000906109c990610eb7906001600160a01b0316610c9d565b600254906118ff565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107e35780601f106107b8576101008083540402835291602001916107e3565b6008546001600160a01b031681565b336000908152600d602090815260408083206001600160a01b0386168452909152812054808310610f8457336000908152600d602090815260408083206001600160a01b0388168452909152812055610fb3565b610f8e81846118ff565b336000908152600d602090815260408083206001600160a01b03891684529091529020555b336000818152600d602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60008061102583610859565b336000908152600c602052604090205490915061104290826118ff565b336000908152600c6020526040808220929092556001600160a01b0386168152205461106e908261174f565b6001600160a01b0385166000818152600c60209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b6006546001600160a01b031681565b6008546000906001600160a01b0316331461112d576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b6001600160a01b0382166111725760405162461bcd60e51b815260040180806020018281038252602a815260200180611a70602a913960400191505060405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038481169190911780835581166000908152600c60209081526040808320660e3d2cfe61ffff19905593546002548551908152945193169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3604080516001600160a01b038416815290517f817c653428858ed536dc085c5d8273734c517b55de44b55f5c5877a75e3373a19181900360200190a150506008805473ffffffffffffffffffffffffffffffffffffffff19169055600190565b834211156112ad576040805162461bcd60e51b815260206004820152601860248201527f5065726d69743a206578706972656420646561646c696e650000000000000000604482015290519081900360640190fd5b6001600160a01b03871660009081526005602052604081204691907f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9908a908a908a906112f990611941565b8a60405160200180878152602001866001600160a01b03168152602001856001600160a01b03168152602001848152602001838152602001828152602001965050505050505060405160208183030381529060405280519060200120905060006119017f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611385610757565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060840152608083018790523060a0808501919091528151808503909101815260c08401825280519083012060f09490941b7fffff0000000000000000000000000000000000000000000000000000000000001660e084015260e283019390935261010280830186905283518084039091018152610122909201909252805191012090507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156114e9576040805162461bcd60e51b815260206004820152601b60248201527f696e76616c6964207369676e6174757265202773272076616c75650000000000604482015290519081900360640190fd5b8560ff16601b14806114fe57508560ff16601c145b61154f576040805162461bcd60e51b815260206004820152601b60248201527f696e76616c6964207369676e6174757265202776272076616c75650000000000604482015290519081900360640190fd5b600060018288888860405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156115ab573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116158015906115ff57508a6001600160a01b0316816001600160a01b0316145b61163a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611a9a6021913960400191505060405180910390fd5b6001600160a01b038b16600090815260056020526040902061165b90611945565b6116668b8b8b61194e565b5050505050505050505050565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205490565b6007546001600160a01b031681565b60006116ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119b0565b9392505050565b60008261170557506000610751565b8282028284828161171257fe5b04146116ef5760405162461bcd60e51b8152600401808060200182810382526021815260200180611abb6021913960400191505060405180910390fd5b6000828201838110156116ef576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080600085116117bb5760006117d1565b6117d1856106d586670de0b6b3a76400006116f6565b905060096040518060e001604052808581526020018381526020018781526020016117fa610e9b565b815260200186815260200161180d6109bc565b81524360209182015282546001818101855560009485529382902083516007909202019081558282015193810193909355604080830151600280860191909155606084015160038601556080840151600486015560a0840151600586015560c0909301516006909401939093559054825142815291820152815185927f917acfbe39be6509ccf7fecb66a7e42ce2be1083c2d7dd3b9b7491dabddb8da4928290030190a2827f6012dbce857565c4a40974aa5de8373a761fc429077ef0c8c8611d1e20d63fb2826118dc6109bc565b6040805192835260208301919091528051918290030190a2506001949350505050565b60006116ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a15565b5490565b80546001019055565b6001600160a01b038084166000818152600d6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600081836119ff5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b506000838581611a0b57fe5b0495945050505050565b60008184841115611a675760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b50505090039056fe7374616b696e67436f6e74726163742063616e6e6f7420626520746865207a65726f20616464726573735a65726f537761705065726d69743a20496e76616c6964207369676e6174757265536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122086f17bffbeb142607beb74a731c2c8413d95628ec9dfbff97af3d0955d87e32464736f6c63430007050033000000000000000000000000fe9fab692c951eeb28345b3a22008f4057eaa232

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806373c69eb7116100f9578063a457c2d711610097578063c4d66de811610071578063c4d66de814610517578063d505accf1461053d578063dd62ed3e1461058e578063ee99205c146105bc576101c4565b8063a457c2d7146104b7578063a9059cbb146104e3578063bf7e214f1461050f576101c4565b80637ecebe00116100d35780637ecebe00146104795780639358928b1461049f57806395d89b41146104a75780639ce110d7146104af576101c4565b806373c69eb7146103df5780637965d56d146104345780637a9e5e4b14610451576101c4565b80632df75cb1116101665780633950935111610140578063395093511461034c57806340a5737f1461037857806361d027b31461039557806370a08231146103b9576101c4565b80632df75cb11461031e57806330adf81f14610326578063313ce5671461032e576101c4565b806318160ddd116101a257806318160ddd146102bb5780631bd39674146102c357806323b872dd146102e05780632986c0e514610316576101c4565b8063058ecdb4146101c957806306fdde03146101fe578063095ea7b31461027b575b600080fd5b6101ec600480360360408110156101df57600080fd5b50803590602001356105c4565b60408051918252519081900360200190f35b610206610757565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610240578181015183820152602001610228565b50505050905090810190601f16801561026d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a76004803603604081101561029157600080fd5b506001600160a01b0381351690602001356107ed565b604080519115158252519081900360200190f35b6101ec610853565b6101ec600480360360208110156102d957600080fd5b5035610859565b6102a7600480360360608110156102f657600080fd5b506001600160a01b03813581169160208101359091169060400135610870565b6101ec6109bc565b6101ec6109ce565b6101ec6109d4565b6103366109f8565b6040805160ff9092168252519081900360200190f35b6102a76004803603604081101561036257600080fd5b506001600160a01b038135169060200135610a1c565b6102a76004803603602081101561038e57600080fd5b5035610aaf565b61039d610c8e565b604080516001600160a01b039092168252519081900360200190f35b6101ec600480360360208110156103cf57600080fd5b50356001600160a01b0316610c9d565b6103fc600480360360208110156103f557600080fd5b5035610cc5565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b6101ec6004803603602081101561044a57600080fd5b5035610d17565b6104776004803603602081101561046757600080fd5b50356001600160a01b0316610d2e565b005b6101ec6004803603602081101561048f57600080fd5b50356001600160a01b0316610e7a565b6101ec610e9b565b610206610ec0565b61039d610f21565b6102a7600480360360408110156104cd57600080fd5b506001600160a01b038135169060200135610f30565b6102a7600480360360408110156104f957600080fd5b506001600160a01b038135169060200135611019565b61039d6110cd565b6102a76004803603602081101561052d57600080fd5b50356001600160a01b03166110dc565b610477600480360360e081101561055357600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611258565b6101ec600480360360408110156105a457600080fd5b506001600160a01b0381358116916020013516611673565b61039d61169e565b6007546000906001600160a01b03163314610615576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b600080610620610e9b565b9050846106b657600254604080514281526020810192909252805186927f917acfbe39be6509ccf7fecb66a7e42ce2be1083c2d7dd3b9b7491dabddb8da492908290030190a2837f6012dbce857565c4a40974aa5de8373a761fc429077ef0c8c8611d1e20d63fb260006106926109bc565b6040805192835260208301919091528051918290030190a260025492505050610751565b80156106e2576106db816106d5600254886116f690919063ffffffff16565b906116ad565b91506106e6565b8491505b6002546106f3908361174f565b60028190556fffffffffffffffffffffffffffffffff1015610724576fffffffffffffffffffffffffffffffff6002555b60025461073a90660e3d2cfe61ffff19906116ad565b600b556107488186866117a9565b50600254925050505b92915050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107e35780601f106107b8576101008083540402835291602001916107e3565b820191906000526020600020905b8154815290600101906020018083116107c657829003601f168201915b5050505050905090565b336000818152600d602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b6000610751600b54836116f690919063ffffffff16565b6001600160a01b0383166000908152600d6020908152604080832033845290915281205461089e90836118ff565b6001600160a01b0385166000818152600d60209081526040808320338085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3600061090583610859565b6001600160a01b0386166000908152600c602052604090205490915061092b90826118ff565b6001600160a01b038087166000908152600c6020526040808220939093559086168152205461095a908261174f565b6001600160a01b038086166000818152600c602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60006109c9600a54610d17565b905090565b600a5481565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b7f000000000000000000000000000000000000000000000000000000000000000990565b336000908152600d602090815260408083206001600160a01b0386168452909152812054610a4a908361174f565b336000818152600d602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600654604080517f452a932000000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163452a9320916004808301926020929190829003018186803b158015610b0d57600080fd5b505afa158015610b21573d6000803e3d6000fd5b505050506040513d6020811015610b3757600080fd5b505160408051808201909152600c81526b15539055551213d49256915160a21b6020820152906001600160a01b03163314610bf05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610bb5578181015183820152602001610b9d565b50505050905090810190601f168015610be25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600a5415610c46576040805162461bcd60e51b815260206004820152601160248201527f496e64657820616c726561647920736574000000000000000000000000000000604482015290519081900360640190fd5b610c4f82610859565b600a81905560408051918252517fe0f56ff65799b4f6ff5b24871ec08f73b36d933db31d1452d59d2af94db99a149181900360200190a1506001919050565b600e546001600160a01b031681565b600b546001600160a01b0382166000908152600c6020526040812054909161075191906116ad565b60098181548110610cd557600080fd5b90600052602060002090600702016000915090508060000154908060010154908060020154908060030154908060040154908060050154908060060154905087565b6000610751600b54836116ad90919063ffffffff16565b600660009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7c57600080fd5b505afa158015610d90573d6000803e3d6000fd5b505050506040513d6020811015610da657600080fd5b505160408051808201909152600c81526b15539055551213d49256915160a21b6020820152906001600160a01b03163314610e225760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b506006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad90600090a250565b6001600160a01b038116600090815260056020526040812061075190611941565b6007546000906109c990610eb7906001600160a01b0316610c9d565b600254906118ff565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107e35780601f106107b8576101008083540402835291602001916107e3565b6008546001600160a01b031681565b336000908152600d602090815260408083206001600160a01b0386168452909152812054808310610f8457336000908152600d602090815260408083206001600160a01b0388168452909152812055610fb3565b610f8e81846118ff565b336000908152600d602090815260408083206001600160a01b03891684529091529020555b336000818152600d602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60008061102583610859565b336000908152600c602052604090205490915061104290826118ff565b336000908152600c6020526040808220929092556001600160a01b0386168152205461106e908261174f565b6001600160a01b0385166000818152600c60209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b6006546001600160a01b031681565b6008546000906001600160a01b0316331461112d576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b6001600160a01b0382166111725760405162461bcd60e51b815260040180806020018281038252602a815260200180611a70602a913960400191505060405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038481169190911780835581166000908152600c60209081526040808320660e3d2cfe61ffff19905593546002548551908152945193169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3604080516001600160a01b038416815290517f817c653428858ed536dc085c5d8273734c517b55de44b55f5c5877a75e3373a19181900360200190a150506008805473ffffffffffffffffffffffffffffffffffffffff19169055600190565b834211156112ad576040805162461bcd60e51b815260206004820152601860248201527f5065726d69743a206578706972656420646561646c696e650000000000000000604482015290519081900360640190fd5b6001600160a01b03871660009081526005602052604081204691907f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9908a908a908a906112f990611941565b8a60405160200180878152602001866001600160a01b03168152602001856001600160a01b03168152602001848152602001838152602001828152602001965050505050505060405160208183030381529060405280519060200120905060006119017f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611385610757565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060840152608083018790523060a0808501919091528151808503909101815260c08401825280519083012060f09490941b7fffff0000000000000000000000000000000000000000000000000000000000001660e084015260e283019390935261010280830186905283518084039091018152610122909201909252805191012090507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156114e9576040805162461bcd60e51b815260206004820152601b60248201527f696e76616c6964207369676e6174757265202773272076616c75650000000000604482015290519081900360640190fd5b8560ff16601b14806114fe57508560ff16601c145b61154f576040805162461bcd60e51b815260206004820152601b60248201527f696e76616c6964207369676e6174757265202776272076616c75650000000000604482015290519081900360640190fd5b600060018288888860405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156115ab573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116158015906115ff57508a6001600160a01b0316816001600160a01b0316145b61163a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611a9a6021913960400191505060405180910390fd5b6001600160a01b038b16600090815260056020526040902061165b90611945565b6116668b8b8b61194e565b5050505050505050505050565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205490565b6007546001600160a01b031681565b60006116ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119b0565b9392505050565b60008261170557506000610751565b8282028284828161171257fe5b04146116ef5760405162461bcd60e51b8152600401808060200182810382526021815260200180611abb6021913960400191505060405180910390fd5b6000828201838110156116ef576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080600085116117bb5760006117d1565b6117d1856106d586670de0b6b3a76400006116f6565b905060096040518060e001604052808581526020018381526020018781526020016117fa610e9b565b815260200186815260200161180d6109bc565b81524360209182015282546001818101855560009485529382902083516007909202019081558282015193810193909355604080830151600280860191909155606084015160038601556080840151600486015560a0840151600586015560c0909301516006909401939093559054825142815291820152815185927f917acfbe39be6509ccf7fecb66a7e42ce2be1083c2d7dd3b9b7491dabddb8da4928290030190a2827f6012dbce857565c4a40974aa5de8373a761fc429077ef0c8c8611d1e20d63fb2826118dc6109bc565b6040805192835260208301919091528051918290030190a2506001949350505050565b60006116ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a15565b5490565b80546001019055565b6001600160a01b038084166000818152600d6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600081836119ff5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b506000838581611a0b57fe5b0495945050505050565b60008184841115611a675760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610bb5578181015183820152602001610b9d565b50505090039056fe7374616b696e67436f6e74726163742063616e6e6f7420626520746865207a65726f20616464726573735a65726f537761705065726d69743a20496e76616c6964207369676e6174757265536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122086f17bffbeb142607beb74a731c2c8413d95628ec9dfbff97af3d0955d87e32464736f6c63430007050033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.