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

KIP-0029: Proposal of new guard type: Constant boolean guard #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CryptoPascal31
Copy link

@CryptoPascal31 CryptoPascal31 commented Feb 14, 2024

The idea is to propose a new guard, the most simple as possible, the easiest to understand.

But it's currently missing, and would be very useful, and would improve the clarity.
Nothing revolutionary.

https://github.com/CryptoPascal31/KIPs/blob/119fe2df7df6a42bba7f46c406ca631aec95e99a/kip-0029.md


@daplcor
Copy link

daplcor commented Feb 14, 2024

This seems extremely useful, I assume it would help with things like the function below. You can type specify bool, arrays, objects, strings, but not guards that I am aware of. So we end up having to add extra helper functions which serve no real purpose.
(defcap USERPAY (account:string)
(with-default-read taxes account {'guard: (create-null-guard) } {'guard:=guard}
(if (!= guard (create-null-guard))
(enforce-guard (at 'guard (coin.details account)))
(enforce-guard guard)
)
)
)

(defun enforce-null:bool
()
false)

(defun create-null-guard:guard
()
(create-user-guard (enforce-null)))

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

Successfully merging this pull request may close these issues.

2 participants