Skip to content

LightmNFT/Lightm-evm

 
 

Repository files navigation

Lightm

Lightm is a RMRK EVM fork, and it uses the EIP-2535's diamond 2 implementation to implement RMRK Spec.

Note

  • We have different implementations with RMRK on Equippable concept.
  • We don't have test part now, but we will add it in the future.

Local Development

  • Run npm i or yarn to install deps first.
  • Run npx hardhat node to start a local hardhat node.
  • Follow Deployment

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.

Full-automatic on-chain deployment

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).

Run ./scripts/deploy_universal_factory.ts to deploy universal factory and make NFT deployment happening tolly on chain.

Semi-automatic deployment

Run ./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
RMRKEquippableFacet The equippable part implement in ERC-6220 way which sharing storage with LightmEquippableFacet 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
LightmImplementer The implementation used by UniversalFactory by default yes
LightmMintModuleImplementer The isolated mint module, be used by UniversalFactory by default yes
LightmCatalogImplementer The catalog implementer, you could call deployCatalog function in UniversalFactory to deploy it, and you can also check Deploy Catalog Script to deploy it yourself (But in this way, the Catalog you deployed can not be displayed on Lightm UI temporarily).
For more about what is Catalog please check https://docs.rmrk.app/lego25-equippable
no

More about mint module

  • You could choose how to mint token:
    • linear (for example: from 1 -> 9999, can not specify an id)
    • assignable (can specify an id)
  • Support "whitelist" by default, which is implemented by merkle tree proof:
    • public mint
      • easily start or stop minting at any time
      • set mint limit only when deploying
      • set mint price only when deploying
    • whitelist mint
      • same with public mint...
      • target address assignable (due to the implementation of whitelist, if you're willing, you could pay for your whitelist friend)

About Upgradable

The collection created by LightmUniversalFactory's deployCollection function will be non-upgradable by default.

But you could write a custom init contract to take over the upgrade permission as deployCollection has customInitStruct allowing you to do a degree of customization.

About

Lightm: RMRK standard implemented in EIP-2535 way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 89.7%
  • TypeScript 10.2%
  • JavaScript 0.1%