Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
24 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....
0
votes
0answers
12 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 ...
1
vote
1answer
20 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, ...
2
votes
0answers
30 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)?
1
vote
1answer
19 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 ...
0
votes
1answer
17 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 = "&...
0
votes
2answers
30 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 ...
1
vote
1answer
33 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....
0
votes
0answers
9 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_ ...
0
votes
0answers
21 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", ...
0
votes
0answers
15 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 ...
0
votes
1answer
23 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
1
vote
2answers
42 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 ...
0
votes
3answers
62 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 ...
2
votes
1answer
23 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 = ...
0
votes
1answer
16 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 ...
0
votes
0answers
26 views

How to handle large token distribution?

We are looking to do "income sharing" for a dapp where we would like to distribute dapp income to holders of a specific token 🙌 Is there a smart way to do this where I don't have to do a ...
1
vote
1answer
35 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 ...
0
votes
1answer
30 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 !
0
votes
0answers
14 views

Is it possible to get past storage (not actual storage, but the hictorical data like update, etc) of another smart contract in a smart contract?

I want to know if accessing past data of another smart contract from my smart contract is possible ? I know you can acces it via RPC, but i would like to use these data in my smart contract. Thanks !
1
vote
1answer
29 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 ...
0
votes
1answer
75 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 ...
1
vote
1answer
95 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 ...
0
votes
2answers
56 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 ...
0
votes
1answer
51 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 ...
3
votes
1answer
63 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 ...
0
votes
1answer
25 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 ...
1
vote
1answer
35 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 ...
5
votes
1answer
288 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 ...
2
votes
1answer
81 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, ...
1
vote
1answer
60 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 ...
1
vote
0answers
26 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?
2
votes
2answers
239 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 ...
0
votes
0answers
87 views

Mint FA2 NFT when contract is called by purchaser

I'm working on a smart contract which allows a caller to "purchase" an NFT simply by calling the contract and providing payment. I'd like the contract to mint the NFT at the time the ...
1
vote
1answer
259 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 ...
2
votes
1answer
85 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 ...
2
votes
1answer
135 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 ...
0
votes
1answer
109 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 ...
1
vote
1answer
35 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 ...
0
votes
1answer
37 views

Error: list indices must be integer, not Expr

I am trying to get the first N prime numbers in the following way: @sp.entry_point def n_primes(self, num): primes = [2] p = sp.local("p", 1) i = sp.local("i&...
2
votes
1answer
39 views

Smart contract break for loop in smartpy

I need to break a for loop in smartpy, but break does not work. Is there any other solution I could use?
0
votes
1answer
33 views

tqtezos / minter-sdk installation issue

I am trying to run below command for minter-contract on my local machine and getting error npm i @tqtezos/minter-contracts no such file or directory, chmod ‘/node_modules/@tqtezos/minter-contracts/...
1
vote
2answers
32 views

Keeping original sender in inter-contract call

I have a token contract (let's say it TC) and creating a contract Wallet. Now, is it possible for a user to call Wallet's entrypoint deposit which will do an inter-contract call to TC's transfer ...
0
votes
1answer
37 views

Calling contract deployed on Tezos sandbox using Taquito

I've a simple contract deployed on Tezos sandbox (https://assets.tqtezos.com/docs/setup/2-sandbox/) and I'm using Taquito in frontend to call this contract. Earlier, I deployed the contract to global ...
1
vote
1answer
29 views

How to fetch list of known addresses in Taquito?

Just like we can run tezos-client list known contracts to get a list of deployed contracts and any user accounts, is there a way to do the same using Taquito? So, in short, I've RPC address and wish ...
2
votes
3answers
51 views

Big map of map vs Big map of pairs

In the FA2 example (https://smartpy.io/ide?template=FA2.py) with multiple assets, we are using a big map of pairs (of user and token). Another option might be storing big map mapping users to another ...
0
votes
3answers
56 views

Is there an equivalent of the Ethereum "selfdestruct" opcode in Tezos?

In Ethereum you can implement a selfdestruct opcode in a smart contract to remove its code from the blockchain and free up storage space. Is there an equivalent on Tezos ?
2
votes
1answer
65 views

Variable callback entrypoint in smartpy

Is it possible to use a variable as the entry_point for a callback in smartpy? This works: @sp.entry_point def getProofs(self, address, callback_address): c = sp.contract(...
2
votes
1answer
80 views

Can a smart contract know its own address?

Is it possible to create a smart contract that knows the value of its KT1 address? E.g. if you wanted the contract to check that there was a signature signed over its contract address, would it be ...
0
votes
1answer
19 views

decidability of real world contracts

I'm wondering if there has been any work done on the decidability of real world, legal contracts. Michelson is great because it lends itself to users bring able to write smart contracts that are ...

1
2 3 4 5 6