Web3JS Online
Viem Online
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:
The function returns a hex string representing the contract address.
Webhooks, Alerts, and a simple API.