From 11db51a9ad4b978a329d900e68c3050fda97290f Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Sat, 26 Jul 2025 15:08:23 +0200 Subject: [PATCH 1/2] refactor: Rename variable --- contracts/Store.sol | 4 +--- contracts/Store.v8.sol | 4 +--- contracts/facets/FacetBase.sol | 3 +-- contracts/facets/FacetBase.v8.sol | 3 +-- contracts/facets/IexecAccessorsFacet.sol | 2 +- contracts/facets/IexecConfigurationFacet.sol | 8 ++++---- contracts/facets/IexecEscrowTokenSwapFacet.sol | 8 ++++---- contracts/facets/SignatureVerifier.v8.sol | 2 +- .../IexecConfiguration/IexecConfiguration.test.ts | 2 +- 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/contracts/Store.sol b/contracts/Store.sol index 91de34948..aa7bb5509 100644 --- a/contracts/Store.sol +++ b/contracts/Store.sol @@ -70,9 +70,7 @@ abstract contract Store { mapping(address => mapping(address => uint256)) m_allowances; // EIP-712 domain hash. // Modified in IexecConfigurationFacet.updateDomainSeparator - bytes32 EIP712DOMAIN_SEPARATOR; // TODO rename - // Poco - Storage - + bytes32 m_eip712DomainSeparator; // Mapping an order hash to its owner. Since a smart contract cannot sign orders // with a private key, it adds an entry to this mapping to provide presigned orders. mapping(bytes32 => address) m_presigned; diff --git a/contracts/Store.v8.sol b/contracts/Store.v8.sol index 17db6eda0..880f3c2ca 100644 --- a/contracts/Store.v8.sol +++ b/contracts/Store.v8.sol @@ -64,9 +64,7 @@ abstract contract Store { mapping(address => mapping(address => uint256)) m_allowances; // EIP-712 domain hash. // Modified in IexecConfigurationFacet.updateDomainSeparator - bytes32 EIP712DOMAIN_SEPARATOR; // TODO rename - // Poco - Storage - + bytes32 m_eip712DomainSeparator; // Mapping an order hash to its owner. Since a smart contract cannot sign orders // with a private key, it adds an entry to this mapping to provide presigned orders. mapping(bytes32 => address) m_presigned; diff --git a/contracts/facets/FacetBase.sol b/contracts/facets/FacetBase.sol index 94a914f8f..bc73b9436 100644 --- a/contracts/facets/FacetBase.sol +++ b/contracts/facets/FacetBase.sol @@ -7,8 +7,7 @@ import "../Store.sol"; import "../interfaces/IOwnable.sol"; // Functions that were declared in ERC1538Store are re-declared here. -// TODO clean this (use LibDiamond) -// - All calls to `owner()` should use `LibDiamond.contractOwner()`. +// TODO use LibDiamond.contractOwner() when migrating all contracts to v8. /** * @title Base contract of all Facet contracts. diff --git a/contracts/facets/FacetBase.v8.sol b/contracts/facets/FacetBase.v8.sol index 7f0adafa3..327f0527f 100644 --- a/contracts/facets/FacetBase.v8.sol +++ b/contracts/facets/FacetBase.v8.sol @@ -7,8 +7,7 @@ import {IERC5313} from "@openzeppelin/contracts-v5/interfaces/IERC5313.sol"; import {Store} from "../Store.v8.sol"; // Functions that were declared in ERC1538Store are re-declared here. -// TODO clean this (use LibDiamond) -// - All calls to `owner()` should use `LibDiamond.contractOwner()`. +// TODO use LibDiamond.contractOwner() when migrating all contracts to v8. /** * @title Base contract of all Facet contracts. diff --git a/contracts/facets/IexecAccessorsFacet.sol b/contracts/facets/IexecAccessorsFacet.sol index 465fad080..1d7c73b59 100644 --- a/contracts/facets/IexecAccessorsFacet.sol +++ b/contracts/facets/IexecAccessorsFacet.sol @@ -170,6 +170,6 @@ contract IexecAccessorsFacet is IexecAccessors, FacetBase { function eip712domain_separator() external view override returns (bytes32) { PocoStorage storage $ = getPocoStorage(); - return $.EIP712DOMAIN_SEPARATOR; + return $.m_eip712DomainSeparator; } } diff --git a/contracts/facets/IexecConfigurationFacet.sol b/contracts/facets/IexecConfigurationFacet.sol index fc20866b6..fe2f859f5 100644 --- a/contracts/facets/IexecConfigurationFacet.sol +++ b/contracts/facets/IexecConfigurationFacet.sol @@ -25,8 +25,8 @@ contract IexecConfigurationFacet is IexecConfiguration, FacetBase { address _v3_iexecHubAddress ) external override onlyOwner { PocoStorage storage $ = getPocoStorage(); - require($.EIP712DOMAIN_SEPARATOR == bytes32(0), "already-configured"); - $.EIP712DOMAIN_SEPARATOR = _domain().hash(); + require($.m_eip712DomainSeparator == bytes32(0), "already-configured"); + $.m_eip712DomainSeparator = _domain().hash(); $.m_baseToken = IERC20(_token); $.m_name = _name; @@ -45,8 +45,8 @@ contract IexecConfigurationFacet is IexecConfiguration, FacetBase { function updateDomainSeparator() external override { PocoStorage storage $ = getPocoStorage(); - require($.EIP712DOMAIN_SEPARATOR != bytes32(0), "not-configured"); - $.EIP712DOMAIN_SEPARATOR = _domain().hash(); + require($.m_eip712DomainSeparator != bytes32(0), "not-configured"); + $.m_eip712DomainSeparator = _domain().hash(); } function importScore(address _worker) external override { diff --git a/contracts/facets/IexecEscrowTokenSwapFacet.sol b/contracts/facets/IexecEscrowTokenSwapFacet.sol index f27c03cf3..f2347d48f 100644 --- a/contracts/facets/IexecEscrowTokenSwapFacet.sol +++ b/contracts/facets/IexecEscrowTokenSwapFacet.sol @@ -165,27 +165,27 @@ contract IexecEscrowTokenSwapFacet is PocoStorage storage $ = getPocoStorage(); uint256 volume; volume = _apporder.volume.sub( - $.m_consumed[keccak256(_toEthTypedStruct(_apporder.hash(), $.EIP712DOMAIN_SEPARATOR))] + $.m_consumed[keccak256(_toEthTypedStruct(_apporder.hash(), $.m_eip712DomainSeparator))] ); if (_datasetorder.dataset != address(0)) volume = volume.min( _datasetorder.volume.sub( $.m_consumed[ - keccak256(_toEthTypedStruct(_datasetorder.hash(), $.EIP712DOMAIN_SEPARATOR)) + keccak256(_toEthTypedStruct(_datasetorder.hash(), $.m_eip712DomainSeparator)) ] ) ); volume = volume.min( _workerpoolorder.volume.sub( $.m_consumed[ - keccak256(_toEthTypedStruct(_workerpoolorder.hash(), $.EIP712DOMAIN_SEPARATOR)) + keccak256(_toEthTypedStruct(_workerpoolorder.hash(), $.m_eip712DomainSeparator)) ] ) ); volume = volume.min( _requestorder.volume.sub( $.m_consumed[ - keccak256(_toEthTypedStruct(_requestorder.hash(), $.EIP712DOMAIN_SEPARATOR)) + keccak256(_toEthTypedStruct(_requestorder.hash(), $.m_eip712DomainSeparator)) ] ) ); diff --git a/contracts/facets/SignatureVerifier.v8.sol b/contracts/facets/SignatureVerifier.v8.sol index cfe97c2c0..8bece6eed 100644 --- a/contracts/facets/SignatureVerifier.v8.sol +++ b/contracts/facets/SignatureVerifier.v8.sol @@ -18,7 +18,7 @@ contract SignatureVerifier is FacetBase { */ function _toTypedDataHash(bytes32 structHash) internal view returns (bytes32) { PocoStorage storage $ = getPocoStorage(); - return MessageHashUtils.toTypedDataHash($.EIP712DOMAIN_SEPARATOR, structHash); + return MessageHashUtils.toTypedDataHash($.m_eip712DomainSeparator, structHash); } /** diff --git a/test/byContract/IexecConfiguration/IexecConfiguration.test.ts b/test/byContract/IexecConfiguration/IexecConfiguration.test.ts index 4f4f89ae5..ee91fec42 100644 --- a/test/byContract/IexecConfiguration/IexecConfiguration.test.ts +++ b/test/byContract/IexecConfiguration/IexecConfiguration.test.ts @@ -205,7 +205,7 @@ describe('IexecConfiguration', async () => { async function setDomainSeparatorInStorage(domainSeparator: string) { await setStorageAt( proxyAddress, - getPocoStorageSlotLocation(11n), // 11 is the slot index of EIP712DOMAIN_SEPARATOR in Store + getPocoStorageSlotLocation(11n), // 11 is the slot index of m_eip712DomainSeparator in Store domainSeparator, ); // Double check the update of the domain separator happened From 9cd64d652c1daa31303d6a530ce8849afeeb00fa Mon Sep 17 00:00:00 2001 From: Zied <26070035+zguesmi@users.noreply.github.com> Date: Sat, 26 Jul 2025 15:08:38 +0200 Subject: [PATCH 2/2] feat: Target latest EVM version --- hardhat.config.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 96df0bcbb..9c3936644 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -71,13 +71,6 @@ const v8Settings = { }, }, }, - // TODO remove this to target the latest EVM version. - /** - * @dev The 0.8.20 compiler switches the default target EVM version to Shanghai. - * At this time, the iExec Bellecour blockchain does not support new OPCODES - * brought by the Shanghai fork, hence the target must be lowered. - */ - evmVersion: bellecourBaseConfig.hardfork, }; const config: HardhatUserConfig = {