Questions tagged [smartpy]

Discussion about the SmartPy language

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

Error: TezosOperationError: (branch) proto.017-PtNairob.contract.empty_transaction

So, i'm doing the royalties function for my NFT Marketplace. My idea was to make a big map with the royalties (user and amount) for each new token created, and it's working fine. My problem is when i'...
borderlessdev's user avatar
0 votes
1 answer
34 views

Programatically create Tezos Wallet

Hi guys inside my ICO website I want to create on the fly a tezos compliant wallet with the custom tokens for people once they purhcase. Is there a way to programatically create a wallet thanks peeps?
The Gaming Pro's's user avatar
0 votes
1 answer
25 views

How to access contract metadata from another contract?

I'm building a NFT Marketplace. I already set the mint function (with editions), list and buy function. Now i'm trying to build the auctions functions. On Smartpy, i created the Marketplace class, and ...
borderlessdev's user avatar
0 votes
1 answer
22 views

Two contract interactions same time?

So, i want to list my NFT, so, i update operators and then update my metadata. The problem is i need to accept two times, one to update operators, other to update (list) in metadata. Is that a way to ...
Guilherme Cousseau's user avatar
0 votes
2 answers
40 views

Error: Uncaught (in promise) TezosOperationError: (temporary) proto.017-PtNairob.tez.subtraction_underflow

Error: Uncaught (in promise) TezosOperationError: (temporary) proto.017-PtNairob.tez.subtraction_underflow I know this error is caused by a subtraction resulting in a negative number, but i'm just ...
Guilherme Cousseau's user avatar
0 votes
1 answer
34 views

How to set Total Supply on TzKT?

I'm trying to create multi-edition items. My idea was to make a list of each token and then each token edition with the owner. Ok, i create the item and shows like that on blockchain: https://api....
borderlessdev's user avatar
0 votes
1 answer
44 views

Error: Error in Scenario / Assertion failed

I am doing a contract to Mint Nfts on Tezos on Legacy SmartPY ide (because Tezos tutorial uses it). I already created Nfts but only in single edition, now i'm trying to do a Multi-edition, but the IDE ...
borderlessdev's user avatar
0 votes
1 answer
16 views

sp.contract can get only explicit string as an entrypoint

I'm trying to call another contract from mine. It seems like I can't feed sp.contract with an entrypoint string that comes from an argument (it works perfectly fine with an explicit string like "...
PinkD's user avatar
  • 1
0 votes
2 answers
37 views

Url error in smartpy

I trying to write a smart contract on the tezos network and using import FA2 library for this. But when I try to run the code I face the url error. this is my code : import smartpy as sp FA2 = sp.io....
AMS SAL's user avatar
0 votes
1 answer
27 views

testing contract inside smartpy test initializing by contract address

While testing on smart contract file by adding scenario, @sp.add_test("IntegrationTest") def test(): sc = sp.test_scenario() helper_contract = deploy_helper_contract() ...
Kin's user avatar
  • 184
0 votes
1 answer
21 views

Integrate a url in an NFT during the mint

I would like to add the possibility when I mint an NFT to integrate a "URL" in the parameters of the NFT. For this I tried to modify my mint function in my smart contract like this: @sp....
TM Paolo's user avatar
1 vote
1 answer
41 views

How to transfer an NFT

I'm trying to transfer an NFT, that I just minted to someone without them paying for it (just like an exchange). Here is the function I created on smartpy: @sp.entry_point def transferTest(self, ...
TM Paolo's user avatar
0 votes
1 answer
52 views

NFT transfer functionality with Smart Contract

I created a smart contract thanks to the documentation on tezos: https://tezos.com/developers/tutorials/nft-markeplace I wanted to be able to test the transfer functionality of nft between users or ...
TM Paolo's user avatar
0 votes
1 answer
33 views

How to handle oversized operation while originating contract?

I was trying to originate a smart contract from legacy smartpy CLI. I got this error: [INFO] - Using RPC https://ghostnet.ecadinfra.com... { "message": "Http error response: (500) [{...
Sanket Nighot's user avatar
0 votes
0 answers
23 views

getting issue on interscore contract burn of single asset

I have a function on my contract that calls the fa2 contract burn method of singleAsset provided by the fa2 library. @sp.entry_point def burn_test2(self,fa2_address, value): ...
Kin's user avatar
  • 184
0 votes
1 answer
10 views

Is there any other way than using lazify to update contract if i find any issue later?

How can we update a SmartPy contract. One way is through lazify but is there any other way to to so?
theBatMan's user avatar
0 votes
1 answer
42 views

calling a FA2 smart contract transfer entrypoint from my contract in smartpy

Hello guys I am trying to call from my contract entry point from FA2 token contract that I have deployed. But I am unable to find anything on the internet. The only thing I found from the ...
Rukundo Aimé's user avatar
-2 votes
3 answers
192 views

Fraudulent Smartpy Charges on my credit card

For two months now I have been charged for Smartpy Smart Browser that I didn't ask for or sign up for. Can someone help me get to the bottom of this.
Rick's user avatar
  • 1
0 votes
0 answers
24 views

Updating baseURI not working in FA2

I have been working on a Worker contract which is the parent of an NFT contract. The NFT contract is used to create dynamic NFTs (by changing their baseURI) in the contract and accessing the tokens ...
Yash Garg's user avatar
0 votes
0 answers
28 views

RLP Encoding of integer in negative value

I want to encode an integer i.e -10, but I don't see any function to encode the negative integer in this library. https://raw.githubusercontent.com/Acurast/acurast-hyperdrive/main/contracts/tezos/libs/...
Kin's user avatar
  • 184
1 vote
3 answers
58 views

checking if the number is negative or not

I have a requirement where I need to pass a byte into a function and that function should convert that byte to integer and returns true if it is negative else false. the function will be this in the ...
Kin's user avatar
  • 184
1 vote
1 answer
39 views

rlp encoding of solidity

there are two functions on solidity function encodeString(string memory self) internal pure returns (bytes memory) { return encodeBytes(bytes(self)); } /** ...
Kin's user avatar
  • 184
2 votes
1 answer
39 views

Pytezos balance_of entrypoint function for fa2 tokens

I was trying to implement a balance_of function. According to the documentation, it should be looking like this $balance_of: { "requests": [ $requests_item, … ], &...
Max's user avatar
  • 21
0 votes
1 answer
20 views

got HTTPError while imporing

i am getting http error while importing fa2 library. i checked link and it says host error. did it moved to new address? File "./contracts/src/something.py", line 3, in FA2 = sp.io....
Sandip Bhujel's user avatar
0 votes
1 answer
26 views

Trying to give a custom metadata but still it is using the default base metadata mentioned in class Common

Hello I am using the template Fa2NFT library. When we add the compilation target we need to give it a metadata parameter. I am trying to give it a custom metadata but still it is using the default ...
user avatar
0 votes
1 answer
32 views

Do I always have to write the argument names in SmartPy tests?

I defined an entrypoint with 2 arguments: @sp.entrypoint def update(self, newx, newy): self.data.x = newx self.data.y = newy then I wrote a test of this entrypoint: scenario += contract....
user avatar
1 vote
1 answer
26 views

rlp decoding not working as expected

I have a rlp encoded data and am trying to decode it with Accurast library Utils = sp.io.import_script_from_url("https://raw.githubusercontent.com/Acurast/acurast-hyperdrive/main/contracts/tezos/...
Kin's user avatar
  • 184
0 votes
1 answer
54 views

Callback function getting issue

I have two contracts , contract A and Contract B. This is my contract B where I have defined a callback function that will return sp.some("test") when called. import smartpy as sp ...
Kin's user avatar
  • 184
0 votes
1 answer
41 views

trying to access a callback function

I am trying to read a balance_of function of fa2 contract and updating my storage with the balance. but I am getting an issue Error: Type Error sp.TList(sp.TPair(sp.TPair(sp.TAddress, sp.TNat), sp....
Kin's user avatar
  • 184
0 votes
1 answer
49 views

call another contract onchain view

first we deploy fa2 contract from a contract like this deployed_fa2 = sp.create_contract_operation(contract=FA2_contract.SingleAssetToken(admin=sp.self_address, metadata=metadata,token_metadata=...
Sandip Bhujel's user avatar
0 votes
1 answer
25 views

Error: Error in Scenario File "smartML/michelson_base/typing.ml", line 206, characters 27-33: Assertion failed

i was writing a HTLC contract and using a scenario when this error shows up: Error: Error in Scenario File "smartML/michelson_base/typing.ml", line 206, characters 27-33: Assertion failed . ...
TheMastro's user avatar
1 vote
1 answer
49 views

RLP decoding on tezos

I have a code where a string "TEST" is encoded using RLP, https://smartpy.io/ide?cid=QmNVpo55Ss43aZiyrkdbEWcmmQEAsR2qHLKsPcLbqie7yu&k=8d516a673d972f3204f0 How do we decode the obtained ...
Kin's user avatar
  • 184
2 votes
1 answer
53 views

Smartpy 0.18.0 FA2 template

I am looking for the FA2 template with the new syntax in version 0.18.0 and above in smartpy. Is there something already available as the token template in the smartpy template are using old version. ...
Axel R.'s user avatar
  • 23
1 vote
1 answer
156 views

Problem when deploying smart contract

I've been trying to create a smart contract on the Tezos blockchain for several times. I was never able to create a smart contract on this blockchain because of this error. I use the code that is in ...
user avatar
1 vote
1 answer
127 views

Error in Inter contract call from a contract to quipuswap dex2 contracts swap entrypoint

I have written smartpy code to call an entrypoint swap on quipuswap dex v2 smart contract. Here is the code for that @sp.entry_point def swap_tokens(self, amount_in, min_amount_out, direction):...
Sanket Nighot's user avatar
1 vote
1 answer
29 views

Unable to fetch view `get_swap_min_res` from quipuswap v2 pool using smartpy

I was trying to use views in the v2 contract of quipuswap. This is my code. But getting the error while executing. Can someone spot where I am going wrong? Code: @sp.entry_point def ...
Sanket Nighot's user avatar
0 votes
0 answers
59 views

Need help on translating code to convert packed address to string

There is a code on this link (https://tezos.stackexchange.com/a/5908/8795) that decodes a packed address using code that is taken from PyTezos . I am trying to achieve the same using smartpy inside a ...
Kin's user avatar
  • 184
0 votes
1 answer
60 views

big endian order in smartpy

def tb(l): return b''.join(map(lambda x: x.to_bytes(1, 'big'), l)) The above function takes a list of number and is being converted into bytes, and the returned value is used this way, base58....
Kin's user avatar
  • 184
1 vote
1 answer
36 views

Do we have allowance() method like solidity in smartpy?

I need to implement allowance() function of Solidity, how can we achieve it in SmartPy?
theBatMan's user avatar
0 votes
1 answer
63 views

How to get XTZ balance of a address?

I want to read available tezos balance of a given address. How do we achieve this in smartpy? Also do we have allowance() method like solidity in smartpy?
theBatMan's user avatar
1 vote
2 answers
36 views

Data type mismatch

I have two codes, Utils = sp.io.import_script_from_url("https://raw.githubusercontent.com/RomarQ/tezos-sc-utils/main/smartpy/utils.py") sp.len(sp.bytes("0x0001")) Utils.Int....
Kin's user avatar
  • 184
0 votes
2 answers
21 views

How to implement a simple hashlock contract with initial commit of a sha256 hash of a password string

Im trying to implement a simple hashlock contract where I initially commit a sha256 hash of a password string and an address of the target receiver. The contract compiles and tests work (since for ...
user avatar
0 votes
1 answer
64 views

Calculation complex mathematical expressions in smartpy like ln, log, etc

I want to calculate complex mathematical expressions such as ln(94) in smartpy. How can this be done?
Sanket Nighot's user avatar
0 votes
2 answers
71 views

TezosOperationError: (permanent) proto.016-PtMumbai.michelson_v1.bad_stack

I am getting following issues: compilation warning: [warning] Error in generated Michelson contract: previous error deployment error: "TezosOperationError: (permanent) proto.016-PtMumbai....
theBatMan's user avatar
0 votes
2 answers
70 views

Decoding sp.pack("address") outside of chain

I have a question , While packing the string, "KT1FRoFxDhnKXGPggejHPAnMs27j6rcVfwzV", the output is 0501000000244b543146526f467844686e4b5847506767656a4850416e4d7332376a3672635666777a56 this ...
lee brune's user avatar
-1 votes
2 answers
24 views

sp.if: cannot unify branches

I am getting "sp.if: cannot unify branches" error from a onchain view method. Below is the code snippet. Full error msg: [error] Type Error sp.TRecord( locked_balance = sp.TNat, ...
theBatMan's user avatar
0 votes
3 answers
199 views

Conversion of address to bytes

I converted contract address to bytes using pack , and the result is this 050a00000016014b168ccb96310249aade4ce010e4e2ec8dd4602900 pasting this on online byte to string tool shows an error Invalid UTF-...
lee brune's user avatar
1 vote
1 answer
38 views

RLP related question

I am trying to translate solidity code in smartpy . bytes memory rlpBytes; rlpBytes = abi.encodePacked(rlpBytes, _link.encodeString()); rlpBytes = abi.encodePacked( rlpBytes.length.addLength(false), ...
lee brune's user avatar
1 vote
1 answer
58 views

Writing SmartPy tests along with LIGO contracts

I have a set of smart contracts coded in SmartPy. They are heavily interdependent and some of them also interact with cTez contracts. I need to write SmartPy tests to check if everything is working ...
Ojuswi Rastogi's user avatar
1 vote
1 answer
78 views

Tracking gas consumption by an entrypoint in smartpy during tests

I want to check how much gas an entrypoint consumes when we perform a transaction when writing tests in smartpy. How can this be done? Smartpy documentation too doesn't have anything that can help.
Sanket Nighot's user avatar

1
2 3 4 5