Skip to content

Commit

Permalink
Merge pull request #101 from 1inch/feature/fix-trackReceivedTokenAndTx
Browse files Browse the repository at this point in the history
[SC-1004] Save context for getBalance in trackReceivedTokenAndTx
  • Loading branch information
ZumZoom authored Nov 21, 2023
2 parents 2b15ce7 + 012d735 commit 71f36d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1inch/solidity-utils",
"version": "3.5.0",
"version": "3.5.1",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function trackReceivedTokenAndTx<T extends unknown[]>(
) : Promise<[bigint, ContractTransactionReceipt]> {
const tokenAddress = 'address' in token ? token.address : await token.getAddress();
const isETH = tokenAddress === constants.ZERO_ADDRESS || tokenAddress === constants.EEE_ADDRESS;
const getBalance = 'balanceOf' in token ? token.balanceOf : provider.getBalance;
const getBalance = 'balanceOf' in token ? token.balanceOf.bind(token) : provider.getBalance.bind(provider);

const preBalance: bigint = await getBalance(wallet);
const txResult = await (await txPromise(...args)).wait();
Expand Down

0 comments on commit 71f36d7

Please sign in to comment.