2 different responses to seemingly similar contract calls

I am making a starknet call via CLI and an exact comparative http post call but get different responses. I know it has to do with negative numbers but not sure why the CURL command fails and the starknet cli command succeeds

StarkNET CLI → starknet call --address 0x07c74a2d7242cf5674543d2079bfea7fb6043323085c061b6a983d504df27f62 --abi ./artifacts/abis/black_scholes_contract.json --function vgvv --inputs 500000000000000000000000000 -1200000000000000000000000000 1400000000000000000000000000 -250000000000000000000000000 300000000000000000000000000 --network alpha-goerli

CURL POST → curl -d ‘{“signature”:[],“contract_address”:“0x07c74a2d7242cf5674543d2079bfea7fb6043323085c061b6a983d504df27f62”,“entry_point_selector”:“0x25c3a48516d487deeee22839b9068e007c4faad37430b7b9d30b1b1df6d78fe”,“calldata”:[“500000000000000000000000000”,"-1200000000000000000000000000",“1400000000000000000000000000”,"-250000000000000000000000000",“300000000000000000000000000”]}’ -H “Content-Type: application/json” -X POST https://alpha4.starknet.io/feeder_gateway/call_contract?blockNumber=pending

14 Likes

For the curl to work exactly like starknet cli, negative numbers should be first converted to felts like P(starknet big prime) - abs(value)

14 Likes