Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: "feat: zksync support for core solidity package" #5275

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions solidity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@ docs
flattened/
buildArtifact.json
fixtures/
# ZKSync
artifacts-zk
cache-zk
core-utils/zksync/artifacts/output
.zksolc-libraries-cache/
typechain-types/
typechain/
2 changes: 0 additions & 2 deletions solidity/core-utils/index.ts

This file was deleted.

103 changes: 0 additions & 103 deletions solidity/core-utils/zksync/index.ts

This file was deleted.

39 changes: 0 additions & 39 deletions solidity/exportBuildArtifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,3 @@ else
echo 'Failed to process build artifact with jq'
exit 1
fi

# ZKSYNC

if [ "$ZKSYNC" = "true" ]; then
# Define the artifacts directory
artifactsDir="./artifacts-zk/build-info"
# Define the output file
outputFileJson="./dist/zksync/buildArtifact.json"
outputFileJs="./dist/zksync/buildArtifact.js"
outputFileTsd="./dist/zksync/buildArtifact.d.ts"

# log that we're in the script
echo 'Finding and processing ZKSync hardhat build artifact...'

# Find most recently modified JSON build artifact
if [ "$(uname)" = "Darwin" ]; then
# for local flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -f "%m %N" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
else
# for CI flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -c "%Y %n" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
fi

if [ ! -f "$jsonFiles" ]; then
echo 'Failed to find ZKSync build artifact'
exit 1
fi

# Extract required keys and write to outputFile
if jq -c '{input, solcLongVersion, zk_version: .output.zk_version}' "$jsonFiles" >"$outputFileJson"; then
echo "export const buildArtifact = " >"$outputFileJs"
cat "$outputFileJson" >>"$outputFileJs"
echo "export const buildArtifact: any" >"$outputFileTsd"
echo 'Finished processing ZKSync build artifact.'
else
echo 'Failed to process ZKSync build artifact with jq'
exit 1
fi
fi
60 changes: 0 additions & 60 deletions solidity/generate-artifact-exports.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion solidity/hardhat.config.cts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
currency: 'USD',
},
typechain: {
outDir: './core-utils/typechain',
outDir: './types',
target: 'ethers-v5',
alwaysGenerateOverloads: true,
node16Modules: true,
Expand Down
15 changes: 4 additions & 11 deletions solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
},
"devDependencies": {
"@layerzerolabs/solidity-examples": "^1.1.0",
"@matterlabs/hardhat-zksync-solc": "^1.2.4",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"@typechain/ethers-v5": "^11.1.2",
Expand All @@ -36,19 +35,17 @@
"ts-node": "^10.8.0",
"tsx": "^4.19.1",
"typechain": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch",
"typescript": "5.3.3",
"zksync-ethers": "^5.10.0"
"typescript": "5.3.3"
},
"directories": {
"test": "test"
},
"type": "module",
"exports": {
".": "./dist/index.js",
"./mailbox": "./dist/typechain/contracts/Mailbox.js",
"./mailbox": "./dist/contracts/Mailbox.js",
"./buildArtifact.js": "./dist/buildArtifact.js",
"./buildArtifact.json": "./dist/buildArtifact.json",
"./buildArtifact-zksync.js": "./dist/zksync/buildArtifact.js",
"./contracts": "./contracts"
},
"types": "./dist/index.d.ts",
Expand All @@ -68,15 +65,12 @@
"license": "Apache-2.0",
"scripts": {
"build": "yarn version:update && yarn hardhat-esm compile && tsc && ./exportBuildArtifact.sh",
"build:zk": "yarn hardhat-zk compile && ts-node generate-artifact-exports.mjs && ZKSYNC=true ./exportBuildArtifact.sh && yarn copy-artifacts",
"prepublishOnly": "yarn build && yarn build:zk",
"lint": "solhint contracts/**/*.sol",
"clean": "yarn hardhat-esm clean && yarn hardhat-zk clean && rm -rf ./dist ./cache ./cache-zk ./types ./coverage ./out ./forge-cache ./fixtures",
"clean": "yarn hardhat-esm clean && rm -rf ./dist ./cache ./types ./coverage ./out ./forge-cache ./fixtures",
"coverage": "yarn fixtures && ./coverage.sh",
"docs": "forge doc",
"fixtures": "mkdir -p ./fixtures/aggregation ./fixtures/multisig",
"hardhat-esm": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config hardhat.config.cts",
"hardhat-zk": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config zk-hardhat.config.cts",
"prettier": "prettier --write ./contracts ./test",
"test": "yarn version:exhaustive && yarn hardhat-esm test && yarn test:forge",
"test:hardhat": "yarn hardhat-esm test",
Expand All @@ -88,8 +82,7 @@
"storage": "./storage.sh",
"version:update": "sh ./bytecodeversion.sh",
"version:changed": "yarn version:update && git diff --exit-code",
"version:exhaustive": "yarn tsx ./test/exhaustiveversion.test.ts",
"copy-artifacts": "mkdir -p dist/zksync/artifacts && cp core-utils/zksync/artifacts/*.json dist/zksync/artifacts/"
"version:exhaustive": "yarn tsx ./test/exhaustiveversion.test.ts"
},
"peerDependencies": {
"@ethersproject/abi": "*",
Expand Down
4 changes: 2 additions & 2 deletions solidity/test/lib/mailboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
LegacyMultisigIsm,
TestMailbox,
TestMerkleTreeHook,
} from '../../core-utils/typechain';
import { DispatchEvent } from '../../core-utils/typechain/contracts/Mailbox';
} from '../../types';
import { DispatchEvent } from '../../types/contracts/Mailbox';

export type MessageAndProof = {
proof: MerkleProof;
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/merkle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import { utils } from 'ethers';

import merkleTestCases from '../../vectors/merkle.json' assert { type: 'json' };
import { TestMerkle, TestMerkle__factory } from '../core-utils/typechain';
import { TestMerkle, TestMerkle__factory } from '../types';

import { getSigner } from './signer';

Expand Down
6 changes: 1 addition & 5 deletions solidity/test/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import {
} from '@hyperlane-xyz/utils';

import testCases from '../../vectors/message.json' assert { type: 'json' };
import {
Mailbox__factory,
TestMessage,
TestMessage__factory,
} from '../core-utils/typechain';
import { Mailbox__factory, TestMessage, TestMessage__factory } from '../types';

import { getSigner, getSigners } from './signer';

Expand Down
5 changes: 1 addition & 4 deletions solidity/test/mockMailbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { utils } from 'ethers';

import { addressToBytes32 } from '@hyperlane-xyz/utils';

import {
MockMailbox__factory,
TestRecipient__factory,
} from '../core-utils/typechain';
import { MockMailbox__factory, TestRecipient__factory } from '../types';

import { getSigner } from './signer';

Expand Down
2 changes: 1 addition & 1 deletion solidity/test/testrecipient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { utils } from 'ethers';

import { addressToBytes32 } from '@hyperlane-xyz/utils';

import { TestRecipient, TestRecipient__factory } from '../core-utils/typechain';
import { TestRecipient, TestRecipient__factory } from '../types';

import { getSigner } from './signer';

Expand Down
4 changes: 2 additions & 2 deletions solidity/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./core-utils"
"rootDir": "./types"
},
"exclude": ["./test", "hardhat.config.cts", "./dist", "zk-hardhat.config.cts"]
"exclude": ["./test", "hardhat.config.cts", "./dist"]
}
Loading
Loading