false
true
0

Contract Address Details

0x0000674bc7700311B62845e2F5cdd4aff9990000

Token
Sun (SUN)
Creator
0x133ba2–06045b at 0x3ffd39–a925c5
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
26611785
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
Sun




Optimization enabled
true
Compiler version
v0.8.24+commit.e11b9ed9




Optimization runs
6000
EVM Version
paris




Verified at
2026-05-13T20:01:05.909018Z

Constructor Arguments

000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000fffffd64effb1f789bfdbb94db682bc764e4ffff

Arg [0] (uint256) : 1000000000
Arg [1] (address) : 0xfffffd64effb1f789bfdbb94db682bc764e4ffff

              

contracts/Sun.sol

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

/* 
 ┌────────────────────────────────────────────────────────────────────────┐
 │                                                                        │
 │                       ███████ ██    ██ ███    ██                       │
 │                       ██      ██    ██ ████   ██                       │
 │                       ███████ ██    ██ ██ ██  ██                       │
 │                            ██ ██    ██ ██  ██ ██                       │
 │                       ███████  ██████  ██   ████                       │
 │                                                                        │
 │                                                                        │
 │  Holding SUN gives you free reflections. MOON uses swap taxes to buy   │
 │  the tokens it’s paired with. Those tokens are automatically reflected │
 │  to SUN holders—connecting them with every project in MOON’s orbit.    │
 │                                                                        │
 │  SUN behavior                                                          │
 │   • Standard ERC-20: fixed supply, no fees, no taxes, no admin keys.   │
 │   • One addition: a lightweight post-transfer hook allows MOON to keep │
 │     it's reflection accounting precise.                                │
 │   • Holders may optionally call Moon.collect() to synchronize          │
 │     reflections at any time, though this is not required.              │
 │                                                                        │
 └────────────────────────────────────────────────────────────────────────┘
*/

/*────────────────────────────  INTERFACES  ───────────────────────────────*/

/// @notice Minimal ERC‑20 interface used by Sun.
interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address owner) external view returns (uint256);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

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

/// @notice Moon’s hook; Sun notifies Moon before every balance‑changing transfer.
/// @dev    Moon uses these pre‑transfer balances to maintain its own accounting.
interface IMoon {
    function transferSun(address from, address to, uint256 fromBal, uint256 toBal, uint256 amount) external;
}

/*──────────────────────────────  CONTRACT  ───────────────────────────────*/

contract Sun is IERC20 {
    /*//////////////////////////////////////////////////////////////////////////
                                    METADATA
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice ERC‑20 name.
    string  public constant name     = "Sun";
    /// @notice ERC‑20 symbol.
    string  public constant symbol   = "SUN";
    /// @notice ERC‑20 decimals (fixed at 18).
    uint8   public constant decimals = 18;

    /*//////////////////////////////////////////////////////////////////////////
                                   IMMUTABLES
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Fixed total supply (scaled by 1e18 in the constructor).
    uint256 public immutable override totalSupply;
    /// @notice The trusted Moon contract that receives transfer hooks.
    address public immutable moon;

    /*//////////////////////////////////////////////////////////////////////////
                               ERC-20 CORE STORAGE
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Balance mapping per ERC‑20.
    mapping(address => uint256) internal balances;
    /// @dev Allowance mapping per ERC‑20 (`owner => (spender => amount)`).
    mapping(address => mapping(address => uint256)) internal allowances;

    /*//////////////////////////////////////////////////////////////////////////
                                   CONSTRUCTOR
    //////////////////////////////////////////////////////////////////////////*/


    /// @param supply       Human‑readable supply (will be scaled by 1e18).
    /// @param moonAddress  The Moon contract to notify on transfers (must be non‑zero).
    /// Mints the entire fixed supply to `msg.sender`.
    constructor(uint256 supply, address moonAddress) {
        require(moonAddress != address(0), "Sun: zero Moon addr");
        moon = moonAddress;

        // Scale by 1e18 to align with `decimals = 18`.
        totalSupply = supply * 1e18;

        // Mint fixed supply to deployer.
        balances[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    /*//////////////////////////////////////////////////////////////////////////
                               ERC-20 VIEW FUNCTIONS
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Returns the current balance of an address.
    function balanceOf(address owner) public view override returns (uint256) {
        return balances[owner];
    }

    /// @notice Returns the remaining allowance from `owner` to `spender`.
    function allowance(address owner, address spender)
        public
        view
        override
        returns (uint256)
    {
        return allowances[owner][spender];
    }

    /*//////////////////////////////////////////////////////////////////////////
                         ERC-20 EXTERNAL MUTATIVE FUNCTIONS
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Sets `spender`’s allowance over the caller’s tokens to `amount`.
    /// Emits an {Approval} event.
    function approve(address spender, uint256 amount)
        external
        override
        returns (bool)
    {
        _approve(msg.sender, spender, amount);
        return true;
    }

    /// @notice Moves `amount` tokens from caller to `to`.
    /// Emits a {Transfer} event and **notifies Moon** before state changes.
    function transfer(address to, uint256 amount)
        external
        override
        returns (bool)
    {
        _transfer(msg.sender, to, amount);
        return true;
    }

    /// @notice Moves `amount` tokens from `from` to `to` using the caller’s allowance.
    /// Deducts allowance unless it is `type(uint256).max` (infinite allowance UX).
    /// Emits a {Transfer} event and **notifies Moon** before state changes.
    function transferFrom(address from, address to, uint256 amount)
        external
        override
        returns (bool)
    {
        uint256 cur = allowances[from][msg.sender];
        if (cur != type(uint256).max) {
            require(cur >= amount, "allowance");
            unchecked {
                allowances[from][msg.sender] = cur - amount;
            }
            emit Approval(from, msg.sender, cur - amount);
        }

        _transfer(from, to, amount);
        return true;
    }

    /*//////////////////////////////////////////////////////////////////////////
                          INTERNAL APPROVAL HELPER
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Internal setter for allowances; emits {Approval}.
    function _approve(address owner, address spender, uint256 amount) internal {
        allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /*//////////////////////////////////////////////////////////////////////////
                               INTERNAL TRANSFER
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Internal move of tokens with Moon transfer notification.
    /// Non‑standard behaviors (documented):
    /// - We call `Moon.transferSun` with pre‑transfer balances.
    function _transfer(address from, address to, uint256 amount) internal {
        // Standard ERC‑20 validations.
        require(to != address(0), "ERC20: transfer to the zero address");
        uint256 fromBal = balances[from];
        require(fromBal >= amount, "ERC20: transfer amount exceeds balance");
        uint256 toBal = balances[to];

        // Apply balance changes (unchecked is safe due to the require above).
        unchecked {
            balances[from] -= amount;
            balances[to]   += amount;
        }

        // Inform Moon of the transfer using pre‑transfer balances. Moon can
        // update reward indices, membership status, or any other accounting.
        IMoon(moon).transferSun(from, to, fromBal, toBal, amount);

        // Emit standard ERC‑20 Transfer event.
        emit Transfer(from, to, amount);
    }
}
        

Compiler Settings

{"viaIR":true,"remappings":[],"optimizer":{"runs":6000,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"paris","compilationTarget":{"contracts/Sun.sol":"Sun"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint256","name":"supply","internalType":"uint256"},{"type":"address","name":"moonAddress","internalType":"address"}]},{"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":"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":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"moon","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"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"}]}]
              

Contract Creation Code

0x60c03461013b5761099690601f38839003908101601f19168201906001600160401b03821183831017610140578083916040958694855283398101031261013b5780516020909101516001600160a01b03811680820361013b57156100f75760a052670de0b6b3a7640000908181029181830414901517156100e15780608052336000526000602052808260002055815190815260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203393a35161083f90816101578239608051816103a8015260a05181818161011401526106000152f35b634e487b7160e01b600052601160045260246000fd5b825162461bcd60e51b815260206004820152601360248201527f53756e3a207a65726f204d6f6f6e2061646472000000000000000000000000006044820152606490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe60806040818152600436101561001457600080fd5b600091823560e01c90816306fdde031461044957508063095ea7b3146103cb57806318160ddd1461039157806323b872dd1461021d578063313ce5671461020257806370a08231146101c057806395d89b4114610168578063a9059cbb14610138578063b9094851146100e85763dd62ed3e1461009057600080fd5b346100e457806003193601126100e457806020926100ac610553565b6100b461057b565b73ffffffffffffffffffffffffffffffffffffffff91821683526001865283832091168252845220549051908152f35b5080fd5b50346100e457816003193601126100e4576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100e457806003193601126100e457602090610161610157610553565b602435903361059e565b5160018152f35b50346100e457816003193601126100e45780516101bc91610188826104a2565b600382527f53554e0000000000000000000000000000000000000000000000000000000000602083015251918291826104ed565b0390f35b50346100e45760206003193601126100e4578060209273ffffffffffffffffffffffffffffffffffffffff6101f3610553565b16815280845220549051908152f35b50346100e457816003193601126100e4576020905160128152f35b50346100e45760606003193601126100e457610237610553565b9061024061057b565b6044359073ffffffffffffffffffffffffffffffffffffffff84169384865260209460018652848720338852865284872054907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036102a8575b505090610161929161059e565b848210610334578482039181895260018852868920338a52885282878a20558211610307578561016196979850519182527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925883393a38594933861029b565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6064878751907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152600960248201527f616c6c6f77616e636500000000000000000000000000000000000000000000006044820152fd5b50346100e457816003193601126100e457602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100e457806003193601126100e457602091816103e8610553565b916024359182913381526001875273ffffffffffffffffffffffffffffffffffffffff8282209516948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b9190503461049e578260031936011261049e576101bc925061046a826104a2565b600382527f53756e0000000000000000000000000000000000000000000000000000000000602083015251918291826104ed565b8280fd5b6040810190811067ffffffffffffffff8211176104be57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60208082528251818301819052939260005b85811061053f575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b8181018301518482016040015282016104ff565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361057657565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361057657565b9173ffffffffffffffffffffffffffffffffffffffff80921692831561078557821691600090838252816020526040918281205491848310610702578682528160205283822054908683528483208681540390558783528483208681540190557f00000000000000000000000000000000000000000000000000000000000000001692833b1561049e579060a4839283875196879485937f67ac46f30000000000000000000000000000000000000000000000000000000085528c60048601528d6024860152604485015260648401528960848401525af180156106f6576106af575b50507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9160209151908152a3565b67ffffffffffffffff82116106c957508152816020610681565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b508251903d90823e3d90fd5b608484517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fdfea26469706673582212207ddbca77177d8334db685b16b619d7b631ba3e6956e0b667af0510cf2d680f8a64736f6c63430008180033000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000fffffd64effb1f789bfdbb94db682bc764e4ffff

Deployed ByteCode

0x60806040818152600436101561001457600080fd5b600091823560e01c90816306fdde031461044957508063095ea7b3146103cb57806318160ddd1461039157806323b872dd1461021d578063313ce5671461020257806370a08231146101c057806395d89b4114610168578063a9059cbb14610138578063b9094851146100e85763dd62ed3e1461009057600080fd5b346100e457806003193601126100e457806020926100ac610553565b6100b461057b565b73ffffffffffffffffffffffffffffffffffffffff91821683526001865283832091168252845220549051908152f35b5080fd5b50346100e457816003193601126100e4576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000fffffd64effb1f789bfdbb94db682bc764e4ffff168152f35b50346100e457806003193601126100e457602090610161610157610553565b602435903361059e565b5160018152f35b50346100e457816003193601126100e45780516101bc91610188826104a2565b600382527f53554e0000000000000000000000000000000000000000000000000000000000602083015251918291826104ed565b0390f35b50346100e45760206003193601126100e4578060209273ffffffffffffffffffffffffffffffffffffffff6101f3610553565b16815280845220549051908152f35b50346100e457816003193601126100e4576020905160128152f35b50346100e45760606003193601126100e457610237610553565b9061024061057b565b6044359073ffffffffffffffffffffffffffffffffffffffff84169384865260209460018652848720338852865284872054907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036102a8575b505090610161929161059e565b848210610334578482039181895260018852868920338a52885282878a20558211610307578561016196979850519182527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925883393a38594933861029b565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6064878751907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152600960248201527f616c6c6f77616e636500000000000000000000000000000000000000000000006044820152fd5b50346100e457816003193601126100e457602090517f0000000000000000000000000000000000000000033b2e3c9fd0803ce80000008152f35b50346100e457806003193601126100e457602091816103e8610553565b916024359182913381526001875273ffffffffffffffffffffffffffffffffffffffff8282209516948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b9190503461049e578260031936011261049e576101bc925061046a826104a2565b600382527f53756e0000000000000000000000000000000000000000000000000000000000602083015251918291826104ed565b8280fd5b6040810190811067ffffffffffffffff8211176104be57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60208082528251818301819052939260005b85811061053f575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b8181018301518482016040015282016104ff565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361057657565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361057657565b9173ffffffffffffffffffffffffffffffffffffffff80921692831561078557821691600090838252816020526040918281205491848310610702578682528160205283822054908683528483208681540390558783528483208681540190557f000000000000000000000000fffffd64effb1f789bfdbb94db682bc764e4ffff1692833b1561049e579060a4839283875196879485937f67ac46f30000000000000000000000000000000000000000000000000000000085528c60048601528d6024860152604485015260648401528960848401525af180156106f6576106af575b50507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9160209151908152a3565b67ffffffffffffffff82116106c957508152816020610681565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b508251903d90823e3d90fd5b608484517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fdfea26469706673582212207ddbca77177d8334db685b16b619d7b631ba3e6956e0b667af0510cf2d680f8a64736f6c63430008180033