Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.37 KB

File metadata and controls

36 lines (27 loc) · 1.37 KB

OpenZeppelin v5.0.2 TransparentUpgradeableProxy.

Use with Foundry: Deploy and Upgrade contract.

Install

$ forge install

Test

$ forge test -vvvv

Description

Old version TransparentUpgradeableProxy on deploy and upgrade you was be must took in advance deploy ProxyAdmin but on new version it's chanded. And now, you must specify in TransparentUpgradeableProxy initialOwner and inside the proxy will deploy ProxyAdmin. It is not possible to get the address of a simple call from the contract, this creates problems in testing and other functionality.

We have several various:

  • Change visibility function getAdmin() contract TransparentUpgradeableProxy what not true.
  • Get b><ProxyAdmin address from events and logs. We can use.
    vm.recordLogs();
    ...............
    ...............
    Vm.Log[] memory entries = vm.getRecordedLogs();

Get ProxyAdmin address from Logs foundry and array entries.

Simple contract: Counter.sol

Script deploy contract: Counter.s.sol

Tests contract: Counter.t.sol