Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7961

How to construct input of solidity program that is fed into solana rbpf?

$
0
0

Get hello_sol.so

anchor init hello --solidityanchor build

hello_sol.sol

@program_id("F1ipperKF9EfD821ZbbYjS319LXYiBmjhzkkf5a26rC")contract hello_sol {    bool private value = true;    @payer(payer)    constructor(address payer) {        print("Hello, World!");    }    /// A message that can be called on instantiated contracts.    /// This one flips the value of the stored `bool` from `true`    /// to `false` and vice versa.    function flip() public {            value = !value;    }    /// Simply returns the current value of our `bool`.    function get() public view returns (bool) {            return value;    }}

Construct input

The input is the encoding of the function flip

5B3vFwFHgDL

Run in rbpf

./rbpf/cli/target/debug/rbpf_cli -u jit --mem 9999999999 --input ./solidity/sol/input --elf ./solidity/sol/hello_sol.so --trace
mem: [53, 66, 51, 118, 70, 119, 70, 72, 103, 68, 76]Result: Err(AccessViolation(Load, 17179869200, 1, "input"))Instruction Count: 46Trace:

Viewing all articles
Browse latest Browse all 7961

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>