Token NUON

 

Overview ERC20

Price
$1.04 @ 0.000299 ETH
Fully Diluted Market Cap
Total Supply:
116,678.84942 NUON

Holders:
497 addresses

Transfers:
-

Contract:
0xfb9fed8cb962548a11fe7f6f282949061395c7f50xfb9Fed8cB962548A11fE7F6F282949061395c7F5

Decimals:
18

Official Site:

Social Profiles:

Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

OVERVIEW

Nuon is the independent, overcollateralized and decentralized flatcoin pegged to the value of unbiased inflation, protecting purchasing power.


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

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

Contract Name:
NUON

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
No with 1 runs

Other Settings:
default evmVersion
File 1 of 1 : NUON_flat.sol
// File: @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.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);
}

// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;


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

// File: @openzeppelin/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

// File: @openzeppelin/contracts/token/ERC20/ERC20.sol


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;




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

// File: @openzeppelin/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;


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

// File: contracts/Nuon/interfaces/INUONController.sol



pragma solidity 0.8.7;

interface INUONController {

    function getMintLimit(uint256 _nuonAmount) external view returns (uint256);

    function addPool(address pool_address) external;

    function getPools() external view returns (address[] memory);

    function addPools(address[] memory poolAddress) external;

    function removePool(address pool_address) external;

    function getNUONSupply() external view returns (uint256);

    function isPool(address pool) external view returns (bool);

    function isMintPaused() external view returns (bool);

    function isRedeemPaused() external view returns (bool);

    function isAllowedToMint(address _minter) external view returns (bool);

    function setFeesParameters(uint256 _mintingFee, uint256 _redeemFee)
        external;

    function setGlobalCollateralRatio(uint256 _globalCollateralRatio) external;

    function getMintingFee(address _CHUB) external view returns (uint256);

    function getRedeemFee(address _CHUB) external view returns (uint256);

    function getGlobalCollateralRatio(address _CHUB) external view returns (uint256);

    function getGlobalCollateralValue() external view returns (uint256);

    function toggleMinting() external;

    function toggleRedeeming() external;

    function getTargetCollateralValue() external view returns (uint256);

    function getMaxCratio(address _CHUB) external view returns (uint256);
}

// File: contracts/Uniswap/Interfaces/IUniswapV2Router01.sol


pragma solidity 0.8.7;

interface IUniswapV2Router01 {
    function factory() external view returns (address);

    function WETH() external view returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 liquidity
        );

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountToken, uint256 amountETH);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapETHForExactTokens(
        uint256 amountOut,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function quote(
        uint256 amountA,
        uint256 reserveA,
        uint256 reserveB
    ) external pure returns (uint256 amountB);

    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountOut);

    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountIn);

    function getAmountsOut(uint256 amountIn, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);

    function getAmountsIn(uint256 amountOut, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);
}

// File: contracts/Uniswap/Interfaces/IUniswapV2Router02.sol



pragma solidity 0.8.7;


interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

// File: contracts/Nuon/Nuon.sol

pragma solidity ^0.8.0;






interface IUniswapPair {
    function token0() external view returns (address);

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

contract NUON is ERC20, Ownable {

    INUONController public controller;
    bool public swapEnabled = false;
    mapping(address => bool) public whitelisted;

    modifier onlyPools() {
        require(controller.isAllowedToMint(msg.sender),'NUON: not an approved pool');
        _;
    }

    constructor() ERC20('NUON', 'NUON') {}

    function enableSwap() public onlyOwner {
        swapEnabled = true;
    }

    function setWhitelisted(address _toWhitelist, bool _status) public onlyOwner {
        whitelisted[_toWhitelist] = _status;
    }

    function setNUONController(address _controller) external onlyOwner {
        require(_controller != address(0), '0 address provided');
        controller = INUONController(_controller);
    }
 
    function mint(address to, uint256 amount) public onlyPools {
        _mint(to, amount);
    }

    function burn(uint256 amount) public {
        _burn(msg.sender, amount);
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public override returns (bool) {

        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transferWithValidation(from, to, amount);

        return true;
    }

    function transfer(address recipient, uint256 amount)
        public
        override
        returns (bool)
    {
        _transferWithValidation(_msgSender(), recipient, amount);
        return true;
    }

    function _transferWithValidation(
        address sender,
        address recipient,
        uint256 amount
    ) internal returns (bool) {
        
        if (isLiquidityPool(recipient) && sender == owner() || 
            isLiquidityPool(sender) && recipient == owner()) {
            _transfer(sender, recipient, amount);
        } else if (sender == owner() && whitelisted[recipient] ||
            whitelisted[sender] && recipient == owner()) {
            _transfer(sender, recipient, amount);
        } else if (swapEnabled) {
            _transfer(sender, recipient, amount);
        } else {
            revert("Not enabled yet");
        }

        return true;
    }

    function getPoolToken(
        address pool,
        string memory signature,
        function() external view returns (address) getter
    ) private returns (address token) {
        (bool success, ) = pool.call(abi.encodeWithSignature(signature));
        if (success) {
            uint32 size;
            assembly {
                size := extcodesize(pool)
            }
            if (size > 0) {
                return getter();
            }
        }
    }

    function isLiquidityPool(address recipient) public returns (bool) {
        address token0 = getPoolToken(
            recipient,
            'token0()',
            IUniswapPair(recipient).token0
        );
        address token1 = getPoolToken(
            recipient,
            'token1()',
            IUniswapPair(recipient).token1
        );

        return (
            token0 == address(this) ||
            token1 == address(this));
    }

    function transferAnyERC20Token(address _tokenAddr, address _to) public onlyOwner {
        uint256 balOfToken = IERC20(_tokenAddr).balanceOf(address(this));
        require(IERC20(_tokenAddr).transfer(_to, balOfToken), "Could not transfer out tokens!");
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "details": {
      "constantOptimizer": true,
      "cse": true,
      "deduplicate": true,
      "inliner": true,
      "jumpdestRemover": true,
      "orderLiterals": true,
      "peephole": true,
      "yul": false
    },
    "runs": 1
  },
  "evmVersion": "london",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"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":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"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":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract INUONController","name":"","type":"address"}],"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":[],"name":"enableSwap","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"address","name":"recipient","type":"address"}],"name":"isLiquidityPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setNUONController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_toWhitelist","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferAnyERC20Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101285760003560e01c806306fdde031461012d578063095ea7b31461014b57806318160ddd1461016b57806323b872dd1461017c578063296914481461018f578063313ce5671461019957806339509351146101a857806340c10f19146101bb57806342966c68146101ce5780636ddd1713146101e157806370a08231146101f5578063715018a61461021e57806376f81926146102265780638da5cb5b146102395780639281aa0b1461024e57806395d89b4114610261578063a457c2d714610269578063a9059cbb1461027c578063bb771c951461028f578063d936547e146102a2578063dd62ed3e146102c5578063e85455d7146102d8578063f2fde38b146102eb578063f77c4791146102fe575b600080fd5b61013561031e565b6040516101429190611478565b60405180910390f35b61015e610159366004610f73565b6103b0565b604051610142919061145c565b6002545b6040516101429190611589565b61015e61018a366004610ef0565b6103ca565b6101976103f1565b005b60126040516101429190611597565b61015e6101b6366004610f73565b61040e565b6101976101c9366004610f73565b610430565b6101976101dc366004610fc7565b6104e3565b60065461015e90600160a01b900460ff1681565b61016f610203366004610e71565b6001600160a01b031660009081526020819052604090205490565b6101976104f0565b610197610234366004610e71565b610504565b610241610554565b6040516101429190611433565b61019761025c366004610f40565b610563565b610135610596565b61015e610277366004610f73565b6105a5565b61015e61028a366004610f73565b6105ed565b61019761029d366004610eb3565b610604565b61015e6102b0366004610e71565b60076020526000908152604090205460ff1681565b61016f6102d3366004610eb3565b61072f565b61015e6102e6366004610e71565b61075a565b6101976102f9366004610e71565b6107fc565b600654610311906001600160a01b031681565b604051610142919061146a565b60606003805461032d9061160b565b80601f01602080910402602001604051908101604052809291908181526020018280546103599061160b565b80156103a65780601f1061037b576101008083540402835291602001916103a6565b820191906000526020600020905b81548152906001019060200180831161038957829003601f168201915b5050505050905090565b6000336103be818585610833565b60019150505b92915050565b6000336103d88582856108e7565b6103e3858585610931565b5060019150505b9392505050565b6103f9610a73565b6006805460ff60a01b1916600160a01b179055565b6000336103be818585610421838361072f565b61042b91906115a5565b610833565b600654604051632409ec5360e11b81526001600160a01b0390911690634813d8a690610460903390600401611433565b60206040518083038186803b15801561047857600080fd5b505afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b09190610fa6565b6104d55760405162461bcd60e51b81526004016104cc90611509565b60405180910390fd5b6104df8282610aa2565b5050565b6104ed3382610b26565b50565b6104f8610a73565b6105026000610bcb565b565b61050c610a73565b6001600160a01b0381166105325760405162461bcd60e51b81526004016104cc90611559565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031690565b61056b610a73565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b60606004805461032d9061160b565b600033816105b3828661072f565b9050838110156105d55760405162461bcd60e51b81526004016104cc90611569565b6105e28286868403610833565b506001949350505050565b60006105fa338484610931565b5060019392505050565b61060c610a73565b6040516370a0823160e01b81526000906001600160a01b038416906370a082319061063b903090600401611433565b60206040518083038186803b15801561065357600080fd5b505afa158015610667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068b9190610fe8565b60405163a9059cbb60e01b81529091506001600160a01b0384169063a9059cbb906106bc9085908590600401611441565b602060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e9190610fa6565b61072a5760405162461bcd60e51b81526004016104cc906114c9565b505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000806107968360405180604001604052806008815260200167746f6b656e30282960c01b815250856001600160a01b0316630dfe1681610c1d565b905060006107d38460405180604001604052806008815260200167746f6b656e31282960c01b815250866001600160a01b031663d21220a7610c1d565b90506001600160a01b0382163014806107f457506001600160a01b03811630145b949350505050565b610804610a73565b6001600160a01b03811661082a5760405162461bcd60e51b81526004016104cc906114a9565b6104ed81610bcb565b6001600160a01b0383166108595760405162461bcd60e51b81526004016104cc90611549565b6001600160a01b03821661087f5760405162461bcd60e51b81526004016104cc906114b9565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108da908590611589565b60405180910390a3505050565b60006108f3848461072f565b9050600019811461092b578181101561091e5760405162461bcd60e51b81526004016104cc906114d9565b61092b8484848403610833565b50505050565b600061093c8361075a565b8015610960575061094b610554565b6001600160a01b0316846001600160a01b0316145b80610993575061096f8461075a565b8015610993575061097e610554565b6001600160a01b0316836001600160a01b0316145b156109a8576109a3848484610d51565b6105fa565b6109b0610554565b6001600160a01b0316846001600160a01b03161480156109e857506001600160a01b03831660009081526007602052604090205460ff165b80610a2e57506001600160a01b03841660009081526007602052604090205460ff168015610a2e5750610a19610554565b6001600160a01b0316836001600160a01b0316145b15610a3e576109a3848484610d51565b600654600160a01b900460ff1615610a5b576109a3848484610d51565b60405162461bcd60e51b81526004016104cc906114f9565b33610a7c610554565b6001600160a01b0316146105025760405162461bcd60e51b81526004016104cc90611519565b6001600160a01b038216610ac85760405162461bcd60e51b81526004016104cc90611579565b8060026000828254610ada91906115a5565b90915550506001600160a01b0382166000818152602081905260408082208054850190555160008051602061168783398151915290610b1a908590611589565b60405180910390a35050565b6001600160a01b038216610b4c5760405162461bcd60e51b81526004016104cc90611529565b6001600160a01b03821660009081526020819052604090205481811015610b855760405162461bcd60e51b81526004016104cc90611499565b6001600160a01b038316600081815260208190526040808220858503905560028054869003905551909190600080516020611687833981519152906108da908690611589565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160048152602481019182905260009182916001600160a01b03881691610c48908890611427565b60408051918290039091206020830180516001600160e01b03166001600160e01b031990921691909117905251610c7f9190611427565b6000604051808303816000865af19150503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b505090508015610d4857853b63ffffffff811615610d465784846040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0557600080fd5b505afa158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190610e92565b925050506107f4565b505b50949350505050565b6001600160a01b038316610d775760405162461bcd60e51b81526004016104cc90611539565b6001600160a01b038216610d9d5760405162461bcd60e51b81526004016104cc90611489565b6001600160a01b03831660009081526020819052604090205481811015610dd65760405162461bcd60e51b81526004016104cc906114e9565b6001600160a01b03808516600081815260208190526040808220868603905592861680825290839020805486019055915160008051602061168783398151915290610e22908690611589565b60405180910390a361092b565b80356103c481611664565b80516103c481611664565b80356103c481611678565b80516103c481611678565b80356103c481611680565b80516103c481611680565b600060208284031215610e8657610e86600080fd5b60006107f48484610e2f565b600060208284031215610ea757610ea7600080fd5b60006107f48484610e3a565b60008060408385031215610ec957610ec9600080fd5b6000610ed58585610e2f565b9250506020610ee685828601610e2f565b9150509250929050565b600080600060608486031215610f0857610f08600080fd5b6000610f148686610e2f565b9350506020610f2586828701610e2f565b9250506040610f3686828701610e5b565b9150509250925092565b60008060408385031215610f5657610f56600080fd5b6000610f628585610e2f565b9250506020610ee685828601610e45565b60008060408385031215610f8957610f89600080fd5b6000610f958585610e2f565b9250506020610ee685828601610e5b565b600060208284031215610fbb57610fbb600080fd5b60006107f48484610e50565b600060208284031215610fdc57610fdc600080fd5b60006107f48484610e5b565b600060208284031215610ffd57610ffd600080fd5b60006107f48484610e66565b611012816115bd565b82525050565b801515611012565b600061102a825190565b6110388185602086016115df565b9290920192915050565b611012816115ce565b6000611055825190565b80845260208401935061106c8185602086016115df565b601f01601f19169290920192915050565b602381526000602082017f45524332303a207472616e7366657220746f20746865207a65726f206164647281526265737360e81b602082015291505b5060400190565b602281526000602082017f45524332303a206275726e20616d6f756e7420657863656564732062616c616e815261636560f01b602082015291506110b9565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015291506110b9565b602281526000602082017f45524332303a20617070726f766520746f20746865207a65726f206164647265815261737360f01b602082015291506110b9565b601e81526000602082017f436f756c64206e6f74207472616e73666572206f757420746f6b656e73210000815291505b5060200190565b601d81526000602082017f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000815291506111b1565b602681526000602082017f45524332303a207472616e7366657220616d6f756e7420657863656564732062815265616c616e636560d01b602082015291506110b9565b600f81526000602082016e139bdd08195b98589b1959081e595d608a1b815291506111b1565b601a815260006020820179139553d38e881b9bdd08185b88185c1c1c9bdd9959081c1bdbdb60321b815291506111b1565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910190815260006111b1565b602181526000602082017f45524332303a206275726e2066726f6d20746865207a65726f206164647265738152607360f81b602082015291506110b9565b602581526000602082017f45524332303a207472616e736665722066726f6d20746865207a65726f206164815264647265737360d81b602082015291506110b9565b602481526000602082017f45524332303a20617070726f76652066726f6d20746865207a65726f206164648152637265737360e01b602082015291506110b9565b60128152600060208201710c081859191c995cdcc81c1c9bdd9a59195960721b815291506111b1565b602581526000602082017f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77815264207a65726f60d81b602082015291506110b9565b601f81526000602082017f45524332303a206d696e7420746f20746865207a65726f206164647265737300815291506111b1565b80611012565b60ff8116611012565b60006103ea8284611020565b602081016103c48284611009565b6040810161144f8285611009565b6103ea6020830184611418565b602081016103c48284611018565b602081016103c48284611042565b602080825281016103ea818461104b565b602080825281016103c48161107d565b602080825281016103c4816110c0565b602080825281016103c4816110ff565b602080825281016103c481611142565b602080825281016103c481611181565b602080825281016103c4816111b8565b602080825281016103c4816111ec565b602080825281016103c48161122f565b602080825281016103c481611255565b602080825281016103c481611286565b602080825281016103c4816112b8565b602080825281016103c4816112f6565b602080825281016103c481611338565b602080825281016103c481611379565b602080825281016103c4816113a2565b602080825281016103c4816113e4565b602081016103c48284611418565b602081016103c4828461141e565b600082198211156115b8576115b8611638565b500190565b60006001600160a01b0382166103c4565b60006103c48260006103c4826115bd565b60005b838110156115fa5781810151838201526020016115e2565b8381111561092b5750506000910152565b60028104600182168061161f57607f821691505b602082108114156116325761163261164e565b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b61166d816115bd565b81146104ed57600080fd5b80151561166d565b8061166d56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122051ade56a2848c5e4996013bbd507d4d64e36303f026ea5b26b14bbaf08581fa564736f6c63430008070033

Loading