Verified source code for UUPS proxy has other proxy contracts

Hello guys,

I have some doubts regarding proxy contracts, I am using UUPSUpgradeable proxy to upgrade my contract, for deployment I have used tools Remix and hardhat with deploy script.
When I am using Remix to deploy my contract it works fine , And it's deploying what I am expected to do ..
Proxy address :
When I am using harhat to deploy my contract it works little much different , its deploying some additional contract which I have not imported in my main contractProxy address :

deploy script in hardhat://async function main() {

const erc1155 = await ethers.getContractFactory("test");
const ERC1155 = await upgrades.deployProxy(erc1155);
await ERC1155.deployed();
console.log("test address:", ERC1155.address);


My questions are simple: why am I getting additional imported contracts like beconProxy.sol , UpgradeableBeacon.sol while deploying in hardhat and how to avoid them ..

Although those additional contracts appear in the verified source code, you can ignore them because they are not used by your specific proxy. For example, ERC1967Proxy does not have any dependencies (either directly or indirectly) on UpgradeableBeacon.sol.

This occurs due to a side effect of how the Hardhat Upgrades plugin currently submits source code for Etherscan verification. These different contracts are all compiled at the same time, so they all appear in the same Solc input JSON that gets submitted to Etherscan.

Issue will fix this in the plugin when it is resolved, however any previously verified contracts would still have those additional source files on Etherscan.

Thanks for your reply :v:

1 Like