Questions tagged [smart-contract]

A digital agreement that specifies where funds/tokens/assets should go, and under what conditions they will be sent, executing a deal only when all the conditions are met.

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

How to build smart contract depending on trusted server for additional information

I am trying to build a smart contract that will need to rely on off-chain information from a trusted server in order to gather to the state of something which will impact on how the UTXO should be ...
Kunikos's user avatar
  • 13
1 vote
1 answer
22 views

Failed to build atlas examples with cabal

I tried both in the main branch and in the atlas-0.3-update branch and get the same result. but when i run cabal build i get the same error fatal: Could not parse object '...
Kunikos's user avatar
  • 13
0 votes
1 answer
19 views

Decompiling Plutus Core Binary Encoding

I'm working with Plutus Core smart contracts, and I have the binary encoding of a Plutus Core script. I'm curious to explore the higher-level Plutus code or any human-readable representation of the ...
Salih Karadag's user avatar
0 votes
0 answers
18 views

Is Plutus compiler backend producing code cheap enough for production purposes?

I have heard a couple of times, that is hard to make Plutus produce non-costly code, and one should consider writing scripts on a level with Plutarch's help instead. Still, I never get real reasons ...
uhbif19's user avatar
  • 101
0 votes
1 answer
18 views

I want to mint an NFT using a JSON file using plu-ts, but I dont know how and where to start

I want to mint an NFT using a JSON file using plu-ts, but I don't know how and where to start. Do I need to create a Node? OR Do I need to write it in Haskel? I have read and performed everything from ...
Talha Sajid Chaudhary's user avatar
0 votes
0 answers
13 views

Coming from ethereum I am looking for the Cardano equivalent of https://remix.ethereum.org/ for quick development

I am coming from the Ethereum world, where I got started with https://remix.ethereum.org/ really fast. What is the equivalant in the Cardano world so that I can experiment fast just using my web ...
yazz.com's user avatar
  • 101
1 vote
1 answer
67 views

Create a smart contract in Marlowe from A to Z

What is the process of building a smart contract in Marlowe from start to deployment and first main net transaction? I know that there's blockly and Marlowe playground. But I can't figure out the step-...
Dmitry's user avatar
  • 11
-1 votes
1 answer
45 views

Programmatically write and submit a smart contract

Title. Any ways to accomplish this? Preferrably in react/javascript Edit: downvote me to oblivion!!
Myles's user avatar
  • 321
2 votes
1 answer
55 views

How to handle sensitive data in smart contracts?

I'm interested in creating an escrow smart contract using Plutus, where a seller stores an encryption key in the Datum and sells it for a price. The key should only be accessible to a buyer who pays ...
Markos Girgis's user avatar
0 votes
2 answers
70 views

Different types of Datums

I have a good understanding of the role of Datums in Cardano's Extended UTXO model, including their use in representing the state of a smart contract. However, I'm seeking further clarification on the ...
Markos Girgis's user avatar
1 vote
2 answers
73 views

which programming language is predominantly used for writing smart contracts in Cardano now?

I am a newbie to blockchain in the Cardano ecosystem. I have been exploring the Cardano documentation, which mentions various programming languages for writing smart contracts on the platform. How do ...
CocDap's user avatar
  • 111
0 votes
0 answers
36 views

How to get Daily Volume for an Cardano token by using Cardano-Db-Syncs database

Is there an way to query directly Cardano Db Syncs database to get withhold of the daily volume of an certain token ( For example via using multi_asset.fingerprint ) WITH ma_tx_ids AS ( SELECT ...
ErikM's user avatar
  • 41
3 votes
2 answers
415 views

Can a smart contract execute itself automatically?

I was wondering wether a smart contract can execute automatically or not. For example, let's say I have a vesting contract that, when a certain deadline passes, automatically executes and send some ...
ash's user avatar
  • 53
1 vote
2 answers
90 views

Mutable NFT state by minting and burning in same transaction

The problem Please consider the following case: a token (NFT) needs to holds some state, ie {a: 234, b: "someState"}, which needs to be mutable and it needs to abide to specific rules. The ...
Duco's user avatar
  • 33
3 votes
2 answers
272 views

Which would be the future language for writing smart-contract?

As we might know well-known approaches for writing smart contracts on Cardano are using Plutus Tx or Marlowe based on specific requirements. However, according to the growth of the Cardano community, ...
manhdt's user avatar
  • 125
0 votes
2 answers
70 views

playground-common package giving 'Failed to build scrypt-0.5.0' error

I'm trying to run my own little smart contract in the plutus-pioneer-program [fourth iteration] docker container and I'm having some problems. I've just added an extra folder alongside the other weeks....
NaeriKailash's user avatar
0 votes
3 answers
97 views

Unlock NFT from smart contract by Cardano-serialization-library

I am trying to implement the Unlocking of NFT from an "always true" smart contract. I am using the Cardano serialization library for this. I can lock the NFT successfully, but when i unlock ...
duaa azhar's user avatar
0 votes
1 answer
18 views

how to use ownPubKey and RedeemerType and DatumType

My code is here. {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ...
Anton Begas's user avatar
2 votes
1 answer
21 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 ...
Anton Begas's user avatar
1 vote
0 answers
20 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 ...
theArchitect's user avatar
0 votes
1 answer
78 views

Limit the number for each Token (AssetName) within one Currency Symbol (Policy ID)

is there any way to limit number for each tokens within one minting policy, in Plutus validator? For example for policy ab12 I want to allow users minting tokens, in different transactions. Сan the ...
dmitry_stas's user avatar
1 vote
1 answer
27 views

Can I view a Plutus smart contract on the NFT marketplace?

Can I view a Plutus smart contract of an NFT from the marketplace like (JPG store) and what is PubKeyHash ?
yogeshM's user avatar
  • 31
1 vote
0 answers
14 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-...
Manu Padilla's user avatar
0 votes
1 answer
59 views

Need to Retrieve Info from (NFT)Assets in Policy ID to see if they are in a Plutus Contract (smart contract) or Not using Blockfrost API

I have a python script that retrieves the NFT asset name, and addresses of a specific policy ID using blockfrost API. Now I need to amend the script to add to the csv whether or not the specific asset ...
dpd's user avatar
  • 3
0 votes
2 answers
90 views

"Transaction submit error" while trying to unlock funds from script address using Mesh

This is my setup code. const wallet = await BrowserWallet.enable('Nami'); // this script always succeeds regardless of the datum or redeemer const script: PlutusScript = { code: '59079559079201......
Jelil Akjaly's user avatar
0 votes
3 answers
112 views

"The second data argument, does not decode to a context" when minting NFT with Mesh

This my script for minting NFT: {-# INLINABLE mkPolicy #-} mkPolicy :: BuiltinData -> PlutusV2.ScriptContext -> Bool mkPolicy _ ctx = traceIfFalse "wrong amount minted" checkNFTAmount ...
Daniel Ng's user avatar
0 votes
1 answer
157 views

How to resolve this "(FromAlonzoUtxoFail (UtxosFailure (ValidationTagMismatch (IsValid True)" transaction submission error on mesh library

I am getting this error on transaction submission. ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (...
duaa azhar's user avatar
1 vote
2 answers
47 views

How do I design a dApp for 1000 NFTs minted per second

I am brainstorming on the architecture of a Cardano dApp that will be able to issue tickets as NFTs and can scale to around 1000 NFT tickets per second. From what I understand so far on UTXO, a ...
Skelli's user avatar
  • 327
0 votes
2 answers
71 views

How to generate CBOR hex of plutus smart contract

How can i generate the CBOR hex of a plutus smart contract. Does it requires to generate CBOR of onchain code only or both onchain and offchain? Also if have a smart contract which requires parameters ...
duaa azhar's user avatar
1 vote
1 answer
170 views

How to deploy the Plutus smart contract

I am following Plutus-pioneer-program to learn smart contract development in Cardano. I have tried the onchain and offchain code, compiled and tested in Plutus playground and also in emulator trace. ...
duaa azhar's user avatar
0 votes
1 answer
41 views

Understanding Script Failure Error Relating to Order TxIds - (script hash not known)

trying to claim back the first player bet after deadline in the ZeroOneGame from ppbl gimbalabs course on pre-production_testnet I get an error when trying to build the claim transaction. I have this ...
user3755529's user avatar
1 vote
2 answers
69 views

What prevents a smart contract from going into an infinite loop?

What is the equivalent of gas in preventing DoS attacks? What happens if an attacker writes a recursion that never stops in Plutus? Someone asked the question before.
sinoTrinity's user avatar
1 vote
1 answer
98 views

Possible to get the total supply of a native token in a smart contract?

Is it possible to get the total supply of a native token in a smart contract, similar to the following Solidity code from here? One can easily query it from an external API. address token = ...
sinoTrinity's user avatar
0 votes
1 answer
45 views

Is validator script needed to spend a UTXO locked by its hash?

When a UTXO is produced, it is locked to an address, i.e., the hash of a script, not the script itself. When a transaction spends it, does the tx have to provide the script in its input? There are ...
sinoTrinity's user avatar
0 votes
1 answer
104 views

How to decode the datum stored across records in the tx_metadata table for a given tx

For a given tx - where a contract has been used, outputs have been stored in the tx_metadata table - in this case key/value pairs where the values of keys 0 through 10, when appended together to form ...
RelevantData's user avatar
0 votes
2 answers
78 views

Mesh Error: getUsedCollateral not implemented

I'm using mesh and follow this example of always-succeed smartcontract. I successfully send Lovelace to the script address. But when building transaction for redeeming Lovelace from the script address,...
Adam's user avatar
  • 343
0 votes
1 answer
146 views

How can I interact with smart contract created from Marlowe in the testnet/mainnet?

I create a smart contract with Marlowe from https://play.marlowe-finance.io I now want to deploy the contract in the preview testnet and later mainnet. I imagine it must be somehow converted into ...
Adam's user avatar
  • 343
1 vote
1 answer
56 views

How to import Plutus.Contracts.Currency

I am trying to build an application that will make use of function mintContract under Plutus.Contracts.Currency, but i have difficulty importing this module. What can i do?
big-tea-rice's user avatar
2 votes
1 answer
83 views

Call Martify Smart contract by cardano-cli

I call the martify smart contract by cardano-cli but I've seen the error Command failed: transaction build Error: The following scripts have execution failures: the script for transaction input 1 (in ...
user7854's user avatar
0 votes
2 answers
33 views

Decentralized Private Content Storage and Accessing

What would be the best way to store Private Video on chain, completely and only NFT holders should be able to access it Like the video can be encrypted and stored on IPFS or STORG. Only the NFT holder ...
Sam Jeffrey's user avatar
3 votes
1 answer
73 views

How To Verify The Code Of A SmartContract?

There's a lot of talk about open-source code on Cardano, but how can I verify that the SmartContract(s) in a git repo are the actual SmartContracts the project has deployed to the Blockchain? I want ...
KryptoKing's user avatar
10 votes
3 answers
268 views

How to properly start a new Plutus project, from scratch

I'm from ETH's ecosystem and recently just decided to get into Cardano development, specifically Plutus dev work thanks to Demeter.Run, and after going through the Plutus starters on there, I noticed ...
0xDaito's user avatar
  • 101
1 vote
1 answer
114 views

How do you interact with smartcontract on jpg.store

Does anyone know how you interact with smart contract on jpg. store Do we need this? https://github.com/jpg-store/current-jpg-store-contracts if so how do we do so?
Brian Yeap's user avatar
4 votes
3 answers
127 views

How do users interact with smart contract?

In plutus playground, there is an example called “Vesting”. In the simulation, users can interact with this smart contract by click on “vest fund” or “retrieve funds”. Now suppose that we compile this ...
Adam's user avatar
  • 343
0 votes
1 answer
44 views

Printing a plutus validators cborhex to a file

I was hoping to get some advice re printing a plutus validators cborhex to a file. Im kinda basing my logic off of an example in week03 in the pioneer program but need to make some adaptations. Below ...
NaeriKailash's user avatar
0 votes
1 answer
46 views

Use a parameterized currencySymbol within a Plutus Validator. Unsupported feature: Type constructor: GHC.Prim.ByteArray#

I have a minting policy which is parameterized by PaymentPubKeyHash and a script which checks that a token from that minting policy has been burned. The script also takes PaymentPubKeyHash as a ...
Rohan Mitta's user avatar
0 votes
1 answer
27 views

Plutus Playground - mustPayToTheScript - unexpected char escapes - 0 converted to \NUL, 1 to \SOH

I am having trouble with the mustPayToTheScript function - I am getting this error Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"...
NaeriKailash's user avatar
1 vote
0 answers
54 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 [(\\\&...
NaeriKailash's user avatar
1 vote
2 answers
79 views

Plutus playground error when running simulator: WalletContractError ToCardanoError (Tag \"toCardanoPolicyId\" (Tag \"1 bytes\" DeserialisationError))

Plutus-apps v2022-04-06 My smart contract compiles successfully however when i run the simulator i get this error Contract instance stopped with error: "WalletContractError (ToCardanoError (Tag \&...
NaeriKailash's user avatar
0 votes
1 answer
31 views

Convert ChainIndexTxOut to TxOutTx

I have this function that is expecting type TxOutTx, but it receives ChainIndexTxOut. I'm trying to convert to the type required but encountering issues getTradeDatum o = case txOutDatum (txOutTxOut o)...
NaeriKailash's user avatar

1
2 3 4 5 6