Questions tagged [pact-lang]

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

71 questions
4
votes
1 answer

How to deploy a smart contract on KADENA

Please how do I deploy a smart contract to the testnet or mainnet WITHOUT Chainweaver web UI? I know I need a YAML file for that, but what do I do with it and where exactly do I send it? Do I need to run a pact server, chainweb api or...? I couldn't…
masch1na
  • 97
  • 5
4
votes
1 answer

Pre-Built Module bind

I am new with Pact (Kadena.io), Could you please give me an easy explanation about what the module bind does ? the explanation in the manual is not completely clear to understand. Thank you. pact-lang
Lukas BA
  • 41
  • 2
3
votes
1 answer

Do all modules inherit the Coin contract automatically or is there a required import?

When accepting payment for an NFT I am making, how do I ensure I can call coin.transfer and coin.details from my module?
nexion21
  • 33
  • 3
3
votes
2 answers

Why does deploying my smart contract fail with : Failure: Tx Failed: Keyset failure (keys-any):

Despite using a unique module name (e.g. THIS was not the issue at hand), deploying my smart contract on kadena's testnet failed with the following error message: : Failure: Tx Failed: Keyset failure (keys-any): '[my keyset name] The only way to…
ednkh
  • 95
  • 6
3
votes
1 answer

getting tx sender data in a pact-lang smartcontract

I’m trying to access the keyset of a sender of a transaction without explicitly passing the publicKey as a string function parameter. I know that in the docs there is a (chain-data) function that returns the following object: {“block-height”:…
fmelp
  • 31
  • 2
3
votes
1 answer

How do you turn on Pact linting on Emacs?

I want to be able to write Pact code on Emacs. Is Pact available on Emacs? If so, how can I enable it?
3
votes
1 answer

Pact Formal Verification Properties

I see that Pact can automatically check certain properties of smart contracts using Microsoft's Z3 theorem prover. Are there relevant properties of smart contracts that can't be verified automatically? If there are, do you expect to verify them on a…
Derek
  • 31
  • 1
3
votes
1 answer

Typing Variables in Functions

I was attempting a basic hello world smart contract in Pact. While being able to complete the contract I received a warning. It didn't stop my contract from running but did concern me. In future lengthier contracts will I have to place the type next…
romerojr
  • 57
  • 4
3
votes
1 answer

How to comment out chunk of code in Pact?

How do I comment out a chunk of code in Pact? Is there a shortcut in Atom for this? I have tried command+? but it comments it out in HTML format. This does however work in Pact Web (pact.kadena.io)
mleafer
  • 825
  • 2
  • 7
  • 15
2
votes
0 answers

How do I exclude functions from properties on formal verification model?

I want to exclude the genesis mint function from the conserves-mass property (module account GOVERNANCE @doc "Account doc" @model [ (defproperty conserves-mass (= (column-delta ledger 'balance ) 0.0))] ... (defun transfer-create:string (…
slaanesh
  • 21
  • 2
2
votes
2 answers

How do I create a KDA wallet guard that will allow for an arbitrary number of people to withdraw from it, if they meet specific conditions?

Question: How do I create a wallet guard that will allow for an arbitrary number of people to withdraw from it, if they meet specific conditions? I am trying to make a wallet with a guard that lets a user withdraw a specific amount from it depending…
Nexion21
  • 309
  • 2
  • 7
2
votes
0 answers

How can i check the module-name in `cont` type transactions for gas-station?

I have implemented a gas-station for my project. When i tried to pay gas for a cont type txn, and it threw me Inside an exec error. (defcap GAS_PAYER:bool ( user:string limit:integer price:decimal ) (enforce (= "exec" (at…
bart
  • 21
  • 4
2
votes
1 answer

Kadena Cannot define a keyset outside of a namespace error

I'm learning Kadena pact-lang and following the tutorial at https://docs.kadena.io/learn-pact/beginner/hello-world I copy pasted the code (define-keyset 'hello-admin (read-keyset 'hello-keyset)) (module hello 'hello-admin "Pact hello-world with…
att
  • 617
  • 8
  • 17
2
votes
1 answer

Why send a nonce as part of a Chainweb transaction?

The Pact documentation describes metadata that can be sent with your transaction to a Chainweb node. In that metadata is an optional nonce field: https://pact-language.readthedocs.io/en/stable/pact-reference.html#yaml-exec-command-request What…
trh
  • 171
  • 6
2
votes
1 answer

How do you call non-write functions from a module without needing to pay gas, using pact-lang-api?

I have a few simple functions that get data from the blockchain, which normally does not require sending a transaction when using Chainweaver. (defun get-price (price-key:decimal) (at "price" (read price-table price-key ["price"] ) This…
Nexion21
  • 309
  • 2
  • 7
1
2 3 4 5