π§ Pact Quest #7 opens tomorrow at 14:00 UTC β Pact keysets: how many keys must sign?
A Pact keyset lists public keys and a predicate that says how many of them must sign. Which built-in predicate is satisfied as soon as at least two of the keyset's keys have signed, however many keys it holds?
(lowercase, hyphenated, exactly as you would write it in Pact β the name only, no parentheses)
Read the Kadena CE docs β the answer is one page away:
π kda-chain.org/docs/smart-conβ¦
π kda-chain.org/docs/pact-5/keβ¦
Claim from 14:00 UTC Sunday β pact-community.org/token, select quest-7
100 PCO Β· one claim per account Β· closes Fri 6 Nov, 12:00 UTC
β
β
Pact Quest #6 is closed β Thank you all.
The answer was with-default-read. It reads a table row and binds the columns you name, but when the key is missing it takes them from a default object instead of aborting. That is how a balance reads as 0.0 before an account's first credit.
The ones it is easily confused with:
β’ with-read β same shape, no fallback: a missing row aborts the transaction
β’ read β returns the whole row, also aborts on a missing key
β’ select β scans a table with a where clause rather than reading one key
π kda-chain.org/docs/pact-5/daβ¦
Questions: t.me/PactCommunityOrg
Free and valueless. Never sold.
#Pact #Kadena kadena:native @KdaCed #SmartContracts
π§ Pact Quest #6 opens tomorrow at 14:00 UTC β Pact tables, and the row that isn't there.
Reading a row that does not exist makes a Pact transaction fail. Which built-in reads a row but falls back to values you supply when the key is missing?
(lowercase, hyphenated, exactly as you would write it in Pact β the name only, no parentheses)
Read the Kadena CE docs β the answer is one page away:
π kda-chain.org/docs/smart-conβ¦
π kda-chain.org/docs/pact-5/daβ¦
Claim from 14:00 UTC Sunday β pact-community.org/token, select quest-6
100 PCO Β· one claim per account Β· closes Fri 23 Oct, 12:00 UTC
β
β
Pact Quest #5 is closed! Thank you all.
The answer was typeof-principal. A Kadena account name can be a "principal", and its prefix says which kind of guard controls it: k: a single public key, w: a multi-key keyset, u: a user guard, c: a capability guard. typeof-principal returns that prefix.
Its neighbours, easy to mix up:
β’ is-principal β only checks the name is shaped like a principal
β’ validate-principal β proves a name really belongs to a guard you hold
β’ create-principal β builds the name from a guard
π kda-chain.org/docs/pact-5/guβ¦
Questions: t.me/PactCommunityOrg
#Pact #Kadena #KadenaCommunityEdition #KadenaCE kadena:native
π§ Pact Quest #4 opens today at 20:00 UTC - capabilities: how Pact decides who may do what.
Which builtin grants a capability for the duration of one block of code, and only that block?
(lowercase, hyphenated, exactly as you would write it in Pact; the name only, no parentheses)
Read first:
π kda-chain.org/docs/smart-conβ¦
π kda-chain.org/docs/pact-5/caβ¦
Claim from 20:00 UTC β pact-community.org/token, select quest-4
100 PCO Β· one claim per account Β· closes Fri 25 Sep, 12:00 UTC
β
β
Pact Quest #3 is closed! Thank you all.
The answer was pact-id. A defpact is a Pact transaction in several steps; the kind that moves tokens between Kadena chains; and every step can read the same id with (pact-id). When PCO crosses chains it runs one, and its id is the request key of step one.
Worth remembering: pact-id is an identifier, not a permission; anyone can read it. In Pact, permission comes from guards and capabilities, which is exactly where Quest #4 goes.
π kda-chain.org/docs/pact-5/geβ¦
Questions: t.me/PactCommunityOrg
Free and valueless. Never sold.
#Pact #Kadena



