Skip to content
Verified contractExactMIT

AuroraGateway

Address0x6fdceee3dcfa762287cc5c7f4cca7aa7e7c53613
Balance

0 ETH

 

Transactions

6

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 300 runs
EVM version
cancun
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
23,174,433
Creation transaction
0x190ea2c1f3…16103ee833

contracts/token.sol

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

contract AuroraGateway {
    /*//////////////////////////////////////////////////////////////
                                EVENTS
    //////////////////////////////////////////////////////////////*/
    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                                ERRORS
    //////////////////////////////////////////////////////////////*/
    error TransferToZero();
    error TransferFromZero();
    error InsufficientBalance();
    error InsufficientAllowance();
    error AlreadyInitialized();
    error NotMinter();
    error MintToZero();

    /*//////////////////////////////////////////////////////////////
                               METADATA
    //////////////////////////////////////////////////////////////*/
    string internal constant _NAME   = "Keepsafe Reserve";
    string internal constant _SYMBOL = "KPSF";

    function name() public pure returns (string memory) { return _NAME; }
    function symbol() public pure returns (string memory) { return _SYMBOL; }
    function decimals() public pure returns (uint8) { return 18; }

    /*//////////////////////////////////////////////////////////////
                               ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/
    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                                IMMUTABLES
    //////////////////////////////////////////////////////////////*/
    address public immutable MINTER;
    uint256 public constant INITIAL_SUPPLY = 45000000000000 * 1e18;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/
    constructor(address _minter) {
        MINTER = _minter;
    }

    /*//////////////////////////////////////////////////////////////
                              ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/
    function approve(address spender, uint256 amount) public returns (bool) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

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

    function transferFrom(address from, address to, uint256 amount) public returns (bool) {
        uint256 allowed = allowance[from][msg.sender];
        if (allowed != type(uint256).max) {
            if (allowed < amount) revert InsufficientAllowance();
            unchecked { allowance[from][msg.sender] = allowed - amount; }
        }
        _transfer(from, to, amount);
        return true;
    }

    /*//////////////////////////////////////////////////////////////
                              ONE-TIME MINT
    //////////////////////////////////////////////////////////////*/
    function initMint() external {
        if (msg.sender != MINTER) revert NotMinter();
        if (totalSupply != 0) revert AlreadyInitialized();
        _mint(MINTER, INITIAL_SUPPLY);
    }

    /*//////////////////////////////////////////////////////////////
                         INTERNALS: TRANSFER/MINT
    //////////////////////////////////////////////////////////////*/
    function _transfer(address from, address to, uint256 amount) internal {
        if (to == address(0)) revert TransferToZero();
        if (from == address(0)) revert TransferFromZero();

        uint256 fromBal = balanceOf[from];
        if (fromBal < amount) revert InsufficientBalance();

        unchecked {
            balanceOf[from] = fromBal - amount;
            balanceOf[to] += amount;
        }
        emit Transfer(from, to, amount);
    }

    function _mint(address to, uint256 amount) internal {
        if (to == address(0)) revert MintToZero();
        totalSupply += amount;
        unchecked { balanceOf[to] += amount; }
        emit Transfer(address(0), to, amount);
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "runs": 300,
    "enabled": true
  },
  "evmVersion": "cancun"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.