npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@europeum-ebsi/beacon-proxy-contract

v1.0.0-rc.3

Published

Europeum EBSI Beacon Proxy smart contract

Readme

Beacon Proxy

OpenZeppelin-based beacon and beacon proxy contracts with optional versioning and opt-in upgrades.

Contracts

Classic (single implementation)

  • UpgradeableBeaconExtended – Extends OZ UpgradeableBeacon with implementationVersion and ImplementationUpgraded(..., newVersion) event.
  • BeaconProxyExtended – Extends OZ BeaconProxy with beaconAddress() and implementationAddress() view functions.

Versioned / opt-in (Safe-like)

Proxies pin a version and resolve implementation as beacon.implementation(version). The beacon publishes new versions; each proxy opts in via upgradeToVersion(newVersion) (proxy owner only).

  • VersionedUpgradeableBeacon

    • Stores one Version record per version: mapping(uint64 => Version) where Version { address implementation; bool isBreakingChange; bool deprecated; bytes32 storageLayoutHash; }. The constructor validates version 1 the same way addVersion validates later versions: non-zero implementation with deployed code, and a non-zero storage-layout hash.
    • Views: latestVersion(), implementation(version), isVersionAvailable(version), getVersion(version) (full Version record), getVersions(), getVersionsCompatibility(fromVersion, toVersion).
    • Admin: addVersion(version, implementation, storageLayoutHash, isBreakingChange) (version must be strictly greater than latestVersion; implementation must be a deployed contract — reverts with ImplementationNotContract otherwise; storageLayoutHash must be non-zero; reverts with StorageLayoutUnchanged if isBreakingChange is true but storageLayoutHash equals the current latest version's — an unchanged layout can't be a breaking change), deprecateVersion(version) (reverts with VersionAlreadyDeprecated if already deprecated — a no-op call that would otherwise re-emit VersionDeprecated).
    • Upgrade: upgradeProxyToVersion(proxy, version, safeUpgrade) (proxy owner only). Reverts with SameVersion if version equals the proxy's current version — a same-value write that would otherwise re-emit ProxyUpgraded. When safeUpgrade is true, the call also reverts (UnsafeUpgrade) unless getVersionsCompatibility(currentVersion, version) is true.
    • Ownership: transferProxyOwnership(proxy, newOwner) (proxy owner only) reverts with SameOwner if newOwner is already the current owner — a same-value write that would otherwise re-emit ProxyOwnerChanged.
    • Compatibility: getVersionsCompatibility(fromVersion, toVersion) only inspects the boundary version being moved onto — the target when upgrading (toVersion > fromVersion), the source when downgrading (toVersion < fromVersion) — not every version in between. A version's isBreakingChange flag already captures its diff against its own predecessor, so this is sufficient without walking the range.
    • Events: VersionAdded(version, implementation, storageLayoutHash, isBreakingChange), VersionDeprecated(version).
  • VersionedBeaconProxy

    • Storage: beacon (ERC-1967 slot), pinned uint64 version, proxy owner.
    • Views: beacon(), version(), proxyOwner().
    • Actions: upgradeToVersion(newVersion) (only proxy owner), transferProxyOwnership(newOwner).
    • Events: ProxyUpgraded(oldVersion, newVersion, newImplementation), ProxyOwnerChanged(oldOwner, newOwner).

Versioned flow

  1. Beacon admin publishes a new implementation: beacon.addVersion(v, impl, storageLayoutHash, isBreakingChange).
  2. Proxies see beacon.latestVersion() and beacon.implementation(version).
  3. Proxy owner chooses when to upgrade: beacon.upgradeProxyToVersion(proxy, targetVersion, safeUpgrade).

This allows staged rollouts, per-tenant governance, and adoption only after verification.

Usage

// Deploy versioned beacon with initial implementation (version 1) and its storage-layout hash
VersionedUpgradeableBeacon beacon = new VersionedUpgradeableBeacon(owner, implV1, hashV1);

// Add versions (beacon owner): storage-layout hash + whether the version is a breaking change
beacon.addVersion(2, implV2, hashV2, false); // non-breaking
beacon.addVersion(3, implV3, hashV3, true);  // breaking storage change

// Deploy proxy (pins the latest version at registration), with init data and owner
bytes memory initData = abi.encodeWithSelector(MockImplementation.initialize.selector, "MyName");
VersionedBeaconProxy proxy = new VersionedBeaconProxy(address(beacon), initData, proxyOwner);

// Later: proxy owner opts in to a new version. safeUpgrade=true reverts if the boundary version
// being moved onto (target when upgrading, source when downgrading) is flagged as breaking.
beacon.upgradeProxyToVersion(address(proxy), 2, true);

Tests

  • pnpm test – runs tests/versioned-beacon-proxy.spec.ts (VersionedUpgradeableBeacon / VersionedBeaconProxy). The classic contracts (UpgradeableBeaconExtended, BeaconProxyExtended) have no tests yet.