Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
4answers
35 views

Is it possible to use natural logarithmic in your smartpy code?

If not,is there any alternative way to implement a natural log component into your smart contract code?
0
votes
1answer
10 views

Tezos.get_entrypoint_opt in Ligo issue

I am trying to replace get_contract with Tezos.get_entrypoint_opt I need to transfer FA1.2 tokens in Dex: https://github.com/madfish-solutions/quipuswap-core/blob/master/contracts/Dex.ligo#L21-L28 ...
1
vote
1answer
33 views

FA2 Permission Policies & Hook permission Behaviour

Is there an example of how to use permission policies and hook permission behaviour with regards to FA2 implementation? https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-12/tzip-12.md I am ...
3
votes
1answer
50 views

Calling view of Fa1.2 contract

From my understanding, getBalance, getAllowance, getTotalSupply & getAdministrator entrypoint requires another contract to read the values. How will the entry point of the second contract look ...
0
votes
1answer
17 views

Error: ligo: generated. untyped BIG_MAP_EMPTY

In ligo for a smart-contract I have a big_map in my storage and I want to pass nothing in the map as intial_storage value. { name = "stablecoin"; symbol = "eur"; total_supply = ...
1
vote
4answers
62 views

Is there a formula to build parameter messages to be passed to smart contract entrypoints?

When calling a smart contract entrypoint, it is required to pass the needed entrypoint parameters. This is done through a message that must be sent in JSON/Pairs format. My doubt is: Is there a ...
1
vote
1answer
5 views

Error in dry : different keys in tuple and record

I am trying to dry-run one contract on online Ligo IDE, Access function : main Parameters : (10n, ("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address)) The logo code is compiling fine and I don't ...
3
votes
2answers
16 views

Contract error location

When you call a smart contract and it fails, it returns an error location. For example: {"kind":"temporary","id":"proto.006-PsCARTHA.michelson_v1.script_rejected","location":2624,"with":{"int":"3"}} ...
3
votes
1answer
31 views

Documentation for Serializing Contract Call Data/Parameters

Is there any documentation available for how to serialize contract call parameters? I found good documentation for serialization of general operations and took a look at the tzips but neither seems ...
1
vote
3answers
18 views

How to delegate the balance of a smart contract?

I am looking to create a smart contact that will delegate the funds it is storing. 1) How does an originated KT address delegate to a baker? 2) If a KT address delegates, can it do anything else? I ...
1
vote
2answers
23 views

What is Big map on Tezos?

I saw Big map on Tezos contract but I don't really understand what is it. Someone can explain to me ? Many thanks!
1
vote
1answer
14 views

Pascaligo map iteration issue

I try to fetch a list of addresses with expired date by appending the address to list(address). However when doing map iteration, it encounters a persistent error says 'not True'. Hope someone can ...
1
vote
1answer
20 views

Transaction with multiple inputs

I'm trying to integrate tezos with my exchange, but have a problem, tezos cant send with multiple input, because in exchange we used balance from different address to send transaction.
0
votes
1answer
24 views

ERROR: Public Key Cannot be Exposed

tezbridge.request({method: 'post_source'}) taquito.Tezos.setProvider({rpc: 'https://rpc.tzkt.io/mainnet', signer: new taquitoTezbridgeSigner.TezBridgeSigner()}) taquito.Tezos.contract.transfer({ to: ...
1
vote
1answer
27 views

My contract compiles, but when deploying I get an error

I'm using the Teztool in sandbox mode. My contract compiles, but when I deploy: teztool carthagenet sandbox client originate contract tezart transferring 0 from bootstrap1 running tezart.tz I get ...
1
vote
1answer
41 views

error: Public Cannot be exposed!

const address = 'tz1Qzi4iMowq8z4BEihyU1HvFFxAUXc9PbAF' tezbridge.request({method: 'post_source'}) taquito.Tezos.setProvider({rpc: 'https://rpc.tzkt.io/mainnet', signer: new ...
1
vote
1answer
13 views

Trouble with calling a function with parameters with Taquito

I'm trying to use taquito to call a method in my contract. Note my contract was programmed in SmartPy (if that makes any difference). I am able to call contract.storage() without any problem. When ...
1
vote
1answer
31 views

Calling contract invocation operation in loop

I have some set of data which I am trying to push to my smart contract in loop. I use conseiljs to send data to smart contract. Here is the code depicting what I am trying to do. async function ...
1
vote
0answers
33 views

I got this error from conseil js TezosNodeWriter.sendContractOriginationOperation. What could be the problem

Failed to parse the request body: No case matched: At /kind, unexpected string instead of endorsement At /kind, unexpected string instead of seed_nonce_revelation At /kind, unexpected string ...
1
vote
1answer
14 views

How to add add a record to a map in CameLIGO

I'm using CameLIGO and want to add a record to a map. I keep getting this error: Error: ligo: : Parse error in file "tmp-1lMUlWlg5fktI.ligo", line 21, characters 45-46, after "{" and before "}": ...
2
votes
1answer
40 views

How to transfer token to multisig contract

The contract code is [{"prim":"parameter","args":[{"prim":"pair","args":[{"prim":"pair","args":[{"prim":"nat","annots":["%counter"]},{"prim":"or","args":[{"prim":"pair","args":[{"prim":"mutez","...
0
votes
1answer
35 views

How do you update a map in Pascal Ligo?

I'm trying to learn how to write a smart contract and using Ligo. I'm struggling with quite a few things at the same time e.g. syntax, understand the documentation, best practices etc. Baby step is, ...
1
vote
0answers
18 views

Fi update a set with 'get'

Struggling with Ligo so took a look at Fi. I want to create a provenancy smart contract i.e. add an artwork, then transfer ownership. The Fi compiler says Error: Error with variable ext - for variable ...
1
vote
1answer
13 views

What is the syntax to define a function which returns a value, in fi

The question is really that simple - I cannot find documentation for this! there are two things I want to do: One is to define a function and be able to use a value returned from that function in ...
0
votes
0answers
9 views

What is the syntax for passing values to a struct within a contract written in fi?

I have defined a type Poll using a struct. I would like to be able to instantiate it, preferably passing initial values to its variables when I do. eg I would imagine a syntax for what I want to do ...
1
vote
2answers
43 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)...
2
votes
0answers
27 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
-1
votes
1answer
26 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" ...
5
votes
1answer
38 views

bigmap.get(key, “”) with default param in case of no entry for key in the map with Taquito

Can we do something similar to myMap.get(key, defaultValue = None) of smartPy with Taquito? An instruction like: const myContract = await Tezos.contract.at(contractAddress); const contractStorage = ...
1
vote
1answer
50 views

sending data from one contract to another smartpy tezos

I am trying to send data from one contract to another in smartpy Remote Contract import smartpy as sp class Try(sp.Contract): def __init__(self): self.init(mynum = sp.int(0)) @sp....
0
votes
0answers
30 views

Call one contract from another smartpy tezos [duplicate]

I am trying to call one contract from other. Remote Contract import smartpy as sp class Try(sp.Contract): def __init__(self): self.init(mynum = sp.int(0)) @sp.entry_point def ...
1
vote
1answer
33 views

Taquito default entrypoint not found

I have deployed a smart contract on carthagenet. The contract only has a single entry point. Taquito is not able to find that single entry point. I tried both default and root methods and it doesn'...
1
vote
1answer
10 views

Get current ChainId in smartPy contract

I'm trying to get the chain_id of the current chain evaluating a transaction or containing the smart contract with smartPy, but I got always error in init and in entrypoints when I try to affect the ...
2
votes
1answer
46 views

How do we use getBalance() function in FA1.2 token contract in SmartPy?

https://smartpy.io/demo/index.html?template=FA1.2.py&source=post_page--------------------------- This is the token contract link. It is deployed on the https://babylonnet.SmartPy.io node with the ...
0
votes
2answers
28 views

How to construct signature list as parameter to invoke contract

I write a contract and deployed it to babylonnet, address: KT1BcH97ZQas6zKMJBtNdmU4iBvyi2ihpsx8, the entry point is withdraw, parameter is amount, signatures, toAddr, txId(string). I use smartpy ...
4
votes
2answers
88 views

Operation cost for invoking smart contract

I would like to find out if the smart contract's code size/storage or an operation's parameters helps to derive to the cost. Is there a formula to calculate the cost of the operation to be invoking a ...
5
votes
3answers
662 views

Testing frameworks for tezos smart-contracts

I did few smart contracts with Ligo, but now looking for more productionize setup. Is there a test framework one can use for Tezos? I'm looking for something like waffle + mocha in Ethereum, or ...
3
votes
1answer
147 views

Storage and parameter size limitations of smart contract?

Got a few questions regarding storage limitations of smart contract. What is the maximum number of bytes of data that I can send for a single transaction? Is there a size limit to the storage of a ...
0
votes
1answer
28 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 ...
1
vote
2answers
45 views

pytezos deploy kt

I'm following the https://baking-bad.github.io/pytezos/#originate-contract refs to originate a contract. I suspect that it has something to do with how I usually iniatialize the storage, so if anyone ...
0
votes
1answer
32 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
vote
1answer
23 views

Parse address to string in smartPy

Can we parse a varialble of type sp.TAddress to sp.TString like this: strAddress = sp.string(sp.address("tz1-add")) or strAddress = str(sp.address("tz1-add"))? Smart Contract Example: import ...
1
vote
1answer
22 views

Call a method with params that do nothing in a smart contract

I'm trying to invoke a method with parameters that do nothing (blank body) in a smart contract but that doesn't work even if the contract is correctly deployed to the blockchain. Use case: Smart ...
3
votes
1answer
73 views

How do I get the storage value of a bigmap using pair datatype as key with taquito library?

I am using the taquito library to interact with a smart contract that I have uploaded to carthagenet. However, I am facing an issue in retrieving the value of a bigmap property in my smart contract ...
1
vote
1answer
72 views

Smart contract calls another smart contract's method with SmartPy

How can I call a smart contract method from another smart contract with smartPy? Use Case: Lest's imagine that we have: Smart contract with a function increment(a) Smart contract with a function ...
1
vote
1answer
27 views

sp.check_signature cryptographic function in SmartPy

I wanna ask about the parameters s and b in the cryptographic function: sp.check_signature(k, s, b) the second parameter s: is the string that we should inject in the blockchain or the signature ...
1
vote
1answer
38 views

Smart Contract Invocation using tezos-client and RPC requests failed

Network: Babylonnet test network Network Version: { "chain_name": "TEZOS_ALPHANET_BABYLON_2019-09-27T07:43:32Z", "distributed_db_version": 0, "p2p_version": 0 } Case: I'm ...
0
votes
0answers
44 views

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'replace' of undefined at Object.normalizeMichelineWhiteSpace

When using conseiljs for deploying contracts the statement seems to have some error which is directly copied from the conseiljs library. const result = await conseiljs.TezosNodeWriter....
1
vote
2answers
124 views

How to retrieve data from smart-contract using javascript?

I have stored data that I would like to retrieve from a deployed smart-contract. The storage structure was defined using SmartPy: def __init__(self): self.init(bmap=sp.big_map(tkey=sp....
1
vote
1answer
14 views

How to fix 'paused before out-of-memory crash' contract deployment error in browser? [ConseilJS]

I wish to deploy a contract using ConseilJS that I am able to originate successfully using smartpy.io However, when I copy the generated Michelson and initial storage into the following function: ...