Everscale blockchain. difference between tvm.rawReserve and tvm.accept - solidity

I can't find in any way what is the difference between tvm.rawReserve(address(this).balance, 0) и tvm.accept()?

Before executing a smart contract:
the total amount of ever on the contract address and those who came with message is considered (for external message 0, for internal how many were sent)
storage fee is deducted from this amount
execution of the smart contract begins
For payment for the execution of a smart contract, it is always debited from the account balance.
if it is an external message (and 0 coins were transferred with it)
that is, a small credit for which you can check the require and, if something is wrong, cancel the transaction. in this case, nothing will be removed from the account balance.
If the checks were successful and it is necessary to execute the rest of the function code, payment for the execution of the transaction is made from the balance of the contract:
tvm.accept() — no gas limit
tvm.rawReserve(uint value, uint8 flag) — set the gas limit, that is, we reserve part of the funds and it will not be possible to spend more than this value. See also tvm.setGasLimit(uint g).

Related

Decentraland total supply is difference in Ethereum and polygon?

I learning about blockchain and look in mana token Decentraland. I compared total supply in etherscan and polygonscan but there are difference why?
The Total Supply coinmarketcap: 2,193,554,627 https://coinmarketcap.com/currencies/decentraland/
The Max Total Supply: etherscan: 2,193,554,627 https://etherscan.io/token/0x0f5d2fb29fb7d3cfee444a200298f468908cc942
The Total Supply polygonscan: 3,881,772 https://polygonscan.com/token/0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4
any one can answer for it pleas.
I know some tokens use polygon or binance chain beside ethereum to add more scalable and less fee? if that true
but there are difference why?
One of the numbers is wrong.
add more scalable and less fee? if that true
yes

Do you have to spent the entire output of a bitcoin transaction?

After reading about how bitcoin is transferred, I learned that you take the outputs of a previous transaction and use them as inputs for a current transaction, in other words you use the transaction id of the previous transaction to supply coins to the current one. There can be multiple inputs and outputs but if you want to spend the bitcoin in an output do you have to spend the entire output or can you spend part of one output and then use that transaction id later to spend the rest of that output. How would the UTXO database keep track of this and handle the math?
Unspent outputs are claimed by the miner of the block. Transaction fees are just unspent outputs.
If you want to spend the bitcoin in an output do you have to spend the entire output or can you spend part of one output and then use that transaction id later to spend the rest of that output.
Yes, you need to spend all of the outputs unless you plan to donate it to the block miner. Usually this is achieved by paying the "change" back to yourself.

How to get the total amount sent to an Etherum address

I'm a noob at Ethereum and need to make statistics from blockchain data.
I have a full node up and running with RPC ready, but can't find a clue in the doc on how to query :
Total number of transactions in/out for a contract/address
Total number of ether sent/received for a contract/address
The only solution I found was to parse all blocks and transactions in a double for loop and the performance is way too slow to do this.
Can someone help me ?
TL;DR : How do you do getTotalAmountSentTo(address) and getTotalNumberOfTransactionsFor(address) in Ethereum?
If you are using web3JS you can use web3.eth.filter function to find all the transactions you are interested in.

Total coin supply, how it works, and what the code means?

I am currently studying the bitcoin and litecoin to try and get a better understanding of cryptocurrencies, and blockchains in general - and I have spotted something in the code that I have a question about.
in src/amount.h - I see the following code...
/** No amount larger than this (in satoshi) is valid.
*
* Note that this constant is *not* the total money supply, which in Bitcoin
* currently happens to be less than 21,000,000 BTC for various reasons, but
* rather a sanity check. As this sanity check is used by consensus-critical
* validation code, the exact value of the MAX_MONEY constant is consensus
* critical; in unusual circumstances like a(nother) overflow bug that allowed
* for the creation of coins out of thin air modification could lead to a fork.
* */
static const CAmount MAX_MONEY = 84000000 * COIN;
Now, the comment here, seems to suggest that this code does not actually define what the total supply of the currency will be, even though the amount of Litecoin available is in fact 84,000,000...
So, my real question :
Is the real total supply held in another piece of code? If so, what am I missing, where can I find this code, and if I were to be trying to edit this (I'm not - but I want to understand what is going on here) - would I need to edit code in multiple places?
NOTE : Tagged bitcoin even though this is litecoin souce in the question, because litecoin doesn't appear to have a stackoverflow tag, and the two codebases are similar anyway.
EDIT : I also wanted to add, that I performed a grep for "84000000" - and only really found that one line of code to be relevant... So I must be missing something...
EDIT 2 : According to literally every coin out there on git that I have looked at - this is the number that they change when adjusting the total supply - so is the comment just wrong - or did I misunderstand it?
I realise this is an old question, but since it hasn't been updated I'll provide an answer.
As the source suggests, MAX_MONEY is simply a sanity check. If someone tries to create a transaction spending 500 million Bitcoin, and it somehow manages to bypass all other sanity checks, the network will still reject it because the amount exceeds MAX_MONEY. So MAX_MONEY is not directly related to total supply, but as you have observed, many alts will set MAX_MONEY to the expected total supply over the lifetime of the coin.
For a pure proof-of-work coin with consistent reward scheme (eg halving every X blocks) the total supply can be pre-calculated, but a future fork could change that.
For a typical proof-of-stake or hybrid proof-of-work and proof-of-stake coin, the maximum supply can be estimated by simulation, but the exact amount will vary depending on network activity.
(This assumes there is not another part of the code that cuts off all rewards after a limit is reached.)

what if the ethereum accounts balance value low than per eth.sendTransaction gas cost, Can the little ether transfer to another account?

What if the ethereum accounts balance value low than per eth.sendTransaction gas cost, Can the little ether transfer to another account?
Can the gas cost default account pointer to another?
eth.sendTransaction({from:eth.accounts[1], to: eth.accounts[2], value:50000000000000}) //the value low the gas cost 21000
I0318 00:24:21.360815 internal/ethapi/api.go:1143] Tx(0x33b58084a35e99245b9c931204a0d161b9d00f9fae5ffb307aff29f200e5cd30) to: 0x49fbd70ca9f90972806c375a111d08950d203f96
"0x33b58084a35e99245b9c931204a0d161b9d00f9fae5ffb307aff29f200e5cd30"
what if eth.getBalance(eth.account[1]) < gas cost 21000, can the execution be successful ?
The simple answer is, if you don't have enough ether to make a successful transaction, the transaction will fail. You always need enough Ether to fund your transactions.
Having less than the required gas cost value will result in your small Ether amount not being able to be moved until the cost to move the Ether is small enough for you to afford.