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

Investigate smart contract components #432

Open
limemloh opened this issue May 16, 2024 — with Linear · 0 comments
Open

Investigate smart contract components #432

limemloh opened this issue May 16, 2024 — with Linear · 0 comments

Comments

Copy link
Collaborator

Investigate how to introduce composable framework for smart contract development in Rust. Currently, the approach for smart contract development is to copy code from several of our examples, if you need an upgradable smart contract you copy from one example, if you need to restrict access on some endpoints you might need the code from another example. We could take inspiration from the rust crate tower.

Examples of components:

  • Admins Holds a list of address which have admin rights. Creates endpoints for managing admins. Must know which endpoints to authorize sender on.
  • Roles Extension of Admins to include roles for each address.
  • Freezeable/Pausable Create endpoint for (un)freezing contract. Must know which endpoints to freeze. - Upgradable Create endpoint for upgrading contract.
  • CIS-2 Create endpoints require by CIS2. Takes some simpler implementation. Add middleware for each endpoint. Add middleware for all the queries Add middleware for all the mutable functions
  • CIS-2 receive tokens Create an endpoint for receiving CIS2. Add middleware.
  • CIS-0 Create endpoint required by CIS0. Create endpoints for managing implementors.
  • ReentrancyGuard Middleware which reject on reentrancy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant