Skip to content

Commit

Permalink
fix(contract): hasEnoughGCsb should greater than 10n ** 18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Songkeys committed Dec 8, 2023
1 parent bd368fe commit defe4e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/contract/subcontracts/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,15 @@ export class BaseContract {
)
}

async #hasEnoughCsb() {
async #hasEnoughGCsb() {
const balance = await this.publicClient.readContract({
abi: erc20Abi,
functionName: 'balanceOf',
args: [this.account.address],
address: this.options.contractAddresses.gcsb,
})

return balance >= 1n
return balance >= 10n ** 18n
}

#proxyContract<T extends GetContractReturnType>(contract: T): T {
Expand All @@ -420,7 +420,7 @@ export class BaseContract {
} else if (this.options.gCsbAsGas === false) {
// do nothing
} else if (this.options.gCsbAsGas === 'asDefault') {
if (await this.#hasEnoughCsb()) {
if (await this.#hasEnoughGCsb()) {
options.gasPrice = 0n
}
}
Expand Down

0 comments on commit defe4e1

Please sign in to comment.