smart-contracts icon indicating copy to clipboard operation
smart-contracts copied to clipboard

getExpectedRateAfterFee with empty hint returns an exception

Open Samboy76 opened this issue 2 years ago • 0 comments

Hello, when passing in an empty converted bytes array or empty string value in javascript into getExpectedRateAfterFee

const expectedRate = await kyber.functions.getExpectedRateAfterFee(
                                          srcToken.address,
                                          destToken.address, 
                                          querySrcAmount,
                                          bps,
                                          "" // empty hints

  );

or equally attempted to do the same from within solidity contract:

uint expectedRate = kyber.getExpectedRateAfterFee(ERC20(srcTokenAddress), ERC20(destTokenAddress), querySrcAmount, bps, bytes(""));

both of which returns the below same error message:

Failure message: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ](method="getExpectedRateAfterFee(address,address,uint256,uint256)", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)

Any ideas please?

Samboy76 avatar Nov 09 '22 11:11 Samboy76