OpenZeppelin / openzeppelin-foundry-upgrades

Foundry library for deploying and managing upgradeable contracts
MIT License
182 stars 29 forks source link

Upgrade transaction not shown on Etherscan #37

Closed malm0d closed 7 months ago

malm0d commented 7 months ago

When upgrading the implementation contract in a TransparentUpgradeableProxy, I noticed that there's no transaction recorded on Etherscan to show that the contract is upgraded. Is this an expected behavior? My contract was successfully upgraded nonetheless but was just wondering if I'm missing something.

import {Upgrades} from "lib/openzeppelin-foundry-upgrades/src/Upgrades.sol";
...

contract UpgradeStaking is Script {

    address stakingAddress;
    Staking stakingContract;

    function run() external {
        uint256 deployerPK = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPK);

        vm.startBroadcast(deployerPK);
        console.log("Deployer Address:", deployer);

        stakingAddress = 0x557... ... ... ... 6E84;
        stakingContract = Staking(stakingAddress);

        Upgrades.upgradeProxy(stakingAddress, "Staking.sol", "");

        vm.stopBroadcast();
    }
}
ericglau commented 7 months ago

Since you are using a TransparentUpgradeableProxy, the upgrade transaction should be visible at its ProxyAdmin address on Etherscan.

You can find the ProxyAdmin address using getAdminAddress