Skip to content

Commit

Permalink
Package
Browse files Browse the repository at this point in the history
  • Loading branch information
Madeindreams committed Apr 23, 2021
1 parent 70693ff commit 8948000
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .envexample
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ETHERSCAN = "etherscan api key"
INFURA_ID = "infura ID"
ALCHEMY_KEY = "Alchemy ID"
MYADDRESS = "your wallet address"

GNOSIS = "your gnosis vault address"
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This is the ideal setup to
- Deploy and verify smart contract



## Installation
To install this package run

Expand All @@ -31,16 +30,22 @@ To Compile the smart contract use the command

```npm run compile```

to deploy your contract
to deploy your contract and own it with the deployer account use

```npm run deploy```

If you have a Gnosis vault use

```npm run deployGnosis```

To run the test

```npm run test```

If you want to verify that contract, once deployed, head to etherscan an veryfy the proxy. It will fail but will return the address of your implementation.
Copy this address and use it to verify your implementation.
If you want to verify that contract, once deployed, head to etherscan an veryfy the proxy. There is a button on the top right of the code textfield under the code tab on Etherscan.
Select the verify proxy otion. Leave the proxy address in the field and click verify. It will fail but will return the address of your implementation.
Copy this address and use it to verify your implementation in the terminal with hardhat.
*Note that you need the Etherscan API key in your .env for verification*

``` npx hardat verify --network rinkeby <the adress of the implementation>```

Expand All @@ -57,7 +62,7 @@ This will upgade your contrct to the second version v2.



If you wish to use a multisignature vault to own your contract. You must uncomment the lines 33 to 37 in the hardhat.config.js file that transfer the contract ownership to the vault.


## Resource

Expand Down
24 changes: 19 additions & 5 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,31 @@ const MDEV_ADDRESS = "Your proxy adress "
const MDEV = await ethers.getContractFactory("MDEV");
const mdev = await upgrades.deployProxy(MDEV,[process.env.MYADDRESS]);
await mdev.deployed();
console.log('YOUR CONTRACT ADDRESS :',mdev.address)
console.log('YOUR PROXY ADDRESS :',mdev.address)

//const gnosisSafe = '0x9FD08Cac2F176C0898ba4D73b02B757c6B2D7150';
//console.log("Transferring ownership of ProxyAdmin...");
}
);

task(
"deployGnosis",
"Deploy your contract owned by your GNOSIS vault",
async (_, { ethers,upgrades }) => {

const MDEV = await ethers.getContractFactory("MDEV");
const mdev = await upgrades.deployProxy(MDEV,[process.env.MYADDRESS]);
await mdev.deployed();
console.log('YOUR PROXY ADDRESS :',mdev.address)

const gnosisSafe = process.env.GNOSIS;
console.log("Transferring ownership of ProxyAdmin...");
// The owner of the ProxyAdmin can upgrade our contracts
//await upgrades.admin.transferProxyAdminOwnership(gnosisSafe);
//console.log("Transferred ownership of ProxyAdmin to:", gnosisSafe);
await upgrades.admin.transferProxyAdminOwnership(gnosisSafe);
console.log("Transferred ownership of ProxyAdmin to:", gnosisSafe);

}
);


task(
"upggrade",
"Upgrade your contract",
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"test": "npx hardhat test",
"compile": "npx hardhat compile",
"deploy": "npx hardhat deploy"
"deploy": "npx hardhat deploy",
"deployGnosis": "npx hardhat deployGnosis"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,6 +36,9 @@
"hardhat": "^2.2.0",
"hardhat-deploy": "^0.7.5",
"hardhat-deploy-ethers": "^0.3.0-beta.7"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/@madeindreams"
}

}

0 comments on commit 8948000

Please sign in to comment.