Skip to content

Commit

Permalink
Update zodiac, hardhat and ethers + Migrate deployments to the Zodiac…
Browse files Browse the repository at this point in the history
… SDK
  • Loading branch information
asgeir-s committed Aug 1, 2023
1 parent 4399940 commit bfcfb89
Show file tree
Hide file tree
Showing 7 changed files with 1,190 additions and 524 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ packages/exit-app/src/contracts/types

packages/exit-app/.env

node_modules
node_modules

.DS_Store
12 changes: 0 additions & 12 deletions node_modules/.yarn-integrity

This file was deleted.

8 changes: 4 additions & 4 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"author": "",
"license": "LGPL-3.0+",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "2.0.2",
"@nomiclabs/hardhat-ethers": "2.2.3",
"@nomiclabs/hardhat-etherscan": "2.1.4",
"@nomiclabs/hardhat-waffle": "2.0.1",
"@types/chai": "4.2.21",
Expand All @@ -38,7 +38,7 @@
"eslint-plugin-no-only-tests": "2.6.0",
"eslint-plugin-prettier": "3.4.0",
"ethereum-waffle": "3.4.0",
"hardhat": "2.6.4",
"hardhat": "2.16.1",
"hardhat-deploy": "0.8.11",
"prettier": "2.3.2",
"prettier-plugin-solidity": "1.0.0-beta.16",
Expand All @@ -50,9 +50,9 @@
"yargs": "16.1.1"
},
"dependencies": {
"@gnosis.pm/zodiac": "^1.0.3",
"@gnosis.pm/zodiac": "3.3.6",
"@gnosis.pm/safe-contracts": "1.3.0",
"@openzeppelin/contracts": "^4.2.0",
"ethers": "^5.4.6"
"ethers": "^5.7.2"
}
}
32 changes: 23 additions & 9 deletions packages/contracts/src/deploy/deploy_circulating_supply.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
import { deployMastercopy } from "@gnosis.pm/zodiac";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import CONTRACT_ARTIFACT from "../../build/artifacts/contracts/CirculatingSupply/CirculatingSupplyERC20.sol/CirculatingSupplyERC20.json";

const SaltZero =
"0x0000000000000000000000000000000000000000000000000000000000000000";
const FirstAddress = "0x0000000000000000000000000000000000000001";

const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
const { deployer } = await getNamedAccounts();
const { deploy } = deployments;
const args = [FirstAddress, FirstAddress, []];
const { getNamedAccounts } = hre;
const { deployer: deployerAddress } = await getNamedAccounts();
const deployer = hre.ethers.provider.getSigner(deployerAddress);

const CirculatingSupplyERC20 = await hre.ethers.getContractFactory(
"CirculatingSupplyERC20"
);

const address = await deployMastercopy(
deployer,
CirculatingSupplyERC20,
[FirstAddress, FirstAddress, []],
SaltZero
);

console.log("CirculatingSupplyERC20 deployed to:", address);

await deploy("CirculatingSupplyERC20", {
from: deployer,
args,
log: true,
deterministicDeployment: true,
hre.deployments.save("CirculatingSupplyERC20", {
abi: CONTRACT_ARTIFACT.abi,
address: address,
});
};

Expand Down
40 changes: 23 additions & 17 deletions packages/contracts/src/deploy/deploy_erc20_exit_module.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import { deployMastercopy } from "@gnosis.pm/zodiac";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import CONTRACT_ARTIFACT from "../../build/artifacts/contracts/ExitModule/ExitERC20Module.sol/ExitERC20.json";

const SaltZero =
"0x0000000000000000000000000000000000000000000000000000000000000000";
const FirstAddress = "0x0000000000000000000000000000000000000001";

const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
const { deployer } = await getNamedAccounts();
const { deploy } = deployments;

const args = [
FirstAddress,
FirstAddress,
FirstAddress,
FirstAddress,
FirstAddress,
];

await deploy("ExitERC20", {
from: deployer,
args,
log: true,
deterministicDeployment: true,
const { getNamedAccounts } = hre;
const { deployer: deployerAddress } = await getNamedAccounts();
const deployer = hre.ethers.provider.getSigner(deployerAddress);

const ExitERC20 = await hre.ethers.getContractFactory("ExitERC20");

const address = await deployMastercopy(
deployer,
ExitERC20,
[FirstAddress, FirstAddress, FirstAddress, FirstAddress, FirstAddress],
SaltZero
);

console.log("ExitERC20 deployed to:", address);

hre.deployments.save("ExitERC20", {
abi: CONTRACT_ARTIFACT.abi,
address: address,
});
};

Expand Down
40 changes: 23 additions & 17 deletions packages/contracts/src/deploy/deploy_erc721_exit_module.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import { deployMastercopy } from "@gnosis.pm/zodiac";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import CONTRACT_ARTIFACT from "../../build/artifacts/contracts/ExitModule/ExitERC721Module.sol/ExitERC721.json";

const SaltZero =
"0x0000000000000000000000000000000000000000000000000000000000000000";
const FirstAddress = "0x0000000000000000000000000000000000000001";

const deploy: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
const { deployer } = await getNamedAccounts();
const { deploy } = deployments;

const args = [
FirstAddress,
FirstAddress,
FirstAddress,
FirstAddress,
FirstAddress,
];

await deploy("ExitERC721", {
from: deployer,
args,
log: true,
deterministicDeployment: true,
const { getNamedAccounts } = hre;
const { deployer: deployerAddress } = await getNamedAccounts();
const deployer = hre.ethers.provider.getSigner(deployerAddress);

const ExitERC721 = await hre.ethers.getContractFactory("ExitERC721");

const address = await deployMastercopy(
deployer,
ExitERC721,
[FirstAddress, FirstAddress, FirstAddress, FirstAddress, FirstAddress],
SaltZero
);

console.log("ExitERC721 deployed to:", address);

hre.deployments.save("ExitERC721", {
abi: CONTRACT_ARTIFACT.abi,
address: address,
});
};

Expand Down
Loading

0 comments on commit bfcfb89

Please sign in to comment.