HoodBabyToken
0x5ba1a1d6eaae78477a569ab4ff0687f056f3b87d
Verification
Verified
v0.8.24+commit.e11b9ed9
Type
Contract
5,890 bytes
ABI entries
36
23 read · 6 write
License
none
Contract information
- Address
- 0x5ba1a1d6eaae78477a569ab4ff0687f056f3b87d
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.24+commit.e11b9ed9
- Optimization
- Enabled
- Creator
- 0xB20d6097A7…4F05C41a13
- Creation tx
- 0x8dbdbe0896…0c183860d3
Token
- Name
- Baby Swole Doge
- Symbol
- BABYSWOGE
- Decimals
- 18
- Holders
- 71
- Market
- View token page →
Read contract (23)
MAX_TAX_BPS() → uint16
PROTOCOL_TAX_BPS() → uint16
allowance(address, address) → uint256
balanceOf(address) → uint256
buyTaxBps() → uint16
creator() → address
creditedReward(address) → uint256
decimals() → uint8
eligibleSupply() → uint256
launchedOn() → string
launcher() → address
name() → string
pendingReward(address) → uint256
pool() → address
rewardPerShareMag() → uint256
rewardToken() → address
sellTaxBps() → uint16
socials() → string
symbol() → string
taxRecipient() → address
totalRewardDistributed() → uint256
totalSupply() → uint256
website() → string
Events (6)
ApprovalLaunchedOnHoodlabRewardClaimedRewardDistributedTaxCollectedTransfer
ABI
[
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
},
{
"internalType": "uint256",
"name": "_supply",
"type": "uint256"
},
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "address",
"name": "_launcher",
"type": "address"
},
{
"internalType": "address",
"name": "_creator",
"type": "address"
},
{
"internalType": "address",
"name": "_rewardToken",
"type": "address"
},
{
"internalType": "string",
"name": "_socials",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "message",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "website",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "socials",
"type": "string"
}
],
"name": "LaunchedOnHoodlab",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "holder",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "RewardClaimed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "rewardPerShareMag",
"type": "uint256"
}
],
"name": "RewardDistributed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "purposeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "protocolAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "isBuy",
"type": "bool"
}
],
"name": "TaxCollected",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "MAX_TAX_BPS",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PROTOCOL_TAX_BPS",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "buyTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "claimReward",
"outputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "creator",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "creditedReward",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "distributeReward",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "eligibleSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launchedOn",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launcher",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "holder",
"type": "address"
}
],
"name": "pendingReward",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rewardPerShareMag",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rewardToken",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "sellTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_pool",
"type": "address"
}
],
"name": "setPool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "socials",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "taxRecipient",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalRewardDistributed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "website",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {HoodTaxToken} from "./HoodTaxableTokens.sol";
interface IRewardERC20 {
function transfer(address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
/// @title HoodBabyToken
/// @notice A Hoodlab-launched "baby" token: the creator's swap-fee revenue is converted
/// by the launcher into a chosen REWARD token — any token that trades on
/// Robinhood Chain's Uniswap v3 (a tokenized stock like AAPL/NVDA, or any other
/// v3 token with a WETH pool) — and paid out pro-rata to holders.
///
/// "Stock Launch" and "Baby Token" are the same mechanism: Stock Launch just
/// restricts the reward to tokenized stocks in the UI. On-chain it's one token.
///
/// Distribution is PULL, not push: a reward-per-share accumulator lets any number
/// of holders `claimReward()` their share — no unbounded holder loop, so it never
/// hits a gas/DoS wall. The token carries no transfer tax (buy/sell fixed to 0);
/// the reward stream is funded entirely by the launcher, which on `claimFees`
/// swaps the creator's 70% WETH share into `rewardToken` and calls
/// `distributeReward`.
contract HoodBabyToken is HoodTaxToken {
uint256 private constant MAG = 1 << 128;
/// @notice The token holders are rewarded in (immutable, chosen at launch).
address public immutable rewardToken;
uint256 public rewardPerShareMag;
uint256 public eligibleSupply;
mapping(address => uint256) private debtMag;
mapping(address => uint256) public creditedReward;
uint256 public totalRewardDistributed;
event RewardDistributed(uint256 amount, uint256 rewardPerShareMag);
event RewardClaimed(address indexed holder, uint256 amount);
constructor(
string memory _name,
string memory _symbol,
uint256 _supply,
address _recipient,
address _launcher,
address _creator,
address _rewardToken,
string memory _socials
) HoodTaxToken(_name, _symbol, _supply, _recipient, _launcher, _creator, 0, 0, _creator, _socials) {
require(_rewardToken != address(0), "zero reward");
rewardToken = _rewardToken;
}
/// @dev The pool, launcher, this contract and the zero address never earn rewards —
/// only real circulating holders do. The creator IS a holder: if they bought (dev
/// allocation / first buy) they earn their pro-rata share like anyone else.
function _isRewardExcluded(address a) internal view returns (bool) {
return a == pool || a == launcher || a == address(this) || a == address(0);
}
/// @notice Credit `amount` of already-received reward token across all eligible holders.
/// @dev Only the launcher may call, and only AFTER it has transferred `amount` of
/// `rewardToken` into this contract. With no eligible holders yet, the reward is
/// returned to the creator so funds can never strand.
function distributeReward(uint256 amount) external {
require(msg.sender == launcher, "only launcher");
if (amount == 0) return;
if (eligibleSupply > 0) {
rewardPerShareMag += (amount * MAG) / eligibleSupply;
totalRewardDistributed += amount;
emit RewardDistributed(amount, rewardPerShareMag);
} else {
require(IRewardERC20(rewardToken).transfer(creator, amount), "reward send failed");
}
}
/// @notice Reward a holder can claim right now (accrued but unclaimed).
function pendingReward(address holder) public view returns (uint256) {
uint256 accrued = creditedReward[holder];
if (!_isRewardExcluded(holder)) {
uint256 gross = balanceOf[holder] * rewardPerShareMag;
uint256 debt = debtMag[holder];
if (gross > debt) accrued += (gross - debt) / MAG;
}
return accrued;
}
/// @notice Claim your accrued rewards. Transfers `rewardToken` to you.
function claimReward() external returns (uint256 amount) {
_settle(msg.sender);
amount = creditedReward[msg.sender];
require(amount > 0, "nothing to claim");
creditedReward[msg.sender] = 0;
require(IRewardERC20(rewardToken).transfer(msg.sender, amount), "reward send failed");
emit RewardClaimed(msg.sender, amount);
}
function _settle(address a) private {
if (_isRewardExcluded(a)) return;
uint256 gross = balanceOf[a] * rewardPerShareMag;
uint256 debt = debtMag[a];
if (gross > debt) creditedReward[a] += (gross - debt) / MAG;
debtMag[a] = gross;
}
/// @dev Settle both sides before every balance change so a holder's accrued reward is
/// locked in against their old balance, then track eligible (circulating) supply.
function _move(address from, address to, uint256 amount) internal override {
bool fromEx = _isRewardExcluded(from);
bool toEx = _isRewardExcluded(to);
if (!fromEx) _settle(from);
if (!toEx) _settle(to);
super._move(from, to, amount);
if (!fromEx) {
debtMag[from] = balanceOf[from] * rewardPerShareMag;
eligibleSupply -= amount;
}
if (!toEx) {
debtMag[to] = balanceOf[to] * rewardPerShareMag;
eligibleSupply += amount;
}
}
}
Chain explorer7804msChain node84ms