Skip to content

Commit

Permalink
fix: resolved conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
web3rover committed Aug 28, 2024
2 parents dae600c + 3430bf2 commit c88300e
Show file tree
Hide file tree
Showing 1,354 changed files with 254,571 additions and 3,753 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ ARCHIVE_NODE_opbnbtestnet=https://opbnb-testnet.nodereal.io/v1/<YOUR_KEY_HERE>
ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
ARCHIVE_NODE_arbitrumsepolia=https://sepolia-rollup.arbitrum.io/rpc
ARCHIVE_NODE_arbitrumone=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/
ARCHIVE_NODE_xlayertestnet=https://rpc.ankr.com/xlayer_testnet/<YOUR_KEY_HERE>
ARCHIVE_NODE_xlayermainnet=https://rpc.ankr.com/xlayer<YOUR_KEY_HERE>
ACHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync
3 changes: 2 additions & 1 deletion .eslint-tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"./src",
"./vips",
"./simulations",
"./multisig"
"./multisig",
"./hardhat.config.zksync.ts"
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
!.yarn/sdks
!.yarn/versions
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/.coverage_artifacts
**/.coverage_cache
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand All @@ -19,4 +21,4 @@ typechain
coverage.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Script to generate proposal data for multiple destinations such as venusApp bsce
Procedure for Creating a Proposal

```
npx hardhat run scripts/createProposal.ts
npx hardhat createProposal --network <networkName>
Enter the number of vip for which you require proposal data.
Select the type of destination, such as txBuilder/venusApp/bsc.
Expand Down Expand Up @@ -97,3 +97,35 @@ Multisig VIP ID (located at ./multisig/proposals/vip-{id}) to process => 000
```

The script should output a file `gnosisTXBuilder.json` that you can import in your Gnosis Safe UI.

### Make proposal for multiple networks

Procedure to make vip:

For remote commands add one more field of `dstChainId` specifying layer zero chain id of desired remote chain for instance `dstChainId = 101` for Ethereum. Lz chain ids can be retrieve from `LzChainId` enum present in types.

### Simulations for multiple networks proposal

In .env update `ARCHIVE_NODE_<NETWORK_NAME>` with the URL of desired network.

Make different simulations for different networks. Use `testForkedNetworkVipCommands` to simulate remote proposal.

To run simulations use this command

```
npx hardhat test simulations/<simulation-path> --fork <network>
```

### Propose VIP

Procedure to propose VIP using tasks

```
npx hardhat propose <path to vip relative to vips> --network bscmainnet
```

For testnet

```
npx hardhat proposeOnTestnet <path to vip relative to vips> --network bsctestnet
```
38 changes: 36 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "module-alias/register";

import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-ethers";
import * as dotenv from "dotenv";
Expand Down Expand Up @@ -26,17 +28,38 @@ const BLOCK_GAS_LIMIT_PER_NETWORK = {
opbnbmainnet: 100000000,
arbitrumsepolia: 30000000,
arbitrumone: 30000000,
xlayertestnet: 30000000,
};

task("propose", "Propose proposal")
.addPositionalParam("proposalPath", "Proposal path to pass to script")
.setAction(async function (taskArguments) {
.setAction(async function (taskArguments, hre) {
hre.FORKED_NETWORK = hre.network.name as "bscmainnet";
const { proposalPath } = taskArguments;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const proposeVip = require("./scripts/proposeVIP").default;
await proposeVip(proposalPath);
});

task("proposeOnTestnet", "Propose proposal on testnet")
.addPositionalParam("proposalPath", "Proposal path to pass to script")
.setAction(async function (taskArguments, hre) {
hre.FORKED_NETWORK = hre.network.name as "bsctestnet";
const { proposalPath } = taskArguments;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const proposeTestnetVIP = require("./scripts/proposeTestnetVIP").default;
await proposeTestnetVIP(proposalPath, hre.network.name);
});
task("createProposal", "Create proposal objects for various destinations").setAction(async function (
taskArguments,
hre,
) {
hre.FORKED_NETWORK = (hre.network.name as "bsctestnet") || "bscmainnet";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const createProposal = require("./scripts/createProposal").default;
await createProposal();
});

task("multisig", "Execute multisig vip")
.addPositionalParam("proposalPath", "Proposal path to pass to script")
.setAction(async function (taskArguments) {
Expand Down Expand Up @@ -111,7 +134,7 @@ const config: HardhatUserConfig = {
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.opbnbtestnet,
},
opbnbmainnet: {
url: process.env.ARCHIVE_NODE_opbnbtestnet || "https://opbnb-mainnet-rpc.bnbchain.org",
url: process.env.ARCHIVE_NODE_opbnbmainnet || "https://opbnb-mainnet-rpc.bnbchain.org",
chainId: 204,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.opbnbmainnet,
Expand All @@ -126,12 +149,23 @@ const config: HardhatUserConfig = {
chainId: 42161,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
},
xlayertestnet: {
url: process.env.ARCHIVE_NODE_xlayertestnet || "https://testrpc.xlayer.tech/",
chainId: 195,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
},
xlayermainnet: {
url: process.env.ARCHIVE_NODE_xlayermainnet || "https://rpc.xlayer.tech/",
chainId: 196,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
},
},
paths: {
tests: "./tests",
},
mocha: {
timeout: 200000000,
delay: true,
},
};

Expand Down
126 changes: 126 additions & 0 deletions hardhat.config.zksync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import "module-alias/register";

import "@matterlabs/hardhat-zksync";
import "@matterlabs/hardhat-zksync-node";
import "@matterlabs/hardhat-zksync-solc";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-ethers";
import * as dotenv from "dotenv";
import { HardhatUserConfig, task } from "hardhat/config";

import "./type-extensions";

dotenv.config();
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;

task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();

for (const account of accounts) {
console.log(account.address);
}
});

const BLOCK_GAS_LIMIT_PER_NETWORK = {
zksyncsepolia: 30000000,
zksyncmainnet: 30000000,
};

task("multisig", "Execute multisig vip")
.addPositionalParam("proposalPath", "Proposal path to pass to script")
.setAction(async function (taskArguments) {
const { proposalPath } = taskArguments;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const executeMultiSigTx = require("./scripts/executeMultiSigTx.ts").default;
await executeMultiSigTx(proposalPath);
});

task("test", "Update fork config")
.addOptionalParam("fork", "Network to fork")
.setAction(async function (taskArguments, hre, runSuper) {
const { fork } = taskArguments;
const hardhatConfig = fork
? {
allowUnlimitedContractSize: false,
loggingEnabled: false,
forking: {
enabled: true,
url: process.env[`ARCHIVE_NODE_${fork}`] as string,
},
gas: "auto" as const,
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK[fork as keyof typeof BLOCK_GAS_LIMIT_PER_NETWORK],
}
: {
allowUnlimitedContractSize: true,
loggingEnabled: false,
};
hre.config.networks.hardhat = { ...hre.config.networks.hardhat, ...hardhatConfig };
hre.FORKED_NETWORK = fork;

await runSuper(taskArguments);
});

const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
zksolc: {
version: "1.5.1",
compilerSource: "binary",
settings: {
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: "none",
},
},
},
solidity: {
compilers: [
{
version: "0.8.25",
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
evmVersion: "paris",
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
],
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
loggingEnabled: false,
zksync: true,
},
zksyncsepolia: {
url: process.env.ARCHIVE_NODE_zksyncsepolia || "https://sepolia.era.zksync.dev",
chainId: 300,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.zksyncsepolia,
zksync: true,
},
zksyncmainnet: {
url: process.env.ARCHIVE_NODE_zksyncmainnet || "https://mainnet.era.zksync.io",
chainId: 324,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.zksyncmainnet,
zksync: true,
},
},
paths: {
tests: "./tests",
},
mocha: {
timeout: 200000000,
delay: true,
},
};

export default config;
15 changes: 15 additions & 0 deletions multisig/proposals/arbitrumone/vip-000/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { makeProposal } from "src/utils";

export const TREASURY = "0x8a662ceAC418daeF956Bc0e6B2dd417c80CDA631";

const vip000 = () => {
return makeProposal([
{
target: TREASURY,
signature: "acceptOwnership()",
params: [],
},
]);
};

export default vip000;
Loading

0 comments on commit c88300e

Please sign in to comment.