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
0 answers
16 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 ...
1 vote
1 answer
15 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 ?
  • 31
1 vote
0 answers
11 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-...
0 votes
1 answer
40 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 ...
  • 3
0 votes
2 answers
50 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......
0 votes
2 answers
28 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 ...
0 votes
1 answer
47 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 (...
1 vote
2 answers
39 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 ...
  • 327
0 votes
2 answers
57 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 ...
1 vote
1 answer
103 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. ...
0 votes
1 answer
23 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 ...
1 vote
2 answers
51 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.
1 vote
1 answer
49 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 = ...
0 votes
1 answer
40 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 ...
0 votes
0 answers
13 views

ownPaymentPubKeyHash == wallet address?

According to this documentation, ownPaymentPubKeyHash is: Get the hash of a public key belonging to the wallet that runs this contract. * Any funds paid to this public key hash will be treated as the ...
  • 323
0 votes
1 answer
53 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 ...
0 votes
2 answers
51 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,...
  • 323
0 votes
0 answers
29 views

How can i store local variables in Plutus just like solidity?

As the title suggests, how do i store local variables in Plutus? In solidity, i can have a (address => bool) mapping to enforce a rule that some functions should be callable at most ONCE by a ...
0 votes
1 answer
94 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 ...
  • 323
1 vote
1 answer
44 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?
2 votes
1 answer
50 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 ...
0 votes
2 answers
31 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 ...
3 votes
1 answer
47 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 ...
9 votes
3 answers
201 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 ...
  • 91
1 vote
1 answer
72 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?
4 votes
3 answers
93 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 ...
  • 323
0 votes
1 answer
38 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 ...
0 votes
1 answer
37 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 ...
0 votes
1 answer
26 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 [(\\\"...
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 [(\\\&...
1 vote
2 answers
78 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 \&...
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)...
1 vote
1 answer
46 views

Is there an equivalent of Bitcoin Script Opcodes or the EVM instruction set in Cardano

Is there some lower level code that Plutus code compiles to (akin to Solidity => EVM bytecode, or BSV sCrypt => OP_codes)? Related (but distinct) how the state changes: https://cardano....
  • 115
3 votes
1 answer
84 views

How can I determine which smart contracts / script addresses are associated with which dApps?

I have seen numerous examples of blockchain explorers providing information about the on chain activity of specific dApps. For example: opencnft.io aggregates data about various token marketplaces ...
  • 125
4 votes
5 answers
419 views

Smart contract is not working after Vasil Hardfork in testnet

My smart contracts deployed in testnet stoped working after the Vasil Hardfork. i get this error: ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [...
0 votes
1 answer
36 views

Can I Use TraceIfFalse in deployment?

So I use traceIfFalse to test a lot of my smart contracts now I'm ready to deploy some of then and I want to know if this is for development only or if its fine to have a smart contract use this ...
0 votes
1 answer
37 views

How to have a contract on chain for extended periods of time?

In PPP Larz explains that there's a limit to how long a contract can remain on chain, what is that limit and how do I go about extending it?
1 vote
1 answer
29 views

What is a Semantics Model?

In the eUTxO research paper by IOHK, it mentioned that the eUTxO model is able to enable both expressive smart contracts and keep the simple semantic simplicity of the UTXO model. But what does ...
1 vote
3 answers
94 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, ...
3 votes
1 answer
132 views

How To Convert Old Plutus Scripts to Vasil Reference Scripts?

One of the fun things, the Vasil hardfork gives us is the ability to reduce the size of transactions and so put more of them into a block (speeding up the chain). My question is how to change the ...
2 votes
1 answer
71 views

How to create an unspent UTXO with specific value

I want to create a script (smart-contract) utxo with a specific number of tokens (it can be an output of a transaction before) in cardano-serialization-lib - javascript. I need this utxo to be part of ...
  • 91
0 votes
1 answer
47 views

Is there a way to see which Plutus code is deployed on a specific script address?

On Ethereum, for example, there is a way to see the Solidity code that is deployed in a specific address (as long as the code gets verified). Is there a way to achieve this same behaviour in Cardano?
0 votes
1 answer
88 views

How to Securely Serialise a Plutus Smart Contract Endpoint?

Assuming I made an arbitrary smart contract and want to serialise the endpoint after I have the validator hash and address hash, what should I do to ensure that the serialisation is as safe as ...
1 vote
1 answer
48 views

Is possible to create a cNFT that depends on 'proof of ownership' in order to be own by a wallet?

I'm thinking on a way to create a cNFT that requires 'proof of ownership' to be minted and own by a wallet, by proof of ownership I refer to something the receipt owns and can pass to others or loss, ...
  • 113
0 votes
1 answer
18 views

How can I check the origin of a Token?

A smart contract minted a Token and send it to my wallet, after a time has passed how can I check if that smart-contract in specific did mint the token?
0 votes
1 answer
18 views

Where Do I Go To Find All The ScriptContexts Feilds and Functions?

Hi im getting lost in the documentation, I have found some things I was looking for but am failing to find the info and functions for script contents. Im using this link https://playground.plutus....
2 votes
1 answer
315 views

Whats the function to get the current time in Plutus?

Im using the time module in the ledger class to do some custom validation logic, but everything is done as intervals and I cant find the function that gets the current time. What is it?
0 votes
2 answers
78 views

How to securely call Blockfrost or other API service from Smart Contract?

I just spent a few days trying to find a way to access account data from a smart contract using only plutus. Turns out IOG has yet to put that functionality in (at least that's how I understand it) ...
0 votes
2 answers
60 views

How to get transaction info of a public key hash in a plutus smart contract?

Given a PubKeyHash (pkh) how can I get the history of that pkh's transactions from within a plutus smart contract?
1 vote
1 answer
29 views

How To Get Address Transaction history into Smart Contract?

If I want the smart contract to alter functionality depending of the history of the signing address, how do I access the history from within the smart contract?

1
2 3 4 5 6