Questions tagged [smart-contracts]
The smart-contracts tag has no usage guidance.
407
questions
-1
votes
2
answers
219
views
Invalid Metadata on Smart Contract
I am in the middle of migrating my DApp from Ithacanet to Ghostnet, the majority of the migration is done, but I am unable to mint (it's a minting contract based off of hin) using the smart contract ...
2
votes
1
answer
162
views
How to get the owner of an FA2 token on chain
For an FA2 nft contract, how can I get the address of the owner of token_id 0 from inside another contract?
1
vote
1
answer
154
views
Calling balance_of via smart contract gives error A FAILWITH instruction was reached with 19
I am trying to call "balance_of" entrypoint of fxhash contract (in ghostnet).
Deployed contract: https://better-call.dev/ghostnet/KT1FqmrtKA4Pz4cNDsikt8qrwEg8pdSCpYug/interact/check
I used &...
2
votes
3
answers
107
views
How to get fxhash token attributes with smartpy?
Want to obtain fxhash token attributes/metadata with smartpy, the problem is fxhash smart contract doesn't have entrypoint or views for it. There is "get_token_data" view but it returns ...
1
vote
1
answer
51
views
Chest keys generated by @smartpy/timelock are not functional
The tool I use
https://www.npmjs.com/package/@smartpy/timelock,
https://github.com/RomarQ/tezos-timelock/
the tool works good on other functions such as openChest and createChestKey.
I used node 14.14....
1
vote
2
answers
68
views
Can I create a smart contract from inside another smart contract in LIGO?
Through a parent contract, I want to be able to originate multiple child contracts. How can I do this in LIGO?
1
vote
1
answer
37
views
how to create a chest on client side?
Trying to build onchain guessing game using commit-reveal pattern pattern uses encryption, solidity example is
// Check the hash to ensure the commitment is correct
require(keccak256(abi.encodePacked(...
1
vote
2
answers
42
views
Truffle is not working for compiling and deploying
Is anybody here still using Truffle in order to compile and deploy Tezos projects? I created a project with it over a year ago and wanted to update the environment. After dowloading the latest Ligo ...
0
votes
2
answers
68
views
FA2 view not working correctly
I've deployed an FA2 token that is supposed to use a token_metadata view to display the token metadata. The view is works fine if you call it directly, but it doesn't seem to be affecting the token ...
0
votes
3
answers
47
views
Size of Big_map or Big_map is empty?
Is it possible to find the size of a Big_map, or to find out whether a Big_map is empty?
1
vote
1
answer
54
views
How to simply store signed, hashed data on Tezos blockchain?
I'm new to Tezos. I'm wanting to store some signed, hashed data on the Tezos blockchain, most likely using Taquito/Batch API. Can anyone direct me to the correct method to simply send the data and get ...
0
votes
1
answer
261
views
How to get all NFT(Non Fungible Token) which created on the specific smart contract of the Tezos blockchain?(getNftForContract)
I have a smart contract address and I want to get the list of all NFTs that exist on this smart contract!
The goal is to get all NFTs data (Like its address, its visual, and its value) with the same ...
0
votes
0
answers
76
views
ListValidationError on interacting with contract using Taquito
I'm trying to interact with this entrypoint using taquito
parameter pair
token_assets list($token_assets_item)
trigger_time timestamp
token_assets_item pair
amount nat
asset_id string
...
1
vote
1
answer
49
views
Technical questions about NFTs
I'm new to both blockchain and Tezos. I've created an NFT from a PNG just to try and I'm not sure I've understood all the concepts under the hood.
As far as I understand, an NFT Collection (on Tezos) ...
1
vote
2
answers
70
views
Tezos - smart contract byte code to michelson
I am trying to figure out the SpicySwap swap fees. Since there is no public implementation available to my knowledge, I am studying the michelson code. For example:
https://tzkt.io/...
0
votes
1
answer
29
views
Tezos.amount>Tezos.balance is wrong?
is "if (Tezos.amount>Tezos.balance) then" wrong?
Oddly, the condition is failwith when i sent more tez compared to the contract balance
1
vote
1
answer
72
views
How to initialize the storage while originating a contract with storage type (pair (address %administrator) (unit %dummy))?
The contract is meant to allow transfers only from the admin. I what to initialized the admin address at origination.
parameter (or (unit %default) (pair %admin_transfer (address %destination) (mutez %...
3
votes
1
answer
92
views
Pytezos for originating contracts
I am quite new to Pytezos and I have a few questions and would be very happy if you could help me.
I want to make my script buy NFT, I know the smart contract address, how could I get from smart ...
0
votes
2
answers
101
views
Tezos for Python
I am quite new to Python, using it for about half a year. I want to learn coding on Tezos blockchain and got some questions for you.
Is there a chance to deploy smart contract using python? I know ...
0
votes
2
answers
106
views
Alternative for faucet "Unfortunately the faucet has run dry message"
Is there any alternative for faucet as I am seeing "Unfortunately the faucet has run dry" message on the site. I don't understand what "faucet has run dry" means.
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
0
votes
1
answer
212
views
error when deploying my smart contract
I created a smart contract it compiles without problem but I have an error when deploying, I don't know what this error can refer to...
HttpResponse: Http error response: (500) [{"kind":&...
1
vote
1
answer
56
views
how to correctly enter the storage parameters?
I am trying to pass the correct storage parameters in json to be able to deploy my smart contract. Thank you for your attention...
(pair (pair (pair (pair (address %admin) (big_map %ledger nat address)...
0
votes
2
answers
102
views
How to change the storage to transfer of an NFT?
I would like to be able to change the price of an nft when transferring it, but I can't change it it gives me an error...
(**
Implementation of the FA2 interface for the NFT contract supporting ...
1
vote
1
answer
50
views
how to fill storage parameters?
I am trying to pass the correct storage parameters in json to be able to deploy my smart contract. Thank you for your attention...
(pair (pair (pair (pair (address %admin) (big_map %ledger nat ...
0
votes
1
answer
46
views
Is it possible to delete an originated (e.g. KT1...) contract?
Is it possible to delete originated contracts? E.g., does Tezos have an analog of Ethereum's selfdestruct?
I'm guessing "no" and that it's a deliberate design decision - this is mostly an ...
1
vote
1
answer
33
views
Help understanding smart contract - why is this one different?
I'm trying to understand why this smart contract appears different compared to the majority that I've seen when viewing the code section of the smart contract on tzkt.io. I assume the smart contract ...
0
votes
2
answers
116
views
How to raise or emit an event?
In Solidity there's emit keyword for raising an event. How to do it in Tezos in a smart contract?
Namely, a) define b) emit an event
?
0
votes
0
answers
34
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 ...
1
vote
1
answer
72
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 ...
1
vote
1
answer
173
views
NFT collection prices API?
I am building on Tezos (I am new here). I was wondering if there is an API for getting floor prices of NFT collections? For example getting the floor price of Tezzardz on OBJKT.com. If not how can I ...
1
vote
1
answer
54
views
Storage settings
I would like to deploy my smart contract but I don't know what to put as parameters in the storage (I'm new to tezos). Thank you very much to those who will take the time to help me :)
//FA2
'(pair (...
0
votes
1
answer
33
views
Missing private variable when using private lambda on offchain view
I'm getting the error Missing private variable string_of_nat Is it not possible to use private lambdas within off_chain_views? What could I do if I want to use them here?
https://smartpy.io/ide?cid=...
0
votes
1
answer
37
views
Declaration Error: Variable name "x" already in use
When calling a method that uses a local variable twice, I'm getting this error.
Example smartpy link. In this linked code I added a new method test_string_of_nat2 which triggers this behavior.
How ...
2
votes
1
answer
224
views
How do I call an entrypoint of an existing contract using SmartPy?
How does one call an entrypoint of an existing contract using SmartPy?
For example, I'd like to be able to write a contract that calls the getBalance method of the existing ETHtz FA1.2 contract and ...
0
votes
2
answers
217
views
When does a contract get gas locked?
Right now I'm iterating over a map (not a big_map) that would have at most 10,000 entries. I know big_map is recommended for a large number of entries, however, I'm testing the limitations of both ...
1
vote
1
answer
74
views
Contract supplied an invalid parameter
I have a little problem because my mint does not pass because of invalid parameters, I don't quite understand why..., in the entrypoint call I deliberately did not put the token_id parameter because ...
0
votes
1
answer
36
views
How does Tezos manage overflow in smart contracts (in 5-year old language please)?
If Tezos was to shorn their full code set into a small 56bit processor it would cause overflow due to the sheer amount of transactions and overriding gas limit.
So it doesn't.
So...what process is ...
0
votes
1
answer
62
views
Branch contract calls
I'm trying to replicate the contracts call for the raw found below:
{ "branch":
"BMLgLBqf6dxFBNMLBBDkVtNSJCfQMcNxLiEmUKRmE8bYFrKY1CW",
"contents":
...
2
votes
1
answer
95
views
Why does `sp.pack('some string')` prepend `0x05010000002e` before the actual bytes?
If I pass in the string QmbPAr5RcCZZDRsNKnf2p1t6GK3Qu7oDH39HCK3aewUq3w to the sp.pack method in an entrypoint and perform and sp.trace in smartpy I expect to get the following bytes:
...
1
vote
1
answer
51
views
What guarantees do on-chain views provide?
A couple of months back, I asked this about off-chain views (here).
Now, on the Hangzhou testnet, synchronous on-chain views are supported. (smartpy documentation). Do these views provide ...
2
votes
2
answers
213
views
How are royalties programmed in an FA2 contract?
I see some contracts (Dogami) say they take royalty fees even when they're sold on a 3rd party marketplace.
How does that work? As far as I can tell, this would require the FA2 contract to have an ...
1
vote
1
answer
34
views
How much overhead is there when calling another contract?
How much worse would it be to call an entry point 100x vs calling a bulk operation entry point with a list[0-99] 1x?
0
votes
1
answer
246
views
RPC error when using @templewallet/dapp
I'm getting this error when trying to execute a contract using temple wallet in my Dapp.
Failed to send request to https://hangzhounet.smartpy.io/chains/main/blocks/head/helpers/forge/operations. ...
0
votes
2
answers
90
views
Any Tezos RPC alternatives suggestions
The open tezos docs suggest using RPC URL: "https://florencenet.smartpy.io/". It does not work.
What alternatives RPC URLs do you use. It seems that when you use the mainnet RPC URL - things ...
0
votes
2
answers
119
views
Tezos Contracts Compiling Error
I am just days into learning how to build a dapp on Tezos for my thesis. I tried replicating the steps from Claude's tutorial - https://hackernoon.com/build-your-first-dapp-on-tezos-rwgl3ymb
I ran ...
0
votes
1
answer
20
views
Has human-readable feedback from contract simulation been considered?
I am wondering if feedback to wallet-users from Michelson contracts has been considered previously in the development of Tezos, and where is it / why is it not being considered ?
I am thinking it ...
0
votes
1
answer
29
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()
...
2
votes
1
answer
63
views
Cannot get to initialize empty list in CameLIGO
I'm trying to write a smart contract in CameLIGO that looks like this
parameters
"Hello world"
storage
[{ text = "Blob"; voters = ["tz1TKc3zQBMv7Rez77sX4JNdqMvG33LQrURk"]}...
0
votes
1
answer
44
views
triggering outside actions from tezos
assuming I am running a tezos node, is there any way to create a smart contract in tezos that is capable of triggering outside actions? For example, sending an email to an address, or turning lights ...