getContractAddress

The getContractAddress function retrieves the contract address generated by the CREATE or CREATE2 opcode after deploying a contract to the network. It takes various parameters, including the address the contract was deployed from, the nonce of the transaction that deployed the contract, and the opcode used for deployment (defaulting to CREATE). The function returns the contract address as a hex string.

The function also has optional parameters for the bytecode and bytecode hash of the contract, which are only applicable for CREATE2 deployments. The salt parameter is also optional and can be any arbitrary value provided by the sender. Here's a summary of the parameters and their types:

  • from: Address (optional)
  • nonce: Address (optional)
  • opcode: "CREATE" | "CREATE2" (optional, default: "CREATE")
  • bytecode: ByteArray | Hex (optional, only applicable for opcode: 'CREATE2')
  • bytecodeHash: ByteArray | Hex (optional, only applicable for opcode: 'CREATE2')
  • salt: ByteArray | Hex (optional)

The function returns a hex string representing the contract address.

Opcode

Output will appear here. You can scroll the text if it becomes too long.

Tired of checking the chain? 😅

Webhooks, Alerts, and a simple API.

Join L3MBDA, it's free!