Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
68 views

how can i call specific smartpy tezos contract entrypoint using ConseilJs?

I am trying to set UI that allow users to interact with tezos smart contract by pressing some buttons that have to call the corresponding function in the smart contract with relative arguments
user avatar
  • 51
-1 votes
1 answer
69 views

Encryption in smartpy tezos

I wanted to give encryption to a string before storing it in smart contract. For example I have "hello" its 256 equivalent should be "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" ...
user avatar
5 votes
1 answer
51 views

bigmap.get(key, "") with default param in case of no entry for key in the map with Taquito

Can we do something similar to myMap.get(key, defaultValue = None) of smartPy with Taquito? An instruction like: const myContract = await Tezos.contract.at(contractAddress); const contractStorage = ...
user avatar
  • 444
1 vote
1 answer
100 views

sending data from one contract to another smartpy tezos

I am trying to send data from one contract to another in smartpy Remote Contract import smartpy as sp class Try(sp.Contract): def __init__(self): self.init(mynum = sp.int(0)) @sp....
user avatar
1 vote
2 answers
183 views

Taquito default entrypoint not found

I have deployed a smart contract on carthagenet. The contract only has a single entry point. Taquito is not able to find that single entry point. I tried both default and root methods and it doesn'...
user avatar
  • 55
1 vote
1 answer
39 views

Get current ChainId in smartPy contract

I'm trying to get the chain_id of the current chain evaluating a transaction or containing the smart contract with smartPy, but I got always error in init and in entrypoints when I try to affect the ...
user avatar
  • 444
2 votes
1 answer
147 views

How do we use getBalance() function in FA1.2 token contract in SmartPy?

https://smartpy.io/demo/index.html?template=FA1.2.py&source=post_page--------------------------- This is the token contract link. It is deployed on the https://babylonnet.SmartPy.io node with the ...
user avatar
0 votes
2 answers
56 views

How to construct signature list as parameter to invoke contract

I write a contract and deployed it to babylonnet, address: KT1BcH97ZQas6zKMJBtNdmU4iBvyi2ihpsx8, the entry point is withdraw, parameter is amount, signatures, toAddr, txId(string). I use smartpy ...
user avatar
5 votes
2 answers
338 views

Operation cost for invoking smart contract

I would like to find out if the smart contract's code size/storage or an operation's parameters helps to derive to the cost. Is there a formula to calculate the cost of the operation to be invoking a ...
user avatar
  • 495
5 votes
3 answers
1k views

Testing frameworks for tezos smart-contracts

I did few smart contracts with Ligo, but now looking for more productionize setup. Is there a test framework one can use for Tezos? I'm looking for something like waffle + mocha in Ethereum, or ...
user avatar
9 votes
1 answer
1k views

Storage and parameter size limitations of smart contract?

Got a few questions regarding storage limitations of smart contract. What is the maximum number of bytes of data that I can send for a single transaction? Is there a size limit to the storage of a ...
user avatar
  • 495
0 votes
1 answer
107 views

ill_typed_data and invalid_contract_notation smart contract deployment error

I'm trying to deploy a smart contract on the testnet. I have made sure it is well typed. But I faced the error message below when trying to deploy on both bablynonnet and carthagenet. Could someone ...
user avatar
  • 495
1 vote
2 answers
113 views

pytezos deploy kt

I'm following the https://baking-bad.github.io/pytezos/#originate-contract refs to originate a contract. I suspect that it has something to do with how I usually iniatialize the storage, so if anyone ...
user avatar
  • 11
0 votes
1 answer
98 views

Initiate a field in the storage of a contract with the source address of origination

I have the following smart contract where I pass admin address in the init function of the smart contract: (you can run it on smartPy online editor) class SC(sp.Contract): def __init__(self, ...
user avatar
  • 444
2 votes
1 answer
154 views

Parse address to string in smartPy

Can we parse a varialble of type sp.TAddress to sp.TString like this: strAddress = sp.string(sp.address("tz1-add")) or strAddress = str(sp.address("tz1-add"))? Smart Contract Example: import ...
user avatar
  • 444
1 vote
1 answer
64 views

Call a method with params that do nothing in a smart contract

I'm trying to invoke a method with parameters that do nothing (blank body) in a smart contract but that doesn't work even if the contract is correctly deployed to the blockchain. Use case: Smart ...
user avatar
  • 444
4 votes
1 answer
448 views

How do I get the storage value of a bigmap using pair datatype as key with taquito library?

I am using the taquito library to interact with a smart contract that I have uploaded to carthagenet. However, I am facing an issue in retrieving the value of a bigmap property in my smart contract ...
user avatar
  • 55
1 vote
1 answer
343 views

Smart contract calls another smart contract's method with SmartPy

How can I call a smart contract method from another smart contract with smartPy? Use Case: Lest's imagine that we have: Smart contract with a function increment(a) Smart contract with a function ...
user avatar
  • 444
1 vote
1 answer
89 views

sp.check_signature cryptographic function in SmartPy

I wanna ask about the parameters s and b in the cryptographic function: sp.check_signature(k, s, b) the second parameter s: is the string that we should inject in the blockchain or the signature ...
user avatar
  • 444
1 vote
1 answer
96 views

Smart Contract Invocation using tezos-client and RPC requests failed

Network: Babylonnet test network Network Version: { "chain_name": "TEZOS_ALPHANET_BABYLON_2019-09-27T07:43:32Z", "distributed_db_version": 0, "p2p_version": 0 } Case: I'm ...
user avatar
  • 444
2 votes
2 answers
489 views

How to retrieve data from smart-contract using javascript?

I have stored data that I would like to retrieve from a deployed smart-contract. The storage structure was defined using SmartPy: def __init__(self): self.init(bmap=sp.big_map(tkey=sp....
user avatar
1 vote
1 answer
29 views

How to fix 'paused before out-of-memory crash' contract deployment error in browser? [ConseilJS]

I wish to deploy a contract using ConseilJS that I am able to originate successfully using smartpy.io However, when I copy the generated Michelson and initial storage into the following function: ...
user avatar
2 votes
1 answer
116 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 = ...
user avatar
1 vote
1 answer
57 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 ...
user avatar
  • 23
1 vote
1 answer
82 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 ...
user avatar
  • 23
1 vote
1 answer
146 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): ...
user avatar
2 votes
1 answer
83 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 (...
user avatar
2 votes
1 answer
51 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:...
user avatar
5 votes
2 answers
158 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.
user avatar
2 votes
3 answers
107 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 ...
user avatar
  • 51
4 votes
3 answers
254 views

How are the originated contract addreses (KT1) computed?

How are smart contract addresses (those that start with KT1) computed? I would like to know whether CHAIN_ID is somehow used in its computation, or it is possible to have two KT1 contracts with ...
user avatar
3 votes
1 answer
92 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 ...
user avatar
  • 444
1 vote
1 answer
140 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, ...
user avatar
2 votes
1 answer
70 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 ...
user avatar
1 vote
2 answers
127 views

How can one keep account active

Do I need to maintain certain amount of balance in order to keep my account active?
user avatar
  • 21
2 votes
1 answer
207 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 ...
user avatar
1 vote
2 answers
117 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 ...
user avatar
3 votes
3 answers
50 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?
user avatar
  • 2,348
1 vote
0 answers
26 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.
user avatar
  • 111
2 votes
2 answers
151 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?...
user avatar
  • 23
2 votes
2 answers
156 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 ...
user avatar
  • 2,348
1 vote
1 answer
49 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
user avatar
1 vote
1 answer
55 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 ...
user avatar
1 vote
1 answer
244 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 ...
user avatar
3 votes
1 answer
57 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 ...
user avatar
  • 490
1 vote
1 answer
233 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
user avatar
1 vote
0 answers
31 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: ...
user avatar
  • 835
2 votes
1 answer
43 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 ...
user avatar
0 votes
1 answer
149 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'...
user avatar
1 vote
1 answer
152 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 ...
user avatar
  • 835

1
3 4
5
6 7