load tests that do massive amount of trades and yield payout - #26
load tests that do massive amount of trades and yield payout#26Alisha-Reddy wants to merge 19 commits into
Conversation
Alisha-Reddy
commented
Jun 27, 2025
- Adds a large-scale integration test for the SecurityToken dividend and checkpoint flow.
- Simulates whitelisting, token issuance, random transfers, minting, burning, and dividend payouts for 1,000+ investors.
- Verifies checkpoint balances and correct dividend distribution before and after transfers.
- Includes two full dividend cycles and random investor actions to stress-test the system.
| const ltime = await latestTime(); | ||
|
|
||
| for (const investor of allInvestors) { | ||
| const tx = await I_GeneralTransferManager.connect(account_issuer).modifyKYCData( |
There was a problem hiding this comment.
The modifyKYCData should use the TradingRestrictionManager modifyKYC
…onalization-Impl into loadtest/massive-investor-checkpoints
| const ltime = await latestTime(); | ||
| const expiry = ltime + duration.days(300); | ||
|
|
||
| smallInvestors = accounts.slice(1, 901); // 900 small |
There was a problem hiding this comment.
how many is this accounts ?
There was a problem hiding this comment.
I tested with 1020 accounts. First 900 are small holders, next 100 are large holders. And the remaining 20 added later
There was a problem hiding this comment.
Is this account from hardhat ? I thought there limit was 10
There was a problem hiding this comment.
It's from Ganache, not Hardhat. We can increase the number of accounts by running ganache -a 1000
| console.log(`Verified & issued tokens to ${allInvestors.length} investors using Merkle Tree.`); | ||
| }); | ||
|
|
||
| it("Should allow existing investors to buy more tokens", async () => { |
There was a problem hiding this comment.
Investors should acquire token through buyWithUSD(STO) not through issue. This it reflect what we have in our system
| console.log(`Second dividend #${dividendIndex} created and validated`); | ||
| }); | ||
|
|
||
| it("Issuer should push full second dividend to all token holders in batches and verify correct payout distribution", async () => { |
There was a problem hiding this comment.
Can we have a test where the investors pull there dividend themselves
| const prevBalance = await I_SecurityToken.balanceOf(address); | ||
|
|
||
| await expect( | ||
| I_USDTieredSTO_Array[stoId].connect(signer).buyWithUSD( |
There was a problem hiding this comment.
Can you check there balances after the buy ?
There was a problem hiding this comment.
I did check for the balance afterward in the line expect(newBalance).to.equal(prevBalance + amount);, didn't I?
| console.log(`Dividend #${dividendIndex} created and verified`); | ||
| }); | ||
|
|
||
| it("Investors should be able to pull their own dividend", async () => { |
There was a problem hiding this comment.
Can create a test to calculate the dividend they are supposed to get and make sure it matches what they get ?
…onalization-Impl into million-investors
…onalization-Impl into loadtest/massive-investor-checkpoints
Million investors
