You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to reproduce a signature that a contract verifies but I'm unable to do it on web3py. To verify I'm producing a signature correctly I'm going to look at an already produced signature and verify that the address is correct. First here's my code:
The output is 0x784aD8676Ade4DEE288fd3f36e2F2EbDfdF70765 but should be 0xf7FA3C8C9Ba3FfCFA1d5f0ca5C9294Afd5970aE7
This is the contract and specifically, I'm looking at newTicket function. Specifically if you look at the code here, LotteryMaster.sol#126you can see this is being done in solidity:
keccak256(
abi.encodePacked(to, txHashes.length, block.chainid, sessionIdx))
); // include session index so the signature only affect only for this session
require(isValidSignature(toAddressHash, _signature), "Mismatch signature.");
If you look at this successful transaction here it has the full signature. Now I want to be able to recover the address like they do in the code. But for that I need to hash the message correctly. If you look at their code you can determine the message parameters by looking at the transaction itself, and so should be able to create the hash that would return the address using the signature. But I can't seem to do that. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
We try to steer usage questions away from here so please re-raise the issue more specifically if you have debugged and believe there is an issue with the library. Best of luck.
pip freeze
outputWhat was wrong?
I'm trying to reproduce a signature that a contract verifies but I'm unable to do it on web3py. To verify I'm producing a signature correctly I'm going to look at an already produced signature and verify that the address is correct. First here's my code:
The output is
0x784aD8676Ade4DEE288fd3f36e2F2EbDfdF70765
but should be0xf7FA3C8C9Ba3FfCFA1d5f0ca5C9294Afd5970aE7
This is the contract and specifically, I'm looking at
newTicket
function. Specifically if you look at the code here,LotteryMaster.sol#126
you can see this is being done in solidity:If you look at this successful transaction here it has the full signature. Now I want to be able to recover the address like they do in the code. But for that I need to hash the message correctly. If you look at their code you can determine the message parameters by looking at the transaction itself, and so should be able to create the hash that would return the address using the signature. But I can't seem to do that. What am I doing wrong?
The text was updated successfully, but these errors were encountered: