Skip to content

Commit

Permalink
Merge pull request #75 from gnosisguild/use-zodiac-core
Browse files Browse the repository at this point in the history
Feat: Implemente `zodiac-core` package, upgrade dependencies and migrate to ethers v6
  • Loading branch information
samepant authored Aug 26, 2024
2 parents 2118798 + 17474c2 commit f55fad0
Show file tree
Hide file tree
Showing 33 changed files with 8,315 additions and 9,518 deletions.
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: 16
node-version: 20
- uses: actions/cache@v2
with:
path: "**/node_modules"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
working-directory: packages/exit-app
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-release-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- run: npm install -g yarn

- run: yarn install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ packages/exit-app/src/contracts/types
packages/exit-app/.env

node_modules
typechain-types

.DS_Store
3 changes: 3 additions & 0 deletions packages/contracts/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-solidity"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./CirculatingSupplyBase.sol";

contract CirculatingSupplyERC20 is CirculatingSupplyBase {
constructor(
address _owner,
address _token,
address[] memory _exclusions
) {
constructor(address _owner, address _token, address[] memory _exclusions) {
bytes memory initParams = abi.encode(_owner, _token, _exclusions);
setUp(initParams);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./CirculatingSupplyBase.sol";

contract CirculatingSupplyERC721 is CirculatingSupplyBase {
constructor(
address _owner,
address _token,
address[] memory _exclusions
) {
constructor(address _owner, address _token, address[] memory _exclusions) {
bytes memory initParams = abi.encode(_owner, _token, _exclusions);
setUp(initParams);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ contract ExclusionList {
/// @param prevExclusion Exclusion that pointed to the exclusion to be removed in the linked list
/// @param exclusion Exclusion to be removed
/// @notice This can only be called by the owner
function _removeExclusion(address prevExclusion, address exclusion)
internal
{
function _removeExclusion(
address prevExclusion,
address exclusion
) internal {
require(
exclusion != address(0) && exclusion != SENTINEL_EXCLUSIONS,
"Invalid exclusion"
Expand Down Expand Up @@ -65,11 +66,10 @@ contract ExclusionList {
/// @param pageSize Maximum number of exclusions that should be returned.
/// @return array Array of exclusions.
/// @return next Start of the next page.
function getExclusionsPaginated(address start, uint256 pageSize)
public
view
returns (address[] memory array, address next)
{
function getExclusionsPaginated(
address start,
uint256 pageSize
) public view returns (address[] memory array, address next) {
// Init array with max page size
array = new address[](pageSize);

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/ExitModule/ExitBase.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 "@gnosis.pm/zodiac/contracts/core/Module.sol";
import "@gnosis-guild/zodiac-core/contracts/core/Module.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "./IExitBase.sol";
Expand Down
4 changes: 1 addition & 3 deletions packages/contracts/contracts/test/TestCollection.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

contract TestCollection is ERC721Enumerable, Ownable {
constructor() ERC721("Token", "T") {
}
constructor() ERC721("Token", "T") {}

function mint(address to, uint256 tokenId) public onlyOwner {
_mint(to, tokenId);
}

}
2 changes: 1 addition & 1 deletion packages/contracts/contracts/test/TestFactory.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;

import "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol";
import "@gnosis-guild/zodiac-core/contracts/factory/ModuleProxyFactory.sol";
4 changes: 1 addition & 3 deletions packages/contracts/contracts/test/TestTokenERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

contract TestTokenERC721 is ERC721Enumerable, Ownable {

constructor() ERC721("NFT", "Test") {
}
constructor() ERC721("NFT", "Test") {}

function mint(address to) external onlyOwner {
_mint(to, totalSupply());
Expand Down
20 changes: 14 additions & 6 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-verify";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "hardhat-deploy";
import dotenv from "dotenv";
import type { HttpNetworkUserConfig } from "hardhat/types";

// Load environment variables.
dotenv.config();
const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY, PK } = process.env;

import "./src/tasks/setup";
import "./tasks/deploy-mastercopies";
import "./tasks/deploy-mastercopy";
import "./tasks/extract-mastercopy";
import "./tasks/verify-mastercopies";
import "./tasks/verify-mastercopy";

const DEFAULT_MNEMONIC =
"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat";
Expand Down Expand Up @@ -42,14 +46,18 @@ export default {
...sharedNetworkConfig,
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
},
xdai: {
gnosis: {
...sharedNetworkConfig,
url: "https://xdai.poanetwork.dev",
url: "https://rpc.gnosischain.com",
},
matic: {
...sharedNetworkConfig,
url: "https://rpc-mainnet.maticvigil.com",
},
sepolia: {
...sharedNetworkConfig,
url: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
},
},
namedAccounts: {
deployer: 0,
Expand Down
4,501 changes: 4,501 additions & 0 deletions packages/contracts/mastercopies.json

Large diffs are not rendered by default.

71 changes: 42 additions & 29 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
"scripts": {
"build": "hardhat compile",
"test": "hardhat test",
"deploy": "hardhat deploy --network",
"extract:mastercopy": "yarn run build && yarn hardhat extract:mastercopy",
"deploy:mastercopies": "yarn hardhat deploy:mastercopies --network",
"deploy:mastercopy": "yarn hardhat deploy:mastercopy --network",
"verify:mastercopies": "yarn hardhat verify:mastercopies --network",
"verify:mastercopy": "yarn hardhat verify:mastercopy --network",
"coverage": "hardhat coverage",
"lint": "yarn lint:sol && yarn lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:ts": "eslint --max-warnings 0 .",
"fmt": "yarn fmt:sol && yarn fmt:ts",
"fmt:sol": "prettier 'contracts/**/*.sol' -w",
"fmt:ts": "prettier 'tasks/**/*.ts' 'test/**/*.ts' -w",
"prepack": "yarn build"
},
"repository": {
Expand All @@ -19,40 +25,47 @@
"author": "",
"license": "LGPL-3.0+",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "2.2.3",
"@nomiclabs/hardhat-etherscan": "2.1.4",
"@nomiclabs/hardhat-waffle": "2.0.1",
"@types/chai": "4.2.21",
"@types/mocha": "8.2.3",
"@types/node": "16.3.3",
"@types/yargs": "17.0.2",
"@typescript-eslint/eslint-plugin": "4.28.4",
"@typescript-eslint/parser": "4.28.4",
"argv": "0.0.2",
"@gnosis-guild/zodiac-core": "^2.0.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@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",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.7",
"@types/node": "^20.5.6",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"chai": "4.3.4",
"debug": "4.3.2",
"dotenv": "10.0.0",
"eslint": "7.31.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-no-only-tests": "2.6.0",
"eslint-plugin-prettier": "3.4.0",
"ethereum-waffle": "3.4.0",
"hardhat": "2.16.1",
"hardhat-deploy": "0.8.11",
"prettier": "2.3.2",
"prettier-plugin-solidity": "1.0.0-beta.16",
"solhint": "3.3.6",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "0.8.4",
"ts-node": "10.1.0",
"typescript": "4.3.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",
"fs": "^0.0.1-security",
"hardhat": "^2.22.7",
"hardhat-gas-reporter": "^2.2.0",
"path": "^0.12.7",
"prettier": "^3.3.3",
"prettier-plugin-solidity": "^1.4.1",
"rimraf": "^6.0.0",
"solhint": "5.0.3",
"solhint-plugin-prettier": "0.1.0",
"solidity-coverage": "^0.8.12",
"ts-node": "^10.9.2",
"typechain": "^8.1.1",
"typescript": "5.5.4",
"yargs": "16.1.1"
},
"dependencies": {
"@gnosis.pm/zodiac": "3.3.6",
"@gnosis.pm/safe-contracts": "1.3.0",
"@openzeppelin/contracts": "^4.2.0",
"ethers": "^5.7.2"
"@openzeppelin/contracts": "4.9.3",
"@openzeppelin/contracts-upgradeable": "4.9.3",
"ethers": "^6.13.2"
}
}
43 changes: 0 additions & 43 deletions packages/contracts/src/deploy/deploy_circulating_supply.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit f55fad0

Please sign in to comment.