From 0a5195a39d83f57bdd9f320f1a79c260ce21cb70 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 14:22:59 +0530 Subject: [PATCH 1/6] chore: add changeset --- .changeset/lemon-wombats-camp.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/lemon-wombats-camp.md diff --git a/.changeset/lemon-wombats-camp.md b/.changeset/lemon-wombats-camp.md new file mode 100644 index 00000000..33a25e4b --- /dev/null +++ b/.changeset/lemon-wombats-camp.md @@ -0,0 +1,6 @@ +--- +'@fuel-bridge/solidity-contracts': minor +'@fuel-bridge/test-utils': minor +--- + +ci for contract upgrade test suite From 5357879aef2b0d381d0afde59f3c3311b8363011 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 14:24:18 +0530 Subject: [PATCH 2/6] chore: add workspace packages --- packages/solidity-contracts/package.json | 10 +++++++++- pnpm-lock.yaml | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/solidity-contracts/package.json b/packages/solidity-contracts/package.json index 70087cf7..41874449 100644 --- a/packages/solidity-contracts/package.json +++ b/packages/solidity-contracts/package.json @@ -21,14 +21,21 @@ "coverage": "pnpm run build && pnpm hardhat coverage --temp artifacts --network hardhat", "check": "pnpm solhint \"contracts/**/*.sol\"", "node": "pnpm hardhat node --network hardhat", + "test:integration": "pnpm mocha -b -r ts-node/register 'integration-tests/**/*.ts'", + "node:up": "sh ./scripts/node:up.sh", "start-mining": "pnpm hardhat run --no-compile --network localhost scripts/startAutoMining.ts", "serve-deployments": "pnpm ts-node scripts/serveDeployments.ts", "test": "pnpm hardhat test", + "upgrade:test:integration": "sh ./scripts/test.sh", "test-no-compile": "pnpm hardhat test --no-compile", "test-parallel": "pnpx mocha 'test/**/*.ts' --recursive --parallel --require hardhat/register", "prettier": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'", "lint": "prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'" }, + "peerDependencies": { + "@fuel-bridge/test-utils": "workspace:*", + "@fuel-bridge/fungible-token": "workspace:*" + }, "devDependencies": { "@fuel-ts/merkle": "^0.21.2", "@inquirer/prompts": "^5.3.8", @@ -54,6 +61,7 @@ "@typescript-eslint/parser": "^5.43.0", "chai": "^4.3.7", "cors": "2.8.5", + "mocha": "^10.0.0", "dotenv": "^16.0.3", "ethers": "6.13.1", "express": "^4.18.2", @@ -76,4 +84,4 @@ "typechain": "^8.3.2", "typescript": "^4.9.3" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc55af5d..94419ef0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,6 +127,13 @@ importers: version: link:../solidity-contracts packages/solidity-contracts: + dependencies: + '@fuel-bridge/fungible-token': + specifier: workspace:* + version: link:../fungible-token + '@fuel-bridge/test-utils': + specifier: workspace:* + version: link:../test-utils devDependencies: '@fuel-ts/merkle': specifier: ^0.21.2 @@ -230,6 +237,9 @@ importers: markdownlint-cli: specifier: ^0.32.2 version: 0.32.2 + mocha: + specifier: ^10.0.0 + version: 10.4.0 node-fetch: specifier: ^2.6.6 version: 2.7.0 From cf10aab30714ffb26f0368cd06503686343d14c4 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 14:25:29 +0530 Subject: [PATCH 3/6] feat: add upgrade scripts --- .../deploy/hardhat/001.chain_state.ts | 4 + .../hardhat/002.fuel_message_portal_v3.ts | 4 + .../deploy/hardhat/003.erc20_gateway_v4.ts | 4 + .../hardhat/005.register_block_committer.ts | 17 +-- .../deploy/hardhat/006._erc721_gateway_v3.ts | 26 ++++- .../deploy/hardhat/007.set_asset_issuer_id.ts | 4 + .../deploy/hardhat/009.chain_state_upgrade.ts | 101 ++++++++++++++++++ .../deploy/hardhat/010.portal_upgrade.ts | 86 +++++++++++++++ .../deploy/hardhat/011.gateway_upgrade.ts | 97 +++++++++++++++++ .../hardhat/999.serve_deployment_file.ts | 78 ++++++++++++-- packages/solidity-contracts/hardhat.config.ts | 4 + 11 files changed, 409 insertions(+), 16 deletions(-) create mode 100644 packages/solidity-contracts/deploy/hardhat/009.chain_state_upgrade.ts create mode 100644 packages/solidity-contracts/deploy/hardhat/010.portal_upgrade.ts create mode 100644 packages/solidity-contracts/deploy/hardhat/011.gateway_upgrade.ts diff --git a/packages/solidity-contracts/deploy/hardhat/001.chain_state.ts b/packages/solidity-contracts/deploy/hardhat/001.chain_state.ts index 1d9f0e2d..30b4b275 100644 --- a/packages/solidity-contracts/deploy/hardhat/001.chain_state.ts +++ b/packages/solidity-contracts/deploy/hardhat/001.chain_state.ts @@ -13,6 +13,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { upgrades: { deployProxy, erc1967 }, deployments: { save }, } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + if (isForking) return; + const [deployer] = await ethers.getSigners(); const contract = await deployProxy(new FuelChainState(deployer), [], { diff --git a/packages/solidity-contracts/deploy/hardhat/002.fuel_message_portal_v3.ts b/packages/solidity-contracts/deploy/hardhat/002.fuel_message_portal_v3.ts index 225aaf25..5468571c 100644 --- a/packages/solidity-contracts/deploy/hardhat/002.fuel_message_portal_v3.ts +++ b/packages/solidity-contracts/deploy/hardhat/002.fuel_message_portal_v3.ts @@ -14,6 +14,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { upgrades: { deployProxy, erc1967 }, deployments: { get, save }, } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + if (isForking) return; + const [deployer] = await ethers.getSigners(); const { address: fuelChainState } = await get('FuelChainState'); diff --git a/packages/solidity-contracts/deploy/hardhat/003.erc20_gateway_v4.ts b/packages/solidity-contracts/deploy/hardhat/003.erc20_gateway_v4.ts index bef7f203..2f117733 100644 --- a/packages/solidity-contracts/deploy/hardhat/003.erc20_gateway_v4.ts +++ b/packages/solidity-contracts/deploy/hardhat/003.erc20_gateway_v4.ts @@ -9,6 +9,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { upgrades: { deployProxy, erc1967 }, deployments: { get, save }, } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + if (isForking) return; + const [deployer] = await ethers.getSigners(); const fuelMessagePortal = await get('FuelMessagePortal'); diff --git a/packages/solidity-contracts/deploy/hardhat/005.register_block_committer.ts b/packages/solidity-contracts/deploy/hardhat/005.register_block_committer.ts index f0fa19ab..9acd6bbe 100644 --- a/packages/solidity-contracts/deploy/hardhat/005.register_block_committer.ts +++ b/packages/solidity-contracts/deploy/hardhat/005.register_block_committer.ts @@ -7,16 +7,21 @@ const COMMITTER_ADDRESS = '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { ethers, deployments } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + const [deployer] = await ethers.getSigners(); - const { address } = await deployments.get('FuelChainState'); + if (!isForking) { + const { address } = await deployments.get('FuelChainState'); - const fuelChainState = FuelChainState__factory.connect(address, deployer); - const COMMITTER_ROLE = await fuelChainState.COMMITTER_ROLE(); + const fuelChainState = FuelChainState__factory.connect(address, deployer); + const COMMITTER_ROLE = await fuelChainState.COMMITTER_ROLE(); - await fuelChainState - .grantRole(COMMITTER_ROLE, COMMITTER_ADDRESS) - .then((tx) => tx.wait()); + await fuelChainState + .grantRole(COMMITTER_ROLE, COMMITTER_ADDRESS) + .then((tx) => tx.wait()); + } console.log('Granted role COMMITTER_ROLE to', COMMITTER_ADDRESS); }; diff --git a/packages/solidity-contracts/deploy/hardhat/006._erc721_gateway_v3.ts b/packages/solidity-contracts/deploy/hardhat/006._erc721_gateway_v3.ts index 3f4734bf..69129a74 100644 --- a/packages/solidity-contracts/deploy/hardhat/006._erc721_gateway_v3.ts +++ b/packages/solidity-contracts/deploy/hardhat/006._erc721_gateway_v3.ts @@ -1,5 +1,7 @@ +import fs from 'fs'; import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import type { DeployFunction } from 'hardhat-deploy/dist/types'; +import path from 'path'; import { FuelERC721GatewayV2__factory as FuelERC721GatewayV2 } from '../../typechain'; @@ -9,13 +11,33 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { upgrades: { deployProxy, erc1967 }, deployments: { get, save }, } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + const [deployer] = await ethers.getSigners(); - const fuelMessagePortal = await get('FuelMessagePortal'); + let portlAddress; + if (isForking) { + const deploymentPath = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet', + 'FuelMessagePortal.json' + ); + + const deployment = JSON.parse(fs.readFileSync(deploymentPath, 'utf8')); + portlAddress = deployment.address; + } else { + const fuelMessagePortal = await get('FuelMessagePortal'); + portlAddress = fuelMessagePortal.address; + } const contract = await deployProxy( new FuelERC721GatewayV2(deployer), - [fuelMessagePortal.address], + [portlAddress], { initializer: 'initialize', } diff --git a/packages/solidity-contracts/deploy/hardhat/007.set_asset_issuer_id.ts b/packages/solidity-contracts/deploy/hardhat/007.set_asset_issuer_id.ts index 025d7345..f689131a 100644 --- a/packages/solidity-contracts/deploy/hardhat/007.set_asset_issuer_id.ts +++ b/packages/solidity-contracts/deploy/hardhat/007.set_asset_issuer_id.ts @@ -16,6 +16,10 @@ const ASSET_ISSUER_ID = const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { ethers, deployments } = hre; + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + if (isForking) return; + const [deployer] = await ethers.getSigners(); await deployments.execute( diff --git a/packages/solidity-contracts/deploy/hardhat/009.chain_state_upgrade.ts b/packages/solidity-contracts/deploy/hardhat/009.chain_state_upgrade.ts new file mode 100644 index 00000000..48fdf219 --- /dev/null +++ b/packages/solidity-contracts/deploy/hardhat/009.chain_state_upgrade.ts @@ -0,0 +1,101 @@ +import fs from 'fs'; +import type { HardhatRuntimeEnvironment } from 'hardhat/types'; +import type { DeployFunction } from 'hardhat-deploy/dist/types'; +import path from 'path'; + +import { FuelChainState__factory } from '../../typechain'; + +const BLOCKS_PER_COMMIT_INTERVAL = 30; +const TIME_TO_FINALIZE = 5; +const COMMIT_COOLDOWN = TIME_TO_FINALIZE; + +const ADMIN = '0x32da601374b38154f05904B16F44A1911Aa6f314'; +let COMMITTER_ADDRESS = '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { + ethers, + upgrades: { erc1967 }, + } = hre; + + const [deployer] = await ethers.getSigners(); + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + let address; + + if (isForking) { + const deploymentPath = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet', + 'FuelChainState.json' + ); + + const deployment = JSON.parse(fs.readFileSync(deploymentPath, 'utf8')); + address = deployment.address; + + const chainState = FuelChainState__factory.connect(address, deployer); + + const factory = await hre.ethers.getContractFactory('FuelChainState'); + + const newImplementation = await factory.deploy( + TIME_TO_FINALIZE, + BLOCKS_PER_COMMIT_INTERVAL, + COMMIT_COOLDOWN + ); + + const newImplementationAddress = await newImplementation.getAddress(); + + let txData = chainState.interface.encodeFunctionData('upgradeTo', [ + newImplementationAddress, + ]); + + await deployer.sendTransaction({ + to: ADMIN, + value: ethers.parseEther('100'), + }); + + const impersonatedSigner = await ethers.getImpersonatedSigner(ADMIN); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + const COMMITTER_ROLE = await chainState.COMMITTER_ROLE(); + + txData = await chainState.interface.encodeFunctionData('grantRole', [ + COMMITTER_ROLE, + COMMITTER_ADDRESS, + ]); + + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + COMMITTER_ADDRESS = '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65'; + + txData = await chainState.interface.encodeFunctionData('grantRole', [ + COMMITTER_ROLE, + COMMITTER_ADDRESS, + ]); + + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + const implementation = await erc1967.getImplementationAddress(address); + + console.log('Upgraded FuelChainState to', implementation); + + return true; + } +}; + +func.tags = ['upgrade_chain_state']; +func.id = 'upgrade_chain_state'; +export default func; diff --git a/packages/solidity-contracts/deploy/hardhat/010.portal_upgrade.ts b/packages/solidity-contracts/deploy/hardhat/010.portal_upgrade.ts new file mode 100644 index 00000000..14682a6a --- /dev/null +++ b/packages/solidity-contracts/deploy/hardhat/010.portal_upgrade.ts @@ -0,0 +1,86 @@ +import { MaxUint256 } from 'ethers'; +import fs from 'fs'; +import type { HardhatRuntimeEnvironment } from 'hardhat/types'; +import type { DeployFunction } from 'hardhat-deploy/dist/types'; +import path from 'path'; + +import { FuelMessagePortalV3__factory as FuelMessagePortal } from '../../typechain'; + +const RATE_LIMIT_DURATION = 3600 * 24 * 7; + +const ADMIN = '0x32da601374b38154f05904B16F44A1911Aa6f314'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { + ethers, + upgrades: { erc1967 }, + } = hre; + + const [deployer] = await ethers.getSigners(); + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + let address; + + if (isForking) { + const deploymentPath = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet', + 'FuelMessagePortal.json' + ); + + const deployment = JSON.parse(fs.readFileSync(deploymentPath, 'utf8')); + address = deployment.address; + + const portal = FuelMessagePortal.connect(address, deployer); + + const SET_RATE_LIMITER_ROLE = await portal.SET_RATE_LIMITER_ROLE(); + + const factory = await hre.ethers.getContractFactory('FuelMessagePortalV3'); + + const newImplementation = await factory.deploy( + MaxUint256, + RATE_LIMIT_DURATION + ); + + const newImplementationAddress = await newImplementation.getAddress(); + + let txData = portal.interface.encodeFunctionData('upgradeTo', [ + newImplementationAddress, + ]); + + await deployer.sendTransaction({ + to: ADMIN, + value: ethers.parseEther('100'), + }); + + const impersonatedSigner = await ethers.getImpersonatedSigner(ADMIN); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + txData = await portal.interface.encodeFunctionData('grantRole', [ + SET_RATE_LIMITER_ROLE, + await deployer.getAddress(), + ]); + + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + const implementation = await erc1967.getImplementationAddress(address); + + console.log('Upgraded FuelMessagePortal to', implementation); + + return true; + } +}; + +func.tags = ['upgrade_portal']; +func.id = 'upgrade_portal'; +export default func; diff --git a/packages/solidity-contracts/deploy/hardhat/011.gateway_upgrade.ts b/packages/solidity-contracts/deploy/hardhat/011.gateway_upgrade.ts new file mode 100644 index 00000000..9b6e0d82 --- /dev/null +++ b/packages/solidity-contracts/deploy/hardhat/011.gateway_upgrade.ts @@ -0,0 +1,97 @@ +import fs from 'fs'; +import type { HardhatRuntimeEnvironment } from 'hardhat/types'; +import type { DeployFunction } from 'hardhat-deploy/dist/types'; +import path from 'path'; + +import { FuelERC20GatewayV4__factory } from '../../typechain'; + +const ADMIN = '0x32da601374b38154f05904B16F44A1911Aa6f314'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { + ethers, + upgrades: { erc1967 }, + } = hre; + + const [deployer] = await ethers.getSigners(); + + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; + let address; + + if (isForking) { + const deploymentPath = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet', + 'FuelERC20GatewayV4.json' + ); + + const deployment = JSON.parse(fs.readFileSync(deploymentPath, 'utf8')); + address = deployment.address; + + const portal = FuelERC20GatewayV4__factory.connect(address, deployer); + + const ADMIN_ROLE = await portal.DEFAULT_ADMIN_ROLE(); + const SET_RATE_LIMITER_ROLE = await portal.SET_RATE_LIMITER_ROLE(); + + const factory = await hre.ethers.getContractFactory('FuelERC20GatewayV4'); + + const newImplementation = await factory.deploy(); + + const newImplementationAddress = await newImplementation.getAddress(); + + let txData = portal.interface.encodeFunctionData('upgradeTo', [ + newImplementationAddress, + ]); + + await deployer.sendTransaction({ + to: ADMIN, + value: ethers.parseEther('100'), + }); + + const impersonatedSigner = await ethers.getImpersonatedSigner(ADMIN); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + txData = await portal.interface.encodeFunctionData('grantRole', [ + ADMIN_ROLE, + await deployer.getAddress(), + ]); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + txData = await portal.interface.encodeFunctionData('grantRole', [ + SET_RATE_LIMITER_ROLE, + await deployer.getAddress(), + ]); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + txData = await portal.interface.encodeFunctionData('requireWhitelist', [ + false, + ]); + await impersonatedSigner.sendTransaction({ + to: address, + data: txData, + }); + + const implementation = await erc1967.getImplementationAddress(address); + + console.log('Upgraded FuelGateway to', implementation); + + return true; + } +}; + +func.tags = ['upgrade_gateway']; +func.id = 'upgrade_gateway'; +export default func; diff --git a/packages/solidity-contracts/deploy/hardhat/999.serve_deployment_file.ts b/packages/solidity-contracts/deploy/hardhat/999.serve_deployment_file.ts index 9900c7e0..4a2fbc64 100644 --- a/packages/solidity-contracts/deploy/hardhat/999.serve_deployment_file.ts +++ b/packages/solidity-contracts/deploy/hardhat/999.serve_deployment_file.ts @@ -1,18 +1,78 @@ -import { promises as fs } from 'fs'; +import fs, { writeFile } from 'fs'; import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import type { DeployFunction } from 'hardhat-deploy/dist/types'; +import path from 'path'; +import { promisify } from 'util'; import { FuelChainState__factory } from '../../typechain'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, ethers } = hre; - const allDeployments = await deployments.all(); + + let address: any; + const isForking = hre.config.networks[hre.network.name]?.forking?.enabled; const deploymentsFile: { [name: string]: string } = {}; - for (const key of Object.keys(allDeployments)) { - deploymentsFile[key] = allDeployments[key].address; + + if (isForking) { + let deploymentDir = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet' + ); + + fs.readdirSync(deploymentDir) + .filter((file) => path.extname(file) === '.json') + .forEach((file) => { + const filePath = path.join(deploymentDir, file); + try { + const deployment = JSON.parse(fs.readFileSync(filePath, 'utf8')); + // Use filename (without .json) as the key + const contractName = path.basename(file, '.json'); + deploymentsFile[contractName] = deployment.address; + } catch (error) { + console.error(`Error reading deployment file ${file}:`, error); + } + }); + + deploymentDir = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'localhost', + 'FuelERC721Gateway.json' + ); + + const deployment = JSON.parse(fs.readFileSync(deploymentDir, 'utf8')); + deploymentsFile['FuelERC721Gateway'] = deployment.address; + + deploymentDir = path.join( + __dirname, + '..', + '..', + '/', + 'deployments', + 'mainnet', + 'FuelChainState.json' + ); + + const chainStateDeployment = JSON.parse( + fs.readFileSync(deploymentDir, 'utf8') + ); + address = chainStateDeployment.address; + } else { + const allDeployments = await deployments.all(); + for (const key of Object.keys(allDeployments)) { + deploymentsFile[key] = allDeployments[key].address; + } + + ({ address } = await deployments.get('FuelChainState')); } - const { address } = await deployments.get('FuelChainState'); const state = FuelChainState__factory.connect(address, ethers.provider); deploymentsFile['BLOCKS_PER_COMMIT_INTERVAL'] = ( @@ -25,10 +85,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await state.TIME_TO_FINALIZE() ).toString(); - await fs.writeFile( + const writeFileAsync = promisify(writeFile); + + await writeFileAsync( 'deployments/deployments.local.json', - JSON.stringify(deploymentsFile, null, ' '), - 'utf-8' + JSON.stringify(deploymentsFile, null, 2), + 'utf8' ); }; diff --git a/packages/solidity-contracts/hardhat.config.ts b/packages/solidity-contracts/hardhat.config.ts index 2815dc62..887110fb 100644 --- a/packages/solidity-contracts/hardhat.config.ts +++ b/packages/solidity-contracts/hardhat.config.ts @@ -41,6 +41,10 @@ const config: HardhatUserConfig = { accounts: { count: 128, }, + forking: { + enabled: !!process.env.TENDERLY_RPC_URL, + url: process.env.TENDERLY_RPC_URL ? process.env.TENDERLY_RPC_URL : '', + }, deploy: ['deploy/hardhat'], }, localhost: { From f9bc4e54e8737c269d65ce26a21fe1fd9251ab14 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 14:53:47 +0530 Subject: [PATCH 4/6] chore: revert workspace update --- packages/solidity-contracts/package.json | 4 ---- pnpm-lock.yaml | 7 ------- 2 files changed, 11 deletions(-) diff --git a/packages/solidity-contracts/package.json b/packages/solidity-contracts/package.json index 41874449..9920ace0 100644 --- a/packages/solidity-contracts/package.json +++ b/packages/solidity-contracts/package.json @@ -32,10 +32,6 @@ "prettier": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'", "lint": "prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'" }, - "peerDependencies": { - "@fuel-bridge/test-utils": "workspace:*", - "@fuel-bridge/fungible-token": "workspace:*" - }, "devDependencies": { "@fuel-ts/merkle": "^0.21.2", "@inquirer/prompts": "^5.3.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94419ef0..e68d59a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,13 +127,6 @@ importers: version: link:../solidity-contracts packages/solidity-contracts: - dependencies: - '@fuel-bridge/fungible-token': - specifier: workspace:* - version: link:../fungible-token - '@fuel-bridge/test-utils': - specifier: workspace:* - version: link:../test-utils devDependencies: '@fuel-ts/merkle': specifier: ^0.21.2 From 337b26a2a2793e63def492afbbad7ebc8d7a863e Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 15:08:18 +0530 Subject: [PATCH 5/6] chore: use workspace packages as dev dependency --- packages/solidity-contracts/package.json | 2 ++ pnpm-lock.yaml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/packages/solidity-contracts/package.json b/packages/solidity-contracts/package.json index 9920ace0..c5fae485 100644 --- a/packages/solidity-contracts/package.json +++ b/packages/solidity-contracts/package.json @@ -33,6 +33,8 @@ "lint": "prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'" }, "devDependencies": { + "@fuel-bridge/test-utils": "workspace:*", + "@fuel-bridge/fungible-token": "workspace:*", "@fuel-ts/merkle": "^0.21.2", "@inquirer/prompts": "^5.3.8", "@nomicfoundation/hardhat-chai-matchers": "^2.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e68d59a5..45e91dba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,6 +128,12 @@ importers: packages/solidity-contracts: devDependencies: + '@fuel-bridge/fungible-token': + specifier: workspace:* + version: link:../fungible-token + '@fuel-bridge/test-utils': + specifier: workspace:* + version: link:../test-utils '@fuel-ts/merkle': specifier: ^0.21.2 version: 0.21.2 From e715f65d73e1af4a2166e884c06cecadc325a336 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Fri, 3 Jan 2025 15:26:03 +0530 Subject: [PATCH 6/6] chore: have a single workspace as peer dependency --- packages/solidity-contracts/package.json | 5 +++-- pnpm-lock.yaml | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/solidity-contracts/package.json b/packages/solidity-contracts/package.json index c5fae485..73097737 100644 --- a/packages/solidity-contracts/package.json +++ b/packages/solidity-contracts/package.json @@ -32,9 +32,10 @@ "prettier": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'", "lint": "prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'" }, + "peerDependencies": { + "@fuel-bridge/test-utils": "workspace:*" + }, "devDependencies": { - "@fuel-bridge/test-utils": "workspace:*", - "@fuel-bridge/fungible-token": "workspace:*", "@fuel-ts/merkle": "^0.21.2", "@inquirer/prompts": "^5.3.8", "@nomicfoundation/hardhat-chai-matchers": "^2.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45e91dba..f87fc478 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,13 +127,11 @@ importers: version: link:../solidity-contracts packages/solidity-contracts: - devDependencies: - '@fuel-bridge/fungible-token': - specifier: workspace:* - version: link:../fungible-token + dependencies: '@fuel-bridge/test-utils': specifier: workspace:* version: link:../test-utils + devDependencies: '@fuel-ts/merkle': specifier: ^0.21.2 version: 0.21.2