Skip to content

Commit

Permalink
@airswap/utils: getFullSwapERC20: handle case of zero fee transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
dmosites committed Nov 21, 2024
1 parent 6ce3c6b commit 30d18bc
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion source/batch-call/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@airswap/swap": "5.0.1",
"@airswap/swap-erc20": "5.0.1",
"@openzeppelin/contracts": "^4.8.3"
Expand Down
2 changes: 1 addition & 1 deletion source/delegate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@airswap/swap-erc20": "5.0.1"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion source/pool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@airswap/merkle": "0.0.2",
"@openzeppelin/contracts": "^4.8.3"
},
Expand Down
2 changes: 1 addition & 1 deletion source/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@openzeppelin/contracts": "^4.8.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion source/staking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@openzeppelin/contracts": "^4.8.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion source/swap-erc20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@airswap/staking": "5.0.1",
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"solady": "0.0.173"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion source/swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"ethers": "^5.7.2"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@nomicfoundation/hardhat-network-helpers": "^1.0.7",
"@openzeppelin/contracts": "^4.8.3"
},
Expand Down
2 changes: 1 addition & 1 deletion source/wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"owners": "hardhat run ./scripts/owner.js"
},
"devDependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@airswap/swap-erc20": "5.0.1",
"@openzeppelin/contracts": "^4.8.3",
"@uniswap/v2-periphery": "^1.1.0-beta.0"
Expand Down
4 changes: 2 additions & 2 deletions tools/libraries/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/libraries",
"version": "5.0.2",
"version": "5.0.3",
"description": "AirSwap: Libraries for Developers",
"repository": {
"type": "git",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@airswap/staking": "5.0.1",
"@airswap/swap": "5.0.1",
"@airswap/swap-erc20": "5.0.1",
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"@airswap/wrapper": "5.0.1",
"browser-or-node": "^2.1.1",
"ethers": "^5.7.2",
Expand Down
4 changes: 2 additions & 2 deletions tools/stores/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/stores",
"version": "5.0.0",
"version": "5.0.1",
"description": "AirSwap: Storage for Indexing",
"repository": {
"type": "git",
Expand All @@ -22,7 +22,7 @@
"test": "REDISCLOUD_URL=redis://localhost:6379 TS_NODE_COMPILER_OPTIONS='{\"strict\":false}' yarn mocha -r ts-node/esm test/*.ts"
},
"dependencies": {
"@airswap/utils": "5.0.1",
"@airswap/utils": "5.0.2",
"redis": "^4.6.13"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tools/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/utils",
"version": "5.0.1",
"version": "5.0.2",
"description": "AirSwap: Utilities for Developers",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions tools/utils/src/swap-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export const getFullSwapERC20FromTransfers = (
}

if (!signerTransfer || !senderTransfer) {
throw new Error('getFullSwapERC20: Either signer or sender not found')
throw new Error('getFullSwapERC20: mutual transfers not found')
}

return {
Expand All @@ -393,7 +393,7 @@ export const getFullSwapERC20FromTransfers = (
senderWallet: senderTransfer.from,
senderToken: senderTransfer.token,
senderAmount: senderTransfer.amount.toString(),
feeAmount: feeTransfer.amount.toString(),
feeAmount: (feeTransfer?.amount || 0).toString(),
}
}

Expand Down

0 comments on commit 30d18bc

Please sign in to comment.