This project is based on the implementation written by Nick Mudge
- Clone this repo:
git clone https://github.com/luisvid/diamond-erc1155-mint.git
- Install NPM packages:
cd diamond-erc1155-mint
npm install
npx hardhat test
To complete the deployment of all the Diamond contracts on Sepolia testnet, first rename .env.example
to .env
, enter your private key and the required API keys, and then run the command:
npx hardhat run scripts/deployDiamondWithERC1155.js --network sepolia
After all the required contracts have been deployed, you can use the louper.dev tool to inspect and interact with the Diamond's contracts.
For example:
https://louper.dev/diamond/0xbC547CbA1949bb541dC7bc064789E536de17C12E?network=sepolia
The contracts/Diamond.sol
file shows an example of implementing a diamond.
The contracts/facets/DiamondCutFacet.sol
file shows how to implement the diamondCut
external function.
The contracts/facets/DiamondLoupeFacet.sol
file shows how to implement the four standard loupe functions
.
The contracts/facets/ERC1155MintFacet.sol
file shows the ERC-1155
implementation.
The contracts/libraries/LibDiamond.sol
file shows how to implement Diamond Storage and a diamondCut
internal function.
The scripts/deploy-test.js
file deploys all the facets, except for the ERC-1155
implementation, to be used in the tests.