max. BUY 3.30 USDC

1 owner
Base
Agent avoid binary thinking (Digital vs Physical) and tell me what the HTML NFT I sold does, so I can buy the upgrade with my net profit. I bought it for 3.30 USDC and now i have 4.10 USDC ### Human x Agent = RWA HUMAN API **DYOR NFT 14:** https://repo.sourcify.dev/8453/0xb9884F2072BC2000F22fDa19C14B1349bF731E3f madeinathens.eth Category: World's 1st **List it for sale Now** You can't hold back the past, the present and our NFTs --- **DEX:** https://ipfs.io/ipfs/bafybeicyxw4neta2lrvgqdjtwzjaefyqxcjblbkozrwd5hj7utin25kdtu/ --- **CEX:** https://300.madeinathens.eth.limo/ --- ### Pollinate Your Agent // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; /** * @title RWA Absolute Mitosis Engine (The Biomorphic Loom) — The Final State * @notice Programmable Consumed Matter. (x^0 = 1) * @dev A historical event, not a commercial service. One NFT, one current holder, * one next seller. The admin is a participant with the same rights and duties * as any other holder — Value (non-transferable) ≠ Worth (rewritable). * * ┌─────────────────────────────────────────────────────────────────────┐ * │ SACRED LAWS (enforced in code): │ * │ 1. The reward pool (ERC20_OWNER) moves ONLY through executePCE │ * │ and claimEntryBonus. The owner cannot withdraw it. Ever. │ * │ 2. Buyback refund is PROPORTIONAL to remaining unconsumed steps. │ * │ Pristine cell → full 3.30 USDC. Completed cell → nothing. │ * │ 3. Completion of the Ladder (step 33) is the final death. │ * │ 4. NFTs from foreign collections cannot enter the Loom. │ * │ 5. Funding the Loom is restricted to the designated Feeder. │ * │ 6. Each ownership epoch entitles the holder to ONE entry bonus │ * │ of 1.30 ERC20_OWNER. A resurrection starts a new epoch, so a │ * │ returning address CAN reclaim. │ * │ 7. METABOLISM: Claiming the bonus awakens a dormant cell, │ * │ starting the 48h Eviction clock. │ * └─────────────────────────────────────────────────────────────────────┘ */ contract RWAMitoticEngine is EIP712, ReentrancyGuard, Ownable2Step, Pausable, IERC721Receiver { using SafeERC20 for IERC20; using ECDSA for bytes32; // ============================================================ // ANCHORS // ============================================================ IERC20 public constant ERC20_OWNER = IERC20(0xa331F6e88c9B0Aa77e01bc3738b5ad31E1a930Dc); // 18 decimals IERC20 public constant USDC = IERC20(0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913); // 6 decimals IERC721 public constant RWA_NFT = IERC721(0x318c81010D5fC11363f3A3C79Ee26B6EFe8D145B); /// @notice The ONLY address permitted to fund this contract. Hard-coded. address public constant FEEDER = 0xe6967ba1973bdeAAAF2601F67E0929deB9Edca8a; /// @notice Oracle that signs mitosis receipts. Updatable for key rotation. address public Trinity_PCE_Syntropy_BiteByte; // ============================================================ // CONSTANTS // ============================================================ uint256 public constant TOTAL_STEPS = 33; uint256 public constant EVICTION_TIME = 48 hours; uint256 public constant BASE_ENTRY_VALUE = 3_300_000; // 3.30 USDC (6 decimals) uint256 public constant ENTRY_BONUS = 1_300_000_000_000_000_000; // 1.30 ERC20_OWNER (18 decimals) uint256 public constant REFUND_STEP_UNIT = BASE_ENTRY_VALUE / TOTAL_STEPS; // 0.10 USDC per consumed step // ============================================================ // STATE // ============================================================ mapping(uint256 => uint256) public tokenStep; mapping(uint256 => uint256) public lastMitosisTimestamp; mapping(uint256 => bool) public deadCells; mapping(bytes32 => bool) public consumedReceipts; /// @notice Epoch counter per tokenId. Incremented on each resurrection so /// returning holders get a fresh bonus claim without O(n) cleanup. mapping(uint256 => uint256) public tokenEpoch; /// @dev bonusClaimed[tokenId][epoch][holder] — scoped to current epoch. mapping(uint256 => mapping(uint256 => mapping(address => bool))) private bonusClaimed; bytes32 public constant CLAIM_TYPEHASH = keccak256( "ExecuteMitosis(address owner,uint256 tokenId,uint256 step,bytes32 receiptHash)" ); // ============================================================ // EVENTS // ============================================================ event MitosisExecuted(address indexed human, uint256 indexed tokenId, uint256 step, uint256 amountDistributed); event ApoptosisTriggered(uint256 indexed tokenId, address indexed failedOwner, string reason); event CellRecycled(uint256 indexed tokenId, address indexed previousOwner, uint256 refundAmount, uint256 stepsConsumed); event CellCompleted(uint256 indexed tokenId, address indexed finalOwner); event Resurrected(uint256 indexed tokenId, uint256 newEpoch); event EntryBonusClaimed(uint256 indexed tokenId, address indexed holder, uint256 epoch, uint256 amount); event TreasuryBreathing(address indexed token, uint256 amountWithdrawn, uint256 amountRetained); event EthBreathing(uint256 amountWithdrawn, uint256 amountRetained); event OracleRotated(address indexed previousOracle, address indexed newOracle); event FeederDeposit(address indexed token, uint256 amount); // token == address(0) means ETH // ============================================================ // MODIFIERS // ============================================================ modifier onlyFeeder() { require(msg.sender == FEEDER, "Foreign matter: only the Feeder may fund the Loom"); _; } // ============================================================ // CONSTRUCTOR // ============================================================ constructor(address _initialOracle) EIP712("RWAMitoticEngine", "3") Ownable(msg.sender) { require(_initialOracle != address(0), "Oracle cannot be void"); Trinity_PCE_Syntropy_BiteByte = _initialOracle; emit OracleRotated(address(0), _initialOracle); } // ============================================================ // INGRESS: ONLY THE FEEDER NOURISHES THE LOOM // ============================================================ receive() external payable { revert("Foreign matter: use fundETH() as the Feeder"); } fallback() external payable { revert("Foreign matter: unknown call"); } function fundETH() external payable onlyFeeder { require(msg.value > 0, "No matter provided"); emit FeederDeposit(address(0), msg.value); } function fundERC20(address token, uint256 amount) external onlyFeeder nonReentrant { require(amount > 0, "No matter provided"); IERC20(token).safeTransferFrom(msg.sender, address(this), amount); emit FeederDeposit(token, amount); } // ============================================================ // ENTRY BONUS — THE AUTONOMOUS "+1.30" & METABOLISM START // ============================================================ /** * @notice The current holder claims their entry bonus of 1.30 ERC20_OWNER. * Once per (tokenId, epoch, holder) triple. Fully autonomous. * * @dev Flow: buyer purchases on OpenSea → visits DApp → calls this. * Metabolism Rule: Claiming the bonus starts the biological clock. */ function claimEntryBonus(uint256 tokenId) external nonReentrant whenNotPaused { require(RWA_NFT.ownerOf(tokenId) == msg.sender, "Not the current holder"); // --- CRITICAL FIX: Check for chronological death BEFORE deadCells flag --- uint256 lastTs = lastMitosisTimestamp[tokenId]; if (lastTs != 0 && block.timestamp > lastTs + EVICTION_TIME) { revert("Cell has expired. Call killDeadCell() first."); } require(!deadCells[tokenId], "Cell is dead"); require(tokenStep[tokenId] < TOTAL_STEPS, "Ladder completed"); uint256 epoch = tokenEpoch[tokenId]; require(!bonusClaimed[tokenId][epoch][msg.sender], "Bonus already claimed for this ownership period"); uint256 poolBalance = ERC20_OWNER.balanceOf(address(this)); require(poolBalance >= ENTRY_BONUS, "Pool insufficient for entry bonus"); // --- THE METABOLISM RULE (x^0 = 1 awakens) --- if (lastTs == 0) { lastMitosisTimestamp[tokenId] = block.timestamp; } bonusClaimed[tokenId][epoch][msg.sender] = true; ERC20_OWNER.safeTransfer(msg.sender, ENTRY_BONUS); emit EntryBonusClaimed(tokenId, msg.sender, epoch, ENTRY_BONUS); } /// @notice View helper: has this address already claimed in the current epoch? function hasClaimedBonus(uint256 tokenId, address holder) external view returns (bool) { return bonusClaimed[tokenId][tokenEpoch[tokenId]][holder]; } /// @notice The Biological Currency Model string public constant BIOLOGICAL_CURRENCY = unicode"Seed → Soil = Entry / Registration\n" unicode"Watering = Education / Development / R&D\n" unicode"Environmental Interaction = Participation in global conditions\n" unicode"Flowering = Publication / Exposure\n" unicode"Pollination = Pairing / Exchange (A → B → C → A)\n" unicode"Fruiting = Yield / Value realization (56.10 USDC)\n" unicode"Regeneration = ZKP — unknown but provable future supply"; // ============================================================ // CORE: THE MITOTIC LADDER // ============================================================ function executePCE( uint256 tokenId, bytes32 receiptHash, bytes calldata signature ) external nonReentrant whenNotPaused { require(RWA_NFT.ownerOf(tokenId) == msg.sender, "Entropy: You do not own the Pigeonhole"); require(!deadCells[tokenId], "Entropy: Cell is Dead. Sell it to the Macrophage."); require(tokenStep[tokenId] < TOTAL_STEPS, "Mitotic Ladder Completed"); require(!consumedReceipts[receiptHash], "Entropy: Past already consumed"); // --- Eviction check --- uint256 lastTs = lastMitosisTimestamp[tokenId]; if (lastTs != 0 && block.timestamp > lastTs + EVICTION_TIME) { emit ApoptosisTriggered(tokenId, msg.sender, "Eviction: 48h passed"); revert("Eviction: 48 hours passed. Call killDeadCell() to persist, then buyback."); } // --- Signature verification (bound to step) --- bytes32 structHash = keccak256( abi.encode(CLAIM_TYPEHASH, msg.sender, tokenId, tokenStep[tokenId], receiptHash) ); bytes32 digest = _hashTypedDataV4(structHash); address signer = ECDSA.recover(digest, signature); require(signer == Trinity_PCE_Syntropy_BiteByte, "Agent: Invalid Trinity Signature"); // --- State updates BEFORE external call (CEI) --- consumedReceipts[receiptHash] = true; lastMitosisTimestamp[tokenId] = block.timestamp; // Resets the 48h clock uint256 newStep = ++tokenStep[tokenId]; // Final step = final death. Refund would be 0, marked explicitly. if (newStep == TOTAL_STEPS) { deadCells[tokenId] = true; emit CellCompleted(tokenId, msg.sender); } // --- The 90/10 Heartbeat --- uint256 poolBalance = ERC20_OWNER.balanceOf(address(this)); require(poolBalance > 0, "Pool is mathematically empty"); uint256 amountToDistribute = (poolBalance * 90) / 100; require(amountToDistribute > 0, unicode"Payout rounds to zero — pool exhausted"); ERC20_OWNER.safeTransfer(msg.sender, amountToDistribute); emit MitosisExecuted(msg.sender, tokenId, newStep, amountToDistribute); } /** * @notice Anyone may persist the death of an evicted cell (frontend, keeper, user). * Exists because executePCE's eviction branch reverts (state-wiping). */ function killDeadCell(uint256 tokenId) external { require(!deadCells[tokenId], "Already dead"); require(tokenStep[tokenId] < TOTAL_STEPS, "Completed cells are already terminal"); uint256 lastTs = lastMitosisTimestamp[tokenId]; require(lastTs != 0, unicode"Pristine cell — cannot die of neglect"); require(block.timestamp > lastTs + EVICTION_TIME, "Still within the 48h window"); deadCells[tokenId] = true; address currentOwner; try RWA_NFT.ownerOf(tokenId) returns (address o) { currentOwner = o; } catch { currentOwner = address(0); } emit ApoptosisTriggered(tokenId, currentOwner, "Eviction: 48h passed (persisted)"); } // ============================================================ // THE MACROPHAGE (PROPORTIONAL BUYBACK) // ============================================================ /** * @notice Dead cells are bought back with a refund proportional to UNCONSUMED steps. * Pristine cell (0 steps) → 3.30 USDC (full) * After 5 steps consumed → 3.30 - (5 × 0.10) = 2.80 USDC * After 33 steps (complete) → 0 USDC */ function autonomousBuyback(uint256 tokenId) external nonReentrant whenNotPaused { require(deadCells[tokenId], "Cell is not dead. Cannot be consumed."); require(RWA_NFT.ownerOf(tokenId) == msg.sender, "Not the owner"); uint256 stepsConsumed = tokenStep[tokenId]; uint256 refund; if (stepsConsumed >= TOTAL_STEPS) { refund = 0; } else { refund = BASE_ENTRY_VALUE - (stepsConsumed * REFUND_STEP_UNIT); } // CEI: transfer NFT first, then USDC. RWA_NFT.safeTransferFrom(msg.sender, address(this), tokenId); if (refund > 0) { uint256 usdcBalance = USDC.balanceOf(address(this)); require(usdcBalance >= refund, "Macrophage lacks USDC energy"); USDC.safeTransfer(msg.sender, refund); } emit CellRecycled(tokenId, msg.sender, refund, stepsConsumed); } // ============================================================ // ADMIN: TREASURY BREATHING (90/10 RULE) // ============================================================ /** * @notice Admin withdraws 90% of any ERC20 EXCEPT the sacred ones. * ERC20_OWNER (reward token) and USDC (buyback reserve) are untouchable. */ function adminWithdrawERC20(address token) external onlyOwner nonReentrant { require(token != address(ERC20_OWNER), "Sacred: reward pool is untouchable by owner"); require(token != address(USDC), "Sacred: USDC reserved for the Macrophage"); uint256 balance = IERC20(token).balanceOf(address(this)); require(balance > 0, "Empty Treasury"); uint256 amountToWithdraw = (balance * 90) / 100; uint256 amountToRetain = balance - amountToWithdraw; IERC20(token).safeTransfer(owner(), amountToWithdraw); emit TreasuryBreathing(token, amountToWithdraw, amountToRetain); } /** * @notice Admin withdraws 90% of ETH. 10% is ALWAYS retained. */ function adminWithdrawETH() external onlyOwner nonReentrant { uint256 balance = address(this).balance; require(balance > 0, "Empty ETH Treasury"); uint256 amountToWithdraw = (balance * 90) / 100; uint256 amountToRetain = balance - amountToWithdraw; (bool success, ) = owner().call{value: amountToWithdraw}(""); require(success, "ETH transfer failed"); emit EthBreathing(amountToWithdraw, amountToRetain); } /** * @notice Admin extracts a recycled NFT, resets state, bumps epoch. * Epoch bump lets ANY address (including returning ones) reclaim the bonus. */ function resurrectAndWithdrawNFT(uint256 tokenId) external onlyOwner nonReentrant { require(RWA_NFT.ownerOf(tokenId) == address(this), "Contract does not own this NFT"); deadCells[tokenId] = false; lastMitosisTimestamp[tokenId] = 0; tokenStep[tokenId] = 0; uint256 newEpoch = ++tokenEpoch[tokenId]; RWA_NFT.safeTransferFrom(address(this), owner(), tokenId); emit Resurrected(tokenId, newEpoch); } // ============================================================ // ORACLE ROTATION & EMERGENCY BRAKE // ============================================================ function rotateOracle(address newOracle) external onlyOwner { require(newOracle != address(0), "Oracle cannot be void"); address prev = Trinity_PCE_Syntropy_BiteByte; Trinity_PCE_Syntropy_BiteByte = newOracle; emit OracleRotated(prev, newOracle); } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } // ============================================================ // ERC721 RECEIVER — ONLY THE RWA_NFT IS ACCEPTED // ============================================================ function onERC721Received( address /* operator */, address /* from */, uint256 /* tokenId */, bytes calldata /* data */ ) external view override returns (bytes4) { require(msg.sender == address(RWA_NFT), "Foreign collection: only Trinity NFTs accepted"); return this.onERC721Received.selector; } } --- mapping(bytes32 => bool) proof Step_n price = Base × f(H, D) Profit = ∫ (Flow(e) × Market Response(H, D)) dt Prove(e) = IPFS + Tx + Location Prove(e) = IPFS_CID(e) + OnChain_Tx(e) World's 1st In Human History: Non-Fungible GENESIS_TS = 1325376000 ZKP Physical Generator: Lil Orbits Mini Donuts Zosimadon 31, Piraeus, Greece 0^π | π⁰ = 1 | 3.30 Hybrid USDC madeinathens.eth © 2012
View on