Address Details
contract
token

0xc0eCE7196D8269B0e33D3883f61038eB2ad05d3e

Token
Project 3 (PRJ3)
Creator
0x4a47b6–0909dc at 0x4b41df–f5f716
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
8 Transactions
Transfers
0 Transfers
Gas Used
380,767
Last Balance Update
17073596
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
ERC20Project




Optimization enabled
true
Compiler version
v0.8.17+commit.8df45f5f




Optimization runs
200
EVM Version
byzantium




Verified at
2023-03-17T19:14:15.164438Z

project:/contracts/ERC20Project.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.8.17.0;

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./DataStructure.sol";

abstract contract PermissionGranterAbs {

    function getPermission(
        address addressReq,
        address contractAddress,
        string memory fname
    ) public virtual returns(bool);
    
}

abstract contract UnergyEventAbs {
    function beforeTransferReceipt(
        address origin,
        address from,
        address to,
        uint256 amount
    ) public virtual;
    function afterTransferReceipt(
        address origin,
        address from,
        address to,
        uint256 amount
    ) public virtual;
}

contract ERC20Project is ERC20, Ownable, ReentrancyGuard {

    UnergyEventAbs unergyEvent;
    address public unergyEventAddr;
    address public permissionGranterAddress;
    DataStructure.ProjectState public projectState;
    ///@dev false: eWatt, True: pWatt
    DataStructure.ProjectType public projectType;
    address payable public recipient;

    event SetPermissionGranter(
        address permissionGranterAddr
    );
    
    constructor(
        string memory name_,
        string memory symbol_,
        address payable owner_
    )
        ERC20(name_, symbol_)
        Ownable()
    {
        projectType =
        DataStructure.ProjectType.pWatt;
        recipient = owner_;
    }

    modifier inFunding() {
        require(
            projectState ==
            DataStructure.ProjectState.FUNDING
        );
        _;
    }

    modifier hasRoleInPermissionGranterOrEWatt(
        address _address,
        string memory _fname
    ) 
    {
        PermissionGranterAbs permissionGranter =
        PermissionGranterAbs(permissionGranterAddress);
        bool permissionState = 
        permissionGranter.getPermission(
            _address,
            address(this),
            _fname
        );
        require(
            permissionState == true ||
            projectType ==
            DataStructure.ProjectType.eWatt, 
            "Caller is not authorized or this is a pWatt token"
        );
        _;
    }

    modifier hasRoleInPermissionGranter(
        address _address,
        string memory _fname
    ) 
    {
        PermissionGranterAbs permissionGranter =
        PermissionGranterAbs(permissionGranterAddress);
        bool permissionState =
        permissionGranter.getPermission(
            _address,
            address(this),
            _fname
        );
        require(permissionState == true);
        _;
    }

    function mint(
        address account,
        uint256 amount
    ) 
        public
        hasRoleInPermissionGranter(
            msg.sender,
            "mint"
        )
    {
        _mint(account, amount);
    }

    function burn(
        address account,
        uint256 amount
    )
        public
        hasRoleInPermissionGranter(
            msg.sender,
            "burn"
        ) 
    {
        _burn(account, amount);
    }

    function burnFrom(
        address account,
        uint256 amount
    ) 
        public
        nonReentrant
        hasRoleInPermissionGranter(
            msg.sender,
            "burnFrom"
        ) 
    {
        _spendAllowance(
            account,
            _msgSender(),
            amount
        );
        _burn(account, amount);
    }

    function transfer(
        address to,
        uint256 amount
    )
        public
        virtual
        inFunding()
        override
        returns (bool)
    {
        address sender = _msgSender();
        _transfer(sender, to, amount);
        return true;
    }

    function setState(
        DataStructure.ProjectState state
    )
        public
        nonReentrant    
        hasRoleInPermissionGranter(
            msg.sender,
            "setState"
        )
    {
        projectState = state;
    }

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

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        if (projectType == DataStructure.ProjectType.pWatt){
            unergyEvent = UnergyEventAbs(unergyEventAddr);
            unergyEvent.beforeTransferReceipt(
                address(this),
                from,
                to,
                amount
            );
        }
    }

    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        if (projectType == DataStructure.ProjectType.pWatt){
            unergyEvent = UnergyEventAbs(unergyEventAddr);
            unergyEvent.afterTransferReceipt(
                address(this),
                from,
                to,
                amount
            );
        }
    }

    /*This function is called when a user acquires pWatts
    with UnergyLogicOperation address as spender 
    */
    function approveSwap(
        address holder,
        address spender,
        uint256 amount
    )
        public
        nonReentrant
        hasRoleInPermissionGranterOrEWatt(
            msg.sender,
            "approveSwap"
        )
        returns (bool)
    {
        if(projectType == DataStructure.ProjectType.pWatt){
            _approve(
                holder,
                spender,
                amount
            );
            return true;
        } else {
            require(
                msg.sender == holder,
                "Caller is not the holder"
            );
            _approve(
                holder,
                spender,
                amount
            );
            return true;
        }
    }

    function setProjectType(
        DataStructure.ProjectType projectType_
    ) 
        public
        nonReentrant
        hasRoleInPermissionGranter(
            msg.sender,
            "setProjectType"
        )

    {
        projectType = projectType_;
    }

    function increaseAllowance(
        address holder,
        uint256 addedValue
    ) 
        public
        override
        onlyOwner
        returns (bool)
    {
        address spender = msg.sender;
        _approve(
            holder,
            spender,
            allowance(holder, spender) + addedValue
        );
        return true;
    }

    function decreaseAllowance(
        address holder,
        uint256 subtractedValue
    ) 
        public
        override
        onlyOwner
        returns (bool) 
    {
        address spender = _msgSender();
        uint256 currentAllowance =
        allowance(holder, spender);
        require(
            currentAllowance >= subtractedValue,
            "ERC20: decreased allowance below zero"
        );
        unchecked {
            _approve(
                holder,
                spender,
                currentAllowance - subtractedValue
            );
        }
        return true;
    }

    function setPermissionGranterAddr(address permissionGranterAddr)
        public
        onlyOwner
    {
        require(
            permissionGranterAddr != address(0),
            "Permission Granter address can not be the zero address"
        );
        permissionGranterAddress = permissionGranterAddr;
        emit SetPermissionGranter(
            permissionGranterAddr
        );
    }

    function setUnergyEventAddr(
        address unergyEventaddr
    ) 
        public
        onlyOwner
    {
        require(
            unergyEventaddr != address(0),
            "Unergy Event address can not be the zero address"
        );
        unergyEventAddr = unergyEventaddr;
    }
    
    ///@dev Ownable methods overridden
    function transferOwnership(
        address newOwner
    ) 
        public
        override
        onlyOwner
    {
        require(
            newOwner != address(0),
            "Ownable: new owner cannot be the zero address"
        );
        _transferOwnership(newOwner);
    }

    function closeContract() 
        public
        onlyOwner
    {
        selfdestruct(recipient);
    }

}
        

/project_/contracts/DataStructure.sol

// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.17.0;

library DataStructure {

    enum ProjectState {
        FUNDING,
        INSTALLED,
        PRODUCTION,
        CLOSED,
        CANCELLED
    }

    struct PWattPrice { 
        uint256 initialValue;
        uint256 finalValue;
    }

    struct Tokens {
        uint256 pWatts;
        uint256 eWatts;
    }

    struct Project {
        uint256 idProject;
        uint256 maintenancePercentage;
        PWattPrice pWattPrice;
        uint256 swapFactor;
        ProjectState state;
        address projectAddr;
        address adminAddr;
        address installerAddr;
        uint256 pWattDepreciated;
        Tokens tokens;
    }

    struct Holders {
        address addr;
        bool fiat;
    }

    struct DepreciatedBalance {
        uint256 pWattDepreciated;
    }

    struct Milestone {
        string name;
        bool state;
        uint256 weight;
        bool installerSignature;
        bool unergySignature;
    }

    enum ProjectType {
        pWatt,
        eWatt
    }

    struct HistoricalSwap {
        uint256 id;
        uint256 uWattsUnergy;
        uint256 totalUWatts;
        uint256 totalSupplyAccumulated;
    }

    struct UWattStatus { 
        uint256 currentUWatts;
        uint256 uWattsSold;
        uint256 uWattsPurchased;
        uint256 claimNumber;
        uint256 uWattsCurrentClaim;
        uint256 percentageToClaim;
        uint256 uWattsClaimed;
        uint256 totalUWatts;
        bool claimStatus;
    }

}
          

/project_/node_modules/_openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity 0.8.17.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() {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

/project_/node_modules/_openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity 0.8.17.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

/project_/node_modules/_openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity 0.8.17.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.openzeppelin.com/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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 {}
}
          

/project_/node_modules/_openzeppelin/contracts/token/ERC20/IERC20.sol

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

pragma solidity 0.8.17.0;

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

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

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

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

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

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

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

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

/project_/node_modules/_openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity 0.8.17.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);
}
          

/project_/node_modules/_openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity 0.8.17.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;
    }
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"address","name":"owner_","internalType":"address payable"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetPermissionGranter","inputs":[{"type":"address","name":"permissionGranterAddr","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approveSwap","inputs":[{"type":"address","name":"holder","internalType":"address"},{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"closeContract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"holder","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"holder","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"permissionGranterAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum DataStructure.ProjectState"}],"name":"projectState","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum DataStructure.ProjectType"}],"name":"projectType","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"recipient","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPermissionGranterAddr","inputs":[{"type":"address","name":"permissionGranterAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setProjectType","inputs":[{"type":"uint8","name":"projectType_","internalType":"enum DataStructure.ProjectType"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setState","inputs":[{"type":"uint8","name":"state","internalType":"enum DataStructure.ProjectState"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUnergyEventAddr","inputs":[{"type":"address","name":"unergyEventaddr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"unergyEventAddr","inputs":[]}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b5060405162001f5638038062001f568339810160408190526200003491620001f4565b8282600362000044838262000329565b50600462000053828262000329565b5050506200008262000073620000c0640100000000026401000000009004565b640100000000620000c4810204565b60016006556009805460a860020a60ff0219169055600a8054600160a060020a031916600160a060020a039290921691909117905550620003fb9050565b3390565b60058054600160a060020a03838116600160a060020a0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126200015757600080fd5b81516001604060020a038082111562000174576200017462000116565b604051601f8301601f19908116603f011681019082821181831017156200019f576200019f62000116565b81604052838152602092508683858801011115620001bc57600080fd5b600091505b83821015620001e05785820183015181830184015290820190620001c1565b600093810190920192909252949350505050565b6000806000606084860312156200020a57600080fd5b83516001604060020a03808211156200022257600080fd5b620002308783880162000145565b945060208601519150808211156200024757600080fd5b50620002568682870162000145565b60408601519093509050600160a060020a03811681146200027657600080fd5b809150509250925092565b6002810460018216806200029657607f821691505b602082108103620002d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111562000324576000818152602081206020601f86010481016020861015620002ff5750805b6020601f860104820191505b8181101562000320578281556001016200030b565b5050505b505050565b81516001604060020a0381111562000345576200034562000116565b6200035d8162000356845462000281565b84620002d6565b602080601f8311600181146200039957600084156200037c5750858301515b60028086026008870290910a600019041982161786555062000320565b600085815260208120601f198616915b82811015620003ca57888601518255948401946001909101908401620003a9565b5085821015620003eb57878501516008601f88160260020a60001904191681555b5050505050600202600101905550565b611b4b806200040b6000396000f3fe608060405234801561001057600080fd5b50600436106101e1576000357c01000000000000000000000000000000000000000000000000000000009004806370a0823111610116578063a457c2d7116100b4578063c5f05a581161008e578063c5f05a58146103fe578063dd62ed3e14610411578063e80b830e14610424578063f2fde38b1461043757600080fd5b8063a457c2d7146103b7578063a9059cbb146103ca578063c2fc0d26146103dd57600080fd5b806379cc6790116100f057806379cc6790146103785780638da5cb5b1461038b57806395d89b411461039c5780639dc29fac146103a457600080fd5b806370a0823114610315578063715018a61461033e578063748807ab1461034657600080fd5b8063395093511161018357806351f5a76d1161015d57806351f5a76d146102d457806356de96db146102e7578063610be654146102fa57806366d003ac1461030257600080fd5b8063395093511461029b5780633e83422e146102ae57806340c10f19146102c157600080fd5b806323b872dd116101bf57806323b872dd1461023957806323e0a75e1461024c57806328eeb6e114610261578063313ce5671461028c57600080fd5b806306fdde03146101e6578063095ea7b31461020457806318160ddd14610227575b600080fd5b6101ee61044a565b6040516101fb91906118af565b60405180910390f35b6102176102123660046118de565b6104dc565b60405190151581526020016101fb565b6002545b6040519081526020016101fb565b610217610247366004611908565b6104f6565b61025f61025a366004611944565b61051c565b005b60095461027490600160a060020a031681565b604051600160a060020a0390911681526020016101fb565b604051600281526020016101fb565b6102176102a93660046118de565b6105d7565b61025f6102bc366004611944565b610601565b61025f6102cf3660046118de565b6106e9565b61025f6102e236600461195f565b6107bc565b61025f6102f5366004611980565b6108d3565b61025f6109e4565b600a5461027490600160a060020a031681565b61022b610323366004611944565b600160a060020a031660009081526020819052604090205490565b61025f6109fa565b60095461036b9074010000000000000000000000000000000000000000900460ff1681565b6040516101fb91906119d0565b61025f6103863660046118de565b610a0e565b600554600160a060020a0316610274565b6101ee610aff565b61025f6103b23660046118de565b610b0e565b6102176103c53660046118de565b610bd9565b6102176103d83660046118de565b610c83565b6009546103f19060a860020a900460ff1681565b6040516101fb91906119ea565b61021761040c366004611908565b610ccb565b61022b61041f3660046119fe565b610ed8565b60085461027490600160a060020a031681565b61025f610445366004611944565b610f03565b60606003805461045990611a31565b80601f016020809104026020016040519081016040528092919081815260200182805461048590611a31565b80156104d25780601f106104a7576101008083540402835291602001916104d2565b820191906000526020600020905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b6000336104ea818585610f93565b60019150505b92915050565b6000336105048582856110f1565b61050f85858561116e565b60019150505b9392505050565b610524611375565b600160a060020a0381166105a85760405160e560020a62461bcd02815260206004820152603060248201527f556e65726779204576656e7420616464726573732063616e206e6f742062652060448201527f746865207a65726f20616464726573730000000000000000000000000000000060648201526084015b60405180910390fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006105e1611375565b336104ea8482856105f28383610ed8565b6105fc9190611a84565b610f93565b610609611375565b600160a060020a0381166106885760405160e560020a62461bcd02815260206004820152603660248201527f5065726d697373696f6e204772616e74657220616464726573732063616e206e60448201527f6f7420626520746865207a65726f206164647265737300000000000000000000606482015260840161059f565b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383169081179091556040519081527f2a36148d29048d8fbf84dc372dd4569ea8af851b52054b738dc281a05577fcda9060200160405180910390a150565b60408051808201825260048082527f6d696e74000000000000000000000000000000000000000000000000000000006020830152600954925160e060020a632c460fb90281523393600160a060020a0316916000918391632c460fb9916107569188913091899101611abe565b6020604051808303816000875af1158015610775573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107999190611af3565b90506001811515146107aa57600080fd5b6107b486866113d2565b505050505050565b6107c46114a8565b604080518082018252600e81527f73657450726f6a656374547970650000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb99061083290879030908890600401611abe565b6020604051808303816000875af1158015610851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108759190611af3565b905060018115151461088657600080fd5b6009805486919075ff000000000000000000000000000000000000000000191660a860020a8360018111156108bd576108bd6119a1565b0217905550505050506108d06001600655565b50565b6108db6114a8565b604080518082018252600881527f73657453746174650000000000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb99061094990879030908890600401611abe565b6020604051808303816000875af1158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611af3565b905060018115151461099d57600080fd5b6009805486919074ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000008360048111156108bd576108bd6119a1565b6109ec611375565b600a54600160a060020a0316ff5b610a02611375565b610a0c6000611504565b565b610a166114a8565b604080518082018252600881527f6275726e46726f6d0000000000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb990610a8490879030908890600401611abe565b6020604051808303816000875af1158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611af3565b9050600181151514610ad857600080fd5b610ae38633876110f1565b610aed8686611563565b50505050610afb6001600655565b5050565b60606004805461045990611a31565b60408051808201825260048082527f6275726e000000000000000000000000000000000000000000000000000000006020830152600954925160e060020a632c460fb90281523393600160a060020a0316916000918391632c460fb991610b7b9188913091899101611abe565b6020604051808303816000875af1158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe9190611af3565b9050600181151514610bcf57600080fd5b6107b48686611563565b6000610be3611375565b336000610bf08583610ed8565b905083811015610c6b5760405160e560020a62461bcd02815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161059f565b610c788583868403610f93565b506001949350505050565b60008060095474010000000000000000000000000000000000000000900460ff166004811115610cb557610cb56119a1565b14610cbf57600080fd5b336104ea81858561116e565b6000610cd56114a8565b604080518082018252600b81527f617070726f7665537761700000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb990610d4390879030908890600401611abe565b6020604051808303816000875af1158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611af3565b905060018115151480610db65750600160095460a860020a900460ff166001811115610db457610db46119a1565b145b610e2b5760405160e560020a62461bcd02815260206004820152603160248201527f43616c6c6572206973206e6f7420617574686f72697a6564206f72207468697360448201527f206973206120705761747420746f6b656e000000000000000000000000000000606482015260840161059f565b600060095460a860020a900460ff166001811115610e4b57610e4b6119a1565b03610e6457610e5b888888610f93565b60019450610eca565b33600160a060020a03891614610ebf5760405160e560020a62461bcd02815260206004820152601860248201527f43616c6c6572206973206e6f742074686520686f6c6465720000000000000000604482015260640161059f565b610e5b888888610f93565b505050506105156001600655565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b610f0b611375565b600160a060020a038116610f8a5760405160e560020a62461bcd02815260206004820152602d60248201527f4f776e61626c653a206e6577206f776e65722063616e6e6f742062652074686560448201527f207a65726f206164647265737300000000000000000000000000000000000000606482015260840161059f565b6108d081611504565b600160a060020a0383166110115760405160e560020a62461bcd028152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0382166110905760405160e560020a62461bcd02815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006110fd8484610ed8565b90506000198114611168578181101561115b5760405160e560020a62461bcd02815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161059f565b6111688484848403610f93565b50505050565b600160a060020a0383166111ed5760405160e560020a62461bcd02815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a03821661126c5760405160e560020a62461bcd02815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161059f565b6112778383836116ea565b600160a060020a038316600090815260208190526040902054818110156113095760405160e560020a62461bcd02815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36111688484846117c3565b600554600160a060020a03163314610a0c5760405160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161059f565b600160a060020a03821661142b5760405160e560020a62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161059f565b611437600083836116ea565b80600260008282546114499190611a84565b9091555050600160a060020a038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610afb600083836117c3565b6002600654036114fd5760405160e560020a62461bcd02815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161059f565b6002600655565b60058054600160a060020a0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600160a060020a0382166115e25760405160e560020a62461bcd02815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b6115ee826000836116ea565b600160a060020a038216600090815260208190526040902054818110156116805760405160e560020a62461bcd02815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36116e5836000846117c3565b505050565b600060095460a860020a900460ff16600181111561170a5761170a6119a1565b036116e5576008546007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283169081179091556040517f6926df58000000000000000000000000000000000000000000000000000000008152306004820152858316602482015291841660448301526064820183905290636926df58906084015b600060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b50505050505050565b600060095460a860020a900460ff1660018111156117e3576117e36119a1565b036116e5576008546007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283169081179091556040517f439b8bca00000000000000000000000000000000000000000000000000000000815230600482015285831660248201529184166044830152606482018390529063439b8bca9060840161178c565b6000815180845260005b8181101561188f57602081850181015186830182015201611873565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006105156020830184611869565b8035600160a060020a03811681146118d957600080fd5b919050565b600080604083850312156118f157600080fd5b6118fa836118c2565b946020939093013593505050565b60008060006060848603121561191d57600080fd5b611926846118c2565b9250611934602085016118c2565b9150604084013590509250925092565b60006020828403121561195657600080fd5b610515826118c2565b60006020828403121561197157600080fd5b81356002811061051557600080fd5b60006020828403121561199257600080fd5b81356005811061051557600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600583106119e4576119e46119a1565b91905290565b60208101600283106119e4576119e46119a1565b60008060408385031215611a1157600080fd5b611a1a836118c2565b9150611a28602084016118c2565b90509250929050565b600281046001821680611a4557607f821691505b602082108103611a7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b808201808211156104f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000600160a060020a03808616835280851660208401525060606040830152611aea6060830184611869565b95945050505050565b600060208284031215611b0557600080fd5b8151801515811461051557600080fdfea264697066735822122071dcdfe756f74e452d5b62b601adab54d87e4f601d9b439b214da00368db082864736f6c63430008110033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004a47b68bf030d730468bf3365a0115b1cf0909dc000000000000000000000000000000000000000000000000000000000000000950726f6a65637420330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000450524a3300000000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101e1576000357c01000000000000000000000000000000000000000000000000000000009004806370a0823111610116578063a457c2d7116100b4578063c5f05a581161008e578063c5f05a58146103fe578063dd62ed3e14610411578063e80b830e14610424578063f2fde38b1461043757600080fd5b8063a457c2d7146103b7578063a9059cbb146103ca578063c2fc0d26146103dd57600080fd5b806379cc6790116100f057806379cc6790146103785780638da5cb5b1461038b57806395d89b411461039c5780639dc29fac146103a457600080fd5b806370a0823114610315578063715018a61461033e578063748807ab1461034657600080fd5b8063395093511161018357806351f5a76d1161015d57806351f5a76d146102d457806356de96db146102e7578063610be654146102fa57806366d003ac1461030257600080fd5b8063395093511461029b5780633e83422e146102ae57806340c10f19146102c157600080fd5b806323b872dd116101bf57806323b872dd1461023957806323e0a75e1461024c57806328eeb6e114610261578063313ce5671461028c57600080fd5b806306fdde03146101e6578063095ea7b31461020457806318160ddd14610227575b600080fd5b6101ee61044a565b6040516101fb91906118af565b60405180910390f35b6102176102123660046118de565b6104dc565b60405190151581526020016101fb565b6002545b6040519081526020016101fb565b610217610247366004611908565b6104f6565b61025f61025a366004611944565b61051c565b005b60095461027490600160a060020a031681565b604051600160a060020a0390911681526020016101fb565b604051600281526020016101fb565b6102176102a93660046118de565b6105d7565b61025f6102bc366004611944565b610601565b61025f6102cf3660046118de565b6106e9565b61025f6102e236600461195f565b6107bc565b61025f6102f5366004611980565b6108d3565b61025f6109e4565b600a5461027490600160a060020a031681565b61022b610323366004611944565b600160a060020a031660009081526020819052604090205490565b61025f6109fa565b60095461036b9074010000000000000000000000000000000000000000900460ff1681565b6040516101fb91906119d0565b61025f6103863660046118de565b610a0e565b600554600160a060020a0316610274565b6101ee610aff565b61025f6103b23660046118de565b610b0e565b6102176103c53660046118de565b610bd9565b6102176103d83660046118de565b610c83565b6009546103f19060a860020a900460ff1681565b6040516101fb91906119ea565b61021761040c366004611908565b610ccb565b61022b61041f3660046119fe565b610ed8565b60085461027490600160a060020a031681565b61025f610445366004611944565b610f03565b60606003805461045990611a31565b80601f016020809104026020016040519081016040528092919081815260200182805461048590611a31565b80156104d25780601f106104a7576101008083540402835291602001916104d2565b820191906000526020600020905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b6000336104ea818585610f93565b60019150505b92915050565b6000336105048582856110f1565b61050f85858561116e565b60019150505b9392505050565b610524611375565b600160a060020a0381166105a85760405160e560020a62461bcd02815260206004820152603060248201527f556e65726779204576656e7420616464726573732063616e206e6f742062652060448201527f746865207a65726f20616464726573730000000000000000000000000000000060648201526084015b60405180910390fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006105e1611375565b336104ea8482856105f28383610ed8565b6105fc9190611a84565b610f93565b610609611375565b600160a060020a0381166106885760405160e560020a62461bcd02815260206004820152603660248201527f5065726d697373696f6e204772616e74657220616464726573732063616e206e60448201527f6f7420626520746865207a65726f206164647265737300000000000000000000606482015260840161059f565b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383169081179091556040519081527f2a36148d29048d8fbf84dc372dd4569ea8af851b52054b738dc281a05577fcda9060200160405180910390a150565b60408051808201825260048082527f6d696e74000000000000000000000000000000000000000000000000000000006020830152600954925160e060020a632c460fb90281523393600160a060020a0316916000918391632c460fb9916107569188913091899101611abe565b6020604051808303816000875af1158015610775573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107999190611af3565b90506001811515146107aa57600080fd5b6107b486866113d2565b505050505050565b6107c46114a8565b604080518082018252600e81527f73657450726f6a656374547970650000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb99061083290879030908890600401611abe565b6020604051808303816000875af1158015610851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108759190611af3565b905060018115151461088657600080fd5b6009805486919075ff000000000000000000000000000000000000000000191660a860020a8360018111156108bd576108bd6119a1565b0217905550505050506108d06001600655565b50565b6108db6114a8565b604080518082018252600881527f73657453746174650000000000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb99061094990879030908890600401611abe565b6020604051808303816000875af1158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611af3565b905060018115151461099d57600080fd5b6009805486919074ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000008360048111156108bd576108bd6119a1565b6109ec611375565b600a54600160a060020a0316ff5b610a02611375565b610a0c6000611504565b565b610a166114a8565b604080518082018252600881527f6275726e46726f6d0000000000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb990610a8490879030908890600401611abe565b6020604051808303816000875af1158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611af3565b9050600181151514610ad857600080fd5b610ae38633876110f1565b610aed8686611563565b50505050610afb6001600655565b5050565b60606004805461045990611a31565b60408051808201825260048082527f6275726e000000000000000000000000000000000000000000000000000000006020830152600954925160e060020a632c460fb90281523393600160a060020a0316916000918391632c460fb991610b7b9188913091899101611abe565b6020604051808303816000875af1158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe9190611af3565b9050600181151514610bcf57600080fd5b6107b48686611563565b6000610be3611375565b336000610bf08583610ed8565b905083811015610c6b5760405160e560020a62461bcd02815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161059f565b610c788583868403610f93565b506001949350505050565b60008060095474010000000000000000000000000000000000000000900460ff166004811115610cb557610cb56119a1565b14610cbf57600080fd5b336104ea81858561116e565b6000610cd56114a8565b604080518082018252600b81527f617070726f7665537761700000000000000000000000000000000000000000006020820152600954915160e060020a632c460fb90281523392600160a060020a0316906000908290632c460fb990610d4390879030908890600401611abe565b6020604051808303816000875af1158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611af3565b905060018115151480610db65750600160095460a860020a900460ff166001811115610db457610db46119a1565b145b610e2b5760405160e560020a62461bcd02815260206004820152603160248201527f43616c6c6572206973206e6f7420617574686f72697a6564206f72207468697360448201527f206973206120705761747420746f6b656e000000000000000000000000000000606482015260840161059f565b600060095460a860020a900460ff166001811115610e4b57610e4b6119a1565b03610e6457610e5b888888610f93565b60019450610eca565b33600160a060020a03891614610ebf5760405160e560020a62461bcd02815260206004820152601860248201527f43616c6c6572206973206e6f742074686520686f6c6465720000000000000000604482015260640161059f565b610e5b888888610f93565b505050506105156001600655565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b610f0b611375565b600160a060020a038116610f8a5760405160e560020a62461bcd02815260206004820152602d60248201527f4f776e61626c653a206e6577206f776e65722063616e6e6f742062652074686560448201527f207a65726f206164647265737300000000000000000000000000000000000000606482015260840161059f565b6108d081611504565b600160a060020a0383166110115760405160e560020a62461bcd028152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0382166110905760405160e560020a62461bcd02815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006110fd8484610ed8565b90506000198114611168578181101561115b5760405160e560020a62461bcd02815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161059f565b6111688484848403610f93565b50505050565b600160a060020a0383166111ed5760405160e560020a62461bcd02815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a03821661126c5760405160e560020a62461bcd02815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161059f565b6112778383836116ea565b600160a060020a038316600090815260208190526040902054818110156113095760405160e560020a62461bcd02815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36111688484846117c3565b600554600160a060020a03163314610a0c5760405160e560020a62461bcd02815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161059f565b600160a060020a03821661142b5760405160e560020a62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161059f565b611437600083836116ea565b80600260008282546114499190611a84565b9091555050600160a060020a038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610afb600083836117c3565b6002600654036114fd5760405160e560020a62461bcd02815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161059f565b6002600655565b60058054600160a060020a0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600160a060020a0382166115e25760405160e560020a62461bcd02815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b6115ee826000836116ea565b600160a060020a038216600090815260208190526040902054818110156116805760405160e560020a62461bcd02815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161059f565b600160a060020a0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36116e5836000846117c3565b505050565b600060095460a860020a900460ff16600181111561170a5761170a6119a1565b036116e5576008546007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283169081179091556040517f6926df58000000000000000000000000000000000000000000000000000000008152306004820152858316602482015291841660448301526064820183905290636926df58906084015b600060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b50505050505050565b600060095460a860020a900460ff1660018111156117e3576117e36119a1565b036116e5576008546007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283169081179091556040517f439b8bca00000000000000000000000000000000000000000000000000000000815230600482015285831660248201529184166044830152606482018390529063439b8bca9060840161178c565b6000815180845260005b8181101561188f57602081850181015186830182015201611873565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006105156020830184611869565b8035600160a060020a03811681146118d957600080fd5b919050565b600080604083850312156118f157600080fd5b6118fa836118c2565b946020939093013593505050565b60008060006060848603121561191d57600080fd5b611926846118c2565b9250611934602085016118c2565b9150604084013590509250925092565b60006020828403121561195657600080fd5b610515826118c2565b60006020828403121561197157600080fd5b81356002811061051557600080fd5b60006020828403121561199257600080fd5b81356005811061051557600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600583106119e4576119e46119a1565b91905290565b60208101600283106119e4576119e46119a1565b60008060408385031215611a1157600080fd5b611a1a836118c2565b9150611a28602084016118c2565b90509250929050565b600281046001821680611a4557607f821691505b602082108103611a7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b808201808211156104f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000600160a060020a03808616835280851660208401525060606040830152611aea6060830184611869565b95945050505050565b600060208284031215611b0557600080fd5b8151801515811461051557600080fdfea264697066735822122071dcdfe756f74e452d5b62b601adab54d87e4f601d9b439b214da00368db082864736f6c63430008110033