7 votes
Accepted

Michelson: Parameter vs Storage

The difference is very simple :) The parameter is made of data that are sent to the contract with a transaction while the storage holds the state of the contract (i.e all the data that the contract ...
user avatar
7 votes
Accepted

What are the new rules for when a KT1 gets destroyed? Or when "--burn-cap" must be used to send funds to a tz1/tz2/tz3 account?

As of 003_PsddFKi3: An originated account is forever.[1] An implicit account is 'allocated'[2] and 'deleted'[3] as its balance goes above and back to zero (if it is not a delegate[4]). Currently ...
user avatar
  • 2,501
7 votes
Accepted

How to extract the storage of a smart contract?

In the command line ./tezos-client get contract storage for KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ You could also just call the RPC curl http://localhost:8732/chains/main/blocks/head/context/...
user avatar
  • 4,409
6 votes
Accepted

Genesis Balances

1) Here they are $ ./tezos-client rpc get /chains/main/blocks/1/context/contracts | grep KT1 "KT1WPEis2WhAc2FciM2tZVn8qe6pCBe9HkDp", "KT1W148mcjmfvr9J2RvWcGHxsAFApq9mcfgT", "...
user avatar
  • 4,409
5 votes
Accepted

FA2 from/to serialization

In the FA2.0 standard the sender and receiver is send as Bytes (vs. send as string for FA1.2). Both token standards say that sender and receiver are Michelson addresses. Michelson addresses have two ...
user avatar
5 votes

What are the differences between key, key_hash, address, contract and signature in Michelson?

Why can I convert between address and contract. But not between address and key_hash? There is the (IMPLICIT_ACCOUNT) instruction to go from key_hash to address. For the other direction, there was (a ...
user avatar
5 votes
Accepted

What are the differences between key, key_hash, address, contract and signature in Michelson?

key_hash is blake2b hash of a public key, in the base58 encoded form it can start only with tz, but address is more general, it can also hold KT accounts; There are no instructions for that, probably ...
user avatar
4 votes
Accepted

Get a returned value when calling a Michelson contract

No. The only way to do that is for the contract you call to explicitely send you a callback, continuation passing style.
user avatar
  • 4,409
4 votes
Accepted

method for calling to entry point of contract instance (?) created by contract.create

You cannot create a contract and call it immediately. It goes like this, chronologically: Your script is running. You invoke CREATE_CONTRACT or CREATE_ACCOUNT. An operation and address are returned ...
user avatar
  • 2,501
4 votes
Accepted

How to store and load custom FA2 NFT metadata?

Your code above has some issues that I will describe below. Also, you are confusing off-chain metadata with on-chain metadata, tzip16 and tzip21 allow those structures because they were designed to be ...
user avatar
3 votes
Accepted

My contract compiles, but when deploying I get an error

You need to provide an initial storage value for your contract. You can write it in Ligo and compile it too using the ligo compile-storage command.
user avatar
3 votes
Accepted

Michelson contract files - spaces, new lines and comments

No, whitespace and comments do not affect storage or gas costs. The syntax of Michelson code and values is called "Micheline". The concrete syntax (the way you actually write Micheline expressions ...
user avatar
  • 2,501
3 votes
Accepted

Drain delegated KT1 contract, then later send funds to the same (but now empty) contract

In a scenario where both the TZ1 and KT1 addresses have been emptied, you can still send funds to your KT1 address. The KT1 contract never gets destroyed. You will however need fund your manager ...
user avatar
  • 434
3 votes

is this RPC methods related about : deploy or call contract?

No - these are helper functions that provide typecheck and testing features. You originate a contract via an operation (with kind origination), and you call it via a standard transaction and the ...
user avatar
3 votes
Accepted

Can't get tzBTC out of the tzBTC Granadanet contract

Only admin can call mintOrBurn in that particular contract. As you can see in the contract storage, tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx is the admin, so you need a private key from this address. ...
user avatar
  • 2,317
3 votes
Accepted

How to get wallet tokens balance with the help of address and tokens contracts?

The best approach is to use an indexer that is aware of all tokens. Its not scalable to query them one at a time from the RPC, or to maintain the list of tokens. This API from TZKT: https://api.tzkt....
user avatar
3 votes

What are the recommended regular expressions for tezos wallet and contract addresses?

Transaction rollups coming with the Jakarta protocol will introduce new addresses with prefixes (txr1, tz4, and txi). And the K protocol will also introduce a new ones scr1, etc. You can find all the ...
user avatar
2 votes

Get a returned value when calling a Michelson contract

In my understanding, you can call a contract by sending a parametrised transaction, that's injected as an operation under /injection/operation. You can trace the flow above in the source of eztz.js. ...
user avatar
2 votes
Accepted

Deploying a simple contract using liquidity

You are using a private key which do not correspond to any account on the alphanet. It works with liquidity --tezos-node http://alphanet-node.tzscan.io:80 --private-key ...
user avatar
  • 332
2 votes
Accepted

Why use transactions to call contracts?

As I understand the concepts, transferring tezos is one kind of contract. It has amount to move from account to another and the move is containing a transaction to track, that the operation gets ...
user avatar
  • 697
2 votes

How to extract the storage of a smart contract?

Let's find the contract on Arronax and look at its code... storage unit; code { CDR ; NIL operation ; AMOUNT ; PUSH mutez 0 ; { COMPARE ; EQ ; IF {} { SOURCE ; CONTRACT ...
user avatar
  • 98
2 votes

Contract originate hangs after 'Waiting for the node to be bootstrapped before injection...'

The babylonnet was terminated about 2 weeks ago. It is no longer supported. You should be on carthagenet now. "Waiting for the node to be bootstrapped" means your node is not yet synchronized with ...
user avatar
  • 3,364
2 votes

Delegating from a Kt1 address locked my coins, how can I fix it?

You created a contract which can only transfer funds when it receives a call to do so from its "manager" account which was specified at origination and is the only value the contract has in its ...
user avatar
  • 1,979
2 votes

Smartpy transfer contract balance to an address

The correct way to do this is simply: @sp.entry_point def withdraw(self, amount): sp.set_type(amount, sp.TMutez) sp.send(sp.sender, amount) The solidity translation tool I used didn't handle ...
user avatar
  • 133
2 votes
Accepted

Interact with Tezos in xamarin

There is https://github.com/baking-bad/netezos, a .NET Standard 2.0 library for working with Tezos. You can easily use it to interact with Tezos node via RPC, manage keys (it also supports Ledger), ...
user avatar
  • 2,317
2 votes
Accepted

How can I manually create an on chain contract call?

You can use an address "KT1..." or "KT1...%entry_point". The chain is then in charge of type checking and converting to the contract type.
user avatar
  • 3,185
2 votes
Accepted

How can I write On Chain Contract Calls in Tezos Sandbox?

There is a bug in the SmartPy template (just discovered it). You should either: add other entry points to onEven and onOdd; or remove the specification of sp.contract(..., entry_point = "run&...
user avatar
  • 3,185
2 votes
Accepted

Contract does not exist

I thought that it was a copy of the previous main net + the new changes to be applied (Granada in this case). It isn't, testnets share no history with mainnet, or each-other. From the Test Networks ...
user avatar
  • 146
2 votes
Accepted

call to 'approve' entrypoint of tzBTC contract failing with 'UnsafeAllowanceChange'

the allowance is only 10 and when I try to chance it I get an UnsafeAllowanceChange error. This error is raised because the allowance is already 10, from the UnsafeAllowanceChange documentation: ...
user avatar
  • 146
2 votes

how to calculate current storage values for liquidity baking CPMM

tzBTC uses 8 decimals like Bitcoin, so you should divide tokenPool by 100000000 to get the number of tzBTC held by the contract.
user avatar
  • 4,409

Only top scored, non community-wiki answers of a minimum length are eligible