Skip to content
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d26565f
refactor: Update test assertions to use revertedWithoutReason for bet…
Le-Caignec Oct 28, 2025
b727db9
docs: Expand Solidity documentation with new facets and methods for I…
Le-Caignec Oct 28, 2025
6df3e1d
feat: Add internal_mintCreate function to AppRegistry, DatasetRegistr…
Le-Caignec Oct 28, 2025
8ff72ac
fix: Add missing newlines at the end of JSON files and update Solidit…
Le-Caignec Oct 28, 2025
59f12bd
fix: Ensure proper formatting by adding missing newlines at the end o…
Le-Caignec Oct 28, 2025
89c4617
fix: Add missing newlines at the end of JSON files and update Solidit…
Le-Caignec Oct 28, 2025
599cd76
fix: Add temporary migration checks in IexecERC20Core and IexecERC20F…
Le-Caignec Oct 28, 2025
28e0251
fix: Add missing newlines at the end of JSON files and update Solidit…
Le-Caignec Oct 28, 2025
4f69ec2
fix: Add temporary migration checks in IexecERC20Core for backward co…
Le-Caignec Oct 28, 2025
b011731
fix: Add missing newlines at the end of JSON files and update import …
Le-Caignec Oct 28, 2025
2cce4c7
fix: Reorder import statements in test file for consistency and clarity
Le-Caignec Oct 28, 2025
9ddf6b3
fix: Rollback modif
Le-Caignec Oct 28, 2025
a5db074
Update test/byContract/registries/registries.test.ts
Le-Caignec Oct 28, 2025
9b09e5e
Merge branch 'feature/make-v8-migration-non-breaking' of https://gith…
Le-Caignec Oct 29, 2025
a7d29aa
chore: WIP
zguesmi Oct 29, 2025
a42d28c
Merge branch 'chore/solidity-v8' into feature/make-v8-migration-non-b…
Le-Caignec Oct 29, 2025
66573d6
fix remove empty line
Le-Caignec Oct 29, 2025
25ef259
fix: remove unnecessary empty lines in contract creation functions fo…
Le-Caignec Oct 29, 2025
3a332cc
fix: optimize balance checks in transfer and burn functions for impro…
Le-Caignec Oct 29, 2025
622a17b
fix: optimize allowance checks in transferFrom and decreaseAllowance …
Le-Caignec Oct 29, 2025
e59c38a
Update test/byContract/registries/registries.test.ts
Le-Caignec Oct 29, 2025
8bc4bde
fix: remove broken changes
Le-Caignec Oct 30, 2025
6c79719
refactor: remove deprecated interfaces and streamline documentation f…
Le-Caignec Oct 30, 2025
5e5670c
fix: abis formatage
Le-Caignec Oct 30, 2025
eaca8fb
fix: update Solidity version to 0.8.0 across multiple interface and l…
Le-Caignec Oct 30, 2025
a4e41d6
Update contracts/interfaces/IexecPoco1.sol
Le-Caignec Oct 30, 2025
3ee37f9
Merge remote-tracking branch 'origin/chore/solidity-v8' into feature/…
Le-Caignec Oct 30, 2025
856ca26
Update contracts/libs/IexecLibOrders_v5.sol
Le-Caignec Oct 30, 2025
1a4735c
Update contracts/interfaces/IexecEscrowToken.sol
Le-Caignec Oct 30, 2025
da22fd6
Update contracts/interfaces/IexecRelay.sol
Le-Caignec Oct 30, 2025
4a19736
Update contracts/interfaces/IexecTokenSpender.sol
Le-Caignec Oct 30, 2025
242f531
Update contracts/interfaces/IOwnable.sol
Le-Caignec Oct 30, 2025
31e5748
Update contracts/interfaces/IexecAccessorsABILegacy.sol
Le-Caignec Oct 30, 2025
d111b66
Update contracts/interfaces/IexecCategoryManager.sol
Le-Caignec Oct 30, 2025
bebed16
Update contracts/interfaces/IexecConfigurationExtra.sol
Le-Caignec Oct 30, 2025
759c0ec
Update contracts/interfaces/IexecConfiguration.sol
Le-Caignec Oct 30, 2025
1432446
Update contracts/interfaces/IexecEscrowNative.sol
Le-Caignec Oct 30, 2025
ea871ea
Update contracts/interfaces/IexecERC20Common.sol
Le-Caignec Oct 30, 2025
c5a145f
Update contracts/interfaces/IexecERC20.sol
Le-Caignec Oct 30, 2025
94328c6
Update Solidity pragma version to ^0.8.0 across multiple interface an…
Le-Caignec Oct 30, 2025
2252323
Implement feature X to enhance user experience and fix bug Y in module Z
Le-Caignec Oct 30, 2025
abfa39e
Refactor _burn function to improve readability and maintainability by…
Le-Caignec Oct 30, 2025
c63bdb9
Update Solidity API documentation by removing outdated interfaces and…
Le-Caignec Oct 30, 2025
fcbeb75
Refactor _transferUnchecked function to improve readability by clarif…
Le-Caignec Oct 30, 2025
6415a36
Refactor contract creation process in Registry and derived contracts …
Le-Caignec Oct 31, 2025
8764fd7
Refactor Solidity API documentation to introduce new registry and dat…
Le-Caignec Oct 31, 2025
caced1d
Update contracts/facets/IexecERC20Facet.sol
Le-Caignec Nov 3, 2025
5c6b124
Update contracts/facets/IexecERC20Facet.sol
Le-Caignec Nov 3, 2025
1ddcd80
Refactor contract creation methods in AppRegistry, DatasetRegistry, a…
Le-Caignec Nov 3, 2025
427bb59
Refactor Solidity API documentation to rename and reorganize interfac…
Le-Caignec Nov 3, 2025
7f3ca8a
chore: Merge branch 'chore/solidity-v8' into feature/make-v8-migratio…
zguesmi Nov 3, 2025
31096ca
Merge branch 'chore/solidity-v8' into feature/make-v8-migration-non-b…
Le-Caignec Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions contracts/facets/IexecERC20Core.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ contract IexecERC20Core is IexecERC20Common, FacetBase {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage();
$.m_balances[sender] = $.m_balances[sender] - amount;
uint256 senderBalance = $.m_balances[sender];
// TEMPORARY MIGRATION FIX: Check balance to prevent underflow and revert without reason for backward compatibility
// TODO: Remove this in the next major version
if (senderBalance < amount) {
revert();
}
$.m_balances[sender] = senderBalance - amount;
$.m_balances[recipient] = $.m_balances[recipient] + amount;
emit Transfer(sender, recipient, amount);
}
Expand All @@ -32,8 +38,14 @@ contract IexecERC20Core is IexecERC20Common, FacetBase {
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage();
uint256 accountBalance = $.m_balances[account];
// TEMPORARY MIGRATION FIX: Check balance to prevent underflow and revert without reason for backward compatibility
// TODO: Remove this in the next major version
if (accountBalance < amount) {
revert();
}
$.m_totalSupply = $.m_totalSupply - amount;
$.m_balances[account] = $.m_balances[account] - amount;
$.m_balances[account] = accountBalance - amount;
emit Transfer(account, address(0), amount);
}

Expand Down
16 changes: 14 additions & 2 deletions contracts/facets/IexecERC20Facet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ contract IexecERC20Facet is IexecERC20, FacetBase, IexecERC20Core {
) external override returns (bool) {
PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage();
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), $.m_allowances[sender][_msgSender()] - amount);
// TEMPORARY MIGRATION FIX: Check allowance to prevent underflow and revert without reason for backward compatibility
// TODO: Remove this in the next major version
uint256 currentAllowance = $.m_allowances[sender][_msgSender()];
if (currentAllowance < amount) {
revert();
}
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}

Expand All @@ -63,7 +69,13 @@ contract IexecERC20Facet is IexecERC20, FacetBase, IexecERC20Core {
uint256 subtractedValue
) external override returns (bool) {
PocoStorageLib.PocoStorage storage $ = PocoStorageLib.getPocoStorage();
_approve(_msgSender(), spender, $.m_allowances[_msgSender()][spender] - subtractedValue);
// TEMPORARY MIGRATION FIX: Check allowance to prevent underflow and revert without reason for backward compatibility
// TODO: Remove this in the next major version
uint256 currentAllowance = $.m_allowances[_msgSender()][spender];
if (currentAllowance < subtractedValue) {
revert();
}
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
}
1 change: 0 additions & 1 deletion contracts/facets/IexecEscrowTokenFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {IexecTokenSpender} from "../interfaces/IexecTokenSpender.sol";
import {PocoStorageLib} from "../libs/PocoStorageLib.sol";

contract IexecEscrowTokenFacet is IexecEscrowToken, IexecTokenSpender, FacetBase, IexecERC20Core {

/***************************************************************************
* Escrow methods: public *
***************************************************************************/
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

interface IOwnable {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IexecAccessorsABILegacy.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

import "../libs/IexecLibCore_v5.sol";

Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IexecCategoryManager.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

interface IexecCategoryManager {
event CreateCategory(uint256 catid, string name, string description, uint256 workClockTimeRef);
Expand Down
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecConfiguration.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
import "../libs/IexecLibOrders_v5.sol";

interface IexecConfiguration {
Expand Down
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecConfigurationExtra.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
interface IexecConfigurationExtra {
function changeRegistries(address, address, address) external;
}
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecERC20.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

import {IexecERC20Common} from "./IexecERC20Common.sol";
Comment on lines 5 to 6
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The pragma experimental ABIEncoderV2; directive is unnecessary and deprecated in Solidity 0.8.0+. ABIEncoderV2 is enabled by default in Solidity 0.8.0 and later versions, so this pragma should be removed.

Suggested change
import {IexecERC20Common} from "./IexecERC20Common.sol";

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

possible to remove or should we consider to keep ?

Copy link
Contributor Author

@Le-Caignec Le-Caignec Oct 30, 2025

Choose a reason for hiding this comment

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

it have been done in this PR. #308
My goal here was simply to patch the functions to make the tests pass.
As discuss Timelock will be removed in a dedicated PR


interface IexecERC20 is IexecERC20Common {

function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
Expand Down
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecERC20Common.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
// TODO merge with IexecERC20 interface.
interface IexecERC20Common {
event Transfer(address indexed from, address indexed to, uint256 value);
Expand Down
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecEscrowNative.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
interface IexecEscrowNative {
receive() external payable;
fallback() external payable;
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IexecEscrowToken.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

interface IexecEscrowToken {
receive() external payable;
Expand Down
4 changes: 1 addition & 3 deletions contracts/interfaces/IexecPoco1.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";

interface IexecPoco1 {
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IexecRelay.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

import "../libs/IexecLibOrders_v5.sol";

Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/IexecTokenSpender.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;

interface IexecTokenSpender {
function receiveApproval(address, uint256, address, bytes calldata) external returns (bool);
Expand Down
2 changes: 1 addition & 1 deletion contracts/libs/IexecLibCore_v5.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma solidity ^0.8.0;

library IexecLibCore_v5 {
/**
Expand Down
4 changes: 1 addition & 3 deletions contracts/libs/IexecLibOrders_v5.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH <[email protected]>
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

pragma solidity ^0.8.0;
library IexecLibOrders_v5 {
// bytes32 public constant EIP712DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');
// bytes32 public constant APPORDER_TYPEHASH = keccak256('AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,address requesterrestrict,bytes32 salt)');
Expand Down
16 changes: 15 additions & 1 deletion contracts/registries/Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ abstract contract Registry is IRegistry, ERC721Enumerable, Ownable {
proxyCodeHash = keccak256(proxyCode);
}

// TEMPORARY MIGRATION FIX: Override _checkOwner to catch custom errors and throw string errors for backward compatibility
// TODO: Remove this override in the next major version
function _checkOwner() internal view override {
if (owner() != _msgSender()) {
revert("Ownable: caller is not the owner");
}
}

function initialize(address _previous) external onlyOwner {
require(!initialized);
initialized = true;
Expand Down Expand Up @@ -69,8 +77,14 @@ abstract contract Registry is IRegistry, ERC721Enumerable, Ownable {

/* Factory */
function _mintCreate(address _owner, bytes memory _args) internal returns (address) {
// TEMPORARY MIGRATION FIX: Check if contract already exists to revert without custom error for backward compatibility
// TODO: Remove this in the next major version
address entry = _mintPredict(_owner, _args);
if (entry.code.length > 0) {
revert("Create2: Failed on deploy");
}
// Create entry (proxy)
address entry = Create2.deploy(0, keccak256(abi.encodePacked(_args, _owner)), proxyCode);
entry = Create2.deploy(0, keccak256(abi.encodePacked(_args, _owner)), proxyCode);
InitializableUpgradeabilityProxy(payable(entry)).initialize(master, _args);
// Mint corresponding token
_mint(_owner, uint256(uint160(entry)));
Expand Down
Loading