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

Feat: Implemente zodiac-core package, upgrade dependencies and migrate to ethers v6 #75

Merged
merged 28 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2f429c7
Bump dependencies and point to local zodiac-core
cristovaoth Jul 30, 2024
aebefed
Migrate tests to zodiac-core part 1
cristovaoth Jul 30, 2024
095ec26
Migrate Tests to zodiac-core part 2
cristovaoth Jul 30, 2024
df901ff
Migrate current deploy scripts to zodiac-core
cristovaoth Jul 30, 2024
8aec912
Add [email protected] and [email protected] mastercopy artifacts
cristovaoth Jul 31, 2024
24d9413
Add [email protected] and [email protected] mastercopy artifacts
cristovaoth Jul 31, 2024
d9c4d39
Include tasks for store, deploy and verify mastercopies
cristovaoth Jul 31, 2024
bc8bbb3
Rename extract amstercopy file
cristovaoth Aug 2, 2024
6adf02c
Adjust mastercopy script names
cristovaoth Aug 2, 2024
84b367b
chore: remove root yarn.lock generated by mistake
cristovaoth Aug 8, 2024
b9feb9f
refact: adjusting to latest zodiac-core version
cristovaoth Aug 8, 2024
7557a8a
feat: migrating setup task
cristovaoth Aug 8, 2024
61baf88
chore: use latest published zodiac-core
cristovaoth Aug 15, 2024
a4b57ca
chore: reconstruct ExitERC20 artifacts for version 1.0.0 1.1.0 and 1.…
cristovaoth Aug 15, 2024
9f28cec
chore: update zodiac-core dependencies
juliopavila Aug 15, 2024
b96a6c0
feat: add all the mastecopy versions
juliopavila Aug 15, 2024
aab29ff
feat: update node version
juliopavila Aug 15, 2024
727cdd8
chore: cleanup hardhat-deploy leftovers
cristovaoth Aug 16, 2024
90fb019
Delete more leftover files
cristovaoth Aug 16, 2024
0ad1a94
feat: improve hardhat task
juliopavila Aug 19, 2024
136c272
feat: refactor hardhat tasks
juliopavila Aug 19, 2024
45acf00
chore: update scripts
juliopavila Aug 20, 2024
b91a708
chore: clean code
juliopavila Aug 20, 2024
c0c9619
chore: add format task
cristovaoth Aug 24, 2024
fcfe728
refact: preparing the package for zodiac-core v2
cristovaoth Aug 26, 2024
6454406
chore: add the zodiac-core package and clean code
juliopavila Aug 26, 2024
b98bc9f
Merge pull request #76 from gnosisguild/use-zodiac-core-v2
juliopavila Aug 26, 2024
17474c2
feat: add prettier config file
juliopavila Aug 26, 2024
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
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
Loading