diff --git a/.github/workflows/root-checks.yaml b/.github/workflows/root-checks.yaml index d1111f533..148d203d4 100644 --- a/.github/workflows/root-checks.yaml +++ b/.github/workflows/root-checks.yaml @@ -44,3 +44,4 @@ jobs: working-directory: ${{ matrix.package }} run: | npm run refresh-abis + # TODO check that SDK and Subgraph projects build is OK. diff --git a/packages/sdk/abis/sharing/DataProtectorSharing.sol/DataProtectorSharing.json b/packages/sdk/abis/sharing/DataProtectorSharing.sol/DataProtectorSharing.json index 42065f51e..8ea079bb1 100644 --- a/packages/sdk/abis/sharing/DataProtectorSharing.sol/DataProtectorSharing.json +++ b/packages/sdk/abis/sharing/DataProtectorSharing.sol/DataProtectorSharing.json @@ -2,7 +2,7 @@ { "inputs": [ { - "internalType": "contract IExecPocoDelegate", + "internalType": "address", "name": "_proxy", "type": "address" }, @@ -195,7 +195,7 @@ }, { "inputs": [], - "name": "FailedInnerCall", + "name": "FailedCall", "type": "error" }, { diff --git a/packages/sdk/abis/sharing/interfaces/IExecPocoDelegate.sol/IExecPocoDelegate.json b/packages/sdk/abis/sharing/interfaces/IPoCo.sol/IPoCo.json similarity index 100% rename from packages/sdk/abis/sharing/interfaces/IExecPocoDelegate.sol/IExecPocoDelegate.json rename to packages/sdk/abis/sharing/interfaces/IPoCo.sol/IPoCo.json diff --git a/packages/sdk/abis/sharing/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json b/packages/sdk/abis/sharing/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json deleted file mode 100644 index 0637a088a..000000000 --- a/packages/sdk/abis/sharing/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/sdk/abis/sharing/registry/AddOnlyAppWhitelistRegistry.sol/AddOnlyAppWhitelistRegistry.json b/packages/sdk/abis/sharing/registry/AddOnlyAppWhitelistRegistry.sol/AddOnlyAppWhitelistRegistry.json index d11f04ff8..ac6a760ab 100644 --- a/packages/sdk/abis/sharing/registry/AddOnlyAppWhitelistRegistry.sol/AddOnlyAppWhitelistRegistry.json +++ b/packages/sdk/abis/sharing/registry/AddOnlyAppWhitelistRegistry.sol/AddOnlyAppWhitelistRegistry.json @@ -4,11 +4,6 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "inputs": [], - "name": "ERC1167FailedCreateClone", - "type": "error" - }, { "inputs": [ { @@ -112,6 +107,27 @@ "name": "ERC721NonexistentToken", "type": "error" }, + { + "inputs": [], + "name": "FailedDeployment", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, { "inputs": [], "name": "InvalidInitialization", diff --git a/packages/sdk/src/lib/dataProtectorSharing/smartContract/getPocoContract.ts b/packages/sdk/src/lib/dataProtectorSharing/smartContract/getPocoContract.ts index 0516f2600..3277864c6 100644 --- a/packages/sdk/src/lib/dataProtectorSharing/smartContract/getPocoContract.ts +++ b/packages/sdk/src/lib/dataProtectorSharing/smartContract/getPocoContract.ts @@ -1,9 +1,9 @@ import type { IExecModule } from 'iexec'; -import type { IExecPocoDelegate } from '../../../../generated/typechain/sharing/interfaces/IExecPocoDelegate.js'; +import type { IPoCo } from '../../../../generated/typechain/sharing/interfaces/IPoCo.js'; export async function getPocoContract( iexec: IExecModule -): Promise { +): Promise { const client = await iexec.config.resolveContractsClient(); - return client.getIExecContract() as unknown as IExecPocoDelegate; + return client.getIExecContract() as unknown as IPoCo; } diff --git a/packages/sdk/src/lib/dataProtectorSharing/smartContract/pocoContract.reads.ts b/packages/sdk/src/lib/dataProtectorSharing/smartContract/pocoContract.reads.ts index e1133dae1..c6ef685c2 100644 --- a/packages/sdk/src/lib/dataProtectorSharing/smartContract/pocoContract.reads.ts +++ b/packages/sdk/src/lib/dataProtectorSharing/smartContract/pocoContract.reads.ts @@ -1,4 +1,4 @@ -import type { IExecPocoDelegate } from '../../../../generated/typechain/sharing/interfaces/IExecPocoDelegate.js'; +import type { IPoCo } from '../../../../generated/typechain/sharing/interfaces/IPoCo.js'; import type { Address } from '../../types/index.js'; import type { AccountDetails } from '../../types/pocoTypes.js'; @@ -12,7 +12,7 @@ const getAccountAllowance = async ({ owner, spender, }: { - pocoContract: IExecPocoDelegate; + pocoContract: IPoCo; owner: Address; spender: Address; }) => { @@ -23,7 +23,7 @@ const getAccountBalance = async ({ pocoContract, owner, }: { - pocoContract: IExecPocoDelegate; + pocoContract: IPoCo; owner: Address; }) => { return pocoContract.balanceOf(owner); @@ -34,7 +34,7 @@ export const getAccountDetails = async ({ userAddress, sharingContractAddress, }: { - pocoContract: IExecPocoDelegate; + pocoContract: IPoCo; userAddress: Address; sharingContractAddress: Address; }): Promise => { diff --git a/packages/sharing-smart-contract/CHANGELOG.md b/packages/sharing-smart-contract/CHANGELOG.md index 202c8c0e4..8a9f1d845 100644 --- a/packages/sharing-smart-contract/CHANGELOG.md +++ b/packages/sharing-smart-contract/CHANGELOG.md @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file. ### Changed -- update blockscout url +- Fix Sharing contract constructor arguments order (#433) +- Update blockscout url ## [2.0.0] diff --git a/packages/sharing-smart-contract/abis/DataProtectorSharing.sol/DataProtectorSharing.json b/packages/sharing-smart-contract/abis/DataProtectorSharing.sol/DataProtectorSharing.json index 6f88e26bf..8ea079bb1 100644 --- a/packages/sharing-smart-contract/abis/DataProtectorSharing.sol/DataProtectorSharing.json +++ b/packages/sharing-smart-contract/abis/DataProtectorSharing.sol/DataProtectorSharing.json @@ -2,7 +2,7 @@ { "inputs": [ { - "internalType": "contract IExecPocoDelegate", + "internalType": "address", "name": "_proxy", "type": "address" }, diff --git a/packages/sharing-smart-contract/abis/interfaces/IExecPocoDelegate.sol/IExecPocoDelegate.json b/packages/sharing-smart-contract/abis/interfaces/IPoCo.sol/IPoCo.json similarity index 100% rename from packages/sharing-smart-contract/abis/interfaces/IExecPocoDelegate.sol/IExecPocoDelegate.json rename to packages/sharing-smart-contract/abis/interfaces/IPoCo.sol/IPoCo.json diff --git a/packages/sharing-smart-contract/abis/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json b/packages/sharing-smart-contract/abis/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json deleted file mode 100644 index 0637a088a..000000000 --- a/packages/sharing-smart-contract/abis/libs/IexecLibOrders_v5.sol/IexecLibOrders_v5.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/sharing-smart-contract/contracts/DataProtectorSharing.sol b/packages/sharing-smart-contract/contracts/DataProtectorSharing.sol index 69c5de4c0..877bd1800 100644 --- a/packages/sharing-smart-contract/contracts/DataProtectorSharing.sol +++ b/packages/sharing-smart-contract/contracts/DataProtectorSharing.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 /****************************************************************************** - * Copyright 2024 IEXEC BLOCKCHAIN TECH * + * Copyright 2024-2025 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -25,7 +25,7 @@ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Hol import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IDataProtectorSharing, IexecLibOrders_v5, ICollection, ISubscription, IRental, ISale} from "./interfaces/IDataProtectorSharing.sol"; import {AddOnlyAppWhitelistRegistry, IAddOnlyAppWhitelist} from "./registry/AddOnlyAppWhitelistRegistry.sol"; -import {ManageOrders, IExecPocoDelegate} from "./ManageOrders.sol"; +import {ManageOrders} from "./ManageOrders.sol"; import {IRegistry} from "./interfaces/IRegistry.sol"; /// @custom:oz-upgrades-unsafe-allow state-variable-immutable @@ -57,7 +57,7 @@ contract DataProtectorSharing is **************************************************************************/ /// @custom:oz-upgrades-unsafe-allow constructor constructor( - IExecPocoDelegate _proxy, + address _proxy, IRegistry protectedDataRegistry_, AddOnlyAppWhitelistRegistry addOnlyAppWhitelistRegistry_ ) ManageOrders(_proxy) { diff --git a/packages/sharing-smart-contract/contracts/ManageOrders.sol b/packages/sharing-smart-contract/contracts/ManageOrders.sol index 5d583eb8e..74debf956 100644 --- a/packages/sharing-smart-contract/contracts/ManageOrders.sol +++ b/packages/sharing-smart-contract/contracts/ManageOrders.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 /****************************************************************************** - * Copyright 2024 IEXEC BLOCKCHAIN TECH * + * Copyright 2024-2025 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -17,7 +17,8 @@ ******************************************************************************/ pragma solidity ^0.8.24; -import {IExecPocoDelegate, IexecLibOrders_v5} from "./interfaces/IExecPocoDelegate.sol"; +import {IexecLibOrders_v5} from "./interfaces/IPoCo.sol"; +import {IPoCo} from "./interfaces/IPoCo.sol"; /// @custom:oz-upgrades-unsafe-allow state-variable-immutable // eslint-disable-next-line quotes @@ -32,7 +33,7 @@ abstract contract ManageOrders { using IexecLibOrders_v5 for IexecLibOrders_v5.RequestOrderOperation; // ---------------------ManageOrders state---------------------------------- - IExecPocoDelegate internal immutable POCO_DELEGATE; + IPoCo internal immutable POCO_DELEGATE; bytes32 internal constant TAG = 0x0000000000000000000000000000000000000000000000000000000000000003; // [tee,scone] uint256 internal constant TRUST = 0; // No replication @@ -44,8 +45,8 @@ abstract contract ManageOrders { * Constructor * **************************************************************************/ /// @custom:oz-upgrades-unsafe-allow constructor - constructor(IExecPocoDelegate pocoDelegate_) { - POCO_DELEGATE = pocoDelegate_; + constructor(address pocoAddress) { + POCO_DELEGATE = IPoCo(pocoAddress); } /*************************************************************************** diff --git a/packages/sharing-smart-contract/contracts/interfaces/IDataProtectorSharing.sol b/packages/sharing-smart-contract/contracts/interfaces/IDataProtectorSharing.sol index 5bf8318fc..9e1b96d31 100644 --- a/packages/sharing-smart-contract/contracts/interfaces/IDataProtectorSharing.sol +++ b/packages/sharing-smart-contract/contracts/interfaces/IDataProtectorSharing.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 /****************************************************************************** - * Copyright 2024 IEXEC BLOCKCHAIN TECH * + * Copyright 2024-2025 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -17,9 +17,9 @@ ******************************************************************************/ pragma solidity ^0.8.24; -import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol"; import {ISubscription} from "./ISubscription.sol"; import {ICollection} from "./ICollection.sol"; +import {IexecLibOrders_v5} from "./IPoCo.sol"; import {IRental} from "./IRental.sol"; import {ISale} from "./ISale.sol"; import {IAddOnlyAppWhitelist} from "./IAddOnlyAppWhitelist.sol"; diff --git a/packages/sharing-smart-contract/contracts/interfaces/IExecPocoDelegate.sol b/packages/sharing-smart-contract/contracts/interfaces/IExecPocoDelegate.sol deleted file mode 100644 index 3aa8a5a29..000000000 --- a/packages/sharing-smart-contract/contracts/interfaces/IExecPocoDelegate.sol +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -/****************************************************************************** - * Copyright 2024 IEXEC BLOCKCHAIN TECH * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - ******************************************************************************/ -pragma solidity ^0.8.24; - -import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol"; - -interface IExecPocoDelegate { - /** - * Publish an on chain application order operation. - * - * @param operation The application order operation to be managed. - */ - function manageAppOrder(IexecLibOrders_v5.AppOrderOperation calldata operation) external; - - /** - * Publish an on chain dataset order operation. - * - * @param operation The dataset order operation to be managed. - */ - function manageDatasetOrder( - IexecLibOrders_v5.DatasetOrderOperation calldata operation - ) external; - - /** - * Publish an on chain workerpool order operation. - * - * @param operation The workerpool order operation to be managed. - */ - function manageWorkerpoolOrder( - IexecLibOrders_v5.WorkerpoolOrderOperation calldata operation - ) external; - - /** - * Publish an on chain request order operation. - * - * @param operation The request order operation to be managed. - */ - function manageRequestOrder( - IexecLibOrders_v5.RequestOrderOperation calldata operation - ) external; - - /** - * Matche orders to form a deal. - * - * @param appOrder The application order. - * @param datasetOrder The dataset order. - * @param workerpoolOrder The workerpool order. - * @param requestOrder The request order. - * @return The deal's unique identifier. - */ - function matchOrders( - IexecLibOrders_v5.AppOrder calldata appOrder, - IexecLibOrders_v5.DatasetOrder calldata datasetOrder, - IexecLibOrders_v5.WorkerpoolOrder calldata workerpoolOrder, - IexecLibOrders_v5.RequestOrder calldata requestOrder - ) external returns (bytes32); - - /** - * Transfers tokens from sender's account to the specified recipient. - * - * @param sender The address of the spender. - * @param recipient The address of the recipient. - * @param amount The amount of tokens to transfer. - * @return A boolean value indicating whether the transfer was successful. - */ - function transferFrom( - address sender, - address recipient, - uint256 amount - ) external returns (bool); - - /** - * @param owner The address of the account owning tokens. - * @return The number of tokens owned by the specified address. - */ - function balanceOf(address owner) external view returns (uint256); - - /** - * Allows a spender to withdraw from your account, multiple times, up to the value amount. - * If this function is called again, it overwrites the current allowance with value. - * - * @param spender The address authorized to spend a certain amount of tokens on behalf of the msg.sender. - * @param value The maximum amount of tokens that can be spent by the spender. - * @return True if the approval was successful, otherwise false. - */ - function approve(address spender, uint256 value) external returns (bool); - - /** - * Deposits a specified amount of tokens into the contract (ERC20 Satcked RLC). - * The caller must ensure they have enough tokens and have approved the contract to spend - * on their behalf. - * - * @return A boolean indicating whether the deposit was successful. - */ - function deposit() external payable returns (bool); - - function approveAndCall( - address spender, - uint256 value, - bytes calldata extraData - ) external returns (bool); - - function allowance(address owner, address spender) external view returns (uint256); -} diff --git a/packages/sharing-smart-contract/contracts/libs/IexecLibOrders_v5.sol b/packages/sharing-smart-contract/contracts/interfaces/IPoCo.sol similarity index 63% rename from packages/sharing-smart-contract/contracts/libs/IexecLibOrders_v5.sol rename to packages/sharing-smart-contract/contracts/interfaces/IPoCo.sol index d50ba608b..96e22deac 100644 --- a/packages/sharing-smart-contract/contracts/libs/IexecLibOrders_v5.sol +++ b/packages/sharing-smart-contract/contracts/interfaces/IPoCo.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 /****************************************************************************** - * Copyright 2024 IEXEC BLOCKCHAIN TECH * + * Copyright 2025 IEXEC BLOCKCHAIN TECH * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -15,8 +15,56 @@ * See the License for the specific language governing permissions and * * limitations under the License. * ******************************************************************************/ + pragma solidity ^0.8.24; +// TODO import interfaces (IexecOrderManagement, IexecPoco1, ...) from @iexec/poco. + +interface IPoCo { + // IexecEscrowNative + function deposit() external payable returns (bool); // Native mode + + // TODO support both token and native modes. + // IexecEscrowToken + // function deposit(uint256) external returns (bool); // Token mode + + // IexecERC20 + function approve(address spender, uint256 value) external returns (bool); + function approveAndCall( + address spender, + uint256 value, + bytes calldata extraData + ) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); + function balanceOf(address owner) external view returns (uint256); + function allowance(address owner, address spender) external view returns (uint256); + + // IexecOrderManagement + function manageAppOrder(IexecLibOrders_v5.AppOrderOperation calldata operation) external; + function manageDatasetOrder( + IexecLibOrders_v5.DatasetOrderOperation calldata operation + ) external; + function manageWorkerpoolOrder( + IexecLibOrders_v5.WorkerpoolOrderOperation calldata operation + ) external; + function manageRequestOrder( + IexecLibOrders_v5.RequestOrderOperation calldata operation + ) external; + + // IexecPoco1 + function matchOrders( + IexecLibOrders_v5.AppOrder calldata appOrder, + IexecLibOrders_v5.DatasetOrder calldata datasetOrder, + IexecLibOrders_v5.WorkerpoolOrder calldata workerpoolOrder, + IexecLibOrders_v5.RequestOrder calldata requestOrder + ) external returns (bytes32); +} + +// TODO import from @iexec/poco library IexecLibOrders_v5 { enum OrderOperationEnum { SIGN, diff --git a/packages/sharing-smart-contract/scripts/deploy.js b/packages/sharing-smart-contract/scripts/deploy.js index 9fdd6498a..b5de0b793 100644 --- a/packages/sharing-smart-contract/scripts/deploy.js +++ b/packages/sharing-smart-contract/scripts/deploy.js @@ -46,8 +46,8 @@ async function main() { const DataProtectorSharingFactory = await ethers.getContractFactory('DataProtectorSharing'); const dataProtectorSharingConstructorArgs = [ - datasetRegistryAddress, pocoAddress, + datasetRegistryAddress, addOnlyAppWhitelistRegistryAddress, ]; const dataProtectorSharingContract = await upgrades.deployProxy(DataProtectorSharingFactory, { diff --git a/packages/sharing-smart-contract/test/SupportsInterface.t.sol b/packages/sharing-smart-contract/test/SupportsInterface.t.sol index 9f7250e45..c1b5443e8 100644 --- a/packages/sharing-smart-contract/test/SupportsInterface.t.sol +++ b/packages/sharing-smart-contract/test/SupportsInterface.t.sol @@ -1,8 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 + pragma solidity ^0.8.24; import {Test} from "forge-std/Test.sol"; import {DataProtectorSharing} from "../contracts/DataProtectorSharing.sol"; -import {IExecPocoDelegate} from "../contracts/interfaces/IExecPocoDelegate.sol"; import {AddOnlyAppWhitelistRegistry} from "../contracts/registry/AddOnlyAppWhitelistRegistry.sol"; import {IRegistry} from "../contracts/interfaces/IRegistry.sol"; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; @@ -14,7 +15,7 @@ contract SupportsInterface is Test { function setUp() external { _dataProtectorSharing = new DataProtectorSharing( - IExecPocoDelegate(address(0)), + address(0), IRegistry(address(0)), AddOnlyAppWhitelistRegistry(address(0)) ); diff --git a/packages/sharing-smart-contract/test/e2e/utils/loadFixture.test.js b/packages/sharing-smart-contract/test/e2e/utils/loadFixture.test.js index d8d7f946c..d0e668262 100644 --- a/packages/sharing-smart-contract/test/e2e/utils/loadFixture.test.js +++ b/packages/sharing-smart-contract/test/e2e/utils/loadFixture.test.js @@ -43,7 +43,7 @@ export async function deploySCFixture() { await dataProtectorSharingContract.waitForDeployment(); // Poco - const pocoContract = await ethers.getContractAt('IExecPocoDelegate', POCO_ADDRESS); + const pocoContract = await ethers.getContractAt('IPoCo', POCO_ADDRESS); return { DataProtectorSharingFactory, diff --git a/packages/sharing-smart-contract/test/invariant/Invariant.t.sol b/packages/sharing-smart-contract/test/invariant/Invariant.t.sol index aa75754b9..551b4d7db 100644 --- a/packages/sharing-smart-contract/test/invariant/Invariant.t.sol +++ b/packages/sharing-smart-contract/test/invariant/Invariant.t.sol @@ -10,7 +10,7 @@ import {HandlerRenting} from "./handlers/HandlerRenting.sol"; import {HandlerGlobal} from "./handlers/HandlerGlobal.sol"; import {IAppRegistry, IApp} from "./interfaces/IAppRegistry.sol"; import {IWorkerpoolRegistry, IWorkerpool} from "./interfaces/IWorkerpoolRegistry.sol"; -import {IexecLibOrders_v5} from "../../contracts/libs/IexecLibOrders_v5.sol"; +import {IexecLibOrders_v5} from "../../contracts/interfaces/IPoCo.sol"; import {DataProtectorSharing} from "../../contracts/DataProtectorSharing.sol"; import {IAddOnlyAppWhitelist} from "../../contracts/registry/AddOnlyAppWhitelistRegistry.sol"; diff --git a/packages/sharing-smart-contract/test/invariant/handlers/HandlerGlobal.sol b/packages/sharing-smart-contract/test/invariant/handlers/HandlerGlobal.sol index 2cc7904ed..e3804386f 100644 --- a/packages/sharing-smart-contract/test/invariant/handlers/HandlerGlobal.sol +++ b/packages/sharing-smart-contract/test/invariant/handlers/HandlerGlobal.sol @@ -5,15 +5,15 @@ import {Test} from "forge-std/Test.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; import {DataProtectorSharing} from "../../../contracts/DataProtectorSharing.sol"; import {AddOnlyAppWhitelistRegistry} from "../../../contracts/registry/AddOnlyAppWhitelistRegistry.sol"; -import {IExecPocoDelegate} from "../../../contracts/interfaces/IExecPocoDelegate.sol"; +import {IPoCo} from "../../../contracts/interfaces/IPoCo.sol"; import {IDataProtector} from "../../../contracts/interfaces/IDataProtector.sol"; import {IRegistry} from "../../../contracts/interfaces/IRegistry.sol"; import {GhostStorage} from "./GhostStorage.sol"; contract HandlerGlobal is Test, GhostStorage { // ---------------------State Variables------------------------------------ - IExecPocoDelegate public constant POCO_DELEGATE = - IExecPocoDelegate(0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f); + // TODO remove hardcoded values to make tests compatible with any chain. + IPoCo public constant POCO_DELEGATE = IPoCo(0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f); IRegistry public constant POCO_PROTECTED_DATA_REGISTRY = IRegistry(0x799DAa22654128d0C64d5b79eac9283008158730); IDataProtector public constant DATA_PROTECTOR_CORE = @@ -37,7 +37,7 @@ contract HandlerGlobal is Test, GhostStorage { addOnlyAppWhitelistRegistry.initialize(); DataProtectorSharing dataProtectorSharingImpl = new DataProtectorSharing( - POCO_DELEGATE, + address(POCO_DELEGATE), POCO_PROTECTED_DATA_REGISTRY, addOnlyAppWhitelistRegistry ); diff --git a/packages/subgraph/abis/AddOnlyAppWhitelistRegistryABI.json b/packages/subgraph/abis/AddOnlyAppWhitelistRegistryABI.json index d11f04ff8..ac6a760ab 100644 --- a/packages/subgraph/abis/AddOnlyAppWhitelistRegistryABI.json +++ b/packages/subgraph/abis/AddOnlyAppWhitelistRegistryABI.json @@ -4,11 +4,6 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "inputs": [], - "name": "ERC1167FailedCreateClone", - "type": "error" - }, { "inputs": [ { @@ -112,6 +107,27 @@ "name": "ERC721NonexistentToken", "type": "error" }, + { + "inputs": [], + "name": "FailedDeployment", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, { "inputs": [], "name": "InvalidInitialization", diff --git a/packages/subgraph/abis/DataProtectorSharingABI.json b/packages/subgraph/abis/DataProtectorSharingABI.json index 42065f51e..8ea079bb1 100644 --- a/packages/subgraph/abis/DataProtectorSharingABI.json +++ b/packages/subgraph/abis/DataProtectorSharingABI.json @@ -2,7 +2,7 @@ { "inputs": [ { - "internalType": "contract IExecPocoDelegate", + "internalType": "address", "name": "_proxy", "type": "address" }, @@ -195,7 +195,7 @@ }, { "inputs": [], - "name": "FailedInnerCall", + "name": "FailedCall", "type": "error" }, {