Skip to content

refactor!: remove token suffix - #356

Merged
zguesmi merged 9 commits into
refactor/convert-abstract-to-librariesfrom
refactor/remove-token-suffix
Sep 3, 2026
Merged

refactor!: remove token suffix#356
zguesmi merged 9 commits into
refactor/convert-abstract-to-librariesfrom
refactor/remove-token-suffix

Conversation

@zguesmi

@zguesmi zguesmi commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • contracts/IexecInterfaceToken.sol => contracts/IexecInterface.sol
  • contracts/facets/IexecEscrowTokenFacet.sol => contracts/facets/IexecEscrowFacet.sol
  • contracts/interfaces/IexecEscrowToken.sol => contracts/interfaces/IexecEscrow.sol

The protocol has run in a single, token-based mode for a long time. The
`Token` suffix no longer distinguishes anything, so it is dropped in favour
of the naming convention the library conversion established: `Iexec*` for
interfaces, `*Base` for abstracts, `*Facet` for facets, `*Lib` for libraries.

    contracts/IexecInterfaceToken.sol       -> contracts/IexecInterface.sol
    contracts/interfaces/IexecEscrowToken.sol -> contracts/interfaces/IexecEscrow.sol
    contracts/facets/IexecEscrowTokenFacet.sol -> contracts/facets/IexecEscrowFacet.sol

The two escrow test files follow the same rename so the suite keeps matching
the contracts it exercises.

This is a breaking change for downstream consumers. `IexecInterfaceToken` is
referenced by path in the SDK and in `iexec-commons-poco`, and the published
ABI moves from `abis/contracts/IexecInterfaceToken.json` to
`abis/contracts/IexecInterface.json`. The contents of that file are byte for
byte identical to the old one; only the name and the path change. The two
hand-maintained facet lists named in the architecture notes,
`utils/proxy-tools.ts#getAllLocalFacetFunctions` and the facet groups in
`scripts/tools/sol-to-uml.mjs`, are updated alongside.

`IexecLibCore_v5` and `IexecLibOrders_v5` are deliberately left alone. Their
names leak into `config/config.json`, the link key in `deploy/0_deploy.ts`, a
hard requirement in `utils/proxy-tools.ts` and the `internalType` fields of
every ABI, so they deserve a separate change. Their rename markers stay in
place.

A note is added to the aggregate interface explaining why `IexecPocoBoost` and
`IexecPocoBoostAccessors` are still absent from it: the Boost facets are not
deployed on Arbitrum mainnet or Arbitrum Sepolia, so aggregating them would
make the SDK advertise functions that revert.
FacetBase declared the eight protocol constants, which put them out of reach
of the helper libraries. A library cannot inherit FacetBase, and a contract
constant is not readable from outside its own contract at any visibility:
solc 0.8.21 rejects `FacetBase.GROUPMEMBER_PURPOSE` from a library with
"Member not found or not visible after argument-dependent lookup", with both
internal and public visibility. CommonLib therefore carried a second, private
copy of GROUPMEMBER_PURPOSE.

A library constant carries no such restriction. ConstantsLib now holds the
single declaration of all eight, CommonLib reads
ConstantsLib.GROUPMEMBER_PURPOSE and drops its copy, and FacetBase keeps the
eight names as aliases of the library's values. The aliases matter: the 31
bare uses in the facets and the eight public getters on
IexecPocoAccessorsFacet stay exactly as they were.

Measured on solc 0.8.21 with viaIR. No ABI changes anywhere. Constant folding
survives the indirection: the deployed bytecode still holds one PUSH5 for 1e9
and one PUSH20 for the kitty address in each facet that reads them, so the
aliases fold back to the same literals. Four facets grew a little jump-offset
churn against the previous commit, IexecPoco1Facet by 8 bytes, IexecPocoBoost-
Facet by 32, IexecPoco2Facet by 40 and IexecPocoAccessorsFacet by 48. The
other eight facets are byte-identical once the trailing metadata is stripped.
The largest, IexecPocoBoostFacet, sits at 16641 of the 24576-byte limit.
The library is renamed `Constants`, and `FacetBase` no longer aliases the
eight protocol constants. Every reader now names the declaration it uses:
the four facets and `CommonLib` reach `Constants.X` directly, and `FacetBase`
is left with the owner helpers alone.

The aliases were a compatibility layer that let the facets keep their bare
names. Removing them costs 48 qualified references but leaves a single path
to each constant, so a reader no longer has to check whether a bare name
comes from the base contract, the file itself or an inherited interface.

The public getters on `IexecPocoAccessorsFacet` keep their names and their
values, so the external surface is unchanged.
@zguesmi zguesmi self-assigned this Sep 3, 2026
This undoes both steps of the constants extraction: the `ConstantsLib`
library added earlier and its rename to `Constants` with the qualified
references. `contracts/libs/Constants.sol` is removed, `FacetBase` declares
the eight constants again, the four facets read them under their bare names,
and `CommonLib` goes back to its own `GROUPMEMBER_PURPOSE` copy.

The rename markers that the extraction had deleted come back with it, so the
work can be picked up later without re-deriving the reasoning.

The external surface never moved: the getters on `IexecPocoAccessorsFacet`
keep the same names and values throughout.
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (caecad3) to head (5f00870).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           refactor/convert-abstract-to-libraries     #356   +/-   ##
=======================================================================
  Coverage                                   99.53%   99.53%           
=======================================================================
  Files                                          31       31           
  Lines                                        1069     1069           
  Branches                                      215      204   -11     
=======================================================================
  Hits                                         1064     1064           
  Misses                                          5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zguesmi
zguesmi marked this pull request as ready for review September 3, 2026 10:18
@zguesmi
zguesmi requested a review from Le-Caignec as a code owner September 3, 2026 10:18
@zguesmi zguesmi changed the title refactor: remove token suffix refactor!: remove token suffix Sep 3, 2026
@zguesmi
zguesmi merged commit 50e5542 into main Sep 3, 2026
8 checks passed
@zguesmi
zguesmi deleted the refactor/remove-token-suffix branch September 3, 2026 15:11
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