Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling vm.rpc reverts for no reason #8287

Closed
1 of 2 tasks
zgorizzo69 opened this issue Jun 28, 2024 · 0 comments · Fixed by #8288
Closed
1 of 2 tasks

calling vm.rpc reverts for no reason #8287

zgorizzo69 opened this issue Jun 28, 2024 · 0 comments · Fixed by #8288
Labels
T-bug Type: bug

Comments

@zgorizzo69
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (c4a984f 2024-06-28T00:18:36.573705176Z)

What command(s) is the bug in?

vm.rpc

Operating System

Linux

Describe the bug

I am calling a tenderly virtual testnet admin rpc end point with a simple script

// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.20;

import {Script} from "forge-std/Script.sol";

contract RPCScript is Script {
    function run() public virtual {
        try vm.rpc(
            "tenderly_setErc20Balance",
            "[\"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\"0x40BdB4497614bAe1A67061EE20AAdE3c2067AC9e\",\"0xDE0B6B3A7640000\"]"
        ) {} catch {}
    }
}

I get this output
image
however in tenderly the rpc call is a success
moreover when I curl the rpc command it succeeds and the return code is correct:

curl --request POST \
     --url https://virtual.mainnet.rpc.tenderly.co/YOUR_VIRTUAL_TESTNET --header 'accept: application/json' \ 
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tenderly_setErc20Balance",
  "params": [
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "0x40BdB4497614bAe1A67061EE20AAdE3c2067AC9e",
    "0xDE0B6B3A7640000"
  ]
}
'
{"id":1,"jsonrpc":"2.0","result":"0x767762eb06369761cde6a5086c15dff74d8bc9f175863bb8757ccec01113b228"}%   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant