Skip to content

Commit

Permalink
Removed getNonceUsedERC20 function
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcontrart committed Jan 13, 2024
1 parent 7f041c4 commit e80a895
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
24 changes: 0 additions & 24 deletions source/batch-call/contracts/BatchCall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -258,28 +258,4 @@ contract BatchCall {
}
return nonceUsed;
}

/**
* @notice Check if the nonce for an array of order has been already used or not
* @dev return array and will fail if large token arrays are inputted
* @dev Returns an array of bool
* @param signerWallets[] list of wallets associated with the nonces to be checked
* * @param nonces[] list of nonces to be checked
* @return bool[] nonce validity
*/

function getNonceUsedERC20(
address[] calldata signerWallets,
uint256[] calldata nonces,
ISwapERC20 swapERC20Contract
) external view returns (bool[] memory) {
require(signerWallets.length > 0);
require(signerWallets.length == nonces.length);
bool[] memory nonceUsed = new bool[](signerWallets.length);

for (uint256 i = 0; i < signerWallets.length; i++) {
nonceUsed[i] = swapERC20Contract.nonceUsed(signerWallets[i], nonces[i]);
}
return nonceUsed;
}
}
4 changes: 2 additions & 2 deletions source/batch-call/test/BatchCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('BatchCall Integration', () => {
]
const orderValidities = await batchCall
.connect(sender)
.getNonceUsedERC20(
.getNonceUsed(
[signer.address, signer.address, signer.address],
[ERC20orders[0].nonce, ERC20orders[1].nonce, ERC20orders[2].nonce],
swapERC20.address
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('BatchCall Integration', () => {
)
const orderValidities = await batchCall
.connect(sender)
.getNonceUsedERC20(
.getNonceUsed(
[signer.address, signer.address, signer.address],
[usedNonce, usedNonce, unusedNonce],
swapERC20.address
Expand Down

0 comments on commit e80a895

Please sign in to comment.