Skip to content

PeoPay-Core is the foundational codebase of the PeoPay ecosystem, providing smart contracts for the PeoCoin (PEO) token, staking, governance, crypto-to-mobile conversion, and Dynamic Contribution Scoring (DCS), ensuring secure, transparent, and extensible decentralized functionality.

License

Notifications You must be signed in to change notification settings

PeoPay/PeoPay-Core

Repository files navigation

PeoPay-Core

License Docs Website Network: Polygon ERC-20 Standard Made with Foundry Uses OpenZeppelin Contracts Verified on Polygonscan

Amoy Testnet Contracts

Contract Address Description
PeoCoin 0x7d66d92a1cba3d8775890a6815eb17f45efdb2e1 Test deployment of PEO token on the Amoy Testnet.
Staking 0x122B9bE8de0e9288C1c8201378086D04b4FFD265 Test deployment of Staking contract on the Amoy Testnet.
DCS 0x26EeB0c59277D00df23204b86A9C5beE4E9c3DA7 Test deployment of Dynamic Contribution Scoring on the Amoy Testnet.

PeoPay-Core is the foundational repository for the PeoPay ecosystem. It contains the core smart contracts and logic for the PeoCoin token (PEO), staking, governance, conversion (crypto-to-mobile), and the Dynamic Contribution Scoring (DCS) system. These contracts form a decentralized infrastructure that supports staking rewards, governance proposals, transaction conversions, and a flexible scoring mechanism to reward active contributors.

For a detailed technical overview and developer guides, refer to the official PeoPay Documentation.


Overview

  • PeoCoin (PEO):
    An ERC-20 token serving as the primary utility token in the PeoPay ecosystem. Mintable, burnable, and managed by an owner account.

  • Staking:
    Enables users to stake PEO tokens to earn rewards over time. Includes lock periods, APY calculations, and optional tier multipliers.

  • Governance:
    Empowers PEO holders to propose and vote on ecosystem changes. Voting power is determined by DCS scores to reward active participants.

  • DCS (Dynamic Contribution Scoring):
    Computes a user’s contribution score based on PEO balance, staking duration, governance participation, and other metrics. Scores influence staking rewards and governance voting power.

  • Conversion (Crypto-to-Mobile):
    Facilitates off-chain conversion of PEO to mobile money. Users request conversions, and the backend service confirms them, enabling seamless integration with traditional financial systems.


Repository Structure

PeoPay-Core/
├── src/                          # Core contracts
│   ├── PeoCoin.sol               # PEO ERC-20 token
│   ├── Staking.sol               # Staking logic and rewards
│   ├── Governance.sol            # Governance proposals and voting
│   ├── Conversion.sol            # Crypto-to-mobile conversion logic
│   ├── DCS.sol                   # Dynamic Contribution Scoring (DCS)
│   └── interfaces/               # Interface definitions
│       ├── IPeoCoin.sol
│       ├── IDCS.sol
│       └── IStaking.sol
├── test/                         # Foundry test files
│   ├── PeoCoin.t.sol
│   ├── Staking.t.sol
│   ├── Governance.t.sol
│   ├── Conversion.t.sol
│   └── DCS.t.sol
├── script/                       # Foundry deployment scripts
│   ├── DeployPeoCoin.s.sol
│   ├── DeployStaking.s.sol
│   ├── DeployDCS.s.sol
│   ├── DeployGovernance.s.sol
│   └── DeployConversion.s.sol
├── foundry.toml                  # Foundry configuration
├── .env.example                  # Example environment variable file
├── README.md                     # This README

Prerequisites

  • Foundry: A fast, portable, and modular development framework for Ethereum.
    Install Foundry by running:

    curl -L https://foundry.paradigm.xyz | bash
    foundryup
  • A Test Network & Provider: Use Infura or Alchemy for RPC endpoints.


Environment Setup

  1. Clone the repository:

    git clone https://github.com/PeoPay/PeoPay-Core.git
    cd PeoPay-Core
  2. Install dependencies:

    forge install
  3. Configure the .env file for deployment:

    cp .env.example .env

    Fill in the following fields:

    • PRIVATE_KEY: Your wallet's private key.
    • RPC_URL: The RPC endpoint for your desired network.
    • ETHERSCAN_API_KEY: API key for contract verification (optional).

Compilation & Testing

Compile Contracts

Run the following command to compile the contracts:

forge build

Run Tests

Run the provided test suite using Foundry:

forge test

Advanced Testing

  • Gas Usage Analysis:
    forge test --gas-report
  • Verbose Output:
    forge test -vvv

Deployment

Deploy contracts using Foundry scripts. Update script/*.s.sol files with deployment parameters and run:

forge script script/DeployPeoCoin.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

To verify the deployed contracts on Etherscan:

forge verify-contract --chain-id <chain_id> --compiler-version <solc_version> <contract_address> <contract_path> --etherscan-api-key $ETHERSCAN_API_KEY

Code Coverage

Generate a coverage report using forge coverage:

forge coverage

Security & Audits

Before deploying to mainnet:

  • Conduct a third-party audit.
  • Use tools like slither and mythril for static analysis.
  • Launch a bug bounty program.

Contributing

  1. Fork the repository and create a feature branch.
  2. Write tests for new features or fixes.
  3. Submit a pull request with a detailed description.

Additional Resources


Contact &

  • Open an issue for support or feature requests.

About

PeoPay-Core is the foundational codebase of the PeoPay ecosystem, providing smart contracts for the PeoCoin (PEO) token, staking, governance, crypto-to-mobile conversion, and Dynamic Contribution Scoring (DCS), ensuring secure, transparent, and extensible decentralized functionality.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •