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

Implement a r/demo/chess_variables #181

Open
moul opened this issue Sep 26, 2023 · 0 comments
Open

Implement a r/demo/chess_variables #181

moul opened this issue Sep 26, 2023 · 0 comments

Comments

@moul
Copy link
Contributor

moul commented Sep 26, 2023

My objective is to streamline our realm structure. Rather than having each realm cluttered with lists like faucets, admins, whitelisted, and various assertIsXXX functions, we should centralize these responsibilities. I envision the chess_variables realm to manage these configurations.

Instead of having individual methods like assertIsFaucet() followed by updateFaucet(newAddr std.Address) {assertIsAdmin(); faucetAddr = newAddr}, we could simply integrate import gno.land/r/demo/chess_variables and utilize chess_variables.AssertIsFaucet(). The management and update functions would be encapsulated within the chess_variables realm.

This approach minimizes redundancy and boilerplate code. It's a design pattern I believe organizations should adopt—having a designated variables realm in their namespace. This way, other contracts can focus on their primary functionality without the added weight of managing basic variables, such as the migration of an adminAddr.

I recommend taking a look at my draft PR in the main repository. There, I've attempted to template these common patterns, aiming for more succinct contracts that utilize established patterns: gnolang/gno#880.

@moul moul changed the title Implement a r/demo/chess_variables Implement a r/demo/chess_variables Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant