Get the code of the specified address on the chain
transfer:
web3.eth.getCode(addressHexString [, defaultBlock] [, callback])
parameter:
addressHexString
: String - The address of the code to get.defaultBlock
: Number|String - (optional) If no parameter is passed, the block defined by web3.eth.defaultBlock is used by default, otherwise the specified block is used.callback
: Function - callback function, used to support asynchronous execution.
return value:
String
- The compiled byte code of the contract at the given address.
Example:
var code = web3.eth.getCode("0xd5677cf67b5aa051bb40496e68ad359eb97cfbf8");
console.log(code);
//"0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056"
Tutorial recommendation: