Categories
Cryptocurrency Ethereum Mastering Development

transfer hash verification on contract side

I want to verify if message-hash has a particular contract method. Like below web3 code generates a rawTransaction having,messageHash,v, r, s, rawTransaction let rawTransaction = { ‘from’: fromAddress, ‘gasLimit’: web3js.utils.toHex(310000), ‘to’: contractAddress, ‘gasPrice’: web3js.utils.toHex(20 * 1e9), ‘value’: “0x0”, ‘data’: contract.methods.transfer(toAddress, amount).encodeABI(), ‘nonce’: web3js.utils.toHex(count), } web3js.eth.accounts.signTransaction(rawTransaction, PK); i.e if message hash from the above signed transaction […]

Categories
Cryptocurrency Ethereum Mastering Development

signing transaction in web3 is not returning msgHash

I am trying to write provble_transfer where owner can pay gas fee for the transaction. Below is the code for signing transaction to my test contact. let rawTransaction = { ‘from’: fromAddress, ‘gasPrice’: web3js.utils.toHex(20 * 1e9), ‘gasLimit’: web3js.utils.toHex(3000000), ‘to’: contractAddress, ‘value’: “0x0”, ‘data’: contract.methods.transfer(toAddress, amount).encodeABI(), ‘nonce’: web3js.utils.toHex(count), “chainId”: 4 }; let privateKey = Buffer.from(requestPrivateKey, ‘hex’); […]