I have been testing some contract that includes EIP712 signatures, with foundry.
As per this doc we need to pass the private key which is being accepted as a uint256.
(uint8 v, bytes32 r, bytes32 s) = vm.sign(ownerPrivateKey, digest);
And it is working fine as long as I am passing a uint256
and creating an address from the same uint using vm.addr
.
The problem kicks in when I have created the address from a string using makeAddr()
function, as shown in the pic below.
createActor Function:
function createActor(string memory name) internal returns (address payable) {
address payable actor = payable(makeAddr(name));
// Transfer 50 eth to every actor
vm.deal({ account: actor, newBalance: 50 ether });
// Transfer 50K PUSH Tokens for every actor
vm.prank(tokenDistributor);
pushToken.transfer(actor, 50_000 ether);
return actor;
}
What is the work around for this? What should I pass as the private key in the vm.sign
function for the addresses that have been created using makeAddr
?
Do let me know if the question was clear or if I need to add more details.