xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
155 stars 43 forks source link

Possible bug in u256 scheme resolution #65

Closed milancermak closed 5 months ago

milancermak commented 5 months ago

As per the book I was trying to send some ETH on Sepolia. This failed:

starkli invoke 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 transfer 0x06614f0ca97aef455365596cfcb78ca16639537423afb591a581a0ab19c5c0ea u256:1000000000000000000 --rpc https://starknet-sepolia.public.blastapi.io --keystore ./sepolia_keystore.json --account ./sepolia_cmdline.json
Enter keystore password:
Error: JSON-RPC error: code=-32602, message="Invalid params", data={"reason":"expected value at line 1 column 589"}

When I split the u256 into 1000000000000000000 0 it succeeded

starkli invoke 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 transfer 0x06614f0ca97aef455365596cfcb78ca16639537423afb591a581a0ab19c5c0ea 1000000000000000000 0 --rpc https://starknet-sepolia.public.blastapi.io/rpc/v0_6 --keystore ./sepolia_keystore.json --account ./sepolia_cmdline.json
Enter keystore password:
Invoke transaction: 0x0437cd8bd49b96d9b016964bb2eba5d1f5657f5bbf7065f6e3c072d0fd8b7d63

I'm using the latest starkli:

starkli --version

0.2.4 (7919143)
xJonathanLEI commented 5 months ago

btw you should be able to do starkli invoke eth instead of starkli invoke 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7. eth is part of the built-in address book.

Looking into the issue now.

xJonathanLEI commented 5 months ago

Actually it's because you used 2 different RPCs:

$ starkli spec-version --rpc https://starknet-sepolia.public.blastapi.io
0.5.1
$ starkli spec-version --rpc https://starknet-sepolia.public.blastapi.io/rpc/v0_6
0.6.0

Got nothing to do with u256.

xJonathanLEI commented 5 months ago

btw looks like you're using the free Blast endpoint. are you aware that free rpc vendors is a thing now? You can literally just do:

starkli invoke --network sepolia eth transfer ...

instead of supplying the RPC URL yourself. This would automatically choose the correct RPC version (0.6.0 in this case) for the network you choose.

(There are 2 free RPC vendors now: nethermind and blast. One will be randomly picked the first time you do it but you can configure it manually through profiles)

xJonathanLEI commented 5 months ago

In any case, closing this now since it turns out to have nothing to do with the issue suggested.