All Questions
Tagged with plutus smart-contract
26
questions with no upvoted or accepted answers
7
votes
1
answer
287
views
Questioning Plutus API design decision
In Lecture 10 from the Plutus Pioneer Programm there is a replica of the Uniswap Smart Contract built on top of Plutus. It is actually part of the standard Plutus use cases Plutus Uniswap
To have a ...
3
votes
0
answers
114
views
Invoking lock endpoint on the plutus-starter guessing game is giving me "endpoint not available" error
Using the nix-shell approach, I'm able to build and execute the plutus starter PAB project, which includes the guessing game contract. GIT repo link
In a separate terminal window, I can run the GET ...
2
votes
1
answer
26
views
Expecting one more argument to ‘RedeemerType’
My code is here
marketConstraints :: Market -> TxConstraints (RedeemerType -> ScriptContext -> Bool) (DatumType, ())
marketConstraints market = mustValidateIn (to $ scriptAddress market)
I ...
2
votes
3
answers
113
views
How to convert Address type variable to get "addr_testXXX" format address?
In plutus endpoint, I want to convert Address type value to get addr_testXXX format address.
I have try :
import Cardano.Api ( SerialiseAddress (deserialiseAddress, serialiseAddress) )
...
-- here, ...
2
votes
0
answers
41
views
Whats a Good Example of Interconnected Smart Contracts?
In the Contract Monad we have the use of w s e a. Now w is used to connect contracts is there a good example of how this is done, in particular how to validate a contract using the w of another ...
2
votes
2
answers
269
views
How to return funds from a smart contract
If I have assets (can be just ADA for simplicity) locked in a contract, how can I release the funds to the previous owners most efficiently?
Some more context regarding the question.
I created a pay ...
2
votes
0
answers
56
views
PAB recovering from Errors
In the current version of the Plutus starter repo (commit a85818 which uses plutus-1.0.9), it seems difficult to know where to handle errors. For example, using the Game contract after initialization ...
2
votes
0
answers
118
views
Weird behavior on validation of outputs
So I have a validator that, in particular, checks how many outputs are produced.
os = txInfoOutputs info
mkValidator :: ...
mkValidator = traceIfFalse "Wrong outputs" checkOutput
where
...
1
vote
0
answers
15
views
redeeming from PlutusV3 script fails
This is the code of my smart contract. It basically requires exactly 3 reference inputs to pass validation.
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ...
1
vote
1
answer
23
views
how to use ownPubKey and RedeemerType and DatumType
My code is here.
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ...
1
vote
0
answers
24
views
PlutusTx TxInfo Type Mismatch
I am building a PlutusTx V1 Smart Contract for NFT Royalty distribution. Part of that requires totaling up the amount of Lovelace sent to the contract from the most recent tx. I came up with the ...
1
vote
0
answers
16
views
Comparing VALUES in a smart contract. How to know if they will be normalized or not?
I need to make VALUES comparisons on chain.
I realized that if a use the (==) operator from Plutus it is very inefficient in matter of memory and cpu steps needed to compute.
(https://github.com/input-...
1
vote
0
answers
55
views
Plutus Playground WalletError: InsufficientFunds
I am running my smart contract on the plutus-playground and getting the error below:
Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\&...
1
vote
0
answers
132
views
Whats the Diffrance between Plutus scripts and Cardano Native Scripts?
What are the key differences between Cardano native scripts and Plutus scripts, from a developer's perspective?
1
vote
0
answers
34
views
How to get the address which locked the fund on a smart contract?
I have two users. The first user locks 1 ADA with a Datum at a script address. The second one unlocks the 1 ADA with the same Datum and should now send 5 ADA to user one.
Can I now implement a logic ...