Skip to content

Feature/auto mass payouts #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

KelvinTrinhSG
Copy link

Description

Add a new example called auto-mass-payouts demonstrating how to automate ERC20 token distribution to multiple wallets on BNB Chain using Hardhat and Node.js backend.

This example includes:

  • A deployable ERC20 token contract
  • A MassPayout smart contract for batch transfers
  • A REST API built with Express.js to trigger payouts
  • A .env-based configuration system
  • Sample scripts for deployment and test runs

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • ✅ Deployed the ERC20 token contract (MyToken.sol) and the MassPayout contract to BNB Chain Testnet using Hardhat
  • ✅ Transferred ERC20 tokens from the deployer's wallet to the MassPayout contract to ensure it holds enough balance
  • ✅ Ran the run-payout.js script and also tested the /payout API endpoint through both curl and Postman, using a JSON body with recipient wallets and token amounts
  • ✅ Verified the transaction success status on https://testnet.bscscan.com using the returned tx hash
  • ✅ Confirmed that each recipient wallet correctly received the specified amount of tokens by checking balances on BSCScan
  • ✅ Repeated payout tests with different recipient/amount configurations to validate flexibility
  • ✅ Confirmed that improper input (e.g. length mismatch) triggers appropriate errors

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md)
  • My changes generate no new warnings
  • I have added tests or verified results manually on testnet
  • New and existing scripts run locally without error

@KelvinTrinhSG
Copy link
Author

✅ Successfully tested the backend payout API using Postman.

The transaction was triggered by a POST /payout request to the Express backend with a JSON body containing recipient wallet addresses and token amounts.

📄 You can verify the result here on BSC Testnet Explorer:
🔗https://testnet.bscscan.com/tx/0x70fd7d9383b1842d9d48c1da3097f8c21cac3fe3b0aec67e9cfec9399e1abd90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants