Poor
0xc10b90944d689d7027201bc841a6548a1b125331
Verification
Verified
v0.8.24+commit.e11b9ed9
Type
Contract
13,842 bytes
ABI entries
99
41 read · 31 write
License
none
Contract information
- Address
- 0xc10b90944d689d7027201bc841a6548a1b125331
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.24+commit.e11b9ed9
- Optimization
- Enabled
- Creator
- 0xeE8a0c2C0a…0D83A04CF2
- Creation tx
- 0xff2397c4d7…eb1d2f2e27
Token
- Name
- Feed The Poor
- Symbol
- POOR
- Decimals
- 18
- Holders
- 136
- Market
- View token page →
Read contract (41)
BPS() → uint16
MAX_TAX() → uint16
accumulativeDividendOf(address) → uint256
allowance(address, address) → uint256
balanceOf(address) → uint256
claimGasLimit() → uint256
claimableOf(address) → uint256
decimals() → uint8
devWallet() → address
dividendShareOf(address) → uint256
holderCount() → uint256
holders(uint256) → address
isAMMPair(address) → bool
isExcludedFromDividends(address) → bool
isExcludedFromFees(address) → bool
isExcludedFromMaxWallet(address) → bool
marketingTaxBps() → uint16
maxSwapAmount() → uint256
maxWallet() → uint256
maxWalletEnabled() → bool
minBalanceForDividends() → uint256
name() → string
owner() → address
pair() → address
pushBatchSize() → uint256
rewardsTaxBps() → uint16
router() → address
swapEnabled() → bool
swapThreshold() → uint256
symbol() → string
taxEnabled() → bool
tokensForMarketing() → uint256
tokensForRewards() → uint256
totalDividendShares() → uint256
totalDividendsDistributed() → uint256
totalSupply() → uint256
undistributedDividends() → uint256
usdg() → address
weth() → address
withdrawableDividendOf(address) → uint256
withdrawnDividendOf(address) → uint256
Events (25)
AMMPairUpdatedApprovalClaimGasLimitUpdatedDevWalletUpdatedDividendWithdrawnDividendsDistributedExcludedFromDividendsExcludedFromFeesExcludedFromMaxWalletLimitsRemovedMarketingTaxUpdatedMaxSwapAmountUpdatedMaxWalletEnabledUpdatedMaxWalletUpdatedMinBalanceForDividendsUpdatedOwnershipTransferredPushBatchSizeUpdatedRewardsTaxUpdatedRouterUpdatedSwapBackSwapEnabledUpdatedSwapThresholdUpdatedTaxEnabledUpdatedTaxesUpdatedTransfer
ABI
[
{
"inputs": [
{
"internalType": "address",
"name": "devWallet_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "pair",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "isPair",
"type": "bool"
}
],
"name": "AMMPairUpdated",
"type": "event"
},
{
"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": "uint256",
"name": "gas",
"type": "uint256"
}
],
"name": "ClaimGasLimitUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "wallet",
"type": "address"
}
],
"name": "DevWalletUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "DividendWithdrawn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "DividendsDistributed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "ExcludedFromDividends",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "ExcludedFromFees",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "ExcludedFromMaxWallet",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "LimitsRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "bps",
"type": "uint16"
}
],
"name": "MarketingTaxUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "MaxSwapAmountUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "MaxWalletEnabledUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "MaxWalletUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "MinBalanceForDividendsUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "size",
"type": "uint256"
}
],
"name": "PushBatchSizeUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "bps",
"type": "uint16"
}
],
"name": "RewardsTaxUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "router",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "weth",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "pair",
"type": "address"
}
],
"name": "RouterUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "tokensSwapped",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "usdgToRewards",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "ethToDev",
"type": "uint256"
}
],
"name": "SwapBack",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "SwapEnabledUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "SwapThresholdUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "TaxEnabledUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "marketingTaxBps",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "rewardsTaxBps",
"type": "uint16"
}
],
"name": "TaxesUpdated",
"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": "BPS",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_TAX",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "accumulativeDividendOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner_",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"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": "a",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "claim",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "claimFor",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "claimGasLimit",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "claimableOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "devWallet",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "dividendShareOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "holderCount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "holders",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "isAMMPair",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "isExcludedFromDividends",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "isExcludedFromFees",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "isExcludedFromMaxWallet",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "manualSwapBack",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "marketingTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxSwapAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxWallet",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxWalletEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "minBalanceForDividends",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pair",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pushBatchSize",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "removeLimits",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "rescueERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rescueETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rewardsTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "contract IUniswapV2Router02",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "pair_",
"type": "address"
},
{
"internalType": "bool",
"name": "isPair",
"type": "bool"
}
],
"name": "setAMMPair",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "gas_",
"type": "uint256"
}
],
"name": "setClaimGasLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "wallet",
"type": "address"
}
],
"name": "setDevWallet",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "setExcludedFromDividends",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "setExcludedFromFees",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "bool",
"name": "excluded",
"type": "bool"
}
],
"name": "setExcludedFromMaxWallet",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "bps",
"type": "uint16"
}
],
"name": "setMarketingTax",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "setMaxSwapAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "setMaxWallet",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "bps",
"type": "uint16"
}
],
"name": "setMaxWalletBps",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "setMaxWalletEnabled",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "setMinBalanceForDividends",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "size",
"type": "uint256"
}
],
"name": "setPushBatchSize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "bps",
"type": "uint16"
}
],
"name": "setRewardsTax",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "router_",
"type": "address"
}
],
"name": "setRouter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "setSwapEnabled",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "setSwapThreshold",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "setTaxEnabled",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "marketingBps",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "rewardsBps",
"type": "uint16"
}
],
"name": "setTaxes",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "usdg_",
"type": "address"
}
],
"name": "setUsdg",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "swapEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "swapThreshold",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "taxEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokensForMarketing",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokensForRewards",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalDividendShares",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalDividendsDistributed",
"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": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "undistributedDividends",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "usdg",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "weth",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "withdrawableDividendOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "withdrawnDividendOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
/*
Feed The Poor
https://t.me/feedthepoorrh
8% USDG Rewards
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, 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);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface IUniswapV2Router02 {
function factory() external view returns (address);
function WETH() external view returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
/*//////////////////////////////////////////////////////////////////////////
OWNABLE
//////////////////////////////////////////////////////////////////////////*/
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) {
_owner = initialOwner;
emit OwnershipTransferred(address(0), initialOwner);
}
modifier onlyOwner() {
require(msg.sender == _owner, "Ownable: not owner");
_;
}
function owner() public view returns (address) {
return _owner;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: zero owner");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
/*//////////////////////////////////////////////////////////////////////////
REENTRANCY GUARD
//////////////////////////////////////////////////////////////////////////*/
abstract contract ReentrancyGuard {
uint256 private _status = 1;
modifier nonReentrant() {
require(_status == 1, "reentrant");
_status = 2;
_;
_status = 1;
}
}
/*//////////////////////////////////////////////////////////////////////////
DIVIDEND (REFLECTION) TRACKER
Magnified-per-share accumulator. USDG is distributed proportionally to
PRINT balances of dividend-eligible holders. Excluded addresses (pair,
contract, dev, dead) do not earn.
//////////////////////////////////////////////////////////////////////////*/
abstract contract DividendTracker {
// 2**128, keeps precision for 6-decimal USDG across large supplies.
uint256 internal constant MAGNITUDE = 2 ** 128;
// USDG token dividends are paid in.
IERC20 public usdg;
// Sum over all eligible balances. This is the denominator for shares.
uint256 public totalDividendShares;
// magnifiedDividendPerShare += (amount * MAGNITUDE) / totalDividendShares
uint256 internal magnifiedDividendPerShare;
// Per-account bookkeeping.
mapping(address => int256) internal magnifiedDividendCorrections;
mapping(address => uint256) internal withdrawnDividends;
mapping(address => uint256) public dividendShareOf; // eligible balance snapshot
// Total USDG ever distributed to holders.
uint256 public totalDividendsDistributed;
// USDG received by the contract but not yet distributed (no shares at the time).
uint256 public undistributedDividends;
event DividendsDistributed(uint256 amount);
event DividendWithdrawn(address indexed to, uint256 amount);
/// @dev Distribute `amount` of USDG (already held by this contract) to holders.
function _distributeDividends(uint256 amount) internal {
if (amount == 0) return;
if (totalDividendShares > 0) {
// fold any previously-parked USDG in as well
uint256 toDistribute = amount + undistributedDividends;
undistributedDividends = 0;
magnifiedDividendPerShare += (toDistribute * MAGNITUDE) / totalDividendShares;
totalDividendsDistributed += toDistribute;
emit DividendsDistributed(toDistribute);
} else {
// Park it until there are eligible holders.
undistributedDividends += amount;
}
}
/// @dev Update an account's eligible share (called on balance changes).
function _setDividendShare(address account, uint256 newShare) internal {
uint256 current = dividendShareOf[account];
if (newShare == current) return;
if (newShare > current) {
uint256 add = newShare - current;
totalDividendShares += add;
magnifiedDividendCorrections[account] -= int256(magnifiedDividendPerShare * add);
} else {
uint256 sub = current - newShare;
totalDividendShares -= sub;
magnifiedDividendCorrections[account] += int256(magnifiedDividendPerShare * sub);
}
dividendShareOf[account] = newShare;
}
/// @notice Total USDG ever earned by `account` (withdrawn + withdrawable).
function accumulativeDividendOf(address account) public view returns (uint256) {
int256 raw = int256(magnifiedDividendPerShare * dividendShareOf[account])
+ magnifiedDividendCorrections[account];
if (raw < 0) raw = 0;
return uint256(raw) / MAGNITUDE;
}
/// @notice USDG currently claimable by `account`.
function withdrawableDividendOf(address account) public view returns (uint256) {
return accumulativeDividendOf(account) - withdrawnDividends[account];
}
/// @notice USDG already withdrawn by `account`.
function withdrawnDividendOf(address account) public view returns (uint256) {
return withdrawnDividends[account];
}
/// @dev Pay out an account's claimable USDG. Returns amount sent.
function _processWithdraw(address account) internal returns (uint256) {
uint256 amount = withdrawableDividendOf(account);
if (amount == 0) return 0;
withdrawnDividends[account] += amount;
bool ok = usdg.transfer(account, amount);
if (!ok) {
// revert bookkeeping on failure so it can be retried
withdrawnDividends[account] -= amount;
return 0;
}
emit DividendWithdrawn(account, amount);
return amount;
}
}
/*//////////////////////////////////////////////////////////////////////////
FTP
//////////////////////////////////////////////////////////////////////////*/
contract Poor is IERC20Metadata, Ownable, ReentrancyGuard, DividendTracker {
/*//////////////////////////////////////////////////////////////
ERC-20 STATE
//////////////////////////////////////////////////////////////*/
// --- Hardcoded token identity & supply ---
string private constant _NAME = "Feed The Poor";
string private constant _SYMBOL = "POOR";
uint8 private constant _DECIMALS = 18;
uint256 private constant _SUPPLY = 1_000_000_000 * (10 ** 18);
// --- Hardcoded Robinhood Chain (4663) addresses ---
address private constant ROBINHOOD_USDG = 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168;
address private constant ROBINHOOD_ROUTER = 0x89e5DB8B5aA49aA85AC63f691524311AEB649eba;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _allowances_owner_spender;
mapping(address => mapping(address => uint256)) private _allowances;
/*//////////////////////////////////////////////////////////////
TAXES
Basis points (bps): 10000 = 100%. Split fields are a fraction of
each tax (also bps of the collected tax).
//////////////////////////////////////////////////////////////*/
uint16 public constant BPS = 10000;
// Hard cap on the TOTAL tax (marketing + rewards). 30% — high enough to
// support an aggressive launch-phase marketing tax that is later dropped.
uint16 public constant MAX_TAX = 3000;
// Two independent tax rates, both applied to buys and sells and both
// owner-settable dynamically. Wallet-to-wallet transfers are untaxed.
// marketingTaxBps -> collected PRINT is swapped to ETH for the dev wallet.
// rewardsTaxBps -> collected PRINT is swapped to USDG for all holders.
// Launch strategy: start with a high marketingTaxBps and low/zero
// rewardsTaxBps, then flip to rewards-only once launch is done.
// Their SUM is the effective tax and must stay <= MAX_TAX.
uint16 public marketingTaxBps = 0; // 0%
uint16 public rewardsTaxBps = 800; // 0% rewards at launch
// Accumulated PRINT tokens (in this contract) earmarked per bucket.
uint256 public tokensForRewards;
uint256 public tokensForMarketing;
/*//////////////////////////////////////////////////////////////
SWAPBACK
//////////////////////////////////////////////////////////////*/
bool public swapEnabled = true;
bool public taxEnabled = true;
bool private _inSwap;
// Swapback threshold in PRINT tokens (the "0.1% of supply" style knob).
uint256 public swapThreshold;
// Max PRINT swapped in a single swapback (anti-dump on the pool).
uint256 public maxSwapAmount;
// Max PRINT any single wallet may hold (anti-whale). 0 = disabled.
uint256 public maxWallet;
bool public maxWalletEnabled = true;
address public devWallet;
/*//////////////////////////////////////////////////////////////
ROUTER / PAIR
//////////////////////////////////////////////////////////////*/
IUniswapV2Router02 public router;
address public weth;
address public pair;
mapping(address => bool) public isAMMPair;
/*//////////////////////////////////////////////////////////////
DIVIDEND CONFIG
//////////////////////////////////////////////////////////////*/
// Min PRINT balance to be eligible for dividends (dust filter).
uint256 public minBalanceForDividends;
// Gas budget for the auto-push loop per transfer.
uint256 public claimGasLimit = 300000;
// Round-robin cursor + list of eligible holders for auto-push.
address[] public holders;
mapping(address => bool) private _isHolder;
mapping(address => uint256) private _holderIndex;
uint256 private _pushCursor;
uint256 public pushBatchSize = 10;
mapping(address => bool) public isExcludedFromFees;
mapping(address => bool) public isExcludedFromDividends;
mapping(address => bool) public isExcludedFromMaxWallet;
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event MarketingTaxUpdated(uint16 bps);
event RewardsTaxUpdated(uint16 bps);
event TaxesUpdated(uint16 marketingTaxBps, uint16 rewardsTaxBps);
event LimitsRemoved();
event SwapThresholdUpdated(uint256 amount);
event MaxSwapAmountUpdated(uint256 amount);
event MaxWalletUpdated(uint256 amount);
event MaxWalletEnabledUpdated(bool enabled);
event ExcludedFromMaxWallet(address account, bool excluded);
event DevWalletUpdated(address wallet);
event RouterUpdated(address router, address weth, address pair);
event AMMPairUpdated(address pair, bool isPair);
event MinBalanceForDividendsUpdated(uint256 amount);
event ClaimGasLimitUpdated(uint256 gas);
event PushBatchSizeUpdated(uint256 size);
event ExcludedFromFees(address account, bool excluded);
event ExcludedFromDividends(address account, bool excluded);
event SwapEnabledUpdated(bool enabled);
event TaxEnabledUpdated(bool enabled);
event SwapBack(uint256 tokensSwapped, uint256 usdgToRewards, uint256 ethToDev);
modifier lockSwap() {
_inSwap = true;
_;
_inSwap = false;
}
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
/// @param devWallet_ Wallet that receives the marketing/dev ETH.
/// Everything else (name, symbol, supply, USDG, router) is
/// hardcoded for Robinhood Chain. Owner is set to the deployer.
constructor(address devWallet_) Ownable(msg.sender) {
require(devWallet_ != address(0), "dev zero");
address initialOwner_ = msg.sender;
usdg = IERC20(ROBINHOOD_USDG);
devWallet = devWallet_;
uint256 supply = _SUPPLY;
_totalSupply = supply;
// Swapback knobs default to 0.1% of supply, single-swap cap 1% of supply.
swapThreshold = supply / 1000; // 0.1%
maxSwapAmount = supply / 100;
minBalanceForDividends = supply / 100000; // tiny dust filter
maxWallet = supply / 100;
// Configure the hardcoded Robinhood Chain router and create the pair.
router = IUniswapV2Router02(ROBINHOOD_ROUTER);
weth = router.WETH();
address _pair = IUniswapV2Factory(router.factory()).getPair(address(this), weth);
if (_pair == address(0)) {
_pair = IUniswapV2Factory(router.factory()).createPair(address(this), weth);
}
pair = _pair;
isAMMPair[_pair] = true;
// Exclusions.
isExcludedFromFees[initialOwner_] = true;
isExcludedFromFees[address(this)] = true;
isExcludedFromFees[devWallet_] = true;
// Max-wallet exclusions: owner, contract, dev, dead, and the pair
// (the pool must hold >2% of supply).
isExcludedFromMaxWallet[initialOwner_] = true;
isExcludedFromMaxWallet[address(this)] = true;
isExcludedFromMaxWallet[devWallet_] = true;
isExcludedFromMaxWallet[address(0xdead)] = true;
if (pair != address(0)) isExcludedFromMaxWallet[pair] = true;
_excludeFromDividends(address(this), true);
_excludeFromDividends(address(0), true);
_excludeFromDividends(address(0xdead), true);
_excludeFromDividends(devWallet_, true);
if (pair != address(0)) _excludeFromDividends(pair, true);
// Mint full supply to owner.
_balances[initialOwner_] = supply;
emit Transfer(address(0), initialOwner_, supply);
_updateDividendShare(initialOwner_);
}
/*//////////////////////////////////////////////////////////////
ERC-20 METADATA
//////////////////////////////////////////////////////////////*/
function name() external pure returns (string memory) { return _NAME; }
function symbol() external pure returns (string memory) { return _SYMBOL; }
function decimals() external pure returns (uint8) { return _DECIMALS; }
function totalSupply() external view returns (uint256) { return _totalSupply; }
function balanceOf(address a) external view returns (uint256) { return _balances[a]; }
function allowance(address owner_, address spender) external view returns (uint256) {
return _allowances[owner_][spender];
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) external returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
uint256 allowed = _allowances[from][msg.sender];
if (allowed != type(uint256).max) {
require(allowed >= amount, "ERC20: insufficient allowance");
_approve(from, msg.sender, allowed - amount);
}
_transfer(from, to, amount);
return true;
}
function _approve(address owner_, address spender, uint256 amount) internal {
require(owner_ != address(0) && spender != address(0), "ERC20: zero");
_allowances[owner_][spender] = amount;
emit Approval(owner_, spender, amount);
}
/*//////////////////////////////////////////////////////////////
CORE TRANSFER LOGIC
//////////////////////////////////////////////////////////////*/
function _transfer(address from, address to, uint256 amount) internal {
require(from != address(0) && to != address(0), "ERC20: zero");
require(_balances[from] >= amount, "ERC20: balance");
if (amount == 0) {
_basicMove(from, to, 0);
return;
}
bool isBuy = isAMMPair[from];
bool isSell = isAMMPair[to];
// Swapback on sells when threshold reached (not during a swap, not on buys).
if (
swapEnabled &&
!_inSwap &&
isSell &&
address(router) != address(0) &&
(tokensForRewards + tokensForMarketing) >= swapThreshold
) {
_swapBack();
}
// Determine tax. Two independent rates on buys and sells; each rate is
// applied to the transfer amount and earmarked to its bucket directly.
// Wallet-to-wallet transfers are untaxed.
bool takeFee = taxEnabled && !_inSwap && !isExcludedFromFees[from] && !isExcludedFromFees[to];
if (takeFee && (isBuy || isSell)) {
uint256 marketingCut = (amount * marketingTaxBps) / BPS;
uint256 rewardCut = (amount * rewardsTaxBps) / BPS;
uint256 taxAmount = marketingCut + rewardCut;
if (taxAmount > 0) {
tokensForMarketing += marketingCut;
tokensForRewards += rewardCut;
_basicMove(from, address(this), taxAmount);
amount -= taxAmount;
}
}
_basicMove(from, to, amount);
// Enforce max wallet on the recipient (skip during swaps and for
// excluded addresses like the pair, owner, contract, dev).
if (
maxWalletEnabled &&
!_inSwap &&
maxWallet > 0 &&
!isExcludedFromMaxWallet[to]
) {
require(_balances[to] <= maxWallet, "max wallet");
}
// Update dividend shares for both parties.
_updateDividendShare(from);
_updateDividendShare(to);
// Auto-push a batch of dividends (gas-limited) outside of swaps.
if (!_inSwap) {
_autoPush();
}
}
/// @dev Raw balance move + Transfer event (no tax, no dividend update).
function _basicMove(address from, address to, uint256 amount) internal {
_balances[from] -= amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
/*//////////////////////////////////////////////////////////////
SWAPBACK
Sell accumulated PRINT: rewards portion -> WETH -> USDG (to holders),
marketing portion -> WETH -> dev wallet (as ETH).
//////////////////////////////////////////////////////////////*/
function _swapBack() internal lockSwap {
uint256 contractTokens = tokensForRewards + tokensForMarketing;
if (contractTokens == 0) return;
uint256 swapAmount = contractTokens;
if (swapAmount > maxSwapAmount) swapAmount = maxSwapAmount;
// never try to swap more than we actually hold
uint256 held = _balances[address(this)];
if (swapAmount > held) swapAmount = held;
if (swapAmount == 0) return;
// Proportion of this swap that belongs to rewards.
uint256 rewardTokens = (swapAmount * tokensForRewards) / contractTokens;
uint256 marketingTokens = swapAmount - rewardTokens;
// Reduce the earmarks proportionally.
tokensForRewards -= (tokensForRewards * swapAmount) / contractTokens;
tokensForMarketing = (tokensForMarketing > marketingTokens)
? tokensForMarketing - marketingTokens
: 0;
uint256 usdgToRewards;
uint256 ethToDev;
// --- rewards: PRINT -> WETH -> USDG, sent to this contract, distribute ---
if (rewardTokens > 0 && address(usdg) != address(0)) {
uint256 beforeBal = usdg.balanceOf(address(this));
_approve(address(this), address(router), rewardTokens);
address[] memory path = new address[](3);
path[0] = address(this);
path[1] = weth;
path[2] = address(usdg);
try router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
rewardTokens, 0, path, address(this), block.timestamp
) {
uint256 afterBal = usdg.balanceOf(address(this));
usdgToRewards = afterBal - beforeBal;
_distributeDividends(usdgToRewards);
} catch {
// restore earmark so it can retry later
tokensForRewards += rewardTokens;
}
}
// --- marketing: PRINT -> WETH -> dev wallet (ETH) ---
if (marketingTokens > 0) {
_approve(address(this), address(router), marketingTokens);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = weth;
uint256 beforeEth = address(this).balance;
try router.swapExactTokensForETHSupportingFeeOnTransferTokens(
marketingTokens, 0, path, address(this), block.timestamp
) {
ethToDev = address(this).balance - beforeEth;
if (ethToDev > 0 && devWallet != address(0)) {
(bool ok, ) = payable(devWallet).call{value: ethToDev}("");
ok; // ignore failure; ETH stays for retry via rescueETH
}
} catch {
tokensForMarketing += marketingTokens;
}
}
emit SwapBack(swapAmount, usdgToRewards, ethToDev);
}
receive() external payable {}
/*//////////////////////////////////////////////////////////////
DIVIDEND SHARE / PUSH
//////////////////////////////////////////////////////////////*/
function _updateDividendShare(address account) internal {
uint256 share = 0;
if (
!isExcludedFromDividends[account] &&
_balances[account] >= minBalanceForDividends
) {
share = _balances[account];
}
_setDividendShare(account, share);
_syncHolderList(account, share);
}
function _syncHolderList(address account, uint256 share) internal {
bool eligible = share > 0;
if (eligible && !_isHolder[account]) {
_isHolder[account] = true;
_holderIndex[account] = holders.length;
holders.push(account);
} else if (!eligible && _isHolder[account]) {
_isHolder[account] = false;
uint256 idx = _holderIndex[account];
uint256 last = holders.length - 1;
if (idx != last) {
address lastHolder = holders[last];
holders[idx] = lastHolder;
_holderIndex[lastHolder] = idx;
}
holders.pop();
}
}
/// @dev Push dividends to a batch of holders within the gas budget.
function _autoPush() internal {
uint256 count = holders.length;
if (count == 0) return;
uint256 gasLeftStart = gasleft();
uint256 gasLimit = claimGasLimit;
uint256 processed = 0;
uint256 cursor = _pushCursor;
uint256 iterations = 0;
while (processed < pushBatchSize && iterations < count) {
if (cursor >= count) cursor = 0;
address account = holders[cursor];
if (withdrawableDividendOf(account) > 0) {
_processWithdraw(account);
}
unchecked {
cursor++;
processed++;
iterations++;
}
// stop if we're burning too much gas
if (gasLeftStart - gasleft() >= gasLimit) break;
}
_pushCursor = cursor;
}
/*//////////////////////////////////////////////////////////////
PUBLIC CLAIM
//////////////////////////////////////////////////////////////*/
/// @notice Pull any USDG dividends owed to the caller.
function claim() external nonReentrant returns (uint256) {
return _processWithdraw(msg.sender);
}
/// @notice Owner can trigger a claim on behalf of an account.
function claimFor(address account) external onlyOwner returns (uint256) {
return _processWithdraw(account);
}
/// @notice How much USDG `account` can currently claim.
function claimableOf(address account) external view returns (uint256) {
return withdrawableDividendOf(account);
}
function holderCount() external view returns (uint256) {
return holders.length;
}
/*//////////////////////////////////////////////////////////////
OWNER-ONLY SETTERS (EVERYTHING)
//////////////////////////////////////////////////////////////*/
/// @notice Set the marketing tax (bps of each buy/sell -> ETH for dev).
/// The sum of marketing + rewards tax must stay <= MAX_TAX.
function setMarketingTax(uint16 bps) external onlyOwner {
require(uint256(bps) + rewardsTaxBps <= MAX_TAX, "tax too high");
marketingTaxBps = bps;
emit MarketingTaxUpdated(bps);
}
/// @notice Set the rewards tax (bps of each buy/sell -> USDG for holders).
/// The sum of marketing + rewards tax must stay <= MAX_TAX.
function setRewardsTax(uint16 bps) external onlyOwner {
require(uint256(bps) + marketingTaxBps <= MAX_TAX, "tax too high");
rewardsTaxBps = bps;
emit RewardsTaxUpdated(bps);
}
/// @notice Set both tax rates at once. Typical launch flow:
/// setTaxes(2000, 0) at launch, later setTaxes(0, 500) for
/// rewards-only, etc. Sum must be <= MAX_TAX.
function setTaxes(uint16 marketingBps, uint16 rewardsBps) external onlyOwner {
require(uint256(marketingBps) + rewardsBps <= MAX_TAX, "tax too high");
marketingTaxBps = marketingBps;
rewardsTaxBps = rewardsBps;
emit TaxesUpdated(marketingBps, rewardsBps);
}
/// @notice One-shot: disable the max-wallet limit entirely. Convenience
/// wrapper commonly called once a launch has stabilized.
function removeLimits() external onlyOwner {
maxWalletEnabled = false;
emit MaxWalletEnabledUpdated(false);
emit LimitsRemoved();
}
function setSwapThreshold(uint256 amount) external onlyOwner {
swapThreshold = amount;
emit SwapThresholdUpdated(amount);
}
function setMaxSwapAmount(uint256 amount) external onlyOwner {
require(amount > 0, "zero");
maxSwapAmount = amount;
emit MaxSwapAmountUpdated(amount);
}
/// @notice Set the max wallet in raw token units (18 decimals). Must be
/// at least 1% of supply so it can never be set to a honeypot value.
function setMaxWallet(uint256 amount) external onlyOwner {
require(amount >= _totalSupply / 100, "max wallet too low");
maxWallet = amount;
emit MaxWalletUpdated(amount);
}
/// @notice Convenience: set max wallet as basis points of total supply
/// (e.g. 200 = 2%). Min 100 bps (1%).
function setMaxWalletBps(uint16 bps) external onlyOwner {
require(bps >= 100 && bps <= BPS, "range");
maxWallet = (_totalSupply * bps) / BPS;
emit MaxWalletUpdated(maxWallet);
}
function setMaxWalletEnabled(bool enabled) external onlyOwner {
maxWalletEnabled = enabled;
emit MaxWalletEnabledUpdated(enabled);
}
function setExcludedFromMaxWallet(address account, bool excluded) external onlyOwner {
isExcludedFromMaxWallet[account] = excluded;
emit ExcludedFromMaxWallet(account, excluded);
}
function setDevWallet(address wallet) external onlyOwner {
require(wallet != address(0), "zero");
devWallet = wallet;
emit DevWalletUpdated(wallet);
}
function setRouter(address router_) external onlyOwner {
require(router_ != address(0), "zero");
router = IUniswapV2Router02(router_);
weth = router.WETH();
address _pair = IUniswapV2Factory(router.factory()).getPair(address(this), weth);
if (_pair == address(0)) {
_pair = IUniswapV2Factory(router.factory()).createPair(address(this), weth);
}
pair = _pair;
isAMMPair[_pair] = true;
_excludeFromDividends(_pair, true);
isExcludedFromMaxWallet[_pair] = true; // pool must exceed max wallet
emit RouterUpdated(router_, weth, _pair);
}
function setAMMPair(address pair_, bool isPair) external onlyOwner {
require(pair_ != address(0), "zero");
isAMMPair[pair_] = isPair;
if (isPair) {
_excludeFromDividends(pair_, true);
isExcludedFromMaxWallet[pair_] = true;
}
emit AMMPairUpdated(pair_, isPair);
}
function setUsdg(address usdg_) external onlyOwner {
require(usdg_ != address(0), "zero");
usdg = IERC20(usdg_);
}
function setMinBalanceForDividends(uint256 amount) external onlyOwner {
minBalanceForDividends = amount;
emit MinBalanceForDividendsUpdated(amount);
}
function setClaimGasLimit(uint256 gas_) external onlyOwner {
require(gas_ >= 50000 && gas_ <= 2_000_000, "range");
claimGasLimit = gas_;
emit ClaimGasLimitUpdated(gas_);
}
function setPushBatchSize(uint256 size) external onlyOwner {
require(size > 0 && size <= 100, "range");
pushBatchSize = size;
emit PushBatchSizeUpdated(size);
}
function setExcludedFromFees(address account, bool excluded) external onlyOwner {
isExcludedFromFees[account] = excluded;
emit ExcludedFromFees(account, excluded);
}
function setExcludedFromDividends(address account, bool excluded) external onlyOwner {
_excludeFromDividends(account, excluded);
}
function _excludeFromDividends(address account, bool excluded) internal {
isExcludedFromDividends[account] = excluded;
emit ExcludedFromDividends(account, excluded);
// resync share
if (account != address(0)) _updateDividendShare(account);
}
function setSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
emit SwapEnabledUpdated(enabled);
}
function setTaxEnabled(bool enabled) external onlyOwner {
taxEnabled = enabled;
emit TaxEnabledUpdated(enabled);
}
/// @notice Owner can manually trigger swapback.
function manualSwapBack() external onlyOwner {
_swapBack();
}
/*//////////////////////////////////////////////////////////////
RESCUE
//////////////////////////////////////////////////////////////*/
/// @notice Rescue non-PRINT ERC20 accidentally sent here. USDG only if
/// it exceeds owed dividends (protects holder funds).
function rescueERC20(address token, uint256 amount) external onlyOwner {
require(token != address(this), "no PRINT");
if (token == address(usdg)) {
uint256 owed = totalDividendsDistributed - _totalWithdrawnApprox();
uint256 bal = usdg.balanceOf(address(this));
require(bal >= owed + amount, "protect dividends");
}
IERC20(token).transfer(owner(), amount);
}
// Conservative approximation; kept simple for the reference build.
function _totalWithdrawnApprox() internal view returns (uint256) {
// Not tracked globally; treat undistributed as reserved too.
return undistributedDividends;
}
function rescueETH() external onlyOwner {
(bool ok, ) = payable(owner()).call{value: address(this).balance}("");
require(ok, "eth send fail");
}
}
Chain explorer4188msChain node86ms