VoucherToken

ERC1155 vouchers with non-transferable ERC721 merchant certification & instant redemption.

ETHGlobal TaipeiShipped April 4, 2025Prize winner#payments#nft#infra#celo
Repo
VoucherToken banner

About

1. Overall Architecture

The system is built on an EVM-compatible blockchain and utilizes two token standards to meet its requirements:

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.

2. Key Smart Contract Functions

Merchant Certification Contract

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.

3. Fund Management

deposit and withdraw: The owner can deposit native currency into the contract to ensure funds are available for redemption or withdraw any unused funds.

Immediate Payment: During voucher redemption, the contract directly transfers the corresponding native currency amount to the merchant, ensuring transparent and instant fund movement.

4. Frontend-Backend Interaction

Frontend Application: Built with Next.js, the application uses RainbowKit and wagmi to enable wallet connection and blockchain interaction. The main modules include:

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.

How it's made

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.

Prizes

  • Celo · Celo L2 Pool Prize · Celo L2 Pool Prize

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

Aura

Unlock diamond liquidity via fractionalized RWA lending with fixed-income bond-like notes.