Questions tagged [pact-lang]

Pact is a language for developing smart contracts to run on a fast deterministic blockchain.

71 questions
1
vote
1 answer

What are the semantics of capability manager functions in Pact?

The Pact documentation describes two flavors of capability: unmanaged and managed. Managed capabilities are dynamic and can change the state of a capability as it is brought in and out of scope. A managed capability accomplishes this dynamic…
trh
  • 171
  • 6
1
vote
1 answer

Is there a way to send modules through the message data?

Question is, in the repl file I can send the coin module in the message data, as the repl parse it into the module itself, and it doesn't require a valid json. But when I try to send it through a real message, it must be a valid json, and therefor…
1
vote
1 answer

How do you make 2 or more keys to sign a transaction and verify the keyset?

When building keysets, they have three options: keys-all, keys-2, and keys-any. I wanted to create a keyset that required 3 keys to sign the transaction, but I was confused about how to force the keyset to take all three keys in the signature…
1
vote
0 answers

What does the error "1:1Typechecker Internal Error: User type in value position" mean?

I was going through the Rotatable Wallet tutorial on the Kadena beginner tutorial, and I ran into this error: "1:1Typechecker Internal Error: User type in value position". What does this mean? And where exactly is the error occurring?
1
vote
1 answer

How do you add an account to Kadena Chainweaver?

When I was trying to deploy the HelloWorld contract using the beginner tutorial, I got to the configuration page in the deployment popup. I made two public keys, but the tutorial specified nothing about the accounts. How do I create accounts so I…
1
vote
1 answer

What is the scope of module governance in Pact?

Pact modules have a number of restrictions that determine what code users can call vs. what code only the module can control. Specifically, when a module is governed by a keyset (for example (module foo 'foo-keyset)), then the documentation states…
trh
  • 171
  • 6
1
vote
2 answers

Webpack/polyfill Error after installing pact-lang-api

While trying to connect a react frontend, which was just created using create-react-app, I got this error message when running npm run start after importing pact-lang-api to the app: ERROR in ./node_modules/eventsource/lib/eventsource.js 5:12-28…
1
vote
1 answer

Key-pair generation for Kadena

Chainweaver uses the following code to generate a key-pair from a Bip 39-generated seed: https://github.com/kadena-io/cardano-crypto.js/blob/c50fb8c2fcd4e8d396506fb0c07de9d658aa1bae/kadena-crypto.js#L336 Is there any documentation regarding this…
herrtim
  • 2,697
  • 1
  • 26
  • 36
1
vote
1 answer

Is there a way to determine if a namespace is already taken on Chainweb?

In the Pact language reference entry on namespaces, the text is clear that on public blockchains modules and interfaces must be defined within namespaces, and namespaces must be globally-unique. Namespace declarations provide a unique prefix for…
trh
  • 171
  • 6
1
vote
1 answer

enforce-guard fails in Zelcore and XWallet

Whenever I call a function that has (enforce-guard some-guard) from X-wallet or Zelcore it always fails with the error Keyset failure (keys-all) I have no issues when doing this from Chainweaver
Kitty Kad
  • 412
  • 1
  • 7
1
vote
2 answers

Is it possible to UNION select from 2 tables?

Is it possible to do something like a sql UNION select with pact or select a common row from 2 separate tables returning a result? For example we have 2 tables, and we want to select row ("Bob") from both tables (ages, favorite-food), and return a…
squiegee
  • 31
  • 2
1
vote
1 answer

How to specify and offset for select query on a table?

Is it possible to specify an offset for select query on a table ?
Kitty Kad
  • 412
  • 1
  • 7
1
vote
1 answer

How to get current time in Pact / Kadena

How do you get the current time in pact? I couldn't find it in the documentation https://pact-language.readthedocs.io/en/stable/pact-functions.html?highlight=time#time-2
Kitty Kad
  • 412
  • 1
  • 7
1
vote
1 answer

Formal Verification slow down with Pact?

I was going to implement this piece of code in my smart contract: (defun absBug:integer (num:integer) ;; This property fails @model [(property (>= result 0))] (if (= (- (* (- num 6) (+ num 11)) (* 42 num)) (* (* 64 7) 52270780833)) (- 1) …
romerojr
  • 57
  • 4
1
vote
1 answer

Format does not except Amount:Decimal

I was writing over a simple payment contract and noticed that I was receiving the warning: We can only analyze calls to format formatting {string,integer,bool} (not amount) Below is my code, I realized if I remove the amount parameter on the…
romerojr
  • 57
  • 4