Skip to content

Add StorageSlot library and ERC1967 upgradeable proxy contracts#28

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-storage-slot-library
Draft

Add StorageSlot library and ERC1967 upgradeable proxy contracts#28
Copilot wants to merge 2 commits intomainfrom
copilot/add-storage-slot-library

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Adds the standard OpenZeppelin-style upgradeable proxy stack (originally submitted for verification at polygonscan.com on 2021-06-12) as contracts/TransparentUpgradeableProxy.sol.

Contracts added

  • StorageSlot — read/write address, bool, bytes32, uint256 at arbitrary EVM storage slots via inline assembly, avoiding storage layout collisions in upgradeable contracts
  • Address — low-level call helpers (isContract, sendValue, functionCall, functionDelegateCall, etc.)
  • IBeacon — interface for beacon proxy targets
  • ERC1967Upgrade — EIP-1967 compliant slot management for implementation, admin, and beacon addresses; includes rollback-safe _upgradeToAndCallSecure
  • Proxy — delegatecall-based fallback base
  • ERC1967Proxy — proxy backed by EIP-1967 implementation slot
  • TransparentUpgradeableProxy — admin-gated upgrade functions using the transparent proxy pattern to prevent selector clashing

Usage example

// Read/write a value at a known EIP-1967 slot
bytes32 slot = 0x360894...;
StorageSlot.getAddressSlot(slot).value = newImplementation;
address impl = StorageSlot.getAddressSlot(slot).value;

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add library for reading and writing storage slots Add StorageSlot library and ERC1967 upgradeable proxy contracts Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants