MoniPayRouter
The core smart contract of the MoniPay protocol.
The MoniPayRouter is the central hub of the MoniPay protocol. It is responsible for processing all payments, verifying signatures, and distributing fees.
Core Functions
executePayment
The primary function used by relayers to submit a gasless payment.
- Parameters: Sender address, recipient address, amount, nonce, signature.
- Logic:
- Verifies the EIP-712 signature against the sender's address.
- Checks the nonce to prevent replay attacks.
- Transfers 99% of the amount to the recipient.
- Transfers 1% of the amount to the protocol treasury.
- Emits a
PaymentExecutedevent.
registerMoniTag
Maps a human-readable MoniTag to a wallet address.
- Parameters: MoniTag string, owner address.
- Logic: Ensures the MoniTag is unique and updates the global registry.
Security Features
- Replay Protection: Each transaction requires a unique, incrementing nonce.
- Signature Verification: Uses OpenZeppelin's
ECDSAlibrary for robust signature validation. - Access Control: Only authorized relayers can call
executePaymentto prevent spam, though the signature itself ensures only the user can authorize the movement of their funds.
Contract Addresses
| Chain | Address |
| :--- | :--- |
| Base | 0x4048...D2c0 |
| BSC | 0x55d3...983E |
| Tempo | 0xTempo...123 |
You can view the full source code and interact with the contract directly on Basescan.