Skip to content

Smart contracts for Pantra non-custodial savings wallet App

License

Notifications You must be signed in to change notification settings

Tee-py/pantra-contracts

Repository files navigation

Pantra Contracts

Pantra Contracts is a set of Lightlink smart contracts designed to provide users with a savings wallet that accumulates ETH on every transaction. These contracts powers the Pantra Smart Wallet mobile App. The contracts consists of three main components: PantraSavingWallet, PantraWalletFactory, and PantraSmartWalletNFT. The Enterprise mode has been enabled for the PantraWalletFactory and PantraSmartWalletNFT contracts to allow for gassless wallet creation and NFT minting.

Contract Architecture

Pantra Contracts Architecture

1. PantraSavingWallet

  • PantraSavingWallet is the core contract responsible for storing ETH and managing user deposits and withdrawals.
  • Users can reset withdrawal intervals DAILY, WEEKLY, or MONTHLY.
  • Early withdrawals attracts a 1% fee.

2. PantraWalletFactory

  • PantraWalletFactory is responsible for PantraSavingWallet creation for each user.
  • Users interacts with the PantraSavingWallet contract through the PantraWalletFactory.
  • Pegasus Deployment

3. PantraSmartWalletNFT

  • PantraSmartWalletNFT is an NFT (Non-Fungible Token) that gets minted by the PantraWalletFactory on the user's first deposit into the savings wallet.
  • The NFT returns a tokenURI which contains an SVG representation of the user's wallet address and wallet balance from the associated PantraSavingWallet.
  • Pegasus Deployment

Deployment Addresses

1. PantraWalletFactory

2. PantraWalletNFT

Development

Prerequisites

  • Node.js installed on your machine
  • Hardhat installation Link here

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd pantra-contracts
  2. Install dependencies:

    npm install

Testing

Run Hardhat Tests:

npx hardhat test

Deployment

Deploy contracts to a network (e.g., Lightlink Phoenix, Lightlink Pegasus):

  1. Create a .env file with the contents
PEGASUS_TESTNET_RPC_URL="https://replicator.pegasus.lightlink.io/rpc/v1"
PHEONIX_MAINNET_RPC_URL="https://replicator.phoenix.lightlink.io/rpc/v1"
PRIVATE_KEY=<PRIVATE_KEY OF THE CONTRACT DEPLOYER>
  1. Lightlink Testnet deployment
npx hardhat run scripts/deploy.ts --network testnet
  1. Lightlink Mainnet deployment
npx hardhat run scripts/deploy.ts --network mainnet

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Smart contracts for Pantra non-custodial savings wallet App

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published