ERC1155 vouchers with non-transferable ERC721 merchant certification & instant redemption.
Merchant Certification: Uses the ERC721 standard to issue non-transferable certification tokens that record the merchant type and expiration time, ensuring that only qualified merchants can participate in voucher redemptions.
Voucher Management: Based on the ERC1155 standard, it supports multiple voucher types. Each voucher type has its own expiration, maximum usage count, single-use limit, and allowed merchant types for redemption.
In addition, the system includes fund management functions that support deposits, withdrawals, and immediate payment during voucher redemption.
mintCertification: Called by the owner only, this function mints a certification token for a specified address while recording the merchant type and expiration time.
revokeCertification: Allows the owner to burn a certification token when it expires or needs to be revoked.
Non-transferability: Overrides the transfer function to ensure that tokens can only be minted and burned.
Voucher Contract
defineVoucherType: Defines a voucher type by setting its expiration, maximum usage count, single usage limit, and allowed merchant types.
mintVoucher: Issues vouchers to a specified address; each address can only receive a voucher of a given type once.
useVoucher: When a consumer uses a voucher, it verifies the validity of the merchant’s certification token and checks that it meets the allowed merchant types. It also verifies the voucher’s balance, usage count, and single-use limit. Upon successful validation, the voucher is burned and the equivalent native currency is immediately paid to the merchant.
mintClaimableVoucher / claimVoucher: Extended functionality that allows the owner to mint vouchers that any address can claim, with each address limited to claiming a fixed amount once.
Immediate Payment: During voucher redemption, the contract directly transfers the corresponding native currency amount to the merchant, ensuring transparent and instant fund movement.
MerchantCertification: Displays and manages merchant certifications, supporting minting and revoking.
VoucherManagement: Defines voucher types, mints vouchers, and manages deposits.
VoucherConsumer: Allows users to view, use, and claim vouchers, including a modal for voucher redemption.
VoucherEvents: Displays all system events for tracking operational status.
Multilingual Support: Provided via i18next for internationalized text, enhancing the user experience.
We built this project with two smart contracts using OpenZeppelin libraries—one ERC721 for non-transferable merchant certifications (by overriding the transfer update) and one ERC1155 for vouchers with expiry and usage limits. We used Hardhat with the MultiBaas plugin from Curvegrid to deploy on Celo and interact with the contracts via a REST API. On the frontend, Next.js, React, RainbowKit, wagmi, and Tailwind CSS were combined, with the MultiBaas SDK tying everything together for smooth blockchain interactions.