Questions tagged [contract]

The tag has no usage guidance.

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

sp.contract can get only explicit string as an entrypoint

I'm trying to call another contract from mine. It seems like I can't feed sp.contract with an entrypoint string that comes from an argument (it works perfectly fine with an explicit string like "...
PinkD's user avatar
  • 1
1 vote
1 answer
16 views

Different outcomes from different nodes when executing contract origination transactions

I have came across an interesting scenario when I was using PyTezos to originate a contract. By using different nodes, I got different errors/acceptance. I have tried the following nodes: SmartPy ...
Florin's user avatar
  • 21
1 vote
1 answer
42 views

General Information

I know tezos strongly believes in immutability but I would like to clear out some curiosity regarding upgradability of a contract. If a function in a contract needs to be updated with it's logic , ...
Kin's user avatar
  • 184
1 vote
1 answer
24 views

Is it possible to use an existing contracts storage as the seed data for a new contract that has the same storage schema?

Can you deploy a new copy of a contract with SmartPy and simultaneously copy the storage of an already existing contract that has an identical model into the freshly deployed contract?
0x10's user avatar
  • 359
1 vote
2 answers
85 views

Can off-chain views call on-chain views?

Is it possible to call and process the result of an on-chain view inside an off-chain view that is stored inside contract metadata?
0x10's user avatar
  • 359
4 votes
1 answer
417 views

What are the recommended regular expressions for tezos wallet and contract addresses?

I need to validate Tezos addresses and have arrived at the following prefixed base 58 regular expressions for wallet and contract addresses. Contract: /KT1[1-9A-HJ-NP-Za-km-z]{33}/ Wallet: /tz[1-3][1-...
0x10's user avatar
  • 359
0 votes
1 answer
57 views

How do you submit a pair when calling an entrypoint on a contract with Taquito?

I am trying to submit a Pair of Bytes in a contract call with Taquito but am receiving an error. The contract interaction documentation does not go into exactly how to submit a Pair, but it does go ...
0x10's user avatar
  • 359
2 votes
1 answer
260 views

How to get wallet tokens balance with the help of address and tokens contracts?

I have a wallet address and token contracts For example: wallet address: tz1MmduNCzoKU9GHngwLqC8TmExTHQXJCSTn and Tokens contracts: Plenty: KT1GRSvLoikDsXujKgZPsGLX8k8VvR2Tq95b Quipu: ...
Taleb's user avatar
  • 177
1 vote
1 answer
67 views

Why does calling sp.address() with a dynamic value inside an entrypoint fail?

Is there some way to call sp.address inside an entrypoint and pass in a dynamic String? I have created an example contract showing the failing state: import smartpy as sp class ...
0x10's user avatar
  • 359
-1 votes
1 answer
37 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 (...
user10431502's user avatar
0 votes
1 answer
50 views

How to check amount sent with transaction (like msg.value>6 in ethereum)

How do I check inside a contract entrypoint, that the user sent a particular amount with the transaction? In Frontend: const operation = await contractInstance.methods.methodName().send({amount:12}); ...
Saksham's 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 ...
Whirlybird's user avatar
1 vote
1 answer
55 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 ...
Whirlybird's user avatar
0 votes
1 answer
134 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 ...
Whirlybird's 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 ...
Whirlybird's user avatar
1 vote
1 answer
80 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 ...
Whirlybird's user avatar
2 votes
1 answer
104 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, ...
Whirlybird's user avatar
1 vote
1 answer
116 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 ...
Whirlybird's user avatar
2 votes
1 answer
565 views

How to store and load custom FA2 NFT metadata?

First time I'm writing a smart contract. If anything doesn't make sense at all, feel free to call out what specifically doesn't make sense and suggest a better approach. Thanks! At a high level I just ...
JJJ's user avatar
  • 557
0 votes
1 answer
118 views

What is the one-time 0.257 tz burn fee?

I have deployed a contract on a test net and I want to send some tez to it to test out some operations. When I try to send through Temple wallet, I get: Failed Unable to estimate transaction to ...
flash76's user avatar
  • 119
0 votes
1 answer
219 views

Smartpy transfer contract balance to an address

I'm trying to figure out how to withdraw money from the contract within a smartpy entrypoint, and test the result in my scenario. When I test the entrypoint: @sp.entry_point def withdraw(self, ...
jon's user avatar
  • 133
2 votes
1 answer
57 views

Interact with Tezos in xamarin

im searching for a way to communicate to the chain in my xamarin app. The problem is that the native libs like this https://github.com/mscappini/Tz.Net are not really well looked after so im searching ...
Platinium's user avatar
1 vote
1 answer
37 views

How to format storage for a contract call with parameters?

I am trying to construct the storage needed to do an on chain contract call but I'm having trouble passing in the parameters. What is making it tricky is that one of the parameters is of type ...
Darius's user avatar
  • 649
1 vote
1 answer
36 views

How can I manually create an on chain contract call?

Using tezos sandbox mode, I am trying to test an on chain contract call in isolation of the main contract which calls it. If my contract was the Collatz template, it would like be trying to run the ...
Darius's user avatar
  • 649
1 vote
2 answers
127 views

How can I write On Chain Contract Calls in Tezos Sandbox?

I am trying to write a test case in Tezos Sandbox that uses an On Chain Contract Call. To start with, I am trying to implement the example from SmartPy "On Chain Contract Calls - Collatz" ...
Darius's user avatar
  • 649
1 vote
1 answer
93 views

FA2 from/to serialization

In the FA2.0 standard the sender and receiver is send as Bytes (vs. send as string for FA1.2). Expected result: When decoding the addresses (string) to their public key hash representation I would ...
Felix Laufenberg's user avatar
2 votes
0 answers
48 views

How to set `contract` as input argument

I have a method Token_metadata_registry which takes contract(address) as input parameter and I would like to call that method from ligo dry-run. How do I do that? ligo dry-run contracts/main/fa2.ligo ...
Thorkil Værge's user avatar
1 vote
1 answer
74 views

Michelson: Parameter vs Storage

I'm struggling to process what the difference between parameter and storage is in Michelson. From what I've been reading, it just looks like two different types of inputs to a contract. So how should ...
user avatar
0 votes
1 answer
43 views

The revealed key of a contract in Michelson

Checking signatures requires keys. Currently, keys must be always given from the outside of Michelson. Is there any reason why Michelson cannot obtain the already revealed keys of given contracts/...
camlspotter's user avatar
1 vote
1 answer
83 views

My contract compiles, but when deploying I get an error

I'm using the Teztool in sandbox mode. My contract compiles, but when I deploy: teztool carthagenet sandbox client originate contract tezart transferring 0 from bootstrap1 running tezart.tz I get ...
Mark Robson's user avatar
1 vote
2 answers
169 views

Contract originate hangs after 'Waiting for the node to be bootstrapped before injection...'

I'm using babylonnet.sh script to run docker. My contract compiles. I output to a 'contract.txt' file. Command is: ./babylonnet.sh client originate contract tezart transferring 0 from ...
Mark Robson's user avatar
4 votes
2 answers
526 views

What are the differences between key, key_hash, address, contract and signature in Michelson?

There is a related question, but the differences are still not clear. These five types are mentioned in the Michelson whitedoc with the following definitions: address: An untyped address (implicit ...
MCH's user avatar
  • 690
4 votes
1 answer
96 views

Genesis Balances

I found out that the genesis balances of each account are present in https://tezos.foundation/wp-content/uploads/2018/09/5223213-genesis.txt . Couple of Questions: 1) I see Bootstrap Contracts have ...
ralex's user avatar
  • 399
2 votes
1 answer
60 views

Tezos - Liquidity deploy contract error

I got an error and I don't know how to handle. I wrote a smart contract in liquidity and script check and so works well. The command to deploy is: liquidity --node http://192.168.1.150:7732 --...
candlez's user avatar
  • 49
2 votes
3 answers
133 views

Originate contract with init

I have a contract of type: pair (pair (list nat) (pair mutez (map address (list nat)))) (pair address (pair address bool)) What is an example of a valid initial storage that can be passed to ...
candlez's user avatar
  • 49
1 vote
1 answer
60 views

How to format the call to the "do" entry point on manager.tz contracts in order to transfer funds to account X"

I accidentally set the account manager for a smart contract to a baker I was trying to delegate to. https://better-call.dev/main/KT1VSiaepk9USGAHDjJQAm4aaYRC6J8dTBHG/operations Now I need to figure ...
Mack Baise's user avatar
1 vote
1 answer
286 views

Delegating from a Kt1 address locked my coins, how can I fix it?

Might have royally messed up here, but I added an address via command line with ./tezos-client add address stakingfacilities tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY (for stakingfacilities baker in ...
Mack Baise's user avatar
1 vote
1 answer
62 views

Drain delegated KT1 contract, then later send funds to the same (but now empty) contract

What happens in the following scenario? A person sends all his funds from his KT1 contract* to his tz1 address The person withdraws all the tez from his tz1 address (both now have a balance of 0 tez) ...
XTZST2O's user avatar
  • 835
1 vote
0 answers
72 views

How to deploy a contract to Tezos Mainnet?

I've searched a lot but it seems nothing works at this point So I have a contract.liq source code. I also have up and running tezos-node. Basically the question is how to deploy contract.liq to the ...
Vourhey's user avatar
  • 11
2 votes
1 answer
115 views

Why is my delegation+origination appearing in red?

I used SimpleStaking wallet to delegate 2599 tezos to TezosBC baker but it doesn't seem to be going through. I tried opening with TezBox wallet and it says the account is not on the blockchain yet ...
user962460's user avatar
4 votes
2 answers
763 views

How to extract the storage of a smart contract?

How do I extract the storage data of a deployed smart contract? I am trying to read the storage data from the "free Ledger Nano S" contract KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ from the Tezos ...
XTZST2O's user avatar
  • 835
4 votes
0 answers
36 views

Updating a existing contract with new code and storage [duplicate]

Is it possible to update a existing deployed contract with new code & storage on the same address? It would be like adding a new version or does the updated contract have to be deployed to a new ...
ConsentDevelopment's user avatar
2 votes
1 answer
80 views

How to initialise a contract with storage (contract unit)

How do I initialise a contract with the following storage - storage (contract unit); Used after the command line parameter --init for contract deployment. I have tried various formats but none of ...
ConsentDevelopment's user avatar
4 votes
2 answers
198 views

Contracts - is events / logging going to be added?

The Ethereum Solidity contract system has a feature for adding events (logging) which can be subscribed via the RPC and also searched for (as the events are stored on the blockchain). Is there going ...
ConsentDevelopment's user avatar
3 votes
1 answer
108 views

Contract - purpose of returned internal operations?

I keep seeing contract internal operations being returned empty (stack - 'NIL operation;') in the example Tezos Michelson contracts. What is the purpose of the internal operations? Also, are there ...
ConsentDevelopment's user avatar
3 votes
0 answers
34 views

Contract : opcodes FAILWITH / FAIL - gas usage

If a contract gets to the point where it fails. What is the process in terms of gas usage? Storage gas (new storage until failure) : reverted Gas usage (used until failure) : reverted Gas fee : paid ...
ConsentDevelopment's user avatar
3 votes
1 answer
42 views

Michelson contract files - spaces, new lines and comments

I wanted to check that when a Michelson contract file is created. Do file spaces, new lines and comments increase the gas cost when deployed?
ConsentDevelopment's user avatar
5 votes
1 answer
88 views

method for calling to entry point of contract instance (?) created by contract.create

Contract A is not able to find the address of the contract created by contract.create. Tried adding the signature of B as well as it's complete definition in contract A but still, it doesn't solve the ...
user_184's user avatar
  • 347
9 votes
2 answers
379 views

What are the new rules for when a KT1 gets destroyed? Or when "--burn-cap" must be used to send funds to a tz1/tz2/tz3 account?

What are the new rules for when a KT1 gets destroyed? Is there a certain balance that it goes below? What about tz1/tz2/tz3? I noticed that sometimes --burn-cap must be used to send funds. Why is ...
Bo Byrd's user avatar
  • 879
6 votes
1 answer
137 views

Deploying a simple contract using liquidity

Contract (simple.liq): [%%version 1.0] type storage = int let%init storage = 0 let%entry main (parameter : int) storage = ( [], storage + parameter ) Deployment command: liquidity --tezos-node ...
Jan-Jaap Korpershoek's user avatar