Skip to content

Description and example use TransparentUpgradeableProxy from OpenZeppelin v.5.0.2

License

Notifications You must be signed in to change notification settings

markgenuine/TransparentUpgradeableProxy_5_0_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Description and example use TransparentUpgradeableProxy from OpenZeppelin v.5.0.2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published