Skip to content
Verified contractExactMIT

ENOXUM

Address0xbdc62aba202177387eca495fee1fbb0ce0bb02ee
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.38

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.38+commit.1835d247
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,401,039
Creation transaction
0xf7050e0c53…90dd5db1f7

ENOXUM.sol


// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract ENOXUM {
    string public constant name = "ENOXUM";
    string public constant symbol = "ENO";
    uint8 public constant decimals = 18;

    uint256 private constant _totalSupply =
        1_000_000_000 * 10 ** 18;

    address private _owner;

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

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

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

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

    modifier onlyOwner() {
        require(msg.sender == _owner, "ENOXUM: Not owner");
        _;
    }

    constructor() {
        _owner = msg.sender;
        _balances[msg.sender] = _totalSupply;

        emit OwnershipTransferred(address(0), msg.sender);
        emit Transfer(address(0), msg.sender, _totalSupply);
    }

    function owner() public view returns (address) {
        return _owner;
    }

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

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

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

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

    function approve(address spender, uint256 amount)
        public
        returns (bool)
    {
        require(spender != address(0), "ENOXUM: Invalid spender");

        _allowances[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public returns (bool) {
        uint256 currentAllowance = _allowances[sender][msg.sender];

        require(
            currentAllowance >= amount,
            "ENOXUM: Exceeds allowance"
        );

        _allowances[sender][msg.sender] =
            currentAllowance - amount;

        emit Approval(
            sender,
            msg.sender,
            _allowances[sender][msg.sender]
        );

        _transfer(sender, recipient, amount);
        return true;
    }

    function increaseAllowance(
        address spender,
        uint256 addedValue
    ) public returns (bool) {
        require(spender != address(0), "ENOXUM: Invalid spender");

        uint256 newAllowance =
            _allowances[msg.sender][spender] + addedValue;

        _allowances[msg.sender][spender] = newAllowance;

        emit Approval(msg.sender, spender, newAllowance);
        return true;
    }

    function decreaseAllowance(
        address spender,
        uint256 subtractedValue
    ) public returns (bool) {
        uint256 currentAllowance = _allowances[msg.sender][spender];

        require(
            currentAllowance >= subtractedValue,
            "ENOXUM: Allowance too low"
        );

        uint256 newAllowance = currentAllowance - subtractedValue;

        _allowances[msg.sender][spender] = newAllowance;

        emit Approval(msg.sender, spender, newAllowance);
        return true;
    }

    function transferOwnership(address newOwner)
        public
        onlyOwner
    {
        require(newOwner != address(0), "ENOXUM: Zero address");

        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal {
        require(sender != address(0), "ENOXUM: Invalid sender");
        require(recipient != address(0), "ENOXUM: Invalid recipient");
        require(amount > 0, "ENOXUM: Amount must be greater than zero");
        require(
            _balances[sender] >= amount,
            "ENOXUM: Insufficient balance"
        );

        unchecked {
            _balances[sender] -= amount;
        }

        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.