I am curious if it's possible to extract a signed transaction, without executing the call completely, against a certain function in a contract? The extracted signature is then saved and fully executed at a later stage.
Scenario:
Setup:
- contract 1 =
Game - contract 2 =
Impersonator - actor 1 =
Player - actor 2 =
Handler
The Game contract has a payable function called Roll:
contract Game { function roll() public payable { // roll a radom number } }
The Player wants to call the roll function but goes through the Imporsonator contract.
The Impersonator contract has a saveRollTrx payable function that saves the signed trx from Player towards the function 'roll'
contract Impersonator { function saveRollTrx() public payable { uint256 sig = gameContract.roll(); // somehow extract the signature without executing the call? } }
The Imporsonator contract would also have a second function that the Handler actor could execute with the saved signature towards the roll function on the Game contract on behalf of Player.
populateTransactionand I can then execute thesendTransaction? It doesn't have to be the user executing thesendTransactionas well? – Casper Nybroe Jun 17 '22 at 08:08