Skip to content
Verified contractPartialMIT

Orbifun

Address0x2a334870ef09a956296cb4beb1df6b561d9da602
Balance

0 ETH

 

Transactions

284

 

Compiler

solc 0.8.35

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.35+commit.47b9dedd
Language
solidity
Optimization
Yes, 1 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,965,164
Creation transaction
0x8e66c0e547…cf60b363b7
Proxy implementation
0x937c5449…68bc1b15Orbifun

src/OrbifunToken.sol

// SPDX-License-Identifier: MIT
// ┌──────────────┐
// │   $ O R B I   │   orbi.fun · https://orbibi.fun/
// └──────────────┘
pragma solidity ^0.8.26;

/*
   orbi.fun token — $ORBI — the token address

   what              where
   ───────────────   ──────────────────────────────────────────────
   balances          here, at this address
   every number      here, in this storage
   the moving parts  a sealed companion, its address written once
   any other call    falls through to that sealed companion

   The mint runs once, in the same transaction that fixes the companion
   address: one billion $ORBI, credited to the deployer, and no path afterward
   to make more. The seal is a bytecode fact — the flag reads false, there is
   no admin, there is no delay to wait on.

   A short set of numbers is answered here directly, without reaching for the
   companion: the name of the protocol, the fixed supply, the fee band, and the
   public link. Everything else is delegated logic.
*/

contract Orbifun {

    // [sealed companion address slot — the standard location every scanner reads]

    bytes32 internal constant _IMPL_SLOT =
        0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    // [token-native constants — readable without reaching the companion]

    string  public constant PROTOCOL      = "orbi.fun";
    string  public constant PROXY_VERSION = "1.0.0";
    bool    public constant UPGRADEABLE   = false;
    uint8   public constant SLOTS_MAX     = 6;
    uint24  public constant FEE_FLOOR     = 3000;
    uint24  public constant FEE_CAP       = 48000;
    uint256 public constant TOTAL_SUPPLY  = 1_000_000_000 * 1e18;
    string  public constant website       = "https://orbibi.fun/";

    // [events]

    event Upgraded(address indexed implementation);
    event TokenInitialized(address indexed initializer, address indexed deployer);

    // [errors]

    error ZeroLogic();
    error ZeroInitializer();
    error ZeroDeployer();
    error NotAContract(address target);
    error InitializationFailed();

    // [constructor]
    //
    // Parameters:
    //   _logic        sealed companion (Orbifun.sol)
    //   _initializer  one-shot mint contract (TokenInit.sol)
    //   _deployer     address that receives the entire supply
    //
    // Order of operations:
    //   1. Reject zero addresses.
    //   2. Reject codeless targets — an empty logic address no-ops every call.
    //   3. Run initialize(_deployer) into this storage → mints 1B $ORBI here.
    //   4. Write _logic to the companion slot. The slot is never written again.

    constructor(address _logic, address _initializer, address _deployer) {

        if (_logic       == address(0)) revert ZeroLogic();
        if (_initializer == address(0)) revert ZeroInitializer();
        if (_deployer    == address(0)) revert ZeroDeployer();

        if (_logic.code.length       == 0) revert NotAContract(_logic);
        if (_initializer.code.length == 0) revert NotAContract(_initializer);

        (bool ok, bytes memory ret) = _initializer.delegatecall(
            abi.encodeWithSignature("initialize(address)", _deployer)
        );
        if (!ok) {
            if (ret.length > 0) { assembly { revert(add(ret, 0x20), mload(ret)) } }
            revert InitializationFailed();
        }
        emit TokenInitialized(_initializer, _deployer);

        assembly { sstore(_IMPL_SLOT, _logic) }
        emit Upgraded(_logic);
    }

    // [token-native reads]
    //
    // These selectors are answered here. Everything else falls through to the
    // sealed companion. The getter below returns the sealed logic address.

    function implementation() external view returns (address impl) {
        impl = _impl();
    }

    function protocolName()  external pure returns (string memory) { return PROTOCOL; }
    function proxyVersion()  external pure returns (string memory) { return PROXY_VERSION; }
    function isUpgradeable() external pure returns (bool)          { return UPGRADEABLE; }

    // the fee band, in pips — must match the constants in Orbifun.sol
    function feeBounds() external pure returns (uint24 floorPips, uint24 capPips) {
        return (FEE_FLOOR, FEE_CAP);
    }

    // the number of slots a block carries, the six of an Ethereum block
    function slotsMax() external pure returns (uint8) {
        return SLOTS_MAX;
    }

    // the fixed supply, answered here so a scanner need not delegate for it
    function expectedSupply() external pure returns (uint256) {
        return TOTAL_SUPPLY;
    }

    // the raw slot value, the same address as the getter above, read the typed way
    function logicSlot() external view returns (bytes32 slot, address stored) {
        slot   = _IMPL_SLOT;
        stored = _impl();
    }

    // [internals]

    function _impl() internal view returns (address impl) {
        assembly { impl := sload(_IMPL_SLOT) }
    }

    // gas-optimal forward: copy calldata, run it against the sealed logic,
    // bubble the return data or the revert reason back to the caller unchanged
    function _delegate(address impl) internal {
        assembly {
            calldatacopy(0, 0, calldatasize())
            let result := delegatecall(gas(), impl, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch result
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }

    // [delegation entrypoints]
    //
    // Any call whose selector is not answered above lands in the fallback and
    // is forwarded to the sealed companion, which runs it against this storage.

    fallback() external payable { _delegate(_impl()); }
    receive()  external payable {}
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 1,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@uniswap/v4-core/=lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "permit2/=lib/permit2/",
    "forge-std/=lib/forge-std/src/",
    "solady/=lib/solady/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/v4-core/lib/solmate/",
    "v4-core/=lib/v4-core/src/",
    "v4-periphery/=lib/v4-periphery/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.