Skip to content
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

fix: bulk fund wallets with massive amount #363

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

SakuBoyz
Copy link
Contributor

@SakuBoyz SakuBoyz commented Sep 4, 2024

Description

Rearranged the code to generate wallets before deploying the Funder contract. The contract is now funded based on the number of wallets generated. The total fund amount is calculated by multiplying the per-wallet funding amount by the number of addresses. This ensures the contract has enough Ether to fund all generated wallets.

Testing

Now we can bulk funding wallets more than 1_000 ETH
Screenshot 2567-09-04 at 12 28 35

Copy link
Member

@leovct leovct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the fix

without the fix: the Funder contract balance is hardcoded to 1000 ETH while it requires 100 000 ETH to fund all the wallets so the call reverts.

$ polycli fund -a 100 -n 1000 --verbosity 500                                                                                                                                                
10:50AM INF Starting bulk funding wallets
10:50AM INF Deriving wallets from the default mnemonic
10:51AM INF Wallet(s) derived count=1000
10:51AM ERR Unable to bulk fund wallets error="execution reverted: revert: Insufficient contract balance for batch funding"
Error: execution reverted: revert: Insufficient contract balance for batch funding

with the fix: the Funder contract is funded with just the right amount of ETH to fund all the wallets.

$ polycli fund -a 100 -n 1000 --verbosity 500    
10:58AM INF Starting bulk funding wallets
10:58AM INF Deriving wallets from the default mnemonic
10:58AM INF Wallet(s) derived count=1000
10:58AM INF Wallet(s) funded! 💸
10:58AM INF Total execution time: 15.65114975s
$ cast balance --ether 0x7f8a0234423b6079e4d68326c24ca1514c27a2d7
0.000000000000000000

@leovct leovct enabled auto-merge (squash) September 5, 2024 08:57
@leovct leovct merged commit d91bae0 into 0xPolygon:main Sep 5, 2024
5 checks passed
@SakuBoyz SakuBoyz deleted the fix/fund-massive-amount branch September 6, 2024 15:24
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