eigerco / nebula

A soroban contract library
https://nebula.eiger.co
Apache License 2.0
7 stars 2 forks source link

Interface research on Soroban contracts #102

Open geofmureithi opened 1 year ago

geofmureithi commented 1 year ago

Summary

Soroban contracts provide interfaces that can be implemented in other contracts. Eg the token and stellar admin interfaces

Motivations

Currently the best use case for this is the marketplace where an interface can be used to manage listings. In this research part I am gonna be looking at how to approach it this way.

References: https://github.com/altugbakan/sorodogs/blob/main/contracts/src/interface.rs

Final conclusions We need to implement interfaces for our contracts.

geofmureithi commented 12 months ago

All our contracts are ripe for interfaces. They need to be consistent in the following

Here is an example of the Token specification. Building interfaces for the current contracts will allow the reusing of different but similar contracts. This would make it easier for dApp devs to build on top of our products.

geofmureithi commented 12 months ago

Here are some examples that can shape this process:

geofmureithi commented 12 months ago

The interface approach would also solve the issue we have at #103. Here are the steps to think about:

  1. Switch from classic stellar asset.
  2. Implement an NFT interface.
  3. Anyone who wants to deploy an NFT would implement the NFT interface on their contract.
  4. Deploy the contract.
  5. Pass in the contract address to the marketplace contract.
  6. Profit
geofmureithi commented 12 months ago

This specification might prove to be helpful too.

geofmureithi commented 12 months ago

This covers the main concepts about soroban interfaces. Let me know your thoughts @eloylp @mariopil

eloylp commented 11 months ago

Switch from classic stellar asset.

Is this something the broader community is doing or is just another way of doing it ?

geofmureithi commented 11 months ago

Switch from classic stellar asset.

Is this something the broader community is doing or is just another way of doing it ?

If we wanna work with soroban, this is the way to go. Check out timelock by soroban examples and timelock with classic assets. With smart contracts we should be using the former.