Lightm is a RMRK EVM fork, and it uses the EIP-2535's diamond 2 implementation to implement RMRK Spec.
To be added.
- Run
npm ioryarnto install deps first. - Run
npx hardhat nodeto start a local hardhat node. - Follow Deployment
We use Create2Deployer to make sure the "to be deployed" contract addresses is predictable and so we could replay a tx on different chains and get same addresses on them. If you have some custom logics, it's totally optional.
Use npx hardhat run --network localhost ./scripts/[script-name].ts to run scripts below. If you don't specify network, it will run on Ethereum. For more infos please go to hardhat site.
The Full-automatic on-chain deployment is a more appropriate approach for creators whom cannot write code. Contracts containing the same implementation code on different chains should be deployed only once.
Before you invoke the script below in a non-local development environment, make sure that no contract has been deployed on this chain(Check if Create2Deployer is deployed on target chain, its address is 0xcf2281070e6a50e4050694eef1a9a7376628d663), otherwise this is a redundant action (except you wanna deploy your own custom factory).
Go to ./scripts/deploy to deploy universal factory and make NFT deployment happening tolly on chain.
Go to ./scripts/deploy_diamond_equippable.ts to deploy your own custom NFT.
| Contract | Description | Can reuse |
|---|---|---|
| Create2Deployer | A create2 contract deployer | yes |
| DiamondCutFacet | The diamond raw facet used to add/remove/replace facet of diamond | yes |
| DiamondLoupeFacet | The diamond raw facet used to explore facets of diamond | yes |
| LightmEquippableNestableFacet | The nestable part of equipment function supported facet | yes |
| LightmEquippableMultiAssetFacet | The multi-asset part of equipment function supported facet | yes |
| LightmEquippableFacet | The equippable part of equipment function supported facet | yes |
| RMRKCollectionMetadataFacet | The collection-metadata part of RMRK NFT | yes |
| Diamond | The real contract that store all state | no |
| LightmInit | The diamond raw facet used to initializes the state of the contract | yes |