Skip to content

Commit

Permalink
zksync failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mmv08 committed Jul 15, 2024
1 parent 28059d0 commit 83873da
Show file tree
Hide file tree
Showing 15 changed files with 1,049 additions and 324 deletions.
720 changes: 720 additions & 0 deletions ZKSYNC.md

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "hardhat-deploy";
import dotenv from "dotenv";
import yargs from "yargs";
import { getSingletonFactoryInfo } from "@safe-global/safe-singleton-factory";
import { LOCAL_NODE_RICH_WALLETS } from "./src/zk-utils/constants";

const argv = yargs
.option("network", {
Expand Down Expand Up @@ -38,9 +39,9 @@ const sharedNetworkConfig: HttpNetworkUserConfig = {};
if (PK) {
sharedNetworkConfig.accounts = [PK];
} else {
sharedNetworkConfig.accounts = {
mnemonic: MNEMONIC || DEFAULT_MNEMONIC,
};
// sharedNetworkConfig.accounts = {
// mnemonic: MNEMONIC || DEFAULT_MNEMONIC,
// };
}

if (["mainnet", "rinkeby", "kovan", "goerli", "ropsten", "mumbai", "polygon"].includes(argv.network) && INFURA_KEY === undefined) {
Expand Down Expand Up @@ -89,14 +90,16 @@ const userConfig: HardhatUserConfig = {
compilers: [{ version: primarySolidityVersion, settings: soliditySettings }, { version: defaultSolidityVersion }],
},
zksolc: {
version: "1.4.0",
version: "1.5.1",
settings: {},
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
blockGasLimit: 100000000,
gas: 100000000,
zksync: Boolean(HARDHAT_RUN_ZKSYNC_NODE),
autoImpersonate: false,
},
mainnet: {
...sharedNetworkConfig,
Expand Down Expand Up @@ -152,11 +155,12 @@ const userConfig: HardhatUserConfig = {
chainId: 270,
url: "http://localhost:3050",
ethNetwork: "http://localhost:8545",
accounts: LOCAL_NODE_RICH_WALLETS.map((w) => w.privateKey),
zksync: true,
saveDeployments: true,
saveDeployments: false,
},
},
deterministicDeployment,
// deterministicDeployment,
namedAccounts: {
deployer: 0,
},
Expand Down
552 changes: 250 additions & 302 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build:ts": "rimraf dist && tsc -p tsconfig.prod.json",
"build:ts:dev": "rimraf dist && tsc -p tsconfig.json",
"test": "hardhat test --network hardhat",
"test:zk": "HARDHAT_RUN_ZKSYNC_NODE=1 hardhat test --network hardhat",
"test:zk": "HARDHAT_RUN_ZKSYNC_NODE=1 hardhat test --network zkSyncLocal",
"test:parallel": "hardhat test --parallel",
"coverage": "hardhat coverage",
"codesize": "hardhat codesize",
Expand Down Expand Up @@ -55,9 +55,9 @@
"devDependencies": {
"@matterlabs/hardhat-zksync-deploy": "^1.3.0",
"@matterlabs/hardhat-zksync-ethers": "^1.0.0",
"@matterlabs/hardhat-zksync-node": "^1.0.3",
"@matterlabs/hardhat-zksync-solc": "^1.1.4",
"@matterlabs/hardhat-zksync-verify": "^1.4.2",
"@matterlabs/hardhat-zksync-node": "^1.0.3",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^3.4.0",
"@safe-global/mock-contract": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/deploy_accessors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/deploy/deploy_factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
4 changes: 2 additions & 2 deletions src/deploy/deploy_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});

await deploy("CompatibilityFallbackHandler", {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
8 changes: 4 additions & 4 deletions src/deploy/deploy_libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});

await deploy("MultiSend", {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});

await deploy("MultiSendCallOnly", {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});

await deploy("SignMessageLib", {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/deploy/deploy_migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/deploy/deploy_safe_l2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/deploy/deploy_safe_singleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: false,
});
};

Expand Down
54 changes: 54 additions & 0 deletions src/zk-utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,57 @@ export const factoryABI = `
}
]
`;

// https://github.com/matter-labs/local-setup/blob/main/rich-wallets.json
export const LOCAL_NODE_RICH_WALLETS = [
{
address: "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
balance: "100000000000000000000",
privateKey: "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110",
},
{
address: "0xa61464658AfeAf65CccaaFD3a512b69A83B77618",
balance: "100000000000000000000",
privateKey: "0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3",
},
{
address: "0x0D43eB5B8a47bA8900d84AA36656c92024e9772e",
balance: "100000000000000000000",
privateKey: "0xd293c684d884d56f8d6abd64fc76757d3664904e309a0645baf8522ab6366d9e",
},
{
address: "0xA13c10C0D5bd6f79041B9835c63f91de35A15883",
balance: "100000000000000000000",
privateKey: "0x850683b40d4a740aa6e745f889a6fdc8327be76e122f5aba645a5b02d0248db8",
},
{
address: "0x8002cD98Cfb563492A6fB3E7C8243b7B9Ad4cc92",
balance: "100000000000000000000",
privateKey: "0xf12e28c0eb1ef4ff90478f6805b68d63737b7f33abfa091601140805da450d93",
},
{
address: "0x4F9133D1d3F50011A6859807C837bdCB31Aaab13",
balance: "100000000000000000000",
privateKey: "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8",
},
{
address: "0xbd29A1B981925B94eEc5c4F1125AF02a2Ec4d1cA",
balance: "100000000000000000000",
privateKey: "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959",
},
{
address: "0xedB6F5B4aab3dD95C7806Af42881FF12BE7e9daa",
balance: "100000000000000000000",
privateKey: "0x74d8b3a188f7260f67698eb44da07397a298df5427df681ef68c45b34b61f998",
},
{
address: "0xe706e60ab5Dc512C36A4646D719b889F398cbBcB",
balance: "100000000000000000000",
privateKey: "0xbe79721778b48bcc679b78edac0ce48306a8578186ffcb9f2ee455ae6efeace1",
},
{
address: "0xE90E12261CCb0F3F7976Ae611A29e84a6A85f424",
balance: "100000000000000000000",
privateKey: "0x3eb15da85647edd9a1159a4a13b9e7c56877c4eb33f614546d4db06a51868b1c",
},
];
2 changes: 1 addition & 1 deletion test/core/Safe.Incoming.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Safe", () => {
});

describe("fallback", () => {
it.only("should be able to receive ETH via transfer", async () => {
it("should be able to receive ETH via transfer", async () => {
console.log("LFG");
const { safe, caller } = await setupTests();
const safeAddress = await safe.getAddress();
Expand Down
2 changes: 1 addition & 1 deletion test/core/Safe.Setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { calculateSafeDomainSeparator } from "../../src/utils/execution";
import { AddressOne } from "../../src/utils/constants";
import { chainId, encodeTransfer } from "../utils/encoding";

describe("Safe", () => {
describe.only("Safe", () => {
const setupTests = hre.deployments.createFixture(async ({ deployments }) => {
await deployments.fixture();
const signers = await getWallets();
Expand Down
1 change: 0 additions & 1 deletion test/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ export const deployContract = async (deployer: Signer, source: string): Promise<
};

export const getWallets = async () => {
console.log({ network: hre.network });
if (hre.network.name === "hardhat") return hre.ethers.getSigners();
if (hre.network.zksync) return hre.zksyncEthers.getWallets();

Expand Down

0 comments on commit 83873da

Please sign in to comment.