litemint-royalty-contract

Crates.iolitemint-royalty-contract
lib.rslitemint-royalty-contract
version0.1.7
sourcesrc
created_at2023-12-28 13:53:26.245434
updated_at2024-02-07 03:07:28.380616
descriptionRoyalty smart contract for the Litemint marketplace supporting fixed, subscription, and percentage-based royalties.
homepage
repositoryhttps://github.com/litemint/litemint-soroban-contracts
max_upload_size
id1082425
size43,051
Frederic 경진 Rezeau (FredericRezeau)

documentation

README

MIT License Twitter

litemint-royalty-contract

Build Status litemint-auction-contract version

Litemint royalty smart contract powering the Litemint marketplace.

Licensed under MIT. This software is provided "AS IS", no liability assumed. More details.

Introduction

Royalties play a pivotal role in digital economies.

The industry has encountered numerous obstacles in achieving decentralized payment enforcements (we discussed this topic at Meridian 2022, see video excerpt here). Currently, most marketplaces retain significant control over enforcing royalty payments (see this Tweet from OpenSea), which poses challenges to creators.

To address these challenges, we have identified a unique combination with Soroban smart contracts, oracles, and Stellar classic primitives (pre-auth transactions) allowing us to implement an unobtrusive solution for on-chain NFT royalty payment enforcements.

The Litemint royalty contract implements multiple royalty payment schemes for non-fungible tokens, including fixed, subscription, and percentage-based models. A key feature is its ability to enforce royalty payments without isolating NFTs from the Stellar DEX. Our approach ensures that NFT creators and collectors can freely hold and trade their NFTs from any Stellar DEX compatible service, enjoying an unrestricted sales funnel.

Feature List

  • Percentage-based royalty payments (see compensation_percentage.rs).
  • Fixed royalty payments (see compensation_fixed.rs).
  • Subcription royalty payments (see compensation_subscription.rs).
  • Decentralized on-chain payment enforcement.
  • NFTs compatibility with all ecosystem services.
  • Support for all currencies and markets.
  • Optional license transfer fee.
  • Configurable grace period and marketplace commission rate.
  • Strategy design pattern for easily adding new royalty schemes.

Dependencies

soroban-kit

soroban-kit provides fast, lightweight functions and macros with lean, targeted functionality for Soroban smart contract development: https://github.com/FredericRezeau/soroban-kit.

The Litemint royalty contract uses the following features from soroban-kit:

  • oracles to receive external market data feed.
  • storage for type safety with storage operations.

Getting Started

From the workspace root:

  1. Cloning the repository:
    git clone https://github.com/Litemint/litemint-soroban-contracts.git
    
  2. Building the contracts:
    soroban contract build
    
  3. Running Tests:
    cargo test -- --nocapture
    
  4. Deploying to testnet:
    soroban contract deploy --wasm target/wasm32-unknown-unknown/release/litemint_auction_contract.wasm --source ACCOUNT --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase "Test SDF Network ; September 2015"
    
    output > CONTRACT_ID
    

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/feature)
  3. Commit your Changes (git commit -m 'Add some feature')
  4. Push to the Branch (git push origin feature/feature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

LitemintHQ on X - @LitemintHQ

Litemint Marketplace: https://litemint.com

Join our discord server: https://litemint.gg

Commit count: 16

cargo fmt