0

I am deploying a contract on the testnet with hardhat, but the address returned is not the real address the contract is at in the blockchain.

I am following hardhat's guide.

Code:

async function main() {
  const TokenContract = await ethers.getContractFactory("Token");
  const token = await TokenContract.deploy();
  await token.deployed();

  console.log("Token deployed to:", token.address);
}

Token deployed to: 0x684c903c66D69777377f0945052160C9f778d689

At that address, though, I see a contract that is not mine! If I look into my wallet's transaction in the explorer I can find the contract creation transaction and the real contract, here:: real address

How come?

2
  • Why do you think your deployed contract is the address you are showing on the screenshot? can you give more detail?
    – Julissa DC
    Dec 18, 2021 at 21:20
  • @JulissaDC I just checked the transactions of my address and saw that there was one about a contract generation. I followed it and I saw that that one was the generated contract. It corresponds with what I deployed. Dec 25, 2021 at 15:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.