https://github.com/peopay/peopay-core
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.
https://github.com/peopay/peopay-core
defi evm-chains mobile-money p2p polygon solidity stacking web3
Last synced: 10 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/peopay/peopay-core
- Owner: PeoPay
- License: gpl-3.0
- Created: 2024-12-11T03:24:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-30T12:04:25.000Z (about 1 year ago)
- Last Synced: 2025-03-30T21:22:52.414Z (11 months ago)
- Topics: defi, evm-chains, mobile-money, p2p, polygon, solidity, stacking, web3
- Language: Solidity
- Homepage: https://peopay.io/
- Size: 2.04 MB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Audit: audits/SELF-AUDIT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# PeoPay-Core
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://docs.peopay.io/)
[](https://peopay.io/)
[](https://polygon.technology/)
[](https://eips.ethereum.org/EIPS/eip-20)
[](https://book.getfoundry.sh/)
[](https://openzeppelin.com/contracts/)
[](https://polygonscan.com/)
## Amoy Testnet Contracts
| Contract | Address | Description |
|------------|--------------------------------------------|--------------------------------------------------------------------|
| PeoCoin | [0x7d66d92a1cba3d8775890a6815eb17f45efdb2e1](https://www.oklink.com/amoy/token/0x7d66d92a1cba3d8775890a6815eb17f45efdb2e1) | Test deployment of PEO token on the Amoy Testnet. |
| Staking | [0x122B9bE8de0e9288C1c8201378086D04b4FFD265](0x122B9bE8de0e9288C1c8201378086D04b4FFD265) | Test deployment of Staking contract on the Amoy Testnet. |
| DCS | [0x26EeB0c59277D00df23204b86A9C5beE4E9c3DA7](https://www.oklink.com/amoy/address/0x26eeb0c59277d00df23204b86a9c5bee4e9c3da7) | Test deployment of Dynamic Contribution Scoring on the Amoy Testnet. |
**PeoPay-Core** is the foundational repository for the [PeoPay](https://peopay.io/) 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](https://docs.peopay.io/).
---
## 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
```plaintext
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:
```bash
curl -L https://foundry.paradigm.xyz | bash
foundryup
```
- **A Test Network & Provider:** Use [Infura](https://infura.io/) or [Alchemy](https://www.alchemy.com/) for RPC endpoints.
---
## Environment Setup
1. Clone the repository:
```bash
git clone https://github.com/PeoPay/PeoPay-Core.git
cd PeoPay-Core
```
2. Install dependencies:
```bash
forge install
```
3. Configure the `.env` file for deployment:
```bash
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:
```bash
forge build
```
### Run Tests
Run the provided test suite using Foundry:
```bash
forge test
```
### Advanced Testing
- **Gas Usage Analysis**:
```bash
forge test --gas-report
```
- **Verbose Output**:
```bash
forge test -vvv
```
---
## Deployment
Deploy contracts using Foundry scripts. Update `script/*.s.sol` files with deployment parameters and run:
```bash
forge script script/DeployPeoCoin.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast
```
To verify the deployed contracts on Etherscan:
```bash
forge verify-contract --chain-id --compiler-version --etherscan-api-key $ETHERSCAN_API_KEY
```
---
## Code Coverage
Generate a coverage report using `forge coverage`:
```bash
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
- **Website:** [peopay.io](https://peopay.io/)
- **Documentation:** [docs.peopay.io](https://docs.peopay.io/)
---
## Contact &
- Open an issue for support or feature requests.