Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Smart Contract without installing in my Mac

I would like to ask, as my Mac Terminal has a problem in setting up the Tezos. Can I proceed into writing Smart Contract via Ligo IDE and connect to my Node (I'm using ChainStack)?
user avatar
  • 1
0 votes
2 answers
88 views

Tezos Contracts Compiling Error

I am just days into learning how to build a dapp on Tezos for my thesis. I tried replicating the steps from Claude's tutorial - https://hackernoon.com/build-your-first-dapp-on-tezos-rwgl3ymb I ran ...
user avatar
0 votes
1 answer
18 views

Has human-readable feedback from contract simulation been considered?

I am wondering if feedback to wallet-users from Michelson contracts has been considered previously in the development of Tezos, and where is it / why is it not being considered ? I am thinking it ...
user avatar
  • 113
0 votes
1 answer
12 views

Online SmartPy IDE run error:

The error says: exports[f] is not a function. Not sure why when I try to run.... import smartpy as sp @sp.add_test(name = "First test") def test(): scenario = sp.test_scenario() ...
user avatar
  • 5
2 votes
1 answer
54 views

Cannot get to initialize empty list in CameLIGO

I'm trying to write a smart contract in CameLIGO that looks like this parameters "Hello world" storage [{ text = "Blob"; voters = ["tz1TKc3zQBMv7Rez77sX4JNdqMvG33LQrURk"]}...
user avatar
  • 21
0 votes
1 answer
34 views

triggering outside actions from tezos

assuming I am running a tezos node, is there any way to create a smart contract in tezos that is capable of triggering outside actions? For example, sending an email to an address, or turning lights ...
user avatar
0 votes
2 answers
46 views

Do FA2 entrypoints need to be at the top level in order to comply with the spec?

Most of the example FA2 implementations I've found, as well as the deployed contracts I've investigated have the required FA2 entrypoints (transfer, balance_of, update_operators) buried in the second ...
user avatar
  • 131
0 votes
1 answer
31 views

List inside of Map, or equivalent?

I want to have a list of data in a map so I can find it with the key which is associated with a user, but I get: Error: Type Error sp.TIntOrNat is not sp.TList(sp.TUnknown()) bad type for map value (...
user avatar
1 vote
1 answer
39 views

How to compare TKeyHash with TAddress? [SmartPy]

I am writing a smart contract which allows the delegate to be changed. I also want incoming payments to be permissioned. Ideally, I want to update the incoming payment whitelist with the baker's ...
user avatar
0 votes
2 answers
53 views

Problem with XTZ wallet

I have a question about XTZ Currency. 2 years ago I deligate XTZ to baker using TEZBOX and all these time I haven't checked it. But today I found out that the TEZBOX wallet is not available. I ...
user avatar
1 vote
1 answer
94 views

Calling Harbinger using Smartpy to get randomness

I want to get a random value in my smart contract to provide a fair distribution of different tokens. I read that using Harbinger to get values and use it for entropy could be the good way to do. But ...
user avatar
1 vote
2 answers
77 views

In Michelson, is it possible to get the balance of an arbitrary contract?

In Michelson, is it possible to get the balance of a contract other than the current one? According to the Michelson reference, it's possible for a contract to get its own balance. But, is it possible ...
user avatar
1 vote
0 answers
39 views

How do I call a tezos smart contract over go

I have deployed a smart contract to my tezos blockchain and want to interact with it. I found the go library tzgo (https://github.com/blockwatch-cc/tzgo) to interact with the blockchain and there is ...
user avatar
  • 11
0 votes
0 answers
48 views

Is there a more sensible way to convert an int to a string in Cameligo?

Is there a more sensible way to convert an int to a string in Cameligo? Alternatively, is there a way to concatenate an int or nat with a string? type lookup = (int, string) map let lookup: lookup = ...
user avatar
1 vote
1 answer
36 views

Type casting craziness

I am trying to execute this line sp.amount == sp.utils.nat_to_mutez(x) * self.data.y where x is the parameter of an entry point function. These are the following types: sp.amount: sp.TMutez, x: sp....
user avatar
  • 13
0 votes
0 answers
13 views

Stress testing making consecutive calls on a contract's entry point

I want to test calling the same entry point on a smart contract repeatedly. I have a smart contract that might linearly increase the gas it consumes after each consecutive call in the entry point. Of ...
user avatar
  • 13
1 vote
1 answer
64 views

Taquito: error when using "parameter" in withTransfer with Batch API

I am trying to transfer an amount to a contract while calling a contract endpoint using the Batch API provided by Taquito. I've tried passing a parameter object as shown in the Taquito documentation, ...
user avatar
  • 21
2 votes
0 answers
44 views

Is there any Sapling contract on mainnet?

Is there on mainnet any deployed Sapling contract that anyone really uses (through tezos-client, as I believe it's the only supported way to do it now)?
user avatar
  • 31
1 vote
1 answer
37 views

Best way to duplicate/sync private database with FA2 contract transactions & balances

If you wanted a private DB to have all of the transactions,balances etc. of a particular FA2 contract deployed on mainnet, what would be the best way of achieving this? Is it possible to have a ...
user avatar
0 votes
1 answer
28 views

sp.contract from hash key

In the test, I am trying to replace the admin with a fixed account. But I cannot find what t should be. admin = sp.contract( t,"tz1dQXqXZ3Y5sgYwU9Aq9xRJPxEZNUwyE6ht", entry_point = "&...
user avatar
0 votes
2 answers
45 views

Calling Harbinger price contract get method in taquito

I am trying to call the get method of the coinbase normalizer harbinger price contract (KT1AdbYiPYb5hDuEuVrfxmFehtnBCXv4Np7r). Is this the correct way to call the get method, as it doesn't seem to be ...
user avatar
  • 3
1 vote
1 answer
43 views

Liquidity Baking subsidies effect on pool ownership

Assume there are 167,659,347 LQT tokens in the storage of the Liquidity Baking CPMM contract currently. If I have 100,000 LQT (a made up amount for the same of this question), that means I own 0....
user avatar
0 votes
0 answers
22 views

How to convert to Ligo type

I have this smart contract and was wondering how to convert to a ligo type transfer parameter list($transfer_item) transfer_item pair from_ address txs list($txs_item) txs_item pair to_ ...
user avatar
0 votes
0 answers
34 views

How to interact with a deployed smart contract ligo

It seems that my smart contract cannot find the transfer operation of my FA2 other smart contract. Here is where the error is being thrown. case (Tezos.get_entrypoint_opt("%transfer", ...
user avatar
0 votes
0 answers
21 views

Avoid over-spending by smart-contract with FA2 token ? (update_operators)

Working with FA1.2 and FA2 token, i see that for FA1.2, when a transaction is done by the user, you need to call approve, with an amount, and for FA2, it is update_operators who is called, but without ...
user avatar
  • 1
0 votes
1 answer
39 views

How to airdrop tokens based on ownership of another token?

How would this work? Would it be like this? Fetch all the addresses that hold token A Iterate over those addresses on off-chain code and programmatically send token B to those addresses
user avatar
  • 557
1 vote
2 answers
87 views

what is the equivalent of ligo "compile-parameter" for smartpy?

The Smartpy compiler allow to compile a contract (compiling the code and the initial storage) but I don't see any "compile-parameter" option, that would allow to convert a smartpy command to ...
user avatar
0 votes
3 answers
98 views

More than a few hundred NFTs?

Is is possible to use Tezos to make more than 100ish NFTS? Using this template it seems that if over ~100 NFTs are minted, the contracts storage runs out. This is also concerning because it seems if ...
user avatar
  • 165
2 votes
1 answer
31 views

How to assign a variable based on the output of a function

I cannot figure out how to assign a variable based on the output of a function. I basically want to do this in my __init__ method def square(x): y = x * x return y toSquare = 10 result = ...
user avatar
  • 165
0 votes
1 answer
27 views

Can a FAILWITH error be caused by improper gas_limit or storage_limit?

Sanity check question: Can a FAILWITH error be caused by improper (too low) values of gas_limit or storage_limit? I'm guessing the answer is "no", but I'm debugging and stranger things have ...
user avatar
1 vote
1 answer
46 views

how does the liquidity baking CPMM round up or down?

I'm not sure how to ask this and I may mess up my mathematical terms, if you think I have then please correct me. When I call addLiquidity on the CPMM, I know that I will be sending tez, and that ...
user avatar
1 vote
1 answer
49 views

Is it possible to automate an action at a certain interval in a tezos smart contract?

Do you know a design who allow to automate an action at a certain interval ? (for example, call another contract every 20 blocks or something like that). Thanks every one for your help !
user avatar
1 vote
1 answer
44 views

how to calculate current storage values for liquidity baking CPMM

In looking at the storage values of the CPMM one can see that as of right now the CPMM has the following amounts of tzBTC (represented by the contract as tokenPool), xtz (represented as xtzPool), and ...
user avatar
0 votes
1 answer
131 views

how to send a nat value other than a whole number

How can I send a nat value to a contract that represents a data type which is not a whole number? For example, the xtzToToken entrypoint of the tzBTC contract allows a user to call the xtzToToken ...
user avatar
1 vote
1 answer
128 views

how to calculate the value of a single LQT token for Liquidity Baking?

In looking at the Granadanet contract storage, I can see the amount of tzBTC, Tez, and LQT tracked in/by the CPMM. Here are those values as of writing this: tokenPool 45805 xtzPool 111379958864916 ...
user avatar
0 votes
2 answers
76 views

what is the Liquidity Baking subsidy used for and how do liquidity providers benefit?

I've read the official Tezos docs on liquidity baking. However these docs do not explain how the subsidy will be used, or what it's even for. How will this subsidy be used, and how will liquidity ...
user avatar
0 votes
1 answer
99 views

call to 'approve' entrypoint of tzBTC contract failing with 'UnsafeAllowanceChange'

I'm trying to call addLiquidity on the Liquidity Baking CPMM. I've already called xtzToToken on the CPMM and given my address tzBTC. I can see that my address has tokens on the tzBTC contract when I ...
user avatar
3 votes
1 answer
67 views

what's a sensible minLqtMinted to send to the Liquidity Baking CPMM when calling addLiquidity?

I'm trying to understand what a sensible value is for the liquidity token (LQT) parameter when calling the Liquidity Baking CPMM. I'm reading the Dexter docs here, since the CPMM is a fork of the ...
user avatar
0 votes
1 answer
42 views

Originate smart contract with empty arguments

I try to initialize a smart contract with five arguments being nat * timestamp * nat * timestamp * address. However, I only want to fill the last argument with some value but for the first four I try ...
user avatar
1 vote
1 answer
63 views

value is invalid for type

I'm trying to call the addLiquidity entrypoint of this contract, which is a copy of the Liquidity Baking CPMM contract, which is itself a copy of the Dexter contract. The original Dexter docs give an ...
user avatar
5 votes
1 answer
332 views

How to provide liquidity to the upcoming liquidity baking tez/tzBTC?

I've tried to understand how to interact on the interface on Better Call dev but can't seem to figure it out. When I execute them under simulation I get failed transaction. Where do I insert the ...
user avatar
2 votes
1 answer
96 views

Can't get tzBTC out of the tzBTC Granadanet contract

i'm trying to (eventually) add liquidity to the Liquidity Baking CPMM contract on Granadanet. In order to add liquidity, I need some tzBTC from the tzBTC contract here.. I cannot, for the life of me, ...
user avatar
1 vote
1 answer
94 views

Contract does not exist

I'm using a Granadanet node to experiment with Liquidity Baking. I'm trying to call the tzBTC contract's mint entry point. This is my first time using a test net, but I thought that it was a copy of ...
user avatar
1 vote
0 answers
29 views

How can we accept USDTZ in smartpy smart contracts, is it even posible?

I was working on a token sale, so is there any way we can accept USDTZ as a mode of payment for the tokens?
user avatar
4 votes
2 answers
603 views

Any way to get the public key of an address?

I am developing a dapp where I need the public key of an address of the user, is it possible to get the public key in the contract (using SmartPy)? Or even on the client side using taquito or any ...
user avatar
  • 143
1 vote
1 answer
443 views

Converting a hash into an int within a range

I have a contract where I'd like to convert a hash (sha256 in this case, but I'm open to any of the other hashing algorithms available) into an Int (or Nat) between 1 and 100. I have the code that ...
user avatar
  • 233
3 votes
1 answer
118 views

Limiting the time (time/date based) that a contract method can be called

I'd like to publish a contract that allows calls up until a certain time and date. For example, say I want to allow anyone to call it for 1 year after publishing the contract to the blockchain, then ...
user avatar
  • 233
3 votes
2 answers
276 views

Using sp.create_contract to generate pseudorandom numbers on-chain

In this answer, the answerer suggested that CREATE_CONTRACT could be used to generate a contract address which could then be used as a seed for a pseudorandom number in a contract. What would a simple ...
user avatar
  • 233
1 vote
1 answer
325 views

Pseudo-random numbers for NFT attribute random generation

I'd like to generate an NFT within a contract and give it a randomly occurring attribute. As I search, it seems that the only fully-secure way to do this is to use an Oracle or build some sort of ...
user avatar
  • 233
1 vote
1 answer
43 views

Tweaking FA1.2 to add level based balance snapshots to assist token voting in a DAO

DAOs functioning on a token voting mechanism (using either FA1.2 or FA2) mostly require the locking up of tokens for the entirety of the voting period essentially to prevent double-voting or any form ...
user avatar

1
2
3 4 5
7