Skip to content

a2nfinance/funpay_fsc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

FunPay is an application designed for users to make payments, investments, and disbursements using cryptocurrencies. The application is deployed on the FON Smart Chain platform.

To test this app, you'll need to install the Metamask wallet and exchange FON or any token on Hieswap

Demo: FunPay dApp

Smart Contract: FunPay Smart Contract

Features

  • Deposit.
  • Create batch recurring payments.
  • Create batch onetime payments.
  • Manage Address book.
  • Create invoice.
  • Withdraw
  • Cancel payment.
  • Transfer payment.
  • Pay invoice.
  • Cancel/Reject/Pause/Active invoice.
  • Show user's sent payments.
  • Show user's received payments.
  • View all invoices.
  • Upload .csv.
  • Manage user permissions for payments.
  • Reports & Statistics.
  • Pause payment.
  • Create invoice with recurring payement options.
  • Payment SDK.

Architecture

  • Frontend (UI/UX): use NextJS and Chakra UI framework.
  • Offchain DB: use Mongo DB.
  • Smart contract interaction: use EthersJS to send transactions.
  • Wallet Connector: use Metamask API to connect wallet.

We use Solidity and Hardhat to develop smart contracts. For the front-end development, we use NextJS and EthersJS.

Prerequisites

To understand source code, you should have basic knowlege of:

  • FON smart chain mainnet.
  • Solidity
  • Hardhat
  • NodeJS
  • React
  • Next JS
  • Wagmi
  • Linux commands.

Installation steps

Step 1: Install Dev environment

  • Install NodeJS (16+)
  • Install VisualCode studio.
  • Install Solidity & Hardhat addons for VisualCode.

Step 2: Install libraries

  • Go to each folder
    • cd frontend -> npm i
    • cd contracts -> npm i

Step 3: Deploy smart contracts

Go to folder: cd contracts

  • Deploy contracts:
    • Use: npx hardhat deploy-contract --network fsc --show-stack-traces
  • Verify contracts:
    • Use: npx hardhat verify --network fsc {contract address}
  • To test smart contracts
    • Use npx hardhat test.

Step 4: Setup .env

Setup ENV file in each folder: Frontend, Contracts.

  • cp .env.example .env and change variable values.

Commands to start

  • To run Backend and Frontend applications in Production mode, use this command: npm run build and pm2 run npm --name "your app name" -- run start

Contribution

We welcome any ideas or suggestions to help us make FunPay better. Please do not hesitate to contact us via email at levi@a2n.finance.

License

This package is released under the BSL 1.1 License.