05 / CONTRACT
EquityAcquisitionTreasury
Everything the treasury can do is written in this one contract. Below is the verbatim source — the exact code deployed and verified on-chain — 401 lines of Solidity, no proxy, no upgrade slots.
- Language
- Solidity ^0.8.24
- License
- MIT
- Source lines
- 401
- Network
- Robinhood Chain
The four phases the contract encodes
- 1FUNDreceive()
Pons routes the creator tax into the contract as ETH; receive() accrues it and emits the event.
- 2WITHDRAWwithdraw()
The operator withdraws toward the brokerage; amount, destination and purpose are all booked.
- 3PURCHASEattestPurchase()
After off-chain settlement, the purchase is attested with share count, price and receipt hash.
- 4PROGRESSownershipBps()
The contract keeps the full acquisition ledger and exposes progress toward the 13D threshold.
Read this first: the trust model
The contract says it up front. The operator has full and immediate custody of the treasury — declared in the NatSpec at the top of the source, not buried in documentation.
NatSpec — TRUST MODEL
* TRUST MODEL — read before interacting: this is an experimental * project. The operator has full, immediate custody of the treasury: * `withdraw` moves ETH to any address with no delay, and `rescueToken` * recovers any ERC20 sent here. Real-world share purchases happen * off-chain and are only as true as the operator's attestations. The * contract guarantees transparency (every movement is an on-chain * event), not custody restrictions.Three thresholds, fixed as constants
The 5% 13D filing line, the 50% voting-control line and the 100% full-acquisition line are compile-time constants. No one can change these three numbers at runtime.
Constants — 13D / control / full
/// @notice Share quantities are stored in micro-shares (1 share = 1e6 units) /// so fractional brokerage fills can be recorded exactly. uint256 public constant SHARE_SCALE = 1e6; /// @notice SEC Schedule 13D beneficial-ownership disclosure threshold. uint256 public constant DISCLOSURE_BPS = 500; // 5.00% /// @notice Simple-majority voting control threshold. uint256 public constant CONTROL_BPS = 5000; // 50.00% (+1 share) uint256 public constant FULL_BPS = 10000; // 100.00%Events
event FeeReceived(address indexed from, uint256 amountWei, uint256 totalFeesReceivedWei); event WithdrawalExecuted(uint256 indexed id, uint256 amountWei, address indexed to, string purpose); event TokenRescued(address indexed token, uint256 amount, address indexed to); event PurchaseAttested( uint256 indexed id, uint256 shareUnits, uint256 avgPriceUsdCents, uint256 costUsdCents, uint256 ethSpentWei, bytes32 brokerReceiptHash ); event MilestoneReached(uint256 indexed bps, uint256 totalSharesAcquiredUnits, uint256 timestamp); event SharesOutstandingUpdated(uint256 oldUnits, uint256 newUnits, string reason); event ReferencePricesUpdated(uint256 stockPriceUsdCents, uint256 ethPriceUsdCents); event OperatorTransferStarted(address indexed current, address indexed pending); event OperatorTransferred(address indexed previous, address indexed current);Errors
error NotOperator(); error ZeroAddress(); error ZeroAmount(); error InsufficientBalance(); error TransferFailed();The functions that move money, in full
Four pieces of code decide everything this treasury can do. They are short enough to read on a phone. Read them.
1 · FUND — receive()
/// @notice Pons v2 routes the creator tax here as plain ETH transfers. receive() external payable { totalFeesReceivedWei += msg.value; emit FeeReceived(msg.sender, msg.value, totalFeesReceivedWei); }2 · WITHDRAW — withdraw()
/** * @notice Withdraw treasury ETH. Immediate; destination is free; every * withdrawal is permanently recorded with its stated purpose. * @param amountWei amount to withdraw; pass 0 to withdraw the full balance * @param to destination address * @param purpose stated purpose, e.g. "Broker deposit #2 for LNKS buys" */ function withdraw(uint256 amountWei, address to, string calldata purpose) external onlyOperator returns (uint256 id) { if (to == address(0)) revert ZeroAddress(); uint256 amount = amountWei == 0 ? address(this).balance : amountWei; if (amount == 0) revert ZeroAmount(); if (amount > address(this).balance) revert InsufficientBalance(); id = withdrawals.length; withdrawals.push( Withdrawal({amountWei: amount, to: to, executedAt: uint64(block.timestamp), purpose: purpose}) ); totalWithdrawnWei += amount; (bool ok, ) = to.call{value: amount}(""); if (!ok) revert TransferFailed(); emit WithdrawalExecuted(id, amount, to, purpose); }3 · PURCHASE — attestPurchase()
/** * @notice Record a completed real-world purchase of target shares. * @param shareUnits micro-shares bought (1 share = 1e6 units) * @param avgPriceUsdCents average fill price per whole share, in USD cents * @param ethSpentWei ETH that was converted to fund this purchase * @param brokerReceiptHash keccak256 of the broker trade confirmation document * @param executedAt real-world execution timestamp * @param memo free-form note, e.g. broker order reference */ function attestPurchase( uint256 shareUnits, uint256 avgPriceUsdCents, uint256 ethSpentWei, bytes32 brokerReceiptHash, uint64 executedAt, string calldata memo ) external onlyOperator returns (uint256 id) { if (shareUnits == 0 || avgPriceUsdCents == 0) revert ZeroAmount(); uint256 costUsdCents = (shareUnits * avgPriceUsdCents) / SHARE_SCALE; id = purchases.length; purchases.push( Purchase({ shareUnits: shareUnits, avgPriceUsdCents: avgPriceUsdCents, costUsdCents: costUsdCents, ethSpentWei: ethSpentWei, executedAt: executedAt, attestedAt: uint64(block.timestamp), brokerReceiptHash: brokerReceiptHash, memo: memo }) ); totalSharesAcquiredUnits += shareUnits; totalCostUsdCents += costUsdCents; emit PurchaseAttested(id, shareUnits, avgPriceUsdCents, costUsdCents, ethSpentWei, brokerReceiptHash); _checkMilestone(DISCLOSURE_BPS); _checkMilestone(CONTROL_BPS); _checkMilestone(FULL_BPS); }4 · PROGRESS — _checkMilestone()
function _checkMilestone(uint256 bps) internal { if (milestoneReachedAt[bps] == 0 && ownershipBps() >= bps) { milestoneReachedAt[bps] = uint64(block.timestamp); emit MilestoneReached(bps, totalSharesAcquiredUnits, block.timestamp); } }getStats() — the dashboard's single read
/// @notice One-call snapshot of everything the dashboard needs. function getStats() external view returns ( uint256 balanceWei, uint256 _totalFeesReceivedWei, uint256 _totalWithdrawnWei, uint256 _totalCostUsdCents, uint256 _totalSharesAcquiredUnits, uint256 _sharesOutstandingUnits, uint256 _ownershipBps, uint256 unitsToDisclosure, uint256 unitsToControl, uint256 unitsToFull, uint256 _estimatedAcquirableShareUnits, uint256 _withdrawalsCount, uint256 _purchasesCount ) { return ( address(this).balance, totalFeesReceivedWei, totalWithdrawnWei, totalCostUsdCents, totalSharesAcquiredUnits, sharesOutstandingUnits, ownershipBps(), shareUnitsToMilestone(DISCLOSURE_BPS), shareUnitsToMilestone(CONTROL_BPS), shareUnitsToMilestone(FULL_BPS), estimatedAcquirableShareUnits(), withdrawals.length, purchases.length ); }Full source
EquityAcquisitionTreasury.sol · 401 lines
EquityAcquisitionTreasury.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.24; /** * @title EquityAcquisitionTreasury * @notice On-chain treasury for an experimental community campaign to acquire * real-world equity (NASDAQ: LNKS — Linkers Industries Limited) funded * by memecoin trading fees routed from the Pons v2 launchpad on * Robinhood Chain. * * Lifecycle encoded in this contract: * 1. FUND — Pons routes the creator tax (ETH) to this contract. * 2. WITHDRAW — the operator withdraws ETH to fund the brokerage * account. Every withdrawal is recorded on-chain with * destination and purpose. * 3. PURCHASE — after real shares are bought off-chain through the * brokerage, the operator attests the purchase on-chain * with quantity, price and a hash of the broker receipt. * 4. PROGRESS — the contract keeps the full acquisition ledger and * exposes progress toward the SEC 13D disclosure * threshold (5%), voting control (50% + 1 share) and * full acquisition (100%). * * TRUST MODEL — read before interacting: this is an experimental * project. The operator has full, immediate custody of the treasury: * `withdraw` moves ETH to any address with no delay, and `rescueToken` * recovers any ERC20 sent here. Real-world share purchases happen * off-chain and are only as true as the operator's attestations. The * contract guarantees transparency (every movement is an on-chain * event), not custody restrictions. */contract EquityAcquisitionTreasury { // --------------------------------------------------------------------- // Constants // --------------------------------------------------------------------- /// @notice Share quantities are stored in micro-shares (1 share = 1e6 units) /// so fractional brokerage fills can be recorded exactly. uint256 public constant SHARE_SCALE = 1e6; /// @notice SEC Schedule 13D beneficial-ownership disclosure threshold. uint256 public constant DISCLOSURE_BPS = 500; // 5.00% /// @notice Simple-majority voting control threshold. uint256 public constant CONTROL_BPS = 5000; // 50.00% (+1 share) uint256 public constant FULL_BPS = 10000; // 100.00% // --------------------------------------------------------------------- // Target company metadata // --------------------------------------------------------------------- string public targetTicker; // "LNKS" string public targetName; // "Linkers Industries Limited" /// @notice Total shares outstanding of the target, in micro-shares. /// Operator-updatable to track splits, buybacks and new issuance. uint256 public sharesOutstandingUnits; // --------------------------------------------------------------------- // Role // --------------------------------------------------------------------- address public operator; address public pendingOperator; // --------------------------------------------------------------------- // Treasury accounting // --------------------------------------------------------------------- uint256 public totalFeesReceivedWei; // lifetime ETH inflow uint256 public totalWithdrawnWei; // lifetime ETH withdrawn uint256 public totalCostUsdCents; // lifetime USD deployed into shares uint256 public totalSharesAcquiredUnits; // micro-shares attested as bought // --------------------------------------------------------------------- // Withdrawals (instant, operator-only, fully recorded) // --------------------------------------------------------------------- struct Withdrawal { uint256 amountWei; address to; uint64 executedAt; string purpose; // e.g. "Broker deposit #3 for LNKS buys" } Withdrawal[] public withdrawals; // --------------------------------------------------------------------- // Purchase attestations // --------------------------------------------------------------------- struct Purchase { uint256 shareUnits; // micro-shares bought uint256 avgPriceUsdCents; // average fill price per whole share, in cents uint256 costUsdCents; // total USD cost of this purchase uint256 ethSpentWei; // ETH converted to fund this purchase uint64 executedAt; // real-world trade timestamp uint64 attestedAt; // block timestamp of this attestation bytes32 brokerReceiptHash; // keccak256 of the broker trade confirmation string memo; } Purchase[] public purchases; // --------------------------------------------------------------------- // Reference prices (operator-attested, for dashboard estimates only) // --------------------------------------------------------------------- uint256 public refStockPriceUsdCents; // last observed LNKS price uint256 public refEthPriceUsdCents; // last observed ETH price uint64 public refPricesUpdatedAt; // --------------------------------------------------------------------- // Milestones // --------------------------------------------------------------------- mapping(uint256 => uint64) public milestoneReachedAt; // bps => timestamp // --------------------------------------------------------------------- // Events // --------------------------------------------------------------------- event FeeReceived(address indexed from, uint256 amountWei, uint256 totalFeesReceivedWei); event WithdrawalExecuted(uint256 indexed id, uint256 amountWei, address indexed to, string purpose); event TokenRescued(address indexed token, uint256 amount, address indexed to); event PurchaseAttested( uint256 indexed id, uint256 shareUnits, uint256 avgPriceUsdCents, uint256 costUsdCents, uint256 ethSpentWei, bytes32 brokerReceiptHash ); event MilestoneReached(uint256 indexed bps, uint256 totalSharesAcquiredUnits, uint256 timestamp); event SharesOutstandingUpdated(uint256 oldUnits, uint256 newUnits, string reason); event ReferencePricesUpdated(uint256 stockPriceUsdCents, uint256 ethPriceUsdCents); event OperatorTransferStarted(address indexed current, address indexed pending); event OperatorTransferred(address indexed previous, address indexed current); // --------------------------------------------------------------------- // Errors // --------------------------------------------------------------------- error NotOperator(); error ZeroAddress(); error ZeroAmount(); error InsufficientBalance(); error TransferFailed(); modifier onlyOperator() { if (msg.sender != operator) revert NotOperator(); _; } // --------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------- /** * @param _operator operator address (full treasury custody) * @param _targetTicker e.g. "LNKS" * @param _targetName e.g. "Linkers Industries Limited" * @param _sharesOutstanding whole shares outstanding (NOT scaled), e.g. 1_770_000 */ constructor( address _operator, string memory _targetTicker, string memory _targetName, uint256 _sharesOutstanding ) { if (_operator == address(0)) revert ZeroAddress(); if (_sharesOutstanding == 0) revert ZeroAmount(); operator = _operator; targetTicker = _targetTicker; targetName = _targetName; sharesOutstandingUnits = _sharesOutstanding * SHARE_SCALE; } // --------------------------------------------------------------------- // 1. FUND — fee intake // --------------------------------------------------------------------- /// @notice Pons v2 routes the creator tax here as plain ETH transfers. receive() external payable { totalFeesReceivedWei += msg.value; emit FeeReceived(msg.sender, msg.value, totalFeesReceivedWei); } // --------------------------------------------------------------------- // 2. WITHDRAW — instant, operator-only, recorded // --------------------------------------------------------------------- /** * @notice Withdraw treasury ETH. Immediate; destination is free; every * withdrawal is permanently recorded with its stated purpose. * @param amountWei amount to withdraw; pass 0 to withdraw the full balance * @param to destination address * @param purpose stated purpose, e.g. "Broker deposit #2 for LNKS buys" */ function withdraw(uint256 amountWei, address to, string calldata purpose) external onlyOperator returns (uint256 id) { if (to == address(0)) revert ZeroAddress(); uint256 amount = amountWei == 0 ? address(this).balance : amountWei; if (amount == 0) revert ZeroAmount(); if (amount > address(this).balance) revert InsufficientBalance(); id = withdrawals.length; withdrawals.push( Withdrawal({amountWei: amount, to: to, executedAt: uint64(block.timestamp), purpose: purpose}) ); totalWithdrawnWei += amount; (bool ok, ) = to.call{value: amount}(""); if (!ok) revert TransferFailed(); emit WithdrawalExecuted(id, amount, to, purpose); } /** * @notice Recover any ERC20 tokens sent to this contract (airdrops, * mistaken transfers, the campaign memecoin itself). * @param token ERC20 token address * @param amount amount to transfer; pass 0 to transfer the full balance * @param to destination address */ function rescueToken(address token, uint256 amount, address to) external onlyOperator { if (to == address(0)) revert ZeroAddress(); uint256 bal = IERC20Minimal(token).balanceOf(address(this)); uint256 amt = amount == 0 ? bal : amount; if (amt == 0) revert ZeroAmount(); if (amt > bal) revert InsufficientBalance(); (bool ok, bytes memory ret) = token.call(abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, amt)); // accept both no-return and bool-return ERC20s if (!ok || (ret.length > 0 && !abi.decode(ret, (bool)))) revert TransferFailed(); emit TokenRescued(token, amt, to); } // --------------------------------------------------------------------- // 3. PURCHASE — on-chain attestation of real-world share purchases // --------------------------------------------------------------------- /** * @notice Record a completed real-world purchase of target shares. * @param shareUnits micro-shares bought (1 share = 1e6 units) * @param avgPriceUsdCents average fill price per whole share, in USD cents * @param ethSpentWei ETH that was converted to fund this purchase * @param brokerReceiptHash keccak256 of the broker trade confirmation document * @param executedAt real-world execution timestamp * @param memo free-form note, e.g. broker order reference */ function attestPurchase( uint256 shareUnits, uint256 avgPriceUsdCents, uint256 ethSpentWei, bytes32 brokerReceiptHash, uint64 executedAt, string calldata memo ) external onlyOperator returns (uint256 id) { if (shareUnits == 0 || avgPriceUsdCents == 0) revert ZeroAmount(); uint256 costUsdCents = (shareUnits * avgPriceUsdCents) / SHARE_SCALE; id = purchases.length; purchases.push( Purchase({ shareUnits: shareUnits, avgPriceUsdCents: avgPriceUsdCents, costUsdCents: costUsdCents, ethSpentWei: ethSpentWei, executedAt: executedAt, attestedAt: uint64(block.timestamp), brokerReceiptHash: brokerReceiptHash, memo: memo }) ); totalSharesAcquiredUnits += shareUnits; totalCostUsdCents += costUsdCents; emit PurchaseAttested(id, shareUnits, avgPriceUsdCents, costUsdCents, ethSpentWei, brokerReceiptHash); _checkMilestone(DISCLOSURE_BPS); _checkMilestone(CONTROL_BPS); _checkMilestone(FULL_BPS); } function _checkMilestone(uint256 bps) internal { if (milestoneReachedAt[bps] == 0 && ownershipBps() >= bps) { milestoneReachedAt[bps] = uint64(block.timestamp); emit MilestoneReached(bps, totalSharesAcquiredUnits, block.timestamp); } } // --------------------------------------------------------------------- // Operator maintenance // --------------------------------------------------------------------- function updateSharesOutstanding(uint256 newWholeShares, string calldata reason) external onlyOperator { if (newWholeShares == 0) revert ZeroAmount(); uint256 old = sharesOutstandingUnits; sharesOutstandingUnits = newWholeShares * SHARE_SCALE; emit SharesOutstandingUpdated(old, sharesOutstandingUnits, reason); } function updateReferencePrices(uint256 stockPriceUsdCents, uint256 ethPriceUsdCents) external onlyOperator { if (stockPriceUsdCents == 0 || ethPriceUsdCents == 0) revert ZeroAmount(); refStockPriceUsdCents = stockPriceUsdCents; refEthPriceUsdCents = ethPriceUsdCents; refPricesUpdatedAt = uint64(block.timestamp); emit ReferencePricesUpdated(stockPriceUsdCents, ethPriceUsdCents); } function transferOperator(address newOperator) external onlyOperator { if (newOperator == address(0)) revert ZeroAddress(); pendingOperator = newOperator; emit OperatorTransferStarted(operator, newOperator); } function acceptOperator() external { if (msg.sender != pendingOperator) revert NotOperator(); address old = operator; operator = pendingOperator; pendingOperator = address(0); emit OperatorTransferred(old, operator); } // --------------------------------------------------------------------- // 4. PROGRESS — views for the dashboard // --------------------------------------------------------------------- /// @notice Current beneficial ownership of the target, in basis points. function ownershipBps() public view returns (uint256) { return (totalSharesAcquiredUnits * FULL_BPS) / sharesOutstandingUnits; } function shareUnitsToMilestone(uint256 bps) public view returns (uint256) { uint256 needed = (sharesOutstandingUnits * bps) / FULL_BPS; return totalSharesAcquiredUnits >= needed ? 0 : needed - totalSharesAcquiredUnits; } /// @notice Micro-shares the current treasury balance could buy at the /// attested reference prices. Zero if prices are unset. function estimatedAcquirableShareUnits() public view returns (uint256) { if (refStockPriceUsdCents == 0 || refEthPriceUsdCents == 0) return 0; uint256 balanceUsdCents = (address(this).balance * refEthPriceUsdCents) / 1 ether; return (balanceUsdCents * SHARE_SCALE) / refStockPriceUsdCents; } function withdrawalsCount() external view returns (uint256) { return withdrawals.length; } function purchasesCount() external view returns (uint256) { return purchases.length; } /// @notice One-call snapshot of everything the dashboard needs. function getStats() external view returns ( uint256 balanceWei, uint256 _totalFeesReceivedWei, uint256 _totalWithdrawnWei, uint256 _totalCostUsdCents, uint256 _totalSharesAcquiredUnits, uint256 _sharesOutstandingUnits, uint256 _ownershipBps, uint256 unitsToDisclosure, uint256 unitsToControl, uint256 unitsToFull, uint256 _estimatedAcquirableShareUnits, uint256 _withdrawalsCount, uint256 _purchasesCount ) { return ( address(this).balance, totalFeesReceivedWei, totalWithdrawnWei, totalCostUsdCents, totalSharesAcquiredUnits, sharesOutstandingUnits, ownershipBps(), shareUnitsToMilestone(DISCLOSURE_BPS), shareUnitsToMilestone(CONTROL_BPS), shareUnitsToMilestone(FULL_BPS), estimatedAcquirableShareUnits(), withdrawals.length, purchases.length ); }} interface IERC20Minimal { function balanceOf(address) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool);}Contract addressBack to the method