Foundry – How to Sign Messages Using Foundry

forgefoundry

The current documentation includes a way to sign messages; however, it returns (v, r, s) values. How to construct a signature from these values?

Best Answer

To construct signatures from (v,r,s), you can use:

bytes memory test = abi.encodePacked(r, s, v);
console.logBytes(test);