Shop for Sells of services or properties using the USDC as payment and your ESH Coin as a stock and rewards
Jan 25, 2026
MIT,
A robust Solidity-based retail management system designed for secure product sales, automated reward distribution, and verifiable digital receipts using NFTs. This contract integrates with an invoice system to mint receipt NFTs and supports a multi-tier distribution model for store profits.
ReentrancyGuard to prevent reentrancy attacks and multi-step balance releases.IERC20Flat for primary payments and a reward token for loyalty points.IInvoice contract to mint/burn NFTs that represent proof of purchase.serverSigner signature for purchaseProduct to prevent front-running or unauthorized price manipulation.14 days5% for worker payments and profit distributions.serverSigner, adding products, and triggering distributions are protected by the onlyOwner modifier._deadline parameter to prevent replay attacks using old signatures._ERCUltra: The address of your Reward Token._invoices: The address of the IInvoice NFT contract._contractOwner: The initial admin address.setServerSigner() to designate the backend wallet that will authorize purchases.The contract emits detailed logs for transparency:
ProductAdded: When new inventory is stocked.NewReceipt: Detailed data for every successful purchase.FundsReleasedToBalance: When the owner claims funds after the refund window.DistributionStarted: Tracks the initiation of profit sharing.No inputs required