Skip to content

EIP-2535 Diamond reference implementation using Hardhat and Solidity 0.8.*

License

Notifications You must be signed in to change notification settings

daibi/oracle-book-via-diamond-3-hardhat

 
 

Repository files navigation

☯️ Oracle-book-via-diamond-3-hardhat

This is a toy example based on @mudgen's Diamond-3-Hardhat Implementation, a forked NFT project to explore as more Smart Contract features as we can.

👨🏻‍💻 Developer notes for AppStorage based Diamond Implementation

For developers who wants to add new feature(facet), please give a round tour about your implementation in your mind and figure out what the storage structure is to fulfill requirements. And then check out ./contracts/oracle_book_contracts/libs/LibAppStorage to define your storage design inside the AppStorage struct.

After that, you are free to implement your logic in the facet as you like.

Please MAKE SURE that you ONLY can have AppStorage field in your facet. That is ONE and ONLY, NOTHING ELSE, or it will make storage collisions.

🚨 Also unit tests should be included for every facet implementations~

Enjoy your exploration in Diamond Contract!

🧙🏻 Get Started

Installation

  1. Clone this repo:
git clone [email protected]:daibi/oracle-book-via-diamond-3-hardhat.git
  1. Install NPM packages:
cd diamond-3-hardhat
npm install

Run Tests

To run the unit test via hardhat: (make sure that all files are compiled after change)

npx hardhat compile
npx hardhat test

License

MIT license. See the license file. Anyone can use or modify this software for their purposes.

About

EIP-2535 Diamond reference implementation using Hardhat and Solidity 0.8.*

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 76.3%
  • JavaScript 23.7%