Questions tagged [smart-contracts]
The smart-contracts tag has no usage guidance.
407
questions
0
votes
0
answers
1
view
Sending simple data in smart contract call
I want to make a simple payment receiver contract not using default the entrypoint that also just sends a plain text message. Is there a way to just send a simple message within the input data that ...
0
votes
2
answers
62
views
I want to transfer the tokens from one contract to another address
When I transfer the token from the contract address: KT1LkNWZgVYh3zdaRkBb9aNgLEFCjVJwEKu2, it works well. However, when I switch back to the address KT1P8RdJ5MfHMK5phKJ5JsfNfask5v2b2NQS, an issue ...
1
vote
3
answers
50
views
I want to retrieve the balance of a smart contract that I own using my wallet address and the address of that smart contract, how can I do that?
I have a contract address: KT1P8RdJ5MfHMK5phKJ5JsfNfask5v2b2NQS, and a wallet address: tz1MSint56iUqoogrKsvEMEykpbKv2Yhmzss. What can I do?
0
votes
1
answer
35
views
Patching a contract with deprecated instructions
The following contract (Hic Et Nunc Marketplace V1) contains the deprecated instruction SUB on type mutez:
https://github.com/hicetnunc2000/objkt-swap/blob/master/michelson/objkt_swap_v1.tz
I want to ...
0
votes
2
answers
38
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'...
0
votes
1
answer
24
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 ...
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 ...
0
votes
2
answers
31
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 ...
0
votes
1
answer
32
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....
0
votes
1
answer
42
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 ...
0
votes
1
answer
40
views
deprecated_instruction error upon contract deployment
I'm attempting to clone some contracts that are available on mainnet and deploy them to Ghostnet. When trying to deploy the Hic et Nunc Marketplace (https://tzstats.com/...
2
votes
1
answer
57
views
Error 32603 Metamask to deploy an ERC20 on the EVM rollup
Hi I am trying to deploy an ERC20 on the EVM rollup
I am copying this code for ERC20 and using the Remix IDE
When I use the "Remix VM (shanghai)", it works fine
However, when I switch to &...
0
votes
1
answer
15
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 "...
0
votes
2
answers
36
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....
0
votes
1
answer
30
views
Issue while generating NFT metadata
I have a problem for the generation of my metadata:
https://ghostnet.tzkt.io/KT19FWtPSqybX52WaLVAD3xbWyHiRqNupD9Q/tokens/14/metadata
This is how I generate my metadata in my code:
const metadata = ...
1
vote
2
answers
52
views
Creation of a FA2 Token (Fungible) and not an NFT
I created a smart contract to do several interactions with tokens.
With the tutorial on the tezos website: https://tezos.com/developers/tutorials/nft-markeplace
Here is my smart contract: https://...
0
votes
1
answer
31
views
The operation cannot be added because the mempool already contains a conflicting operation that should not be replaced
I am getting below issue while deploying SmartPy contract in ghostnet.
HttpResponse: Http error response: (500)
[
{
"kind":"temporary",
"id":"...
0
votes
1
answer
19
views
Buy NFT with fee for the marketplace
I want when a user buys an nft, 90% of the amount goes to the author and 10% to the marketplace.
When I deploy my smart contract everything works fine: https://legacy.smartpy.io/ide?cid=...
0
votes
1
answer
19
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....
0
votes
1
answer
8
views
How to calculate shares in Quipuswap V2 dex?
In quipuswap dex v2, when we call invest_liquidity, there is parameter called shares. I want to know how to calculate those shares.
I know that there is view in contract called get_toks_per_share but ...
1
vote
1
answer
38
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, ...
0
votes
1
answer
51
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 ...
0
votes
1
answer
41
views
Problem for creating smart contract NFT marketplace
I am trying to make an NFT Marketplace using the tutorials given here: https://tezos.com/developers/tutorials/nft-markeplace
The first problem I had was when they give us the smartcontract, the ...
0
votes
2
answers
32
views
Contract compile error in Dapp tutorial (wine collection marketplace)
I'm trying to run through this tutorial on dapp development with ligo (https://tezos.com/developers/tutorials/nft-ligo-marketplace/) and am running into an error. In the "NFT Marketplace Contract&...
0
votes
0
answers
11
views
How to migrate storage from one contract to another?
Can we migrate storage from one contract to another,if we get any issue in first contract?
0
votes
1
answer
32
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 ...
0
votes
1
answer
20
views
How to compile a LigoLang jsLigo written smart contract on Windows + vsCode?
I'm beginning to learn to write Tezos smart contracts with LigoLang using jsLigo as programming language and Windows as operating system. For IDE I'm using vsCode. I've followed the Getting Started ...
0
votes
0
answers
25
views
Unable to interact with other contracts because Tezos.get_contract_opt got None
I tried to interact with other contracts but failed because Tezos.get_contract_opt always returns None. Here's the demo code (ligo v0.60.0):
receiver.jsligo - A contract that the "broadcaster&...
0
votes
2
answers
63
views
CORS error with completium-cli sandbox
I'm trying to access a contract on the completium-cli sandbox within my dapp running on a local vite server. Ideally I would set up my dev environment so I can test deploy to the sandbox within the ...
0
votes
1
answer
25
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 ...
0
votes
1
answer
42
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=...
0
votes
1
answer
12
views
Is there a way to convert from Big_map to map?
Is there a way to convert from Big_map to map ? (Use case : send the storage to another contract that need to parse it)
0
votes
2
answers
10
views
What to use instead of try catch?
I have a requirement, there are two contracts Contract A and Contract B.
Contract A calls Contract B , if some error occurs in contract B while calling.
Instead of failing of transaction, Contract B ...
1
vote
3
answers
38
views
How do you generate your initial storage for deployment in ligo?
I'm curious about your strategies regarding the following questions:
How do you generate your initial storage for deployment ? Where do you store your storage types ? Do you keep your storage ...
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 ...
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?
0
votes
1
answer
44
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?
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?
0
votes
2
answers
70
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....
-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,
...
1
vote
1
answer
37
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),
...
1
vote
1
answer
54
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 ...
0
votes
1
answer
44
views
Error when deploying: proto.016-PtMumbai.michelson_v1.bad_stack
TezosOperationError: (permanent) proto.016-PtMumbai.michelson_v1.bad_stack
Now getting this issue while deploying contract on ghostnet, whats the reason for this?
1
vote
1
answer
27
views
Examples of deploying a smart contract on a tezos sandbox with python/pytezos
I've been looking for up to date examples of deploying a smart contract on a tezos sandbox for a while now. Does anyone know of any good references? I'm using python/pytezos.
0
votes
1
answer
79
views
Concat Address to String in smartpy
My use case is, I need to concat address with string this way,
"ab" + sp.self_address + "cd" .
How to achieve this in smartpy ?
1
vote
1
answer
49
views
Rollup Q&A: How can arbitrum or optimism update their rollup with an admin key? I thought Smart Contract were immutable?
Question from reddit
How can Arbitrum or Optimism update their rollup with an admin key? I
thought SC were immutable?
1
vote
1
answer
231
views
Rollup Q&A: Why are Tezos "enshrined" rollup better than Ethereum smart contract rollup?
[Question coming from reddit]
What makes the tezos rollups "enshrined" as compared to smart contract ETH rollups? Is it because the rollups have special treatment by the L1: specific sr ...
0
votes
1
answer
21
views
Missing item in map error
I have defined a map and in a entry point i try to verify if the value of a key exists or not. I am getting error : Missing item in map: 'param' is not in {} while evaluating self.data.links[params]. ...
0
votes
1
answer
37
views
How to implement try & catch in smaryPy?
How do we implement following solidity code in smartPy.
try this.checkAddress(to) {
sendResponseMessage(
Types.ServiceType.REPONSE_HANDLE_SERVICE,
...
1
vote
1
answer
98
views
How to write enum in smartPy?
How do we translate the below enum in smartPy.
enum ServiceType {
REQUEST_COIN_TRANSFER,
REQUEST_COIN_REGISTER,
REPONSE_HANDLE_SERVICE,
BLACKLIST_MESSAGE,
...