diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 820ae243a..419a0b003 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -109,5 +109,3 @@ jobs: - name: core run: yarn workspace @hyperlane-xyz/core run test - - name: app - run: yarn workspace @hyperlane-xyz/app run test diff --git a/.gitignore b/.gitignore index 2545b73af..264f8d02d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ tmp.env typescript/*/node_modules typescript/infra/config/environments/test/create2/*json typescript/infra/config/environments/test/testrecipient/*json -solidity/*/artifacts +solidity/artifacts .yarn/install-state.gz .yarn/cache diff --git a/Dockerfile b/Dockerfile index 0181ce596..232415a0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,7 @@ COPY typescript/sdk/package.json ./typescript/sdk/ COPY typescript/helloworld/package.json ./typescript/helloworld/ COPY typescript/ica/package.json ./typescript/ica/ COPY typescript/infra/package.json ./typescript/infra/ -COPY solidity/core/package.json ./solidity/core/ -COPY solidity/app/package.json ./solidity/app/ +COPY solidity/package.json ./solidity/ RUN yarn install && yarn cache clean diff --git a/package.json b/package.json index 8cae77f22..1dc995408 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "publish:all": "yarn workspaces foreach --no-private --verbose --topological npm publish --access public" }, "workspaces": [ - "solidity/*", + "solidity", "typescript/*" ], "resolutions": { diff --git a/solidity/core/.env.example b/solidity/.env.example similarity index 100% rename from solidity/core/.env.example rename to solidity/.env.example diff --git a/solidity/app/.gitignore b/solidity/.gitignore similarity index 100% rename from solidity/app/.gitignore rename to solidity/.gitignore diff --git a/solidity/.solcover.js b/solidity/.solcover.js new file mode 100644 index 000000000..e06da7cac --- /dev/null +++ b/solidity/.solcover.js @@ -0,0 +1,3 @@ +module.exports = { + skipFiles: ['test'], +}; diff --git a/solidity/app/.solhint.json b/solidity/.solhint.json similarity index 100% rename from solidity/app/.solhint.json rename to solidity/.solhint.json diff --git a/solidity/core/README.md b/solidity/README.md similarity index 100% rename from solidity/core/README.md rename to solidity/README.md diff --git a/solidity/app/.solcover.js b/solidity/app/.solcover.js deleted file mode 100644 index d4a4a0437..000000000 --- a/solidity/app/.solcover.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - skipFiles: ["test"], -}; diff --git a/solidity/app/hardhat.config.ts b/solidity/app/hardhat.config.ts deleted file mode 100644 index f4fbb2824..000000000 --- a/solidity/app/hardhat.config.ts +++ /dev/null @@ -1,34 +0,0 @@ -import '@nomiclabs/hardhat-waffle'; -import '@typechain/hardhat'; -import 'hardhat-gas-reporter'; -import 'solidity-coverage'; - -/** - * @type import('hardhat/config').HardhatUserConfig - */ -module.exports = { - solidity: { - compilers: [ - { - version: '0.8.16', - }, - { - version: '0.7.6', - settings: { - optimizer: { - enabled: true, - runs: 999999, - }, - }, - }, - ], - }, - gasReporter: { - currency: 'USD', - }, - typechain: { - outDir: './types', - target: 'ethers-v5', - alwaysGenerateOverloads: false, - }, -}; diff --git a/solidity/app/package.json b/solidity/app/package.json deleted file mode 100644 index 24cfb1af1..000000000 --- a/solidity/app/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@hyperlane-xyz/app", - "description": "Solidity contracts for Hyperlane apps", - "version": "0.5.1", - "dependencies": { - "@hyperlane-xyz/core": "0.5.1", - "@hyperlane-xyz/utils": "0.5.1", - "@openzeppelin/contracts-upgradeable": "^4.5.0" - }, - "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.0.5", - "@nomiclabs/hardhat-waffle": "^2.0.2", - "@typechain/ethers-v5": "10.0.0", - "@typechain/hardhat": "^6.0.0", - "@types/mocha": "^9.1.0", - "chai": "^4.3.0", - "ethereum-waffle": "^3.4.4", - "ethers": "^5.6.8", - "hardhat": "^2.8.4", - "hardhat-gas-reporter": "^1.0.7", - "prettier": "^2.4.1", - "prettier-plugin-solidity": "^1.0.0-beta.5", - "solhint": "^3.3.2", - "solhint-plugin-prettier": "^0.0.5", - "solidity-coverage": "^0.7.14", - "ts-node": "^10.8.0", - "typechain": "8.0.0", - "typescript": "^4.7.2" - }, - "directories": { - "test": "test" - }, - "files": [ - "/dist", - "/contracts", - "/interfaces" - ], - "homepage": "https://www.hyperlane.xyz", - "keywords": [ - "Hyperlane", - "Solidity" - ], - "license": "Apache-2.0", - "main": "dist/index.js", - "repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo", - "scripts": { - "build": "hardhat compile && tsc", - "clean": "hardhat clean && rm -rf ./dist ./cache", - "coverage": "hardhat coverage", - "prettier": "prettier --write ./contracts ./test", - "test": "hardhat test" - }, - "types": "dist/index.d.ts" -} diff --git a/solidity/app/tsconfig.json b/solidity/app/tsconfig.json deleted file mode 100644 index 85da2e13b..000000000 --- a/solidity/app/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist/", - "rootDir": "./types/" - }, - "exclude": ["./node_modules/", "./dist/", "./types/hardhat.d.ts"], - "extends": "../../tsconfig.json", - "include": ["./types/**/*.ts"] -} diff --git a/solidity/app/contracts/AbacusConnectionClient.sol b/solidity/contracts/AbacusConnectionClient.sol similarity index 94% rename from solidity/app/contracts/AbacusConnectionClient.sol rename to solidity/contracts/AbacusConnectionClient.sol index cf96f8a34..a77a42499 100644 --- a/solidity/app/contracts/AbacusConnectionClient.sol +++ b/solidity/contracts/AbacusConnectionClient.sol @@ -2,9 +2,9 @@ pragma solidity >=0.6.11; // ============ Internal Imports ============ -import {IInterchainGasPaymaster} from "@hyperlane-xyz/core/interfaces/IInterchainGasPaymaster.sol"; -import {IOutbox} from "@hyperlane-xyz/core/interfaces/IOutbox.sol"; -import {IAbacusConnectionManager} from "@hyperlane-xyz/core/interfaces/IAbacusConnectionManager.sol"; +import {IInterchainGasPaymaster} from "../interfaces/IInterchainGasPaymaster.sol"; +import {IOutbox} from "../interfaces/IOutbox.sol"; +import {IAbacusConnectionManager} from "../interfaces/IAbacusConnectionManager.sol"; // ============ External Imports ============ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; diff --git a/solidity/core/contracts/AbacusConnectionManager.sol b/solidity/contracts/AbacusConnectionManager.sol similarity index 100% rename from solidity/core/contracts/AbacusConnectionManager.sol rename to solidity/contracts/AbacusConnectionManager.sol diff --git a/solidity/core/contracts/Create2Factory.sol b/solidity/contracts/Create2Factory.sol similarity index 100% rename from solidity/core/contracts/Create2Factory.sol rename to solidity/contracts/Create2Factory.sol diff --git a/solidity/core/contracts/Inbox.sol b/solidity/contracts/Inbox.sol similarity index 100% rename from solidity/core/contracts/Inbox.sol rename to solidity/contracts/Inbox.sol diff --git a/solidity/core/contracts/InterchainGasPaymaster.sol b/solidity/contracts/InterchainGasPaymaster.sol similarity index 100% rename from solidity/core/contracts/InterchainGasPaymaster.sol rename to solidity/contracts/InterchainGasPaymaster.sol diff --git a/solidity/core/contracts/Mailbox.sol b/solidity/contracts/Mailbox.sol similarity index 100% rename from solidity/core/contracts/Mailbox.sol rename to solidity/contracts/Mailbox.sol diff --git a/solidity/core/contracts/MerkleTreeManager.sol b/solidity/contracts/MerkleTreeManager.sol similarity index 100% rename from solidity/core/contracts/MerkleTreeManager.sol rename to solidity/contracts/MerkleTreeManager.sol diff --git a/solidity/core/contracts/Outbox.sol b/solidity/contracts/Outbox.sol similarity index 100% rename from solidity/core/contracts/Outbox.sol rename to solidity/contracts/Outbox.sol diff --git a/solidity/app/contracts/Router.sol b/solidity/contracts/Router.sol similarity index 94% rename from solidity/app/contracts/Router.sol rename to solidity/contracts/Router.sol index e9c8cc84a..2544f46bb 100644 --- a/solidity/app/contracts/Router.sol +++ b/solidity/contracts/Router.sol @@ -3,10 +3,10 @@ pragma solidity >=0.6.11; // ============ Internal Imports ============ import {AbacusConnectionClient} from "./AbacusConnectionClient.sol"; -import {IAbacusConnectionManager} from "@hyperlane-xyz/core/interfaces/IAbacusConnectionManager.sol"; -import {IInterchainGasPaymaster} from "@hyperlane-xyz/core/interfaces/IInterchainGasPaymaster.sol"; -import {IMessageRecipient} from "@hyperlane-xyz/core/interfaces/IMessageRecipient.sol"; -import {IOutbox} from "@hyperlane-xyz/core/interfaces/IOutbox.sol"; +import {IAbacusConnectionManager} from "../interfaces/IAbacusConnectionManager.sol"; +import {IInterchainGasPaymaster} from "../interfaces/IInterchainGasPaymaster.sol"; +import {IMessageRecipient} from "../interfaces/IMessageRecipient.sol"; +import {IOutbox} from "../interfaces/IOutbox.sol"; abstract contract Router is AbacusConnectionClient, IMessageRecipient { string constant NO_ROUTER_ENROLLED_REVERT_MESSAGE = diff --git a/solidity/core/contracts/libs/Merkle.sol b/solidity/contracts/libs/Merkle.sol similarity index 100% rename from solidity/core/contracts/libs/Merkle.sol rename to solidity/contracts/libs/Merkle.sol diff --git a/solidity/core/contracts/libs/Message.sol b/solidity/contracts/libs/Message.sol similarity index 100% rename from solidity/core/contracts/libs/Message.sol rename to solidity/contracts/libs/Message.sol diff --git a/solidity/core/contracts/libs/TypeCasts.sol b/solidity/contracts/libs/TypeCasts.sol similarity index 100% rename from solidity/core/contracts/libs/TypeCasts.sol rename to solidity/contracts/libs/TypeCasts.sol diff --git a/solidity/core/contracts/mock/MockInbox.sol b/solidity/contracts/mock/MockInbox.sol similarity index 100% rename from solidity/core/contracts/mock/MockInbox.sol rename to solidity/contracts/mock/MockInbox.sol diff --git a/solidity/core/contracts/mock/MockOutbox.sol b/solidity/contracts/mock/MockOutbox.sol similarity index 100% rename from solidity/core/contracts/mock/MockOutbox.sol rename to solidity/contracts/mock/MockOutbox.sol diff --git a/solidity/core/contracts/test/MysteryMath.sol b/solidity/contracts/test/MysteryMath.sol similarity index 100% rename from solidity/core/contracts/test/MysteryMath.sol rename to solidity/contracts/test/MysteryMath.sol diff --git a/solidity/core/contracts/test/MysteryMathV1.sol b/solidity/contracts/test/MysteryMathV1.sol similarity index 100% rename from solidity/core/contracts/test/MysteryMathV1.sol rename to solidity/contracts/test/MysteryMathV1.sol diff --git a/solidity/core/contracts/test/MysteryMathV2.sol b/solidity/contracts/test/MysteryMathV2.sol similarity index 100% rename from solidity/core/contracts/test/MysteryMathV2.sol rename to solidity/contracts/test/MysteryMathV2.sol diff --git a/solidity/app/contracts/test/TestAbacusConnectionClient.sol b/solidity/contracts/test/TestAbacusConnectionClient.sol similarity index 90% rename from solidity/app/contracts/test/TestAbacusConnectionClient.sol rename to solidity/contracts/test/TestAbacusConnectionClient.sol index 071cea25e..e17960a9c 100644 --- a/solidity/app/contracts/test/TestAbacusConnectionClient.sol +++ b/solidity/contracts/test/TestAbacusConnectionClient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; -import {IOutbox} from "@hyperlane-xyz/core/interfaces/IOutbox.sol"; +import {IOutbox} from "../../interfaces/IOutbox.sol"; import "../AbacusConnectionClient.sol"; diff --git a/solidity/core/contracts/test/TestInbox.sol b/solidity/contracts/test/TestInbox.sol similarity index 100% rename from solidity/core/contracts/test/TestInbox.sol rename to solidity/contracts/test/TestInbox.sol diff --git a/solidity/core/contracts/test/TestMailbox.sol b/solidity/contracts/test/TestMailbox.sol similarity index 100% rename from solidity/core/contracts/test/TestMailbox.sol rename to solidity/contracts/test/TestMailbox.sol diff --git a/solidity/core/contracts/test/TestMerkle.sol b/solidity/contracts/test/TestMerkle.sol similarity index 100% rename from solidity/core/contracts/test/TestMerkle.sol rename to solidity/contracts/test/TestMerkle.sol diff --git a/solidity/core/contracts/test/TestMessage.sol b/solidity/contracts/test/TestMessage.sol similarity index 100% rename from solidity/core/contracts/test/TestMessage.sol rename to solidity/contracts/test/TestMessage.sol diff --git a/solidity/core/contracts/test/TestMultisigValidatorManager.sol b/solidity/contracts/test/TestMultisigValidatorManager.sol similarity index 100% rename from solidity/core/contracts/test/TestMultisigValidatorManager.sol rename to solidity/contracts/test/TestMultisigValidatorManager.sol diff --git a/solidity/core/contracts/test/TestOutbox.sol b/solidity/contracts/test/TestOutbox.sol similarity index 100% rename from solidity/core/contracts/test/TestOutbox.sol rename to solidity/contracts/test/TestOutbox.sol diff --git a/solidity/core/contracts/test/TestRecipient.sol b/solidity/contracts/test/TestRecipient.sol similarity index 100% rename from solidity/core/contracts/test/TestRecipient.sol rename to solidity/contracts/test/TestRecipient.sol diff --git a/solidity/app/contracts/test/TestRouter.sol b/solidity/contracts/test/TestRouter.sol similarity index 100% rename from solidity/app/contracts/test/TestRouter.sol rename to solidity/contracts/test/TestRouter.sol diff --git a/solidity/core/contracts/test/TestSendReceiver.sol b/solidity/contracts/test/TestSendReceiver.sol similarity index 100% rename from solidity/core/contracts/test/TestSendReceiver.sol rename to solidity/contracts/test/TestSendReceiver.sol diff --git a/solidity/core/contracts/test/TestValidatorManager.sol b/solidity/contracts/test/TestValidatorManager.sol similarity index 100% rename from solidity/core/contracts/test/TestValidatorManager.sol rename to solidity/contracts/test/TestValidatorManager.sol diff --git a/solidity/core/contracts/test/bad-recipient/BadRecipient1.sol b/solidity/contracts/test/bad-recipient/BadRecipient1.sol similarity index 100% rename from solidity/core/contracts/test/bad-recipient/BadRecipient1.sol rename to solidity/contracts/test/bad-recipient/BadRecipient1.sol diff --git a/solidity/core/contracts/test/bad-recipient/BadRecipient2.sol b/solidity/contracts/test/bad-recipient/BadRecipient2.sol similarity index 100% rename from solidity/core/contracts/test/bad-recipient/BadRecipient2.sol rename to solidity/contracts/test/bad-recipient/BadRecipient2.sol diff --git a/solidity/core/contracts/test/bad-recipient/BadRecipient3.sol b/solidity/contracts/test/bad-recipient/BadRecipient3.sol similarity index 100% rename from solidity/core/contracts/test/bad-recipient/BadRecipient3.sol rename to solidity/contracts/test/bad-recipient/BadRecipient3.sol diff --git a/solidity/core/contracts/test/bad-recipient/BadRecipient5.sol b/solidity/contracts/test/bad-recipient/BadRecipient5.sol similarity index 100% rename from solidity/core/contracts/test/bad-recipient/BadRecipient5.sol rename to solidity/contracts/test/bad-recipient/BadRecipient5.sol diff --git a/solidity/core/contracts/test/bad-recipient/BadRecipient6.sol b/solidity/contracts/test/bad-recipient/BadRecipient6.sol similarity index 100% rename from solidity/core/contracts/test/bad-recipient/BadRecipient6.sol rename to solidity/contracts/test/bad-recipient/BadRecipient6.sol diff --git a/solidity/core/contracts/upgrade/UpgradeBeacon.sol b/solidity/contracts/upgrade/UpgradeBeacon.sol similarity index 100% rename from solidity/core/contracts/upgrade/UpgradeBeacon.sol rename to solidity/contracts/upgrade/UpgradeBeacon.sol diff --git a/solidity/core/contracts/upgrade/UpgradeBeaconController.sol b/solidity/contracts/upgrade/UpgradeBeaconController.sol similarity index 100% rename from solidity/core/contracts/upgrade/UpgradeBeaconController.sol rename to solidity/contracts/upgrade/UpgradeBeaconController.sol diff --git a/solidity/core/contracts/upgrade/UpgradeBeaconProxy.sol b/solidity/contracts/upgrade/UpgradeBeaconProxy.sol similarity index 100% rename from solidity/core/contracts/upgrade/UpgradeBeaconProxy.sol rename to solidity/contracts/upgrade/UpgradeBeaconProxy.sol diff --git a/solidity/core/contracts/upgrade/Versioned.sol b/solidity/contracts/upgrade/Versioned.sol similarity index 100% rename from solidity/core/contracts/upgrade/Versioned.sol rename to solidity/contracts/upgrade/Versioned.sol diff --git a/solidity/core/contracts/validator-manager/InboxValidatorManager.sol b/solidity/contracts/validator-manager/InboxValidatorManager.sol similarity index 100% rename from solidity/core/contracts/validator-manager/InboxValidatorManager.sol rename to solidity/contracts/validator-manager/InboxValidatorManager.sol diff --git a/solidity/core/contracts/validator-manager/MultisigValidatorManager.sol b/solidity/contracts/validator-manager/MultisigValidatorManager.sol similarity index 100% rename from solidity/core/contracts/validator-manager/MultisigValidatorManager.sol rename to solidity/contracts/validator-manager/MultisigValidatorManager.sol diff --git a/solidity/core/contracts/validator-manager/OutboxValidatorManager.sol b/solidity/contracts/validator-manager/OutboxValidatorManager.sol similarity index 100% rename from solidity/core/contracts/validator-manager/OutboxValidatorManager.sol rename to solidity/contracts/validator-manager/OutboxValidatorManager.sol diff --git a/solidity/core/.gitignore b/solidity/core/.gitignore deleted file mode 100644 index 1dddebd13..000000000 --- a/solidity/core/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -node_modules/ -cache/ -artifacts/ -types/ -dist/ -coverage/ -coverage.json -.env diff --git a/solidity/core/.solcover.js b/solidity/core/.solcover.js deleted file mode 100644 index d4a4a0437..000000000 --- a/solidity/core/.solcover.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - skipFiles: ["test"], -}; diff --git a/solidity/core/.solhint.json b/solidity/core/.solhint.json deleted file mode 100644 index 9c3fb3e5d..000000000 --- a/solidity/core/.solhint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "solhint:recommended", - "rules": { - "compiler-version": ["error", "^0.6.11"], - "func-visibility": ["warn", {"ignoreConstructors":true}], - "not-rely-on-time": "off", - "avoid-low-level-calls": "off", - "no-inline-assembly": "off" - } -} diff --git a/solidity/core/tsconfig.json b/solidity/core/tsconfig.json deleted file mode 100644 index 85da2e13b..000000000 --- a/solidity/core/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist/", - "rootDir": "./types/" - }, - "exclude": ["./node_modules/", "./dist/", "./types/hardhat.d.ts"], - "extends": "../../tsconfig.json", - "include": ["./types/**/*.ts"] -} diff --git a/solidity/core/hardhat.config.ts b/solidity/hardhat.config.ts similarity index 100% rename from solidity/core/hardhat.config.ts rename to solidity/hardhat.config.ts diff --git a/solidity/core/interfaces/IAbacusConnectionManager.sol b/solidity/interfaces/IAbacusConnectionManager.sol similarity index 100% rename from solidity/core/interfaces/IAbacusConnectionManager.sol rename to solidity/interfaces/IAbacusConnectionManager.sol diff --git a/solidity/core/interfaces/IInbox.sol b/solidity/interfaces/IInbox.sol similarity index 100% rename from solidity/core/interfaces/IInbox.sol rename to solidity/interfaces/IInbox.sol diff --git a/solidity/core/interfaces/IInterchainGasPaymaster.sol b/solidity/interfaces/IInterchainGasPaymaster.sol similarity index 100% rename from solidity/core/interfaces/IInterchainGasPaymaster.sol rename to solidity/interfaces/IInterchainGasPaymaster.sol diff --git a/solidity/core/interfaces/IMailbox.sol b/solidity/interfaces/IMailbox.sol similarity index 100% rename from solidity/core/interfaces/IMailbox.sol rename to solidity/interfaces/IMailbox.sol diff --git a/solidity/core/interfaces/IMessageRecipient.sol b/solidity/interfaces/IMessageRecipient.sol similarity index 100% rename from solidity/core/interfaces/IMessageRecipient.sol rename to solidity/interfaces/IMessageRecipient.sol diff --git a/solidity/core/interfaces/IMultisigValidatorManager.sol b/solidity/interfaces/IMultisigValidatorManager.sol similarity index 100% rename from solidity/core/interfaces/IMultisigValidatorManager.sol rename to solidity/interfaces/IMultisigValidatorManager.sol diff --git a/solidity/core/interfaces/IOutbox.sol b/solidity/interfaces/IOutbox.sol similarity index 100% rename from solidity/core/interfaces/IOutbox.sol rename to solidity/interfaces/IOutbox.sol diff --git a/solidity/core/package.json b/solidity/package.json similarity index 100% rename from solidity/core/package.json rename to solidity/package.json diff --git a/solidity/core/test/.eslintrc b/solidity/test/.eslintrc similarity index 100% rename from solidity/core/test/.eslintrc rename to solidity/test/.eslintrc diff --git a/solidity/app/test/abacusConnectionClient.test.ts b/solidity/test/abacusConnectionClient.test.ts similarity index 99% rename from solidity/app/test/abacusConnectionClient.test.ts rename to solidity/test/abacusConnectionClient.test.ts index 48dc14552..30134eae0 100644 --- a/solidity/app/test/abacusConnectionClient.test.ts +++ b/solidity/test/abacusConnectionClient.test.ts @@ -10,8 +10,7 @@ import { Outbox__factory, TestInbox__factory, TestMultisigValidatorManager__factory, -} from '@hyperlane-xyz/core'; - +} from '../types'; import { TestAbacusConnectionClient, TestAbacusConnectionClient__factory, diff --git a/solidity/core/test/abacusConnectionManager.test.ts b/solidity/test/abacusConnectionManager.test.ts similarity index 100% rename from solidity/core/test/abacusConnectionManager.test.ts rename to solidity/test/abacusConnectionManager.test.ts diff --git a/solidity/core/test/inbox.test.ts b/solidity/test/inbox.test.ts similarity index 100% rename from solidity/core/test/inbox.test.ts rename to solidity/test/inbox.test.ts diff --git a/solidity/core/test/interchainGasPaymaster.test.ts b/solidity/test/interchainGasPaymaster.test.ts similarity index 100% rename from solidity/core/test/interchainGasPaymaster.test.ts rename to solidity/test/interchainGasPaymaster.test.ts diff --git a/solidity/core/test/lib/mailboxes.ts b/solidity/test/lib/mailboxes.ts similarity index 100% rename from solidity/core/test/lib/mailboxes.ts rename to solidity/test/lib/mailboxes.ts diff --git a/solidity/core/test/lib/upgrade.ts b/solidity/test/lib/upgrade.ts similarity index 100% rename from solidity/core/test/lib/upgrade.ts rename to solidity/test/lib/upgrade.ts diff --git a/solidity/core/test/mailbox.test.ts b/solidity/test/mailbox.test.ts similarity index 100% rename from solidity/core/test/mailbox.test.ts rename to solidity/test/mailbox.test.ts diff --git a/solidity/core/test/merkle.test.ts b/solidity/test/merkle.test.ts similarity index 95% rename from solidity/core/test/merkle.test.ts rename to solidity/test/merkle.test.ts index acf145698..b7711c539 100644 --- a/solidity/core/test/merkle.test.ts +++ b/solidity/test/merkle.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; -import merkleTestCases from '../../../vectors/merkle.json'; +import merkleTestCases from '../../vectors/merkle.json'; import { TestMerkle, TestMerkle__factory } from '../types'; describe('Merkle', async () => { diff --git a/solidity/core/test/message.test.ts b/solidity/test/message.test.ts similarity index 97% rename from solidity/core/test/message.test.ts rename to solidity/test/message.test.ts index 582ffc015..ea8f0fa24 100644 --- a/solidity/core/test/message.test.ts +++ b/solidity/test/message.test.ts @@ -5,7 +5,7 @@ import { utils } from '@hyperlane-xyz/utils'; import { TestMessage, TestMessage__factory } from '../types'; -const testCases = require('../../../vectors/message.json'); +const testCases = require('../../vectors/message.json'); const remoteDomain = 1000; const localDomain = 2000; diff --git a/solidity/core/test/mockMailbox.test.ts b/solidity/test/mockMailbox.test.ts similarity index 100% rename from solidity/core/test/mockMailbox.test.ts rename to solidity/test/mockMailbox.test.ts diff --git a/solidity/core/test/outbox.test.ts b/solidity/test/outbox.test.ts similarity index 100% rename from solidity/core/test/outbox.test.ts rename to solidity/test/outbox.test.ts diff --git a/solidity/app/test/router.test.ts b/solidity/test/router.test.ts similarity index 99% rename from solidity/app/test/router.test.ts rename to solidity/test/router.test.ts index 228d6a8f1..99756ef12 100644 --- a/solidity/app/test/router.test.ts +++ b/solidity/test/router.test.ts @@ -4,6 +4,8 @@ import { expect } from 'chai'; import { ContractTransaction } from 'ethers'; import { ethers } from 'hardhat'; +import { utils } from '@hyperlane-xyz/utils'; + import { AbacusConnectionManager, AbacusConnectionManager__factory, @@ -14,9 +16,7 @@ import { TestInbox, TestInbox__factory, TestMultisigValidatorManager__factory, -} from '@hyperlane-xyz/core'; -import { utils } from '@hyperlane-xyz/utils'; - +} from '../types'; import { TestRouter, TestRouter__factory } from '../types'; const ONLY_OWNER_REVERT_MSG = 'Ownable: caller is not the owner'; diff --git a/solidity/core/test/testSendReceiver.test.ts b/solidity/test/testSendReceiver.test.ts similarity index 100% rename from solidity/core/test/testSendReceiver.test.ts rename to solidity/test/testSendReceiver.test.ts diff --git a/solidity/core/test/testrecipient.test.ts b/solidity/test/testrecipient.test.ts similarity index 100% rename from solidity/core/test/testrecipient.test.ts rename to solidity/test/testrecipient.test.ts diff --git a/solidity/core/test/upgrade.test.ts b/solidity/test/upgrade.test.ts similarity index 100% rename from solidity/core/test/upgrade.test.ts rename to solidity/test/upgrade.test.ts diff --git a/solidity/core/test/validator-manager/inboxValidatorManager.test.ts b/solidity/test/validator-manager/inboxValidatorManager.test.ts similarity index 100% rename from solidity/core/test/validator-manager/inboxValidatorManager.test.ts rename to solidity/test/validator-manager/inboxValidatorManager.test.ts diff --git a/solidity/core/test/validator-manager/multisigValidatorManager.test.ts b/solidity/test/validator-manager/multisigValidatorManager.test.ts similarity index 99% rename from solidity/core/test/validator-manager/multisigValidatorManager.test.ts rename to solidity/test/validator-manager/multisigValidatorManager.test.ts index cf1ebb567..f8bd6d686 100644 --- a/solidity/core/test/validator-manager/multisigValidatorManager.test.ts +++ b/solidity/test/validator-manager/multisigValidatorManager.test.ts @@ -16,7 +16,7 @@ const OUTBOX_DOMAIN = 1234; const QUORUM_THRESHOLD = 1; // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -const domainHashTestCases = require('../../../../vectors/domainHash.json'); +const domainHashTestCases = require('../../../vectors/domainHash.json'); describe('MultisigValidatorManager', async () => { let validatorManager: TestMultisigValidatorManager, diff --git a/solidity/core/test/validator-manager/outboxValidatorManager.test.ts b/solidity/test/validator-manager/outboxValidatorManager.test.ts similarity index 100% rename from solidity/core/test/validator-manager/outboxValidatorManager.test.ts rename to solidity/test/validator-manager/outboxValidatorManager.test.ts diff --git a/solidity/core/test/validator-manager/utils.ts b/solidity/test/validator-manager/utils.ts similarity index 100% rename from solidity/core/test/validator-manager/utils.ts rename to solidity/test/validator-manager/utils.ts diff --git a/solidity/tsconfig.json b/solidity/tsconfig.json index 3c43903cf..2a4472fff 100644 --- a/solidity/tsconfig.json +++ b/solidity/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": "../tsconfig.json" + "compilerOptions": { + "outDir": "./dist/", + "rootDir": "./types/" + }, + "exclude": ["./node_modules/", "./dist/", "./types/hardhat.d.ts"], + "extends": "../tsconfig.json", + "include": ["./types/**/*.ts"] } diff --git a/solidity/core/update_abis.sh b/solidity/update_abis.sh similarity index 83% rename from solidity/core/update_abis.sh rename to solidity/update_abis.sh index fe41ff5fc..8ce86537d 100755 --- a/solidity/core/update_abis.sh +++ b/solidity/update_abis.sh @@ -4,7 +4,7 @@ copy() { # Optionally allow path to be passed in, and extract the contract name # as the string following the last instance of `/` CONTRACT_NAME="${1##*/}" - jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../../rust/chains/abacus-ethereum/abis/"$CONTRACT_NAME".abi.json + jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../rust/chains/abacus-ethereum/abis/"$CONTRACT_NAME".abi.json } copy Inbox && copy Outbox && copy validator-manager/InboxValidatorManager && copy InterchainGasPaymaster diff --git a/typescript/helloworld/contracts/HelloWorld.sol b/typescript/helloworld/contracts/HelloWorld.sol index dd88d1aa3..34d88d3b8 100644 --- a/typescript/helloworld/contracts/HelloWorld.sol +++ b/typescript/helloworld/contracts/HelloWorld.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.13; // ============ External Imports ============ -import {Router} from "@hyperlane-xyz/app/contracts/Router.sol"; +import {Router} from "@hyperlane-xyz/core/contracts/Router.sol"; /* * @title The Hello World App diff --git a/typescript/ica/contracts/InterchainAccountRouter.sol b/typescript/ica/contracts/InterchainAccountRouter.sol index 1f3cbfc4d..3d7930276 100644 --- a/typescript/ica/contracts/InterchainAccountRouter.sol +++ b/typescript/ica/contracts/InterchainAccountRouter.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.13; import {OwnableMulticall, Call} from "./OwnableMulticall.sol"; // ============ External Imports ============ -import {Router} from "@hyperlane-xyz/app/contracts/Router.sol"; +import {Router} from "@hyperlane-xyz/core/contracts/Router.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; diff --git a/typescript/ica/contracts/InterchainQueryRouter.sol b/typescript/ica/contracts/InterchainQueryRouter.sol index aa460d5c6..3cd0310cd 100644 --- a/typescript/ica/contracts/InterchainQueryRouter.sol +++ b/typescript/ica/contracts/InterchainQueryRouter.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.13; import {OwnableMulticall, Call} from "./OwnableMulticall.sol"; // ============ External Imports ============ -import {Router} from "@hyperlane-xyz/app/contracts/Router.sol"; +import {Router} from "@hyperlane-xyz/core/contracts/Router.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; diff --git a/typescript/ica/package.json b/typescript/ica/package.json index ba904ce17..c441f737a 100644 --- a/typescript/ica/package.json +++ b/typescript/ica/package.json @@ -3,7 +3,7 @@ "description": "A router middleware for interchain accounts", "version": "0.5.1", "dependencies": { - "@hyperlane-xyz/app": "0.5.1", + "@hyperlane-xyz/core": "0.5.1", "@hyperlane-xyz/sdk": "0.5.1", "@hyperlane-xyz/utils": "0.5.1", "@openzeppelin/contracts-upgradeable": "^4.6.0", diff --git a/typescript/sdk/package.json b/typescript/sdk/package.json index d0b1ee508..5544fa26f 100644 --- a/typescript/sdk/package.json +++ b/typescript/sdk/package.json @@ -3,7 +3,6 @@ "description": "The official SDK for the Hyperlane Network", "version": "0.5.1", "dependencies": { - "@hyperlane-xyz/app": "0.5.1", "@hyperlane-xyz/celo-ethers-provider": "^0.1.1", "@hyperlane-xyz/core": "0.5.1", "@hyperlane-xyz/utils": "0.5.1", diff --git a/typescript/sdk/src/router.ts b/typescript/sdk/src/router.ts index ee94f1316..2795f26e8 100644 --- a/typescript/sdk/src/router.ts +++ b/typescript/sdk/src/router.ts @@ -1,6 +1,6 @@ import type { ethers } from 'ethers'; -import { Router } from '@hyperlane-xyz/app'; +import { Router } from '@hyperlane-xyz/core'; import type { types } from '@hyperlane-xyz/utils'; import { HyperlaneContracts, HyperlaneFactories } from './contracts'; @@ -25,4 +25,4 @@ export type ConnectionClientConfig = { interchainGasPaymaster: types.Address; }; -export { Router } from '@hyperlane-xyz/app'; +export { Router } from '@hyperlane-xyz/core'; diff --git a/typescript/sdk/src/test/envSubsetDeployer/app.ts b/typescript/sdk/src/test/envSubsetDeployer/app.ts index d9e96acb4..c8a9ddaac 100644 --- a/typescript/sdk/src/test/envSubsetDeployer/app.ts +++ b/typescript/sdk/src/test/envSubsetDeployer/app.ts @@ -1,4 +1,4 @@ -import { TestRouter__factory } from '@hyperlane-xyz/app'; +import { TestRouter__factory } from '@hyperlane-xyz/core'; import { HyperlaneApp } from '../../HyperlaneApp'; import { chainConnectionConfigs } from '../../consts/chainConnectionConfigs'; diff --git a/yarn.lock b/yarn.lock index 79b6e1d9e..751aefc35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3677,34 +3677,6 @@ __metadata: languageName: node linkType: hard -"@hyperlane-xyz/app@0.5.1, @hyperlane-xyz/app@workspace:solidity/app": - version: 0.0.0-use.local - resolution: "@hyperlane-xyz/app@workspace:solidity/app" - dependencies: - "@hyperlane-xyz/core": 0.5.1 - "@hyperlane-xyz/utils": 0.5.1 - "@nomiclabs/hardhat-ethers": ^2.0.5 - "@nomiclabs/hardhat-waffle": ^2.0.2 - "@openzeppelin/contracts-upgradeable": ^4.5.0 - "@typechain/ethers-v5": 10.0.0 - "@typechain/hardhat": ^6.0.0 - "@types/mocha": ^9.1.0 - chai: ^4.3.0 - ethereum-waffle: ^3.4.4 - ethers: ^5.6.8 - hardhat: ^2.8.4 - hardhat-gas-reporter: ^1.0.7 - prettier: ^2.4.1 - prettier-plugin-solidity: ^1.0.0-beta.5 - solhint: ^3.3.2 - solhint-plugin-prettier: ^0.0.5 - solidity-coverage: ^0.7.14 - ts-node: ^10.8.0 - typechain: 8.0.0 - typescript: ^4.7.2 - languageName: unknown - linkType: soft - "@hyperlane-xyz/celo-ethers-provider@npm:^0.1.1": version: 0.1.1 resolution: "@hyperlane-xyz/celo-ethers-provider@npm:0.1.1" @@ -3714,9 +3686,9 @@ __metadata: languageName: node linkType: hard -"@hyperlane-xyz/core@0.5.1, @hyperlane-xyz/core@workspace:solidity/core": +"@hyperlane-xyz/core@0.5.1, @hyperlane-xyz/core@workspace:solidity": version: 0.0.0-use.local - resolution: "@hyperlane-xyz/core@workspace:solidity/core" + resolution: "@hyperlane-xyz/core@workspace:solidity" dependencies: "@hyperlane-xyz/utils": 0.5.1 "@nomiclabs/hardhat-ethers": ^2.0.5 @@ -3819,7 +3791,7 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperlane-xyz/interchain-accounts@workspace:typescript/ica" dependencies: - "@hyperlane-xyz/app": 0.5.1 + "@hyperlane-xyz/core": 0.5.1 "@hyperlane-xyz/sdk": 0.5.1 "@hyperlane-xyz/utils": 0.5.1 "@nomicfoundation/hardhat-chai-matchers": ^1.0.3 @@ -3870,7 +3842,6 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperlane-xyz/sdk@workspace:typescript/sdk" dependencies: - "@hyperlane-xyz/app": 0.5.1 "@hyperlane-xyz/celo-ethers-provider": ^0.1.1 "@hyperlane-xyz/core": 0.5.1 "@hyperlane-xyz/utils": 0.5.1 @@ -4235,7 +4206,7 @@ __metadata: languageName: node linkType: hard -"@openzeppelin/contracts-upgradeable@npm:^4.5.0, @openzeppelin/contracts-upgradeable@npm:^4.6.0": +"@openzeppelin/contracts-upgradeable@npm:^4.6.0": version: 4.6.0 resolution: "@openzeppelin/contracts-upgradeable@npm:4.6.0" checksum: f9802c9cccf31bd475412ba5d862ed15eed5352302c30b29c38f84aed2dcfe0d957687935a72068f3d44292a4a55b0ff26cd018b2e14a47f16f74f087009aa29