Robinhood MainnetChain ID: 4663
Contract detail

HAMFACTORY

HAMFACTORY is a verified Robinhood Chain smart contract at 0x07b78ef7…0ecdba97 with 87 indexed transactions.

Address type
Smart contract
Transactions
87
First indexed block
#28518834
Latest indexed block
#44269212
Emitted events
296
Verification
Verified
Compiler
v0.8.34+commit.80d5c536
Verification match
full
Creation transaction
0x33ef7f63…0f869eb9
Created at block
#28518834
Language
solidity
EVM version
osaka
License
mit
Compiler optimization
Enabled · 5000 runs
Related activity

Transactions

Verified contract

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.34;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract HAMFACTORY is ERC20 {
    error EmptyTokenName();
    error EmptyTokenSymbol();
    error ZeroTokenSupply();
    error ZeroLaunchFingerprint();
    error LengthMismatch();
    error AllowanceBelowZero();
    bytes32 public immutable launchFingerprint;
    constructor(
        string memory name_,
        string memory symbol_,
        uint256 totalSupply_,
        bytes32 launchFingerprint_
    ) ERC20(name_, symbol_) {
        if (bytes(name_).length == 0) revert EmptyTokenName();
        if (bytes(symbol_).length == 0) revert EmptyTokenSymbol();
        if (totalSupply_ == 0) revert ZeroTokenSupply();
        if (launchFingerprint_ == bytes32(0)) revert ZeroLaunchFingerprint();
        if (_composeLaunchDigest(launchFingerprint_) == bytes32(0)) revert ZeroLaunchFingerprint();
        launchFingerprint = launchFingerprint_;
        _mint(msg.sender, totalSupply_);
    }
    function decimals() public view override returns (uint8) {
        if (_composeLaunchDigest(launchFingerprint) == bytes32(0)) revert ZeroLaunchFingerprint();
        return super.decimals();
    }

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

    function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
        _approve(msg.sender, spender, allowance(msg.sender, spender) + addedValue);
        return true;
    }

    function batchTransfer(address[] calldata recipients, uint256[] calldata amounts) external {
        if (recipients.length != amounts.length) revert LengthMismatch();
        for (uint256 i = 0; i < recipients.length; ++i) {
            _transfer(msg.sender, recipients[i], amounts[i]);
        }
    }

    function holderShareBps(address account) external view returns (uint256) {
        uint256 supply = totalSupply();
        return supply == 0 ? 0 : (balanceOf(account) * 10000) / supply;
    }
    function _foldKeccakTagged(bytes32 acc) private pure returns (bytes32) {
        return keccak256(abi.encodePacked(acc, uint256(0x9e3779b97f4a7c15)));
    }

    function _foldMultiplyPrime(bytes32 acc) private pure returns (bytes32) {
        unchecked { return bytes32(uint256(acc) * 0x100000001b3 + 0xcbf29ce484222325); }
    }

    function _foldShiftXorLow(bytes32 acc) private pure returns (bytes32) {
        unchecked { return bytes32(uint256(acc) ^ (uint256(acc) << 31)); }
    }

    function _foldKeccakHalves(bytes32 acc) private pure returns (bytes32) {
        return keccak256(abi.encodePacked(uint128(uint256(acc) >> 128), uint128(uint256(acc))));
    }

    function _foldShiftXorHigh(bytes32 acc) private pure returns (bytes32) {
        return bytes32(uint256(acc) ^ (uint256(acc) >> 17));
    }

    function _foldKeccakPacked(bytes32 acc) private pure returns (bytes32) {
        return keccak256(abi.encodePacked(acc));
    }

    function _composeLaunchDigest(bytes32 acc) private pure returns (bytes32) {
        return _foldKeccakPacked(_foldShiftXorHigh(_foldKeccakHalves(_foldShiftXorLow(_foldMultiplyPrime(_foldKeccakTagged(acc))))));
    }
}