refactor!: remove token suffix - #356
Merged
zguesmi merged 9 commits intoSep 3, 2026
Merged
Conversation
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.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Le-Caignec
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
contracts/IexecInterfaceToken.sol=>contracts/IexecInterface.solcontracts/facets/IexecEscrowTokenFacet.sol=>contracts/facets/IexecEscrowFacet.solcontracts/interfaces/IexecEscrowToken.sol=>contracts/interfaces/IexecEscrow.sol