NewLo Point is an ERC20 point token with gradual transfer control functionality. During the initial service phase, user-to-user transfers are restricted, allowing only minting from the service operator. As the service evolves and exchanges are prepared, transfers can be gradually enabled.
The NewLo Point (NLP) Contract System is a comprehensive DeFi protocol suite that provides everything from NLP token issuance and management to multi-token exchange systems.
- Function: ERC20-compliant NLP token issuance and management
- Features:
- Upgradeable proxy pattern
- Supply adjustment through admin privileges
- Standard ERC20 functionality
- Function: Factory contract for NewLoPoint tokens
- Features:
- Creation of multiple NLP token instances
- Unified management interface
- Function: Exchange NLP to multiple tokens (ETH, USDC, USDT)
- Features:
- π‘οΈ Role-based Access Control: Granular permission management
- π° Operational Fee System: Independent operational fee configuration and management
- π Flexible Price Management: Chainlink Oracle + external price data
- β‘ Gasless Exchange: Free transactions using permit signatures
- π― Soneium Optimization: Optimized for oracle-limited environments
- Function: Batch distribution system for multiple tokens
- Features:
- Efficient batch processing
- Simultaneous distribution of multiple token types
- Gas efficiency optimization
- Function: Cross-chain escrow adapter for NLP (Soneium) to JPYC (Polygon) exchange
- Features:
- π Cross-Chain Support: Soneium β Polygon bridge functionality
- π Backend-Controlled: All operations executed by OPERATOR_ROLE
- β‘ Gasless Transactions: EIP-2612 permit-based approvals
- πΌ Escrow Management: User-specific NLP escrow tracking
- π° Flexible Fee System: Configurable exchange and operational fees
- π‘οΈ Security First: ReentrancyGuard, Pausable, AccessControl
- π Transparent Operations: Comprehensive event logging for off-chain tracking
- Documentation: See docs/NLPToJPYCExchangeAdapter.md
| Role | Permissions | Purpose |
|---|---|---|
| DEFAULT_ADMIN_ROLE | Full permissions | Super admin |
| CONFIG_MANAGER_ROLE / CONFIG_ROLE | Configuration management | Token settings, fee configuration |
| PRICE_UPDATER_ROLE | Price updates | External price data updates |
| EMERGENCY_MANAGER_ROLE | Emergency management | Emergency stops, fund withdrawals |
| FEE_MANAGER_ROLE | Fee management | Operational fee configuration and withdrawals |
| OPERATOR_ROLE | Backend operations | Execute escrow deposits, burns, and transfers (NLPToJPYCExchangeAdapter) |
| PAUSER_ROLE | Pause control | Emergency pause functionality (NLPToJPYCExchangeAdapter) |
- Exchange Fee: Basic exchange fee
- Operational Fee: Additional fee for operational revenue
- Maximum Exchange Fee: 5% (500 basis points)
- Maximum Operational Fee: 2% (200 basis points)
// Standard exchange
exchange.exchangeNLP(TokenType.ETH, nlpAmount);
// Gasless exchange
exchange.exchangeNLPWithPermit(TokenType.ETH, nlpAmount, deadline, v, r, s, user);// Grant roles
exchange.grantRole(exchange.PRICE_UPDATER_ROLE(), updaterAddress);
// Configure operational fees
exchange.configureOperationalFee(TokenType.ETH, 50, feeRecipient, true);
// Update price data
exchange.updateExternalPrice(TokenType.ETH, 2500e18);- Reentrancy Protection: Uses ReentrancyGuard
- Access Control: Uses OpenZeppelin AccessControl
- Price Data Validation: Freshness checks and validity confirmation
- Emergency Stop: Pausable functionality for immediate stops
- Audited: Comprehensive security audit completed
- Overall Rating: A-grade (Excellent)
- Test Success Rate: 100% (34/34 tests passed)
- Slither Analysis: No critical vulnerabilities
- Soneium: Optimized for oracle-limited environments
- Ethereum: Full Chainlink Oracle support
- Other EVM-compatible chains: Flexible configuration support
- Chainlink Oracle: Automatic price fetching
- External Price Data: Manual and automatic update support
- Batch Updates: Efficient bulk price updates
newlo-point-contract/
βββ src/
β βββ NewLoPoint.sol # NLP Token
β βββ NewLoPointFactory.sol # Factory
β βββ NLPToMultiTokenExchange.sol # Multi-token exchange (Latest)
β βββ MultiTokenDistribution.sol # Distribution system
β βββ interfaces/ # Interfaces
β βββ tokens/ # Token implementations
β βββ mocks/ # Test mocks
βββ test/ # Test files
βββ script/ # Deploy scripts
βββ docs/ # Documentation
β βββ MULTI_TOKEN_EXCHANGE_GUIDE.md # Complete operation guide
β βββ SECURITY_AUDIT_REPORT.md # Security audit report
β βββ ...
βββ README.md # This file
# Clone the repository
git clone <repository-url>
cd newlo-point-contract
# Install dependencies
forge install
# Run tests
forge test# Set environment variables
export PRIVATE_KEY="your-private-key"
# Deploy to local environment
forge script script/DeployMultiTokenExchange.s.sol:DeployMultiTokenExchangeLocal \
--rpc-url http://localhost:8545 \
--private-key $PRIVATE_KEY \
--broadcast# Deploy to Soneium environment
forge script script/DeployMultiTokenExchange.s.sol:DeployMultiTokenExchange \
--rpc-url https://rpc.soneium.org \
--private-key $PRIVATE_KEY \
--broadcast- πContract Addresses: Deployed contracts
- Multi-Token Exchange System Complete Guide: Comprehensive operation procedures
- Security Audit Report: Detailed audit results
- Production Operations Guide: Operational considerations
- Gasless Exchange Guide: How to use permit signatures
- Distribution System Guide: Efficient distribution methods
- Local Development Guide: Development environment setup
# Run all tests
forge test
# Run tests with verbose output
forge test -vv
# Run specific tests
forge test --match-contract NLPToMultiTokenExchangeTest
# Check coverage
forge coverage- Test Success Rate: 100% (34/34 tests passed)
- Coverage: High-level code coverage
- Test Categories:
- Basic functionality tests
- Security tests
- Error handling tests
- Integration tests
- Fuzz tests
- β Role-based Access Control implementation
- β Operational fee system addition
- β Security enhancements
- β 34 test items completed
- β Comprehensive security audit completed
- β Basic multi-token exchange functionality
- β Chainlink Oracle support
- β Gasless exchange functionality
- β NewLo Point token
- β NLP distribution functionality
- Fork and create pull requests
- Add/update tests
- Report security vulnerabilities
- Improve documentation
- Report bugs via GitHub Issues
- Contact directly for security-related issues
MIT License - See LICENSE for details
- Official Website: NewLo Official
- Official Quest Site: NewLo Quest
- Documentation: Docs
NewLo Point Contract System - Next-generation DeFi protocol suite π