...

/

Displaying the Deployed Contract Address

Displaying the Deployed Contract Address

Learn how to display the deployed contract address.

We'll cover the following...

Showing the partnership address

The users can find the partnership contract address by looking at the Etherscan website. However, this is not the best user experience. We can show the partnership contract address after the deployment from inside our app. First, we’ll create a new state variable called deployedContractAddress:

const [deployedContractAddress, setDeployedContractAddress,] = useState("");

We’ll then update this state with the address data from the deployment receipt:

Press + to interact
on("receipt", (receipt) => {
// receipt will contain deployed contract address
console.log(receipt);
setIsDeploying(false);
setDeployedContractAddress(
receipt.contractAddress
);
});

If the ...