Skip to main content
Immutable LogoImmutable Logo
Learn
Build
  • Unity
  • Unreal
  • Typescript
Reference
Tools
  • Overview
  • Immutable zkEVM Faucet
  • Network Status
Blog
v2
  • v2
  • v1
Immutable Hub
Reference Docs
  • Unity SDK Reference
    • Passport
    • Orderbook
    • Marketplace
  • Unreal SDK Reference
    • Passport
    • Orderbook
  • Typescript SDK Reference
    • Passport
    • Orderbook
    • Minting
    • Checkout
    • Blockchain Data
    • JSON-RPC API
      • eth_requestAccounts
      • eth_sendTransaction
      • eth_accounts
      • eth_gasPrice
      • eth_getBalance
      • eth_getStorageAt
      • eth_estimateGas
      • eth_call
      • eth_blockNumber
      • eth_chainId
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getTransactionByHash
      • eth_getTransactionReceipt
      • eth_getTransactionCount
      • eth_getCode
      • eth_signTypedData_v4
      • personal_sign
    • V1 to V2 Migration Guide
    • V1 SDK Troubleshooting
  • Immutable zkEVM API
    • API Reference
    • API Keys
  • Typescript SDK Reference
  • JSON-RPC API
  • eth_getCode
Version: v2

eth_getCode

Returns the bytecode of a smart contract at a given address.

Params​

  1. Address: string. The address of the storage.
  2. 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...']
Previous
eth_getTransactionCount
Next
eth_signTypedData_v4

IMX Whitepaper • IMX Tokenomics • Block Explorer • Careers • Contact Us