Skip to content

Commit

Permalink
hotifx: collectbounties
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed Jul 24, 2023
1 parent 8b4fce3 commit 7750716
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/wallet/GoodWalletClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,9 @@ export class GoodWallet {
async collectInviteBounties() {
const tx = this.invitesContract.methods.collectBounties()
const nativeBalance = await this.balanceOfNative()
const gas = Math.min(await tx.estimateGas(), nativeBalance / this.gasPrice - 150000) //convert to gwei and leave 150K gwei for user
if (gas < 150000) {
const gas = Math.min(2000000, nativeBalance / this.gasPrice - 150000) //convert to gwei and leave 150K gwei for user
// we need around 400k gas to collect 1 bounty, so that's the minimum
if (gas < 400000) {
log.error('collectInvites low gas:', '', '', { gas, nativeBalance })
return false
}
Expand Down

0 comments on commit 7750716

Please sign in to comment.