I'm interested in looking at the code in instances of the Parity Multisig wallet attacks, but the contracts have self-destructed. How can I get ahold of the exact bytecode that was executed in a given transaction once the contract has self-destructed?
1 Answer
For the source code, you can check Parity's repo. To get the bytecode, do something like:
const Web3 = require("web3"); const web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/")); const deadContractAddress = "0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4"; const blockAtDestruct = 4501969; const blockBeforeDestruct = blockAtDestruct - 1; web3.eth.getCode( deadContractAddress, blockBeforeDestruct, console.log);