eth_getCode
Returns the bytecode of a smart contract at a given address.
Params
Address
:string
. The address of the storage.BlockNumber
:string
(optional). The block number to get the storage at. If omitted, the latest block is used.
Result
Returns a Promise that resolves with a string containing the bytecode of the smart contract at the given address.
Example
const storage = await provider.request({
method: 'eth_getCode',
params: [
'0x...',
'latest'
]
});
console.log(storage); // ['0x...']