Skip to content

thejpanganiban/hardhat-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat Sandbox

Started with the leanest project scaffold. Installed a few plugins as they were needed.

Project 1

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

Project 2

Replicated the infamous "Parity Hack".

Protect functions. Write guards!

Artifacts: test/parityHack.js

Project 3

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.

OpenZeppelin Network Files

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.

Artifacts Created

  • 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

Contracts of Interest

About

Solidity development sandbox

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published