Questions tagged [smartpy]

Discussion about the SmartPy language

Filter by
Sorted by
Tagged with
1
vote
0answers
26 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: ...
0
votes
3answers
83 views

More than a few hundred NFTs?

Is is possible to use Tezos to make more than 100ish NFTS? Using this template it seems that if over ~100 NFTs are minted, the contracts storage runs out. This is also concerning because it seems if ...
0
votes
1answer
39 views

sp.if not working as it should

I am using sp.if in an internal function, then I call it in an entry point, but whatever I enter in sp.if, it always is read as "True". Why? And how to fix it? My code : def is_something(...
0
votes
1answer
40 views

Getting CORS errors on mainnet.smartpy.io with Taquito

const Tezos = new TezosToolkit('https://mainnet.smartpy.io'); const network = { type: 'mainnet', rpcUrl: 'https://mainnet.smartpy.io' }; This is what I've been using to hook up Taquito, ...
0
votes
1answer
32 views

error Type sp.TInt / sp.TNat mismatch

Error: Type sp.TInt / sp.TNat mismatch sp.is_nat expects a sp.TInt Got: sp.TNat line 119 Line: 119 self.data.shop_items[item_to_purchase.key].amount -= sp.as_nat(item_to_purchase.value) I'm ...
0
votes
1answer
34 views

import_script_from_url syntax

i'd like to ask if it's possible to load another smart contract from an IPFS Hash or from a SmartPy url. What would be the best way to handle them with urls? Contract A: https://smartpy.io/ide?cid=...
0
votes
1answer
100 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, ...
0
votes
1answer
20 views

Is SmartPy package inside All Michaelson Supported Languages?

I've discovered that Liquidity, LigoLang and Ocamel Support Tezos development, but I've only found 1 resource that states that SmartPy supports only LigoLang. I wanted to use the right language to ...
0
votes
2answers
137 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
34 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
84 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 ...
0
votes
1answer
31 views

Packing args in taquito to match sp.pack / PACK

How can i pack on taquito side params so that they match what i would get in smartpy with sp.pack? Say i have params two ints and a string: 1, 3, "something" What do i need to do in taquito ...
0
votes
2answers
37 views

Calling Harbinger price contract get method in taquito

I am trying to call the get method of the coinbase normalizer harbinger price contract (KT1AdbYiPYb5hDuEuVrfxmFehtnBCXv4Np7r). Is this the correct way to call the get method, as it doesn't seem to be ...
0
votes
1answer
48 views

Error: list indices must be integer, not Expr

I am trying to get the first N prime numbers in the following way: @sp.entry_point def n_primes(self, num): primes = [2] p = sp.local("p", 1) i = sp.local("i&...
0
votes
1answer
37 views

Incompatible parameter error when calling another smart contract

I'm getting this weird error when trying to call the mint entrypoint from another contract... I had additional parameters in the BuyLandRequest and was overriding the TezosHomepageAdNft.mint ...
0
votes
2answers
74 views

How can I do string interpolation on smartpy?

I'm trying to provide better error messages. I've tried several things already that don't work such as regular python fstrings, regular string concatenation. I'm tried to using the sp.string function ...
0
votes
1answer
25 views

Is it possible to dynamically generate FA2 token metadata?

For example, I know the code below isn't valid syntax, but would doing something like it be possible to dynamically set metadata content based on the token id? If so, how would that work? @sp....
0
votes
2answers
50 views

Is it possible to optimize FA2 NFT storage to create 10,000+ without expensive storage fees?

I used this Smartpy code to mint 200 NFTs (max allowed per transaction) which cost cost 14 Tez - bettercalldev link. How much could this be optimized?
0
votes
1answer
9 views

Online SmartPy IDE run error:

The error says: exports[f] is not a function. Not sure why when I try to run.... import smartpy as sp @sp.add_test(name = "First test") def test(): scenario = sp.test_scenario() ...
0
votes
1answer
47 views

Calling Harbinger using Smartpy to get randomness

I want to get a random value in my smart contract to provide a fair distribution of different tokens. I read that using Harbinger to get values and use it for entropy could be the good way to do. But ...
0
votes
0answers
27 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....
0
votes
1answer
21 views

sp.contract from hash key

In the test, I am trying to replace the admin with a fixed account. But I cannot find what t should be. admin = sp.contract( t,"tz1dQXqXZ3Y5sgYwU9Aq9xRJPxEZNUwyE6ht", entry_point = "&...
0
votes
0answers
38 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/...
0
votes
0answers
20 views

Is there any default FA2 / FA1.2 config to mint non-transferable tokens?

I am working on a requirement that needs a non-transferable token (similar to ERC 1238 requirement). ie the token can be transferred only from token contract/ admin to the user and the user cannot ...
0
votes
0answers
133 views

Mint FA2 NFT when contract is called by purchaser

I'm working on a smart contract which allows a caller to "purchase" an NFT simply by calling the contract and providing payment. I'd like the contract to mint the NFT at the time the ...
0
votes
0answers
24 views

how to work with map of map

I have a structure that looks like this: struc = sp.TRecord( addr = sp.TAddress, value = sp.TNat ) struct2 = sp.big_map( tkey=sp.TAddress, tvalue=sp.TMap( sp.TNat, sp....
0
votes
2answers
62 views

What's the best IDE and language to create a FA2 Token?

Does SmartPy provide the best interface to do it? https://smartpy.io/ide?template=FA2.py Does this example provide everything you need to create your own token? Any help would be appreciated.
0
votes
0answers
21 views

Can anyone refer me to a good code example that creates a Token crowdfunding STO/IDO/ICO contract in Tezos?

Can anyone refer me to a good code example that creates a Token crowdfunding STO/IDO/ICO contract in Tezos? (Comparable to ERC-20 crowdfunding contracts)
0
votes
1answer
85 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
votes
1answer
59 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" ...
-1
votes
1answer
63 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

1 2
3