Questions tagged [smartpy]

The tag has no usage guidance.

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

how to hook function in smartpy FA2

when calling transfer method, how to call hook method on received smart contract. I'm using fa2 in smartpy
1
vote
1answer
15 views

How does sp.record arrange data into pairs?

For example if I have the following code: sp.record(one = one, two = two, three = three, four = four, five = five) Would the format of the result be pair(one pair(two pair(three pair(four five)))) or ...
1
vote
1answer
26 views

Can we have a Time clocked transaction in Tezos?

I want to make an escrow contract where the transaction can be done after an interval. Is it possible / any hack that can make it happen? The balance should get deducted from the sender beforehand and ...
1
vote
1answer
24 views

How do you do sp.record(sp.pack()) outside of SmartPy?

I have a smart contract which verifies a signature from Bob in order to do something. The contract was made using SmartPy and for testing the scenario I used the following code to produce a signature: ...
1
vote
1answer
20 views

What guarantees do we have when verifying the sender's identity (in SmartPy)?

When we check the address that called the current entry point e.g. in SmartPy: sp.verify(self.data.authorizedAddr == sp.sender) What guarantees do we have? For example, is it possible for someone ...
2
votes
1answer
67 views

Why does smartpy use sp.for/sp.while instead of the default loops provided by python?

So I just started out with smartpy and I am kinda confused about the point of having separate expression for loops. My understanding is that it is may be because it's a part of on-chain computations, ...
3
votes
4answers
82 views

Is it possible to use natural logarithmic in your smartpy code?

If not,is there any alternative way to implement a natural log component into your smart contract code?
4
votes
1answer
67 views

Calling view of Fa1.2 contract

From my understanding, getBalance, getAllowance, getTotalSupply & getAdministrator entrypoint requires another contract to read the values. How will the entry point of the second contract look ...
1
vote
4answers
68 views

Is there a formula to build parameter messages to be passed to smart contract entrypoints?

When calling a smart contract entrypoint, it is required to pass the needed entrypoint parameters. This is done through a message that must be sent in JSON/Pairs format. My doubt is: Is there a ...
2
votes
1answer
46 views

How to get a contract storage data from another contract in smartPy?

I'm trying to access a storage data of a contract from another one using the continuous passing style in smartPy. import smartpy as sp class XXIFA12(sp.Contract): def __init__(self, admin): ...
1
vote
2answers
47 views

How to get a contract storage data or call a “get” entrypoint from another contract in smartPy?

I want to interact with the FA12.py smart contract (https://smartpy.io/demo/index.html?template=FA1.2.py) and get the balance of a user, from another smart contract. the FA12 function that I tried to ...
3
votes
3answers
38 views

How to delegate the balance of a smart contract?

I am looking to create a smart contact that will delegate the funds it is storing. 1) How does an originated KT address delegate to a baker? 2) If a KT address delegates, can it do anything else? I ...
1
vote
1answer
24 views

Trouble with calling a function with parameters with Taquito

I'm trying to use taquito to call a method in my contract. Note my contract was programmed in SmartPy (if that makes any difference). I am able to call contract.storage() without any problem. When ...
1
vote
2answers
58 views

Send tezos to contract address after origination using conseiljs

I am trying to send tez from my tz1-AAA account to KT1-AAA contract address means I want my contract address to hold some tez. Disclaimer - I have knowingly replaced some part of address with "....(s)...
2
votes
0answers
29 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
1
vote
1answer
24 views

set a ui to allow to nodes interact via smartpy contract

Hii have wrote a smart contract using smartpy where i have two nodes that should interact with each other, now i want to set the user interface to simulate the nodes interact what should i use and ...
-1
votes
1answer
34 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" ...
2
votes
1answer
29 views

Cyclic inter contract calling in smartpy

What I am trying to achieve is that, once I receive data from another contract my contract should return data after computation to same contract who has sent the data. Computational Contract import ...
5
votes
1answer
43 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 = ...
1
vote
1answer
54 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....
0
votes
0answers
34 views

Call one contract from another smartpy tezos [duplicate]

I am trying to call one contract from other. Remote Contract import smartpy as sp class Try(sp.Contract): def __init__(self): self.init(mynum = sp.int(0)) @sp.entry_point def ...
1
vote
1answer
41 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'...
1
vote
1answer
15 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 ...
2
votes
1answer
54 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 ...
0
votes
2answers
61 views

how to transfer tezos to contract

I deployed a contract at babylonnet, source code is https://smartpy.io/demo/index.html?code=eJzVV22L3DYQ_r6_Qvg@xOaM2beQcODSvJAmDRtKbkkox2F0tnatnld2JTl7m5L89owkv0j2ZrMf2tIaDuzRaPTMM8@...
0
votes
2answers
28 views

Use lorentz to wrap my SmartPy contract to multisig failed

I write a simple contract at smarty ide, link. And then I use lorentz-contract to wrap it to multi sig contract, but I meet an error:
0
votes
1answer
38 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 ...
1
vote
3answers
44 views

Operation has injection no error but is not included

My contract is here === === but not include == What's wrong! Please help me!
0
votes
1answer
36 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, ...
1
vote
1answer
39 views

How can I delay executing a smart contract until 30 minutes after its last invocation using Tezos SmartPy?

I have a function f1 in tezos contract that can be invoked by a node but after 30 min of the invocation if no other function f' has been invoked the f1 has to continue its process normally otherwise ...
1
vote
1answer
25 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 ...
1
vote
1answer
22 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 ...
1
vote
1answer
85 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 ...
1
vote
1answer
30 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 ...
0
votes
0answers
85 views

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'replace' of undefined at Object.normalizeMichelineWhiteSpace

When using conseiljs for deploying contracts the statement seems to have some error which is directly copied from the conseiljs library. const result = await conseiljs.TezosNodeWriter....
1
vote
2answers
153 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....
0
votes
1answer
55 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
31 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
30 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
54 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
31 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 (...
5
votes
2answers
81 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.
5
votes
4answers
180 views

Ethereum/Solidity dev here, looking to migrate some Solidity contracts onto Tezos. Was hoping to have some light shed on a few questions

Was hoping to have some light shed on a few questions. Narrowing in on using Ligo, Archetype, or Liquidity. Is Liquidity kind of a dead-end right now? I noticed it's not listed on developeres.tezos....
2
votes
1answer
161 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
42 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 ...
2
votes
2answers
81 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?...
1
vote
0answers
15 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: ...
1
vote
2answers
85 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 ...