diff --git a/CHANGELOG.md b/CHANGELOG.md index e19015f71..48a680d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [x] `IexecPoco2Delegate.sol` ### Features +- Purge Truffle leftovers (#180) - Sunset Jenkins pipeline (#178) - Re-use variable in `IexecPoco2Delegate` in `contribute(...)` function. (#168) - Remove unnecessary back and forth transfers in `IexecPoco2Delegate` happening during `claim(..)`. (#167) diff --git a/migrations/1_initial_migration.js b/migrations/1_initial_migration.js deleted file mode 100644 index b71efe29d..000000000 --- a/migrations/1_initial_migration.js +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-FileCopyrightText: 2020 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const deployer = require('../scripts/hardhat-truffle-utils'); -var Migrations = artifacts.require('Migrations'); - -module.exports = async function () { - await deployer.deploy(Migrations); -}; diff --git a/migrations/3_deploy_token.js b/migrations/3_deploy_token.js deleted file mode 100644 index 30c774d02..000000000 --- a/migrations/3_deploy_token.js +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const deployer = require('../scripts/hardhat-truffle-utils'); -// CONFIG -const CONFIG = require('../config/config.json'); -// Token -var RLC = artifacts.require('rlc-faucet-contract/RLC'); - -/***************************************************************************** - * Main * - *****************************************************************************/ -module.exports = async function (accounts) { - console.log('# web3 version:', web3.version); - const chainid = await web3.eth.net.getId(); - const chaintype = await web3.eth.net.getNetworkType(); - console.log('Chainid is:', chainid); - console.log('Chaintype is:', chaintype); - console.log('Deployer is:', accounts[0]); - - const deploymentOptions = CONFIG.chains[chainid] || CONFIG.chains.default; - - switch (deploymentOptions.asset) { - case 'Token': - if (deploymentOptions.token) { - RLC.setAsDeployed(await RLC.at(deploymentOptions.token)); - } else { - RLC.isDeployed() || (await deployer.deploy(RLC)); - } - break; - - case 'Native': - break; - } -}; diff --git a/migrations/4_deploy_core.js b/migrations/4_deploy_core.js deleted file mode 100644 index 7d360154e..000000000 --- a/migrations/4_deploy_core.js +++ /dev/null @@ -1,243 +0,0 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const deployer = require('../scripts/hardhat-truffle-utils'); -const assert = require('assert'); -// CONFIG -const CONFIG = require('../config/config.json'); -// FactoryDeployer -const { TruffleDeployer: Deployer } = require('../utils/FactoryDeployer'); -const { getFunctionSignatures } = require('./utils/getFunctionSignatures'); -// Token -var RLC = artifacts.require('rlc-faucet-contract/RLC'); -// ERC1538 core & delegates -var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); -var ERC1538Update = artifacts.require('@iexec/solidity/ERC1538UpdateDelegate'); -var ERC1538Query = artifacts.require('@iexec/solidity/ERC1538QueryDelegate'); -// Libraries -var IexecLibOrders = artifacts.require('IexecLibOrders_v5'); -// Interface -var IexecInterfaceNative = artifacts.require('IexecInterfaceNative'); -var IexecInterfaceToken = artifacts.require('IexecInterfaceToken'); -// Delegates -var IexecAccessors = artifacts.require('IexecAccessorsDelegate'); -var IexecAccessorsABILegacy = artifacts.require('IexecAccessorsABILegacyDelegate'); -var IexecCategoryManager = artifacts.require('IexecCategoryManagerDelegate'); -var IexecERC20 = artifacts.require('IexecERC20Delegate'); -var IexecEscrowNative = artifacts.require('IexecEscrowNativeDelegate'); -var IexecEscrowToken = artifacts.require('IexecEscrowTokenDelegate'); -var IexecEscrowTokenSwap = artifacts.require('IexecEscrowTokenSwapDelegate'); -var IexecMaintenance = artifacts.require('IexecMaintenanceDelegate'); -var IexecMaintenanceExtra = artifacts.require('IexecMaintenanceExtraDelegate'); -var IexecOrderManagement = artifacts.require('IexecOrderManagementDelegate'); -var IexecPoco1 = artifacts.require('IexecPoco1Delegate'); -var IexecPoco2 = artifacts.require('IexecPoco2Delegate'); -var IexecRelay = artifacts.require('IexecRelayDelegate'); -var ENSIntegration = artifacts.require('ENSIntegrationDelegate'); -// Other contracts -var AppRegistry = artifacts.require('AppRegistry'); -var DatasetRegistry = artifacts.require('DatasetRegistry'); -var WorkerpoolRegistry = artifacts.require('WorkerpoolRegistry'); - -const BYTES32_ZERO = '0x0000000000000000000000000000000000000000000000000000000000000000'; -const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; - -/***************************************************************************** - * Main * - *****************************************************************************/ -module.exports = async function (accounts) { - console.log('# web3 version:', web3.version); - const chainid = await web3.eth.net.getId(); - const chaintype = await web3.eth.net.getNetworkType(); - console.log('Chainid is:', chainid); - console.log('Chaintype is:', chaintype); - console.log('Deployer is:', accounts[0]); - - /* ------------------------- Existing deployment ------------------------- */ - const deploymentOptions = CONFIG.chains[chainid] || CONFIG.chains.default; - - const factoryDeployer = deploymentOptions.v5.usefactory && new Deployer(web3, accounts[0]); - const salt = process.env.SALT || deploymentOptions.v5.salt; - const libraries = [IexecLibOrders]; - - /* ------------------------ Deploy & link library ------------------------ */ - if (deploymentOptions.v5.usefactory) { - for (library of libraries) { - await factoryDeployer.deploy(library); - } - } else { - const iexecLibOrders = await deployer.deploy(IexecLibOrders); - await deployer.link(iexecLibOrders, IexecPoco1); - await deployer.link(iexecLibOrders, IexecMaintenance); - await deployer.link(iexecLibOrders, IexecOrderManagement); - } - - /* ---------------------------- Modules list ----------------------------- */ - contracts = [ - ERC1538Update, - ERC1538Query, - IexecAccessors, - IexecAccessorsABILegacy, - IexecCategoryManager, - IexecERC20, - deploymentOptions.asset == 'Native' && IexecEscrowNative, - deploymentOptions.asset == 'Token' && IexecEscrowToken, - deploymentOptions.asset == 'Token' && deploymentOptions.uniswap && IexecEscrowTokenSwap, - IexecMaintenance, - IexecOrderManagement, - IexecPoco1, - IexecPoco2, - IexecRelay, - ENSIntegration, - chainid != 1 && IexecMaintenanceExtra, - ].filter(Boolean); - - /* --------------------------- Deploy modules ---------------------------- */ - for (module of contracts) { - deploymentOptions.v5.usefactory - ? await factoryDeployer.deploy(module, { libraries }) - : await deployer.deploy(module); - } - - /* ---------------------------- Deploy proxy ----------------------------- */ - if (deploymentOptions.v5.usefactory) { - await factoryDeployer.deploy(ERC1538Proxy, (await ERC1538Update.deployed()).address, { - call: web3.eth.abi.encodeFunctionCall( - ERC1538Proxy._json.abi.find((e) => e.name == 'transferOwnership'), - [accounts[0]], - ), - salt: process.env.PROXY_SALT || salt, - }); - } else { - await deployer.deploy(ERC1538Proxy, (await ERC1538Update.deployed()).address); - } - ERC1538 = await ERC1538Update.at((await ERC1538Proxy.deployed()).address); - console.log(`IexecInstance deployed at address: ${ERC1538.address}`); - - /* --------------------------- Setup modules ---------------------------- */ - for (module of contracts.filter((module) => module != ERC1538Update)) { - console.log(`ERC1538 link: ${module.contractName}`); - await ERC1538.updateContract( - (await module.deployed()).address, - getFunctionSignatures(module.abi), - 'Linking ' + module.contractName, - ); - } - - /* --------------------------- Configure Stack --------------------------- */ - IexecInterfaceInstance = await IexecInterfaceToken.at(ERC1538.address); - - if (deploymentOptions.v5.AppRegistry) AppRegistry.address = deploymentOptions.v5.AppRegistry; - if (deploymentOptions.v5.DatasetRegistry) - DatasetRegistry.address = deploymentOptions.v5.DatasetRegistry; - if (deploymentOptions.v5.WorkerpoolRegistry) - WorkerpoolRegistry.address = deploymentOptions.v5.WorkerpoolRegistry; - if (deploymentOptions.v5.usefactory) { - AppRegistry.isDeployed() || - (await factoryDeployer.deploy(AppRegistry, { - call: web3.eth.abi.encodeFunctionCall( - AppRegistry._json.abi.find((e) => e.name == 'transferOwnership'), - [accounts[0]], - ), - salt, - })); - DatasetRegistry.isDeployed() || - (await factoryDeployer.deploy(DatasetRegistry, { - call: web3.eth.abi.encodeFunctionCall( - DatasetRegistry._json.abi.find((e) => e.name == 'transferOwnership'), - [accounts[0]], - ), - salt, - })); - WorkerpoolRegistry.isDeployed() || - (await factoryDeployer.deploy(WorkerpoolRegistry, { - call: web3.eth.abi.encodeFunctionCall( - WorkerpoolRegistry._json.abi.find((e) => e.name == 'transferOwnership'), - [accounts[0]], - ), - salt, - })); - } else { - AppRegistry.isDeployed() || (await deployer.deploy(AppRegistry)); - DatasetRegistry.isDeployed() || (await deployer.deploy(DatasetRegistry)); - WorkerpoolRegistry.isDeployed() || (await deployer.deploy(WorkerpoolRegistry)); - } - - switch (deploymentOptions.asset) { - case 'Token': - TokenInstance = await RLC.deployed(); - break; - - case 'Native': - TokenInstance = { address: ADDRESS_ZERO }; - break; - } - - AppRegistryInstance = await AppRegistry.deployed(); - DatasetRegistryInstance = await DatasetRegistry.deployed(); - WorkerpoolRegistryInstance = await WorkerpoolRegistry.deployed(); - console.log(`AppRegistry deployed at address: ${AppRegistryInstance.address}`); - console.log(`DatasetRegistry deployed at address: ${DatasetRegistryInstance.address}`); - console.log(`WorkerpoolRegistry deployed at address: ${WorkerpoolRegistryInstance.address}`); - console.log(`Using token: ${TokenInstance.address}`); - - const AppRegistryInitialized = await AppRegistryInstance.initialized(); - const DatasetRegistryInitialized = await DatasetRegistryInstance.initialized(); - const WorkerpoolRegistryInitialized = await WorkerpoolRegistryInstance.initialized(); - const IexecInterfaceInitialized = - (await IexecInterfaceInstance.eip712domain_separator()) != BYTES32_ZERO; - - !AppRegistryInitialized && - (await AppRegistryInstance.initialize(deploymentOptions.v3.AppRegistry || ADDRESS_ZERO)); - !DatasetRegistryInitialized && - (await DatasetRegistryInstance.initialize( - deploymentOptions.v3.DatasetRegistry || ADDRESS_ZERO, - )); - !WorkerpoolRegistryInitialized && - (await WorkerpoolRegistryInstance.initialize( - deploymentOptions.v3.WorkerpoolRegistry || ADDRESS_ZERO, - )); - !AppRegistryInitialized && - (await AppRegistryInstance.setBaseURI(`https://nfts-metadata.iex.ec/app/${chainid}/`)); - !DatasetRegistryInitialized && - (await DatasetRegistryInstance.setBaseURI( - `https://nfts-metadata.iex.ec/dataset/${chainid}/`, - )); - !WorkerpoolRegistryInitialized && - (await WorkerpoolRegistryInstance.setBaseURI( - `https://nfts-metadata.iex.ec/workerpool/${chainid}/`, - )); - !IexecInterfaceInitialized && - (await IexecInterfaceInstance.configure( - TokenInstance.address, - 'Staked RLC', - 'SRLC', - 9, // TODO: generic ? - AppRegistryInstance.address, - DatasetRegistryInstance.address, - WorkerpoolRegistryInstance.address, - ADDRESS_ZERO, - )); - - /* ----------------------------- Categories ------------------------------ */ - - const catCountBefore = await IexecInterfaceInstance.countCategory(); - await CONFIG.categories.slice(catCountBefore.toNumber()).reduce(async (promise, category) => { - await promise; - await IexecInterfaceInstance.createCategory( - category.name, - JSON.stringify(category.description), - category.workClockTimeRef, - ); - }, Promise.resolve()); - - const catCountAfter = await IexecInterfaceInstance.countCategory(); - console.log(`countCategory is now: ${catCountAfter}`); - ( - await Promise.all( - Array(catCountAfter.toNumber()) - .fill() - .map((_, i) => IexecInterfaceInstance.viewCategory(i)), - ) - ).forEach((category, i) => console.log(['category', i, ':', ...category].join(' '))); -}; diff --git a/migrations/5_deploy_ens.js b/migrations/5_deploy_ens.js deleted file mode 100644 index f6c9d9ec5..000000000 --- a/migrations/5_deploy_ens.js +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const deployer = require('../scripts/hardhat-truffle-utils'); -const assert = require('assert'); -// CONFIG -const CONFIG = require('../config/config.json'); -// ENS -var ENSRegistry = artifacts.require('@ensdomains/ens-contracts/contracts/registry/ENSRegistry'); -var FIFSRegistrar = artifacts.require('@ensdomains/ens-contracts/contracts/registry/FIFSRegistrar'); -var ReverseRegistrar = artifacts.require( - '@ensdomains/ens-contracts/contracts/registry/ReverseRegistrar', -); -var PublicResolver = artifacts.require( - '@ensdomains/ens-contracts/contracts/resolvers/PublicResolver', -); -// Core -var RLC = artifacts.require('rlc-faucet-contract/RLC'); -var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); -var IexecInterfaceNative = artifacts.require('IexecInterfaceNative'); -var IexecInterfaceToken = artifacts.require('IexecInterfaceToken'); -var AppRegistry = artifacts.require('AppRegistry'); -var DatasetRegistry = artifacts.require('DatasetRegistry'); -var WorkerpoolRegistry = artifacts.require('WorkerpoolRegistry'); - -/***************************************************************************** - * Main * - *****************************************************************************/ -module.exports = async function (accounts) { - console.log('# web3 version:', web3.version); - const chainid = await web3.eth.net.getId(); - const chaintype = await web3.eth.net.getNetworkType(); - console.log('Chainid is:', chainid); - console.log('Chaintype is:', chaintype); - console.log('Deployer is:', accounts[0]); - - /* ------------------------- Existing deployment ------------------------- */ - const deploymentOptions = CONFIG.chains[chainid] || CONFIG.chains.default; - - /* ----------------------------- Deploy ENS ------------------------------ */ - if (chainid > 1000) { - // skip for mainnet and testnet use - var ens = null; - var resolver = null; - var registrars = {}; - - function labelhash(label) { - return web3.utils.keccak256(label.toLowerCase()); - } - - function compose(labelHash, rootHash) { - return web3.utils.keccak256( - web3.eth.abi.encodeParameters(['bytes32', 'bytes32'], [rootHash, labelHash]), - ); - } - - function namehash(domain) { - return domain - .split('.') - .reverse() - .reduce((hash, label) => compose(labelhash(label), hash), '0x0'); - } - - async function bootstrap() { - // ens registry - ENSRegistry.isDeployed() || (await deployer.deploy(ENSRegistry)); - ens = await ENSRegistry.deployed(); - console.log(`ENSRegistry deployed at address: ${ens.address}`); - // resolver - PublicResolver.isDeployed() || (await deployer.deploy(PublicResolver, ens.address)); - resolver = await PublicResolver.deployed(); - console.log(`PublicResolver deployed at address: ${resolver.address}`); - // root registrar - await registerDomain(''); - } - - async function setReverseRegistrar() { - ReverseRegistrar.isDeployed() || - (await deployer.deploy(ReverseRegistrar, ens.address, resolver.address)); - reverseregistrar = await ReverseRegistrar.deployed(); - - await registrars[''].register(labelhash('reverse'), accounts[0], { from: accounts[0] }); - await ens.setSubnodeOwner( - namehash('reverse'), - labelhash('addr'), - reverseregistrar.address, - ); - } - - async function registerDomain(label, domain = '') { - const name = domain ? `${label}.${domain}` : `${label}`; - const labelHash = label ? labelhash(label) : '0x0'; - const nameHash = name ? namehash(name) : '0x0'; - const owner = await ens.owner(nameHash); - if ((await web3.eth.getCode(owner)) == '0x') { - registrars[name] = await FIFSRegistrar.new(ens.address, nameHash, { - from: accounts[0], - }); - if (!!name) { - await registrars[domain].register(labelHash, registrars[name].address, { - from: accounts[0], - }); - } else { - await ens.setOwner(nameHash, registrars[name].address, { from: accounts[0] }); - } - } else { - registrars[name] = await FIFSRegistrar.at(owner); - } - console.log( - `FIFSRegistrar for domain ${name} deployed at address: ${registrars[name].address}`, - ); - return registrars[name]; - } - - async function registerAddress(label, domain, address) { - const name = `${label}.${domain}`; - const labelHash = labelhash(label); - const nameHash = namehash(name); - // register as subdomain - await registrars[domain].register(labelHash, accounts[0], { from: accounts[0] }); - // link to ens (resolver & addr) - await ens.setResolver(nameHash, resolver.address, { from: accounts[0] }); - await resolver.setAddr(nameHash, 60, address, { from: accounts[0] }); - } - - await bootstrap(); - await setReverseRegistrar(); - await registerDomain('eth'); - await registerDomain('iexec', 'eth'); - await registerDomain('v5', 'iexec.eth'); - await registerDomain('users', 'iexec.eth'); - await registerDomain('apps', 'iexec.eth'); - await registerDomain('datasets', 'iexec.eth'); - await registerDomain('pools', 'iexec.eth'); - - /* ------------------------- Fetching contracts -------------------------- */ - switch (deploymentOptions.asset) { - case 'Token': - IexecInterfaceInstance = await IexecInterfaceToken.at( - (await ERC1538Proxy.deployed()).address, - ); - break; - case 'Native': - IexecInterfaceInstance = await IexecInterfaceNative.at( - (await ERC1538Proxy.deployed()).address, - ); - break; - } - - const RLCInstance = deploymentOptions.asset == 'Token' && (await RLC.deployed()); - const AppRegistryInstance = await AppRegistry.deployed(); - const DatasetRegistryInstance = await DatasetRegistry.deployed(); - const WorkerpoolRegistryInstance = await WorkerpoolRegistry.deployed(); - - await registerAddress('admin', 'iexec.eth', accounts[0]); - RLCInstance && (await registerAddress('rlc', 'iexec.eth', RLCInstance.address)); - IexecInterfaceInstance && - (await registerAddress('core', 'v5.iexec.eth', IexecInterfaceInstance.address)); - AppRegistryInstance && - (await registerAddress('apps', 'v5.iexec.eth', AppRegistryInstance.address)); - DatasetRegistryInstance && - (await registerAddress('datasets', 'v5.iexec.eth', DatasetRegistryInstance.address)); - WorkerpoolRegistryInstance && - (await registerAddress( - 'workerpools', - 'v5.iexec.eth', - WorkerpoolRegistryInstance.address, - )); - await reverseregistrar.setName('admin.iexec.eth', { from: accounts[0] }); - IexecInterfaceInstance && - (await IexecInterfaceInstance.setName(ens.address, 'core.v5.iexec.eth')); - AppRegistryInstance && - (await AppRegistryInstance.setName(ens.address, 'apps.v5.iexec.eth')); - DatasetRegistryInstance && - (await DatasetRegistryInstance.setName(ens.address, 'datasets.v5.iexec.eth')); - WorkerpoolRegistryInstance && - (await WorkerpoolRegistryInstance.setName(ens.address, 'workerpools.v5.iexec.eth')); - } -}; diff --git a/migrations/999_functions.js b/migrations/999_functions.js deleted file mode 100644 index d2836b552..000000000 --- a/migrations/999_functions.js +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2020 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -// ERC1538 core & delegates -var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); -var ERC1538Query = artifacts.require('@iexec/solidity/ERC1538QueryDelegate'); - -/***************************************************************************** - * Main * - *****************************************************************************/ -module.exports = async function () { - const ERC1538QueryInstace = await ERC1538Query.at((await ERC1538Proxy.deployed()).address); - const functionCount = await ERC1538QueryInstace.totalFunctions(); - - console.log(`The deployed ERC1538Proxy supports ${functionCount} functions:`); - ( - await Promise.all( - Array(functionCount.toNumber()) - .fill() - .map((_, i) => ERC1538QueryInstace.functionByIndex(i)), - ) - ).forEach((details, i) => console.log(`[${i}] ${details.delegate} ${details.signature}`)); -}; diff --git a/migrations/utils/getFunctionSignatures.js b/migrations/utils/getFunctionSignatures.js index de5f6a02c..ba1404f57 100644 --- a/migrations/utils/getFunctionSignatures.js +++ b/migrations/utils/getFunctionSignatures.js @@ -1,8 +1,6 @@ // SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH // SPDX-License-Identifier: Apache-2.0 -const { TruffleDeployer: Deployer } = require('../../utils/FactoryDeployer'); - /***************************************************************************** * Tools * *****************************************************************************/ diff --git a/scripts/hardhat-fixture-deployer.ts b/scripts/hardhat-fixture-deployer.ts index c8e796aee..ce7b7c7bc 100644 --- a/scripts/hardhat-fixture-deployer.ts +++ b/scripts/hardhat-fixture-deployer.ts @@ -10,6 +10,8 @@ const { resetNetworkToInitialState } = require('./common-test-snapshot'); const deploy = require('../deploy/0_deploy'); const deployEns = require('../deploy/1_deploy-ens'); +// TODO update and move to test/utils/ + // Anonymous functions cannot be used as fixtures, hence we need to wrap body // in a method which will be called by `loadFixture`. async function resetNetworkAndDeployAllContracts() { @@ -58,6 +60,5 @@ async function resetNetworkAndDeployAllContracts() { * @returns proxy address. */ export const loadHardhatFixtureDeployment = async () => { - console.log('Running hardhat-fixture'); return await loadFixture(resetNetworkAndDeployAllContracts); }; diff --git a/scripts/hardhat-truffle-utils.js b/scripts/hardhat-truffle-utils.js deleted file mode 100644 index d557f9316..000000000 --- a/scripts/hardhat-truffle-utils.js +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -module.exports = { - deploy: async function (contract, ...args) { - const instance = await contract.new(...args); - contract.setAsDeployed(instance); - console.log("%s: %s", contract._json.contractName, instance.address); - return instance; - }, - link: async function (libraryInstance, contract) { - const chainid = await web3.eth.net.getId(); - const instance = contract._json.networks[chainid]; - if (!instance) { - await contract.link(libraryInstance); - } - }, -}; diff --git a/scripts/module_upgrade.js b/scripts/module_upgrade.js index 0cab8d21b..e580e7d3d 100644 --- a/scripts/module_upgrade.js +++ b/scripts/module_upgrade.js @@ -7,6 +7,8 @@ var GenericFactory = artifacts.require('@iexec/solidity/GenericFactory'); var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); var ERC1538Update = artifacts.require('@iexec/solidity/ERC1538UpdateDelegate'); +// TODO replace `web3` by `ethers`. + /***************************************************************************** * Configuration * *****************************************************************************/ diff --git a/scripts/truffle-fixture-deployer.js b/scripts/truffle-fixture-deployer.js deleted file mode 100644 index d9fbbc59d..000000000 --- a/scripts/truffle-fixture-deployer.js +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: 2023-2024 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { resetNetworkToInitialState } = require('./common-test-snapshot'); -const initial_migration = require('../migrations/1_initial_migration.js'); -const deploy_token = require('../migrations/3_deploy_token.js'); -const deploy_core = require('../migrations/4_deploy_core.js'); -const deploy_ens = require('../migrations/5_deploy_ens.js'); -const functions = require('../migrations/999_functions.js'); - -async function resetNetworkAndDeployAllContracts() { - await resetNetworkToInitialState(); - console.log('Migrating contracts..'); - await initial_migration(); - const accounts = await web3.eth.getAccounts(); - await deploy_token(accounts); - await deploy_core(accounts); - await deploy_ens(accounts); - await functions(accounts); -} - -module.exports = async () => { - console.log('Running truffle-fixture'); - await loadFixture(resetNetworkAndDeployAllContracts); -}; diff --git a/scripts/upgrades/5_0_0-to-5_1_0.js b/scripts/upgrades/5_0_0-to-5_1_0.js index 619015e7e..db66306b8 100644 --- a/scripts/upgrades/5_0_0-to-5_1_0.js +++ b/scripts/upgrades/5_0_0-to-5_1_0.js @@ -7,6 +7,8 @@ var GenericFactory = artifacts.require('@iexec/solidity/GenericFactory'); var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); var ERC1538Update = artifacts.require('@iexec/solidity/ERC1538UpdateDelegate'); +// TODO replace `web3` by `ethers`. + /***************************************************************************** * Configuration * *****************************************************************************/ diff --git a/scripts/upgrades/5_1_0-to-5_2_0.js b/scripts/upgrades/5_1_0-to-5_2_0.js index 195ce6430..74942d884 100644 --- a/scripts/upgrades/5_1_0-to-5_2_0.js +++ b/scripts/upgrades/5_1_0-to-5_2_0.js @@ -7,6 +7,8 @@ var GenericFactory = artifacts.require('@iexec/solidity/GenericFactory'); var ERC1538Proxy = artifacts.require('@iexec/solidity/ERC1538Proxy'); var ERC1538Update = artifacts.require('@iexec/solidity/ERC1538UpdateDelegate'); +// TODO replace `web3` by `ethers`. + const { ethers } = require('ethers'); /***************************************************************************** diff --git a/utils/FactoryDeployer.js b/utils/FactoryDeployer.js index 3cdd7fe19..b09de2d75 100644 --- a/utils/FactoryDeployer.js +++ b/utils/FactoryDeployer.js @@ -134,11 +134,4 @@ class EthersDeployer { } } -class TruffleDeployer extends EthersDeployer { - constructor(web3, wallet = 0, options = {}) { - const provider = new ethers.providers.Web3Provider(web3.currentProvider); - super(provider.getSigner(wallet), options); - } -} - -module.exports = { EthersDeployer, TruffleDeployer, factoryAddress: FACTORY.address }; +module.exports = { EthersDeployer, factoryAddress: FACTORY.address }; diff --git a/verify.sh b/verify.sh deleted file mode 100755 index adb14f027..000000000 --- a/verify.sh +++ /dev/null @@ -1,45 +0,0 @@ -# TODO migrate - -#!/usr/bin/env bash - -NETWORKS=( - # mainnet - # ropsten - rinkeby - # goerli - # kovan -) - -declare -A CHAINID=( - [mainnet]=1 - [ropsten]=3 - [rinkeby]=4 - [goerli]=5 - [kovan]=42 -) - -CONTRACTS=( - # AppRegistry - # DatasetRegistry - # WorkerpoolRegistry - # ENSIntegrationDelegate - # IexecCategoryManagerDelegate - # IexecERC20Delegate - # IexecEscrowTokenDelegate - # IexecMaintenanceExtraDelegate - # IexecRelayDelegate - - # IexecAccessorsABILegacyDelegate - # IexecMaintenanceDelegate # Library ? - # IexecPocoDelegate # Library ? - # IexecOrderManagementDelegate # Library ? - # IexecLibOrders_v5 # ??? -) - -for CONTRACT in "${CONTRACTS[@]}"; -do -for NETWORK in "${NETWORKS[@]}"; -do - truffle run verify $CONTRACT --network $NETWORK $@ -done -done