Skip to content

Commit

Permalink
feat: implement zodiac core package
Browse files Browse the repository at this point in the history
  • Loading branch information
juliopavila committed Aug 27, 2024
1 parent b02b2eb commit d01fce1
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
GOERLI_URL=https://eth-goerli.alchemyapi.io/v2/<YOUR ALCHEMY KEY>
SEPOLIA_URL=https://eth-sepolia.alchemyapi.io/v2/<YOUR ALCHEMY KEY>
PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- uses: actions/cache@v2
with:
path: "**/node_modules"
Expand Down
2 changes: 1 addition & 1 deletion contracts/MyModule.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "zodiac-core/contracts/core/Module.sol";
import "@gnosis-guild/zodiac-core/contracts/core/Module.sol";

contract MyModule is Module {
address public button;
Expand Down
4 changes: 2 additions & 2 deletions deploy/01_mastercopy_module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ZeroHash } from "ethers"
import { DeployFunction } from "hardhat-deploy/types"
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { deployFactories, deployMastercopy } from "zodiac-core"
import { deployFactories, deployMastercopy } from "@gnosis-guild/zodiac-core"

import createAdapter from "./eip1193"
import MODULE_CONTRACT_ARTIFACT from "../artifacts/contracts/MyModule.sol/MyModule.json"
import MODULE_CONTRACT_ARTIFACT from "../build/artifacts/contracts/MyModule.sol/MyModule.json"

const FirstAddress = "0x0000000000000000000000000000000000000001"

Expand Down
12 changes: 2 additions & 10 deletions deploy/03_proxy_module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DeployFunction } from "hardhat-deploy/types"
import { HardhatRuntimeEnvironment } from "hardhat/types"

import MODULE_CONTRACT_ARTIFACT from "../artifacts/contracts/MyModule.sol/MyModule.json"
import MODULE_CONTRACT_ARTIFACT from "../build/artifacts/contracts/MyModule.sol/MyModule.json"
import createAdapter from "./eip1193"
import { deployFactories, deployProxy } from "zodiac-core"

Expand All @@ -23,15 +23,7 @@ const deploy: DeployFunction = async function ({
provider: network.provider,
signer: await ethers.getSigner(deployerAddress),
})

/// const chainId = await getChainId()
// const network: SupportedNetworks = Number(chainId)
// if ((await ethers.provider.getCode(ContractAddresses[network][KnownContracts.FACTORY])) === "0x") {
// // the Module Factory should already be deployed to all supported chains
// // if you are deploying to a chain where its not deployed yet (most likely locale test chains), run deployModuleFactory from the zodiac package
// throw Error("The Module Factory is not deployed on this network. Please deploy it first.")
// }


console.log("buttonDeployment.address:", buttonDeployment.address)

// Deploys the ModuleFactory (and the Singleton factory) if it is not already deployed
Expand Down
2 changes: 1 addition & 1 deletion deploy/eip1193.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Signer } from "ethers"
import { EIP1193Provider } from "zodiac-core"
import { EIP1193Provider } from "@gnosis-guild/zodiac-core"

export default function createAdapter({
provider,
Expand Down
4 changes: 2 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ dotenv.config()
const config: HardhatUserConfig = {
solidity: "0.8.22",
networks: {
goerli: {
url: process.env.GOERLI_URL || "",
sepolia: {
url: process.env.SEPOLIA_URL || "",
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
},
"homepage": "https://github.com/gnosis/zodiac-mod-starter-kit",
"devDependencies": {
"@gnosis-guild/zodiac-core": "^2.0.1",
"@gnosis.pm/safe-contracts": "1.3.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
"@nomicfoundation/hardhat-ignition": "^0.15.5",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.9",
Expand All @@ -40,19 +41,19 @@
"@typescript-eslint/parser": "^7.17.0",
"chai": "^4.3.7",
"dotenv": "^16.4.5",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint": "^9.8.0",
"ethers": "^6.13.2",
"hardhat": "^2.14.0",
"hardhat-deploy": "^0.12.0",
"hardhat-gas-reporter": "^2.2.0",
"hardhat": "^2.14.0",
"prettier": "^3.3.3",
"prettier-plugin-solidity": "^1.1.3",
"solhint-plugin-prettier": "0.1.0",
"solhint": "5.0.2",
"solhint-plugin-prettier": "0.1.0",
"solidity-coverage": "^0.8.12",
"ts-node": "^10.9.2",
"typechain": "^8.1.1",
Expand Down
47 changes: 17 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,17 @@
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d"
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==

"@gnosis-guild/zodiac-core@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@gnosis-guild/zodiac-core/-/zodiac-core-2.0.1.tgz#07226e77e09e2ac8faf2ed21fe1dcb8d18a796bb"
integrity sha512-R3K4DLjkbGdUXy3USLaciQwSJzcFaKcxiua4it8fT84wydN+auRs3DIcHLZdiL5yEWXv5yFPcXoCex8Ecc/SHw==
dependencies:
"@gnosis.pm/safe-contracts" "1.3.0"
"@openzeppelin/contracts" "5.0.2"
"@openzeppelin/contracts-upgradeable" "5.0.2"
ethers "^6.13.2"
semver "^7.6.3"

"@gnosis.pm/[email protected]":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-contracts/-/safe-contracts-1.3.0.tgz#316741a7690d8751a1f701538cfc9ec80866eedc"
Expand Down Expand Up @@ -4534,7 +4545,7 @@ semver@^6.3.0, semver@^6.3.1:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.4, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0:
semver@^7.3.4, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
Expand Down Expand Up @@ -4775,16 +4786,7 @@ string-format@^2.0.0:
resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b"
integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -4837,14 +4839,7 @@ string_decoder@^1.1.1:
dependencies:
safe-buffer "~5.2.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -5329,16 +5324,7 @@ workerpool@^6.5.1:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down Expand Up @@ -5432,9 +5418,10 @@ zksync-ethers@^5.0.0:
ethers "~5.7.0"

"zodiac-core@file:../zodiac-core":
version "4.0.3"
version "2.0.0"
dependencies:
"@gnosis.pm/safe-contracts" "1.3.0"
"@openzeppelin/contracts" "5.0.2"
"@openzeppelin/contracts-upgradeable" "5.0.2"
ethers "^6.13.2"
semver "^7.6.3"

0 comments on commit d01fce1

Please sign in to comment.