Skip to content

refactor: make AddressUtils an extension trait of Address#873

Open
cats2101 wants to merge 1 commit into
OpenZeppelin:mainfrom
cats2101:refactor/address-utils-extension-trait
Open

refactor: make AddressUtils an extension trait of Address#873
cats2101 wants to merge 1 commit into
OpenZeppelin:mainfrom
cats2101:refactor/address-utils-extension-trait

Conversation

@cats2101

Copy link
Copy Markdown

Closes #791

Refactors AddressUtils from a unit struct with associated functions into an extension trait implemented on Address. This enables a more idiomatic calling pattern:

// Before
AddressUtils::function_delegate_call(context, target, data)?;
AddressUtils::verify_call_result_from_target(target, result)?;

// After
target.function_delegate_call(context, data)?;
target.verify_call_result_from_target(result)?;

All call sites in erc1967::utils, uups_upgradeable, and examples are updated. The private revert helper becomes a module-level function since it doesn't operate on an address.

All existing unit tests pass.

@netlify

netlify Bot commented Apr 16, 2026

Copy link
Copy Markdown

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit 7c07ad2
🔍 Latest deploy log https://app.netlify.com/projects/contracts-stylus/deploys/69e028c972acf20008465bf5

@0xNeshi

0xNeshi commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Hello @cats2101 , thank you for your contribution!
We're currently working on some higher priority tasks, we'll review the PR once those are handled.

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.

[Refactor]: Make AddressUtils an Extension Trait of Address

2 participants