A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [smart-contracts]

The tag has no usage guidance.

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

Type error, (sp.TRecord(addr = sp.TAddress)) is not (sp.TUnit) in smartPy

When I implement a getBalance in the FA1.2 function like this: @sp.entryPoint def getBalance(self, params): return self.data.balances[params.addr] As test: scenario += c1.getBalance(addr = ...
1
vote
1answer
15 views

venv / entrypoint return storage?

3 questions: 1) someone use Smartpy in a venv as a pip3 package? I was thinking about printing some variables for debug purposes — there is a similar feature in the editor? 2) if you are in a ...
1
vote
1answer
15 views

Local variables within smart contracts (Smartpy)

I'd like to share a question that were being worked on Smartpy telegram, and also a few thoughts along the way (it's a long way -- random observation). Some people were talking about local variables ...
1
vote
1answer
20 views

How to interact with SmartPy BigMap in contract?

I would like to setup a smart contract that contains (as defined by smartpy) a BigMap storage. I have the following code: import smartpy as sp class contract(sp.Contract): def __init__(self): ...
2
votes
1answer
12 views

How to create a mapping in smartpy ? Do we need to define the datatypes of the key & value like in solidity?

Want to implement mappings like this in smartpy : // Mapping from token ID to owner mapping (uint256 => address) private _tokenOwner; // Mapping from token ID to approved address mapping (...
2
votes
0answers
16 views

ConseilJS TezosContractIntrospector.generateEntryPointsFromAddress `Uncaught (in promise) TypeError: Cannot read property '0' of undefined`

Trying to retrieve contract entry points using the TezosContractIntrospector The following code: async function entry_points(){ const server={ url:'https://conseil-dev.cryptonomic-infra.tech:...
5
votes
2answers
34 views

How do I get a list of a Tezos smart contract KT1 address entrypoints and its parameters?

I wish to retrieve info from a KT1 address so I know which entrypoints are available for consuming and which are their parameters and types. How can I achieve this? Thanks in advance.
2
votes
3answers
37 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 ...
2
votes
1answer
34 views

Error while initializing a Map in contract deployment

I was trying to deploy a vote smart contract on Tezos using tezos-client but because of initilization issue nothing was happening the right way. The smart contract code in liquidity ( you can see the ...
1
vote
1answer
26 views

Call smart contract via RPC error

I am trying to call a smart contract via RPC, but keep getting this error: "Failed to parse the request body: No case matched:\n At /kind, unexpected string instead of endorsement\n At /kind, ...
2
votes
1answer
47 views

What happens if two smart contracts call each other?

Simple question. What happens if you have two smart contracts that recursively call each other in such a way that it will never end? Will those calls just bounce back and forth until one of the ...
1
vote
2answers
84 views

How can one keep account active

Do I need to maintain certain amount of balance in order to keep my account active?
2
votes
1answer
113 views

How to deploy a smart contract influenced by UI inputs using ConseilJS and SmartPy generated Michelson?

I wish to be able to create a smart contract taking input from a UI to supply parameters pubKey,prvKey,pubHash for the deployment and minAmount and maxTime to influence the Michelson. I have the ...
1
vote
2answers
22 views

How to total smartpy.TMutez type stored as values in smartpy.bigmap?

I have the following smartpy.bigmap in smart contract storage: import smartpy as sp self.data.init(bgmp=sp.bigmap(tkey=sp.TAddress,tvalue=sp.TMutez)) I would like to total all the stored tvalue so ...
1
vote
2answers
17 views

Searching through deployed smart contracts

I'm looking for a deployment of the multisig contract somewhere on the block chain. Is there any tools that lets me search through deployed contracts?
1
vote
0answers
21 views

How to define Tezos Contract start and end date? [duplicate]

Developing Smart Contract for Tezos, How i can define Tezos Contract start and end date ? it should only work between given date.
2
votes
2answers
44 views

Tezos Blockchain Time in SmartPy

I am new to Tezos Block chain and I am writing a smart-contract for crowdfunding using smartPy. For this I need current date time of Tezos Block chain. So, can anyone help me out, how to find out this?...
2
votes
1answer
37 views

How do you discover the indexes of the big maps of a contract?

How do you discover the indexes of the big maps of a contract? It seems you would have to inspect the storage, and correlate with the type of the storage, and pick out the numbers that correspond to ...
1
vote
1answer
36 views

Is there a parameter we can add to a KT1 contract so that it expires after a certain amount of blocks?

I'm asking because I would like certain KT1 addresses return the funds back to the owner after a certain amount of blocks
1
vote
1answer
24 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 ...
1
vote
1answer
100 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 ...
3
votes
1answer
42 views

What happens when a smart contract receives two transactions with different outcomes?

Let's say that we have a smart contract where the argument passed along the transaction updates the value "lastAccount" which is equal to the pkh of the transaction sender. If, at the same time, two ...
1
vote
1answer
90 views

How do you create a secondary KT1 contact under your TZ address?

I want to have multiple KT1 address on one TZ address(ledger) to delegate to multiple people
1
vote
0answers
14 views

Split function contract template

Is there a code template for a simple contract which splits the incoming funds and sends them proportionally to a list of pre-registered addresses? Example: Contract has the following functions: ...
2
votes
1answer
33 views

Where can I go to study how to make smart contracts

In particular, I have an idea, I want to create a contract to delegate Tezos to a designated baker, but in a more long term contract, where he can use my delegation as bond, however if he double bakes ...
0
votes
1answer
43 views

Originating an account in Bablyonnet - error in contract script

I'm trying to originate a contract in Tezos so I can test delegating to a baking account. I was able to do this before the upgrade to babylonnet, but now that a script is required for the contract, I'...
0
votes
0answers
17 views

Deploying a smart contract : “Request error (code 404)”

I'm trying to deploy a smart contract on the tezos sandbox. My node is running, and my smart contract is without compilation error. To deploy my contract I do : ~/.opam/liquidity/bin/liquidity --...
1
vote
1answer
39 views

How to verify the manager.tz script code?

Since the protocol update to Babylon all KT1 accounts were replaced with smart contracts which contain the manager.tz script. Code: parameter (or (lambda %do unit (list operation)) (unit ...
1
vote
1answer
32 views

Transfer from smart contracts?

Can smart contract account (address starting with KT1) transfer Tezos to other accounts? I know this is possible for plain vanilla KT1 account.
1
vote
2answers
55 views

Where are the API docs for SmartPy?

I'm working on a contract now and specifically I'd like to call a SmartPy API like sp.transfer(address, amount)? Is there a function like this? I can't find API docs for SmartPy and digging into the ...
2
votes
2answers
29 views

Does a smart contract browser or explorer exist?

Is there any smart contract browser or explorer currently available? (i.e. a web browser-based tool where someone can easily audit the code held in the blockchain)
2
votes
0answers
36 views

Choosing a language [closed]

I want to start using Tezos and one of the problems that I found as opposite to Ethereum where Solidity highlights, is that seems to be a lot of options to start writing contracts. I've been ...
0
votes
0answers
31 views

TezBox transaction with parameter not going through

I am using TezBox to make a transaction from tz1fVCLCR9zKMgGBTvuxcQufktXwwXJVC5KE to my smart contract KT1BNuzMP54AoPNWQF45LkjhcFjW3A48rcHb. In the parameter field, I use Left "...
2
votes
1answer
66 views

How do I get the contents of a big_map through the RPC interface?

I'm trying to view the contents of a big_map in the storage of a smart contract. However, querying my Tezos node doesn't seem to provide that information. Is there a way of using the RPC interface to ...
3
votes
1answer
42 views

Why cant i call the contract entry point with type parameter througth eztz.contract.send

im trying to call the entry point create_proposition ... (pair :proposition %_Liq_entry_create_proposition (key_hash %destination) (mutez %amount)) using the function eztz.contract....
2
votes
1answer
36 views

Getting errors related to the smart contract after running eztz.contract.send()

im tryng to send a operation to a previously deployed contract and im geting these errors, error: "Operation Failed" ​ errors: (3) […] ​​ 0: {…} ​​​ contract: "...
3
votes
1answer
50 views

how can i send operation throught eztz to a contract specific entry point?

im tryng to send the operation to a deployed contract, this is my function ... eztz.contract .send( "KT18qHvhEZUwiawA8QEURwuK8RGJj184725L", keysext.pkh, keysext.sk, 5, "RIGHT LEFT UNIT", "...
3
votes
1answer
54 views

Can someone provide a link to a tutorial on how to do a basic smart contract on the Tezos protocol?

I'm looking for a video tutorial on how to become a programmer/how to become more knowledgeable regarding smart contracts and such. Is there a good you-tuber who blogs about Tezos programming?
1
vote
1answer
217 views

Smart contract transaction of 0 XTZ throwing error from TezBox

I am trying to send transaction to KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ to complete ledger nano verification using TezBox but I am getting error as below, can someone please guide me? {"status":"...
3
votes
2answers
161 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 ...
4
votes
1answer
67 views

Error while initializing storage in contract deployment

I am using folowing command: ./tezos-client originate contract TestContract for tz1address transferring 1 from tz1address running contes.fi --init 'pair (map "KT1address" 1) (map "KT1address" "2019-...
1
vote
0answers
32 views

Deployment of a smart contract through fi compiler

I seem to fill in these parameters incorrectly. What do I need to enter in the Storage.Value and Storage.StartTime columns? If you can give examples
1
vote
0answers
29 views

Problem with Liquidity installation

After entering this command make build-deps , I get the error message: The following dependencies couldn't be met: - liquidity → ocaml < 4.07.1 no matching version No solution found, ...
5
votes
1answer
65 views

Can I withdraw funds from an empty smart contract?

I've stuffed up bad and managed to send some Tez to an empty KT1 smart contract. Is there any way of getting it back? The contract is: parameter string; storage string; code { CAR ; NIL operation ;...
2
votes
1answer
42 views

How to deploy a contract in Mainnnet (not Alfanet!) Tezos? I have a contract code for Fi, a working node on the Digital Ocean. What should I do next?

I have a contract code for Fi, a working Mainnet node on the Digital Ocean. What should I do next? Please explain in detail because I have little experience.
4
votes
0answers
23 views

Checking contract against contract type in Liquidity

With the example below, is it possible to get liquidity to check that the type of the contract C matches C_intf? contract type C_intf = sig type storage val%entry check_balance : nat -> _ end ...
4
votes
0answers
22 views

How to split a string in Liquidity?

I'm attempting to split apart a string by "." so that "my.name" returns {"my", "name"}. However, I can't seem to find an in-built method of performing this operation in Liquidity. Lately, I've tried ...
4
votes
1answer
39 views

When contract simulation may fail to predict the contract's behavior?

When we try to run a smart contract using tezos-client, it estimates the gas cost and predicts the final output of the contract. It simulates the contract execution under the current block-chain, ...
5
votes
1answer
59 views

Operations created by a smart contract call chain go in the same block?

Imagine there is a smart contract which calls other smart contracts using TRANSFER_TOKENS and in the end lots of operations are created. Are these operations baked in a block atomically? I mean, is ...
4
votes
0answers
46 views

How to implement a signature checker for the signature scheme BLS?

We are willing to implement a signature checker for the signature scheme BLS (or BLS12-381). To the best of our knowledge, it may not be too painful since the smart contract language already supports ...