Skip to content

Conversation

zguesmi
Copy link
Member

@zguesmi zguesmi commented Jul 23, 2025

Migration steps:

  • Migrate src files (minimal changes)
  • Modify receive and fallback behavior in Diamond.sol
  • Rename all 1538 to 2535 in contracts and rename Module to Facet in contracts names
  • Update all facets to use namespaces app storage.
  • Remove ENSIntegration modules/functions
  • Update docs (soldoc, diagrams, ...)
  • Add unit tests for Diamond.sol

Important diff:

The diff between Nick Mudge's Diamond.sol and ours can be seen in this commit: Adapt Diamond contract

Arbitrum Sepolia deployment:

Proxy deployed and verified on Arbitrum Sepolia: 0x83AB1D51195894E402D0dE895e0141b2a1E4f9E8

Deployment logs:
npm run deploy -- --network arbitrumSepolia                                                                                                                                                             1 ✘ 

> @iexec/poco@5.5.0 deploy
> npx hardhat deploy --network arbitrumSepolia

Nothing to compile
No need to generate any newer typings.
Deploying PoCo..
Using existing RLC token at: 0x86934B9A25212D94fb95486FAE8518d6039f0309
RLC: 0x86934B9A25212D94fb95486FAE8518d6039f0309
→ CreateX is available on this network at 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed
Deploying at 0x69F264e0eB7da46Db1f382D8223B1664cC89A9E0
DiamondInit: 0x69F264e0eB7da46Db1f382D8223B1664cC89A9E0 
Deploying at 0x2fB0b80b54D017AA5380501Ddc9F6Abe87Ac889c
LibDiamond: 0x2fB0b80b54D017AA5380501Ddc9F6Abe87Ac889c 
Deploying at 0xfDBc8ff99Bd49abe681F7B487BC57c4e8d1379eB
DiamondCutFacet: 0xfDBc8ff99Bd49abe681F7B487BC57c4e8d1379eB 
Deploying at 0x3d20E08795ee1f86155b088F23579F7af8d8C726
DiamondLoupeFacet: 0x3d20E08795ee1f86155b088F23579F7af8d8C726 
Deploying at 0x170616e91Ba57a1eC5D8115518d033Dca33BF64b
OwnershipFacet: 0x170616e91Ba57a1eC5D8115518d033Dca33BF64b 
Deploying at 0x83AB1D51195894E402D0dE895e0141b2a1E4f9E8
Diamond: 0x83AB1D51195894E402D0dE895e0141b2a1E4f9E8 
IexecInstance found at address: 0x83AB1D51195894E402D0dE895e0141b2a1E4f9E8
[Warning] Invalid Fragment {"inputs":[{"components":[{"components":[{"internalType":"address","name":"app","type":"address"},{"internalType":"uint256","name":"appmaxprice","type":"uint256"},{"internalType":"address","name":"dataset","type":"address"},{"internalType":"uint256","name":"datasetmaxprice","type":"uint256"},{"internalType":"address","name":"workerpool","type":"address"},{"internalType":"uint256","name":"workerpoolmaxprice","type":"uint256"},{"internalType":"address","name":"requester","type":"address"},{"internalType":"uint256","name":"volume","type":"uint256"},{"internalType":"bytes32","name":"tag","type":"bytes32"},{"internalType":"uint256","name":"category","type":"uint256"},{"internalType":"uint256","name":"trust","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"callback","type":"address"},{"internalType":"string","name":"params","type":"string"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.RequestOrder","name":"order","type":"tuple"},{"internalType":"enum IexecLibOrders_v5.OrderOperationEnum","name":"operation","type":"IexecLibOrders_v5.OrderOperationEnum"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.RequestOrderOperation","name":"_requestorderoperation","type":"tuple"}],"name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}: invalid type (argument="type", value="IexecLibOrders_v5.OrderOperationEnum", code=INVALID_ARGUMENT, version=6.13.5)
[Warning] Invalid Fragment {"inputs":[{"components":[{"components":[{"internalType":"address","name":"dataset","type":"address"},{"internalType":"uint256","name":"datasetprice","type":"uint256"},{"internalType":"uint256","name":"volume","type":"uint256"},{"internalType":"bytes32","name":"tag","type":"bytes32"},{"internalType":"address","name":"apprestrict","type":"address"},{"internalType":"address","name":"workerpoolrestrict","type":"address"},{"internalType":"address","name":"requesterrestrict","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.DatasetOrder","name":"order","type":"tuple"},{"internalType":"enum IexecLibOrders_v5.OrderOperationEnum","name":"operation","type":"IexecLibOrders_v5.OrderOperationEnum"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.DatasetOrderOperation","name":"_datasetorderoperation","type":"tuple"}],"name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}: invalid type (argument="type", value="IexecLibOrders_v5.OrderOperationEnum", code=INVALID_ARGUMENT, version=6.13.5)
[Warning] Invalid Fragment {"inputs":[{"components":[{"components":[{"internalType":"address","name":"workerpool","type":"address"},{"internalType":"uint256","name":"workerpoolprice","type":"uint256"},{"internalType":"uint256","name":"volume","type":"uint256"},{"internalType":"bytes32","name":"tag","type":"bytes32"},{"internalType":"uint256","name":"category","type":"uint256"},{"internalType":"uint256","name":"trust","type":"uint256"},{"internalType":"address","name":"apprestrict","type":"address"},{"internalType":"address","name":"datasetrestrict","type":"address"},{"internalType":"address","name":"requesterrestrict","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.WorkerpoolOrder","name":"order","type":"tuple"},{"internalType":"enum IexecLibOrders_v5.OrderOperationEnum","name":"operation","type":"IexecLibOrders_v5.OrderOperationEnum"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.WorkerpoolOrderOperation","name":"_workerpoolorderoperation","type":"tuple"}],"name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}: invalid type (argument="type", value="IexecLibOrders_v5.OrderOperationEnum", code=INVALID_ARGUMENT, version=6.13.5)
[Warning] Invalid Fragment {"inputs":[{"components":[{"components":[{"internalType":"address","name":"app","type":"address"},{"internalType":"uint256","name":"appprice","type":"uint256"},{"internalType":"uint256","name":"volume","type":"uint256"},{"internalType":"bytes32","name":"tag","type":"bytes32"},{"internalType":"address","name":"datasetrestrict","type":"address"},{"internalType":"address","name":"workerpoolrestrict","type":"address"},{"internalType":"address","name":"requesterrestrict","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.AppOrder","name":"order","type":"tuple"},{"internalType":"enum IexecLibOrders_v5.OrderOperationEnum","name":"operation","type":"IexecLibOrders_v5.OrderOperationEnum"},{"internalType":"bytes","name":"sign","type":"bytes"}],"internalType":"struct IexecLibOrders_v5.AppOrderOperation","name":"_apporderoperation","type":"tuple"}],"name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}: invalid type (argument="type", value="IexecLibOrders_v5.OrderOperationEnum", code=INVALID_ARGUMENT, version=6.13.5)
Deploying at 0xCa34e763FbB1475FDb76E4Da8FbF2E7003b68E76
IexecLibOrders_v5: 0xCa34e763FbB1475FDb76E4Da8FbF2E7003b68E76  (previously deployed)
Deploying at 0x09909567D8Ae260aeF058ffd5d556145edDF1150
IexecAccessorsDelegate: 0x09909567D8Ae260aeF058ffd5d556145edDF1150 
Deploying at 0x6c75AB614259c29319Df9293477A1e8fCc3d00D5
IexecAccessorsABILegacyDelegate: 0x6c75AB614259c29319Df9293477A1e8fCc3d00D5 
Deploying at 0xc7C7d67D7A2551d7E688B0B87d1791757e4A85Ba
IexecCategoryManagerDelegate: 0xc7C7d67D7A2551d7E688B0B87d1791757e4A85Ba 
Deploying at 0x6710ADC12DAe109E20c40f187e360Ab1ED9CeDcC
IexecERC20Delegate: 0x6710ADC12DAe109E20c40f187e360Ab1ED9CeDcC 
Deploying at 0xe5B27D3691508A64f61f76FDFfFC1f9f8c5b172e
IexecEscrowTokenDelegate: 0xe5B27D3691508A64f61f76FDFfFC1f9f8c5b172e 
Deploying at 0x2F50E7e693633c4C757829A1a88EC55fcc396b50
IexecMaintenanceDelegate: 0x2F50E7e693633c4C757829A1a88EC55fcc396b50 
Deploying at 0x1746ec688D25045A18AEC635825b597Bb4efA25A
IexecOrderManagementDelegate: 0x1746ec688D25045A18AEC635825b597Bb4efA25A 
Deploying at 0x6d7197B71B375d2E54eE4274Ea0ca96Dd2E23394
IexecPoco1Delegate: 0x6d7197B71B375d2E54eE4274Ea0ca96Dd2E23394 
Deploying at 0x86513EAcaC139823D1cff7Ecc1166E150526FA85
IexecPoco2Delegate: 0x86513EAcaC139823D1cff7Ecc1166E150526FA85 
Deploying at 0x71805c1FCf7b76346946F9AD342Cd734823553E4
IexecRelayDelegate: 0x71805c1FCf7b76346946F9AD342Cd734823553E4 
Deploying at 0x3EfFfD3cD623529C60bDa131E48108278089694C
ENSIntegrationDelegate: 0x3EfFfD3cD623529C60bDa131E48108278089694C 
Deploying at 0x91B941332c15fA4Dc4F06d97a2e12131fE32aB04
IexecMaintenanceExtraDelegate: 0x91B941332c15fA4Dc4F06d97a2e12131fE32aB04 
Deploying at 0xD63A3a41537374F060E5cf8292de0385e66a62FD
IexecPocoAccessorsDelegate: 0xD63A3a41537374F060E5cf8292de0385e66a62FD 
Deploying at 0xE21334a656B912DA58603dF1711448Ef6CE9Ef6e
IexecPocoBoostDelegate: 0xE21334a656B912DA58603dF1711448Ef6CE9Ef6e 
Deploying at 0x617199968F80d45375E2f851E6B2C1e261c0AAb4
IexecPocoBoostAccessorsDelegate: 0x617199968F80d45375E2f851E6B2C1e261c0AAb4 
The deployed ERC1538Proxy now supports 100 functions:
Deploying at 0xF97528eE5E85F00b167359adE7F43672f5BE1485
AppRegistry: 0xF97528eE5E85F00b167359adE7F43672f5BE1485 
Deploying at 0xFdf03FBC06e7d42A969B88a51FFA81d34c717853
DatasetRegistry: 0xFdf03FBC06e7d42A969B88a51FFA81d34c717853 
Deploying at 0xfC0Fde28D3c56fd912Ba483E32f243e9B421B491
WorkerpoolRegistry: 0xfC0Fde28D3c56fd912Ba483E32f243e9B421B491 
countCategory is now: 5 (was 0)
Category 0: XS,"",300
Category 1: S,"",1200
Category 2: M,"",3600
Category 3: L,"",10800
Category 4: XL,"",36000
Waiting for block explorer to index the contracts...
[...]
Deploying and configuring ENS..
ENSRegistry: 0x32643B79787Eb41E806d5f07d1D68121FDCF244c
PublicResolver: 0x87ae3705a3Bd7DE9F75c017BA695a894d9248EE5
ReverseRegistrar: 0x82793b160c6aD59953d397A5a1fA380b868441A4
FIFSRegistrar for domain : 0x91c102d620465f7D4B300A0Ba6526fd48Ec4Da26
FIFSRegistrar for domain eth: 0xAEd2a839C00f66987a79B0502f4c05222407a981
FIFSRegistrar for domain iexec.eth: 0x0050cB8A69B185c04e14fd8f68ca3e103c367F83
FIFSRegistrar for domain v5.iexec.eth: 0x1937eFE92d125f22aDa09d3BCa97E0AD0e66a4b6
FIFSRegistrar for domain users.iexec.eth: 0x46fF93cEFadb2002BE28FB687b774e80CB1c3ADF
FIFSRegistrar for domain apps.iexec.eth: 0x5F8A0f7606644F67F40131D6a60D1FD9B5EbA50b
FIFSRegistrar for domain datasets.iexec.eth: 0x20109d8Aa46407dE41e72D1b80c3661c072fb2ab
FIFSRegistrar for domain pools.iexec.eth: 0x128be96D16080ffb49AB6d381F0494fd93360a36

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.35%. Comparing base (368c297) to head (940478e).
Report is 6 commits behind head on feature/diamond.

Files with missing lines Patch % Lines
contracts/Diamond.sol 93.75% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           feature/diamond     #223   +/-   ##
================================================
  Coverage            84.35%   84.35%           
================================================
  Files                   37       37           
  Lines                 1112     1112           
  Branches               225      225           
================================================
  Hits                   938      938           
  Misses                 174      174           

☔ View full report in Codecov by Sentry.
📢 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 changed the title Fix fallback and receive functions Fix fallback and receive functions in Diamond contract Jul 24, 2025
Base automatically changed from feature/diamond-migration-src to feature/diamond July 24, 2025 11:07
@zguesmi zguesmi self-assigned this Jul 24, 2025
@zguesmi zguesmi marked this pull request as ready for review July 24, 2025 11:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements fixes for the fallback and receive functions in the Diamond contract as part of migrating from ERC-1538 to ERC-2535 Diamond pattern. The changes remove unused utility functions and clean up deployment configuration files while updating test storage slot references to match the new storage layout.

  • Removal of unused code comment blocks and utility functions
  • Update of Diamond dependency configuration in Hardhat
  • Storage slot corrections for test cases to align with new Diamond implementation

Reviewed Changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated 1 comment.

File Description
utils/proxy-tools.ts Removes unused function and commented code blocks
test/byContract/IexecEscrow/IexecEscrowNative.test.ts Updates storage slot index from 0x0c to 0x07 for m_totalSupply
hardhat.config.ts Comments out Diamond.sol dependency compilation
deployments/arbitrumSepolia/*.json Updates contract addresses and deployment counts for new deployment

Copy link
Contributor

@Le-Caignec Le-Caignec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Good job 👍🏻

@zguesmi zguesmi merged commit 3ccfc47 into feature/diamond Jul 24, 2025
4 checks passed
@zguesmi zguesmi deleted the feature/diamond-migration-part2 branch July 24, 2025 13:09
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.

3 participants