-
Notifications
You must be signed in to change notification settings - Fork 274
Value not in range: 32 #59
Comments
Can you try replacing the catch statement with catch (error, trace) {
print(error);
print(trace);
} And give me the output of the stacktrace? Thanks! |
RangeError: Value not in range: 32 |
Thank you for the report. This seems similar to #47 (comment), so a bit more information would be helpful to find the cause
|
Thanks for your detail reply! |
flutter doctor [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) ! Doctor found issues in 2 categories. |
Oh interesting! The abi from the repo you linked doesn't define a "getBalance" function, it has a "balanceOf" function instead. They both declare the same return types though, so I'm surprised that didn't work. I'll take a more detailed look later. |
Hey @simolus3 , I'm still getting this error. I checked, the function is available in the abi.json and also on the smart contract.
|
Trace:
|
@AyushBherwani1998 Can you sent me the part of the contract abi that defines the |
Here is the snippet from abi.json
|
@simolus3 Any updates on the issue? |
Sorry for the delay - unfortunately I couldn't find a bug in web3dart here. We have tests to verify that booleans are encoded and decoded correctly. Can you try attaching a logger to the http client (for instance like this) and post what the |
i got this error today with a function in the aave contract with no boolean involved only uint256 but the bug is not always here will investigate more if it reproduce |
here i got a stacktrace RangeError: Value not in range: 128
#0 _rangeCheck (dart:typed_data-patch/typed_data_patch.dart:4791:5)
#1 _ByteBuffer.asUint8List (dart:typed_data-patch/typed_data_patch.dart:1931:5)
#2 _IntTypeBase.decode (package:web3dart/src/contracts/abi/integers.dart:29:31)
#3 TupleType.decode (package:web3dart/src/contracts/abi/tuple.dart:102:29)
#4 ContractFunction.decodeReturnValues (package:web3dart/src/contracts/abi/abi.dart:257:30)
#5 Web3Client.call (package:web3dart/src/core/client.dart:314:21)
<asynchronous suspension>
#6 LendingPool.getUserAccountData (package:aave_sdk/src/contracts/lending_pool.dart:328:34)
#7 main (file:///Users/kleak/Work/github.com/no-loss-investor-wallet/aave_sdk/bin/get_health_factor.dart:26:48)
<asynchronous suspension>
#8 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12) |
in lib/src/crypto/formatting.dart when i print
so here we have a 100 element List but then in lib/src/contracts/abi/integers.dart |
i call the method Notice that not all call fail but only some of them which render the task of debugging it pretty complicated. |
Interesting. That method returns 8 |
i'm on mainnet and i can provide you an address that fail everytime. |
@simolus3 Here are the logs sending https://rinkeby.infura.io/v3/b306ccbea4ad48aa97a9xxxxxx5970 with {"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xdce881db68e093637378083611367dac5bb7ce3b","data":"0xace8a4af000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000
0000000000000000000000000000024f2b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064b69646e65790000000000000000000000000000000000000000000000000000"},"latest"],"id":1}
I/flutter ( 9100): response:
I/flutter ( 9100): {"jsonrpc":"2.0","id":1,"result":"0x"} |
Thanks a lot @AyushBherwani1998! I can reproduce this problem locally. I think this might be an infura bug: INFURA/infura#157 |
This sounds weird. The address is correct. I'm able to do transactions but not able to call functions. |
I had the same error.
|
Hey, Ive read through the comments and it doesn't seem like a resolution was found I'm experiencing a similar issue using I'd love to dive in and provide any information needed. dart funtion ran: @override
Future<void> checkUserBalance() async {
final result = await _client.call(
contract: _tokenContract,
function: _balanceOf,
params: [_ownAddress],
);
print(result);
} balanceOf definition http logs:
I'm curious, why is the |
Here is the repo if anyone is curious: https://github.com/drexel-ue/eth_swap |
I am stuck with this error. Couldnt find any solution, did anyone managed to get the solution I/flutter (20363): sending https://ropsten.infura.io/v3/78b90db8ffa14e85848a478a7a4b3e22 with {"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x6661ba2d65552ae933a7135cd8e24d05a9ecd46e","data":"0x70a082310000000000000000000000007ab70bdc3a9b8fa75ae2a6256e3c926e7730baa7"},"latest"],"id":2} |
Hey, does anyone have any links to resolution of this error? I am attempting to authenticate a challenge string and coming up with a similar error in flutter.
|
I am attempting to sign a challenge string in the following way
|
I'm experiencing this same issue (September 20, 2021) - If anyone is available to help me out with this one I'll be more than willing to reply with my source code/more details. It's been a while since somebody has been able to offer some help on the matter but let me know if there are any signs of life ahah |
This happens if the RPC endpoint replies with |
you can view the contract source at this address on the ropsten testnet: 0xA8c53a4D9e1D47A0E2ECCA6bd0334445541ce88F |
I've found the source of the error and it was related to an improper use of the Convert dart package (for decoding/encoding the json abi) rather than an error brought on by Web3dart or the implementation thereof. I adjusted this and the code worked wonderfully. Thanks as well to simolus3 for reaching out. |
Hi, I got the same error trying to call Uniswap's "addLiquidity" function.
|
Had this issue when I was trying to use a contract that was not deployed on the network. Maybe that could help. |
@John1Fazio can you please share the code that you adjusted? |
Hey @simolus3 Is there any update on the issue? I am still facing it |
It's been a while since this issue, so I'm foggy on the details. Following this code, you should be able to connect to Web3Dart and call functions on your smart contract. The private key and my infura key are omitted for obvious reasons. Let me know if this is even helpful. If not, I may be able to share more code.
|
I experienced this but managed to solve it by changing to Injected Web3 Environment.. |
When I call your contract dart in example and it happend a error: Value not in range: 32
this is my code:
The text was updated successfully, but these errors were encountered: