Started with the leanest project scaffold. Installed a few plugins as they were needed.
Built a pseudo-ERC-20 token. Wrote unit tests. Deployed it on Rinkeby Testnet. Verified the contract Etherscan.
You can find the verified contract here.
Artifacts: contracts/Token.sol
, test/token.js
, deployments/deployToken.js
Replicated the infamous "Parity Hack".
Protect functions. Write guards!
Artifacts: test/parityHack.js
Built a super simple contract for the purpose of deploying it on the local hardhat node. Wrote real client code (ethers.js) that interacts with the local node.
Artifacts: contracts/Hello.sol
, deployments/deployHello.js
Followed this guide created by abcoathup.
Created a simple contract called Box
. Deployed it on the Rinkeby network through the hardhat-upgrades extension. Transfered ownership of the contract to a safe in GnosisSafe.
Created a new contract called BoxV2
. Deployed this contract. Then performed upgrades.
Unit tests were also created for both v1 and v2. In the BoxV2.proxy.js test, you would find that the state is retained even after the contract is upgraded.
The folder .openzeppelin
was also created. That folder keeps track of any openzeppelin deployments and proxy associations. They're called network files.
Recommendation is to keep track of the files.
- Installed Packages:
@openzeppelin/hardhat-upgrades
,@openzeppelin/contracts-upgradeable
- Contracts:
Box.sol
,Box2.sol
- Tests:
Box.js
,Box.proxy.js
,BoxV2.js
,BoxV2.proxy.js
- Deployments:
3_deploy_Box.js
,4_transfer_Box.js
,5_upgrade_Box_BoxV2.js
- Network Files:
rinkeby.json