Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface research on Soroban contracts #102

Open
geofmureithi opened this issue Nov 9, 2023 · 7 comments
Open

Interface research on Soroban contracts #102

geofmureithi opened this issue Nov 9, 2023 · 7 comments
Labels

Comments

@geofmureithi
Copy link
Contributor

geofmureithi commented Nov 9, 2023

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
Copy link
Contributor Author

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

  • Function interface (name and arguments).
  • Authorization - the users have to authorize the token function calls with all the arguments of the invocation
  • Events - the token has to emit the events in the specified format.

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
Copy link
Contributor Author

geofmureithi commented Nov 30, 2023

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
Copy link
Contributor Author

This specification might prove to be helpful too.

@geofmureithi
Copy link
Contributor Author

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

@eloylp
Copy link
Member

eloylp commented Dec 4, 2023

Switch from classic stellar asset.

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

@geofmureithi
Copy link
Contributor Author

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.

@geofmureithi geofmureithi removed their assignment Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants