You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A decentralized payment infrastructure that enables merchants to accept payments in any cryptocurrency while receiving settlements in their preferred stablecoin (USDT or IDRX). Built on Lisk blockchain with treasury-based settlement architecture.
π Overview
MultiCoyn solves a critical problem in crypto payments: merchants want stable currency, but users want to pay with their preferred tokens. Our payment router acts as an intelligent intermediary that:
Accepts multi-token payments - Users can pay with ETH, USDC, USDT, DAI, WBTC, or any combination
Settles in stablecoins - Merchants always receive USDT or IDRX (Indonesian Rupiah stablecoin)
Handles overpayments - Automatic cashback in the settlement currency if user overpays
No merchant registration - Any wallet can receive payments instantly
Main payment processing contract with treasury-based settlement
TokenRegistry
Manages supported tokens and their Chainlink-compatible price feeds
SimpleNFTMarketplace
Example integration - NFT marketplace powered by PaymentRouter
β¨ Key Features
Multi-Token Payments
Pay with up to 5 different tokens in a single transaction
Combine ETH + USDC + DAI in one payment
Real-time USD value calculation via price oracles
Stablecoin Settlement
Merchants choose USDT (USD) or IDRX (Indonesian Rupiah)
Consistent settlement regardless of payment tokens
Treasury pool ensures instant liquidity
Automatic Cashback
Overpayments are automatically refunded
Cashback in settlement currency (same as merchant receives)
Minimum threshold: $0.10 USD equivalent
Fee Structure
0.3% platform fee on product price
Fee collected separately from merchant settlement
Transparent fee calculation on-chain
External Call Support
Execute arbitrary contract calls during payment
Perfect for NFT purchases, subscriptions, or service activations
Settlement tokens approved to target contract
π¦ Supported Tokens
Payment Tokens
Token
Decimals
Description
ETH/LSK
18
Native blockchain token
USDC
6
USD Coin
USDT
6
Tether USD
DAI
18
Dai Stablecoin
WBTC
8
Wrapped Bitcoin
Settlement Tokens
Token
Decimals
Description
USDT
6
Tether USD
IDRX
2
Indonesian Rupiah stablecoin
π Getting Started
Prerequisites
Node.js v18+
npm or yarn
Git
Installation
# Clone the repository
git clone https://github.com/your-repo/multicoyn-contracts.git
cd multicoyn-contracts
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your PRIVATE_KEY
Environment Variables
PRIVATE_KEY=your_wallet_private_keyREPORT_GAS=true# Optional: for gas reporting
Compile Contracts
npx hardhat compile
Run Tests
# Run all tests
npx hardhat test# Run with gas reporting
REPORT_GAS=true npx hardhat test# Run specific test file
npx hardhat test test/Lock.ts
Deploy to Lisk Sepolia (Testnet)
# Deploy all contracts
npx hardhat run scripts/deploy.ts --network liskSepolia
# Fund settlement pools
npx hardhat run scripts/fund-pools.ts --network liskSepolia
# Verify contracts on Blockscout
npx hardhat run scripts/verify-contracts.ts --network liskSepolia
Deploy to Lisk Mainnet
npx hardhat run scripts/deploy.ts --network lisk
π Contract Addresses (Lisk Sepolia Testnet)
Core Contracts
Contract
Address
PaymentRouter
0x7b3dfd5A3F3903237faC3D2de69d4c1915A09C9A
TokenRegistry
0x8515a560284AedE5D78Ff5b73f2CeCa247DCAab7
Payment Tokens
Token
Address
Native (ETH/LSK)
0x0000000000000000000000000000000000000000
USDC
0x5DD8eEF51d251a53D6368CfD79a88F3BC186514B
USDT
0xc9013AD6e74A7dC418b2e601aaCD772044E59c22
DAI
0xF84851B3A4253b74813112A5488E38E724731E2a
WBTC
0x437f0b6328892ac36E01836aBc865d16c875D291
Settlement Tokens
Token
Address
IDRX
0x5324Cd3e781cf85Cf63253138Ef6c6E84143de7B
USDT
0xc9013AD6e74A7dC418b2e601aaCD772044E59c22
NFT Marketplace
Contract
Address
MockNFT
0xd5B14514255B6a6B23930A9D779414D59aA4D64b
SimpleNFTMarketplace
0xB2f127912AD550d4b8aFb0BC78A5Ff32f24c330a
π§ Usage Examples
Basic Payment (JavaScript/Ethers.js)
const{ ethers }=require("ethers");// Connect to PaymentRouterconstpaymentRouter=newethers.Contract("0x7b3dfd5A3F3903237faC3D2de69d4c1915A09C9A",PaymentRouterABI,signer);// Pay with USDC for a $10 product, settle in IDRXconsttokens=["0x5DD8eEF51d251a53D6368CfD79a88F3BC186514B"];// USDCconstamounts=[ethers.parseUnits("10.03",6)];// $10 + 0.3% feeconstproductPriceUSD=ethers.parseUnits("10",8);// $10 in 1e8 scale// Approve USDC firstawaitusdcContract.approve(paymentRouter.address,amounts[0]);// Execute paymentconsttx=awaitpaymentRouter.pay(merchantAddress,// Merchant wallettokens,// Payment tokensamounts,// Token amountsproductPriceUSD,// Product price in USD (1e8 scale)true,// settleInIDR: true = IDRX, false = USDTethers.ZeroAddress,// No external call"0x"// No calldata);
Multi-Token Payment
// Pay with ETH + USDC for a $100 productconsttokens=[ethers.ZeroAddress,// Native ETH"0x5DD8eEF51d251a53D6368CfD79a88F3BC186514B",// USDC];constamounts=[ethers.parseEther("0.025"),// ~$50 in ETHethers.parseUnits("50.30",6),// ~$50.30 in USDC];consttx=awaitpaymentRouter.pay(merchantAddress,tokens,amounts,ethers.parseUnits("100",8),// $100 productfalse,// Settle in USDTethers.ZeroAddress,"0x",{value: amounts[0]}// Send ETH with transaction);
Payment with External Call (NFT Purchase)
// Buy NFT through marketplace using PaymentRouterconstmarketplace="0xB2f127912AD550d4b8aFb0BC78A5Ff32f24c330a";constlistingId=1;// Encode marketplace buyNFTFor functionconstcallData=marketplaceInterface.encodeFunctionData("buyNFTFor",[listingId,buyerAddress,]);consttx=awaitpaymentRouter.pay(sellerAddress,tokens,amounts,nftPriceUSD,true,// Settle in IDRXmarketplace,// Target contractcallData// Encoded function call);