Questions tagged [smartpy]

Discussion about the SmartPy language

20 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
46 views

How to use internal hacks to convert from String to Address (or from Address to String) in SmartPy

There is a similar question but it does not fully answer this question. In the answer for that question posted here there is mention that while it is officially not possible it is actually technically ...
user avatar
  • 439
2 votes
0 answers
84 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
user avatar
  • 51
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 vote
0 answers
8 views

Suggestion more then question about tezos course on plural sight

There is a good course about BlockChain fundamentals on Plural sight but addressing ethereum. It could be great if someone can create similar curse there with targeting tezos with
user avatar
1 vote
1 answer
51 views

Can I create an on-chain view that calls another contract's on-chain view and return it?

I have two contracts contract_one and contract_two. On contract_two I have an on-chain-view defined like this: @sp.onchain_view() def get(self, id): sp.result(self.data.map[id]) This view works ...
user avatar
1 vote
1 answer
42 views

Using the token_metadata @offchain_view to load tzip-21 compliant metadata

Are there any downsides to how I'm declaring the token_metadata in the @offchain_view below? Loading the data from storage appears to work as expected when testing it on tzcomet and BCD, though I just ...
user avatar
  • 557
1 vote
0 answers
29 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?
user avatar
1 vote
1 answer
75 views

Can a Dapp buy or sell (usdtz or tzbtc) from dexter?

Looking for a way for a dapp to buy tzBTC automatically after receiving tez from a baker.
user avatar
  • 31
1 vote
2 answers
164 views

Implementing Contract Metadata (tzip-16) on an already originated FA1.2 Smart Contract

Referring to the documents and examples of tzip-16, how would one implement the contract metadata on a Fa1.2 contract on SmartPy? In order to provide balance updates and offchain events.
user avatar
  • 495
1 vote
1 answer
80 views

How to create a contract which would delegate XTZs and receive rewards?

I am trying to write a contract that receives rewards from the baker using a default entry point and should only allow me to change the baker from a different entry point. I am using the smartpy tool ...
user avatar
1 vote
2 answers
114 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)...
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
0 votes
0 answers
19 views

Initiating a contract with map

I want to originate a contract in SmartPy with an initial map() payload. However the originated contract always has an empty contracts storage. Here's what I have: def __init__(self): self....
user avatar
0 votes
0 answers
28 views

Is there a smartpy util to stringify JSON?

I see there's a good utils repo for strings here: https://github.com/RomarQ/tezos-sc-utils I'm just wondering whether there's one for stringifying JSON. Or an example that does this. Input: map or ...
user avatar
  • 557
0 votes
0 answers
21 views

How do you compile 2 smartpy contracts with one's deployment address depended by the other?

Say we have contract A and contract B. We want to use contract A's address as the admin for contract B. Do I need to first deploy contract A and then input that address into contract B's admin_address ...
user avatar
  • 557
0 votes
0 answers
25 views

How minimize storage fee when doing airdrop using smartpy and fa2 template

Hello I try to do a airdrop for my community using FA2 template and smartpy, you can see my smart contract below : import smartpy as sp FA2 = sp.io.import_template("FA2.py") class Token(FA2....
user avatar
0 votes
0 answers
31 views

missing token metadata

I believe with this operation ooDavbDYs9SkBR4JoaUxTBysvEnd7y1gP1ZDGddQgfQZaURpdjx I have created a token. This is the entry point I called @sp.entry_point def mintDiezDAO(self, params): sp....
user avatar
0 votes
0 answers
72 views

is there an implementation of the FA1.2 template in ligo with metadata ( TZIP-016)?

I have find 2 implementations of the FA1.2 template, one in PascaLigo (https://gitlab.com/camlcase-dev/fa1.2/-/blob/master/ligo/fa1.2.ligo) and one in CameLigo https://gitlab.com/ligolang/ligo/-/blob/...
user avatar
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
-1 votes
1 answer
67 views

Tezos SmartPy Developer Course video 1.2

How do I get find the Tezos test net as opposed to the web browser smart py interface? Regards WF
user avatar