madumas / ethsupply Goto Github PK
View Code? Open in Web Editor NEWLicense: ISC License
License: ISC License
The genesis supply constant should not be in the code, as it can be derived from block 0 transactions.
It's also off by a bit, probably by rounding.
Line 17 in bfb2c83
The script only assumes that certain amount of ETH has been issued while ignoring transactions and account balances.
If an account balance was edited, this script would not catch it.
Hey! The issuance used in this script is 72009990.50
. The exact issuance in WEI is 72009990499480000000000000
and in ETH is 72009990.49948
. These values can be generated from Geth here (RLP-encoded): https://github.com/ethereum/go-ethereum/blob/48b484c5ac537d1759c9903ce81302c298f03a84/core/genesis_alloc.go Open Ethereum here (json): https://github.com/openethereum/openethereum/blob/master/ethcore/res/ethereum/foundation.json, and Nethermind (json) here: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Chains/foundation.json
I think it's important to get this exactly right.
Hey, I think your calculations might start getting off as the cumulative sums increase down the blockchain. Using JavaScript's floating-point numbers is going to be inaccurate when dealing with decimal places. I recommend doing all calculations with BigNumber.js, and in WEI, then dividing by 10**18 to display the final result
"Calculates the total amount of Eth ever issued."
https://github.com/madumas/ethsupply/blame/master/README.md#L2
Hard coding an asserted result doesn't count as a calculation in the context of verification.
Line 17 in 04e4e14
Hey, I just published my script for total ETH issuance: https://twitter.com/lastmjs/status/1294742341593387008?s=20
I'm trying to collect reconciliations between these scripts. I'm documented the numbers in this table here: https://github.com/lastmjs/eth-total-supply#reconciliation
I would love some help on this! I've been running the numbers on your script, and I've already opened an issue for this, but the biggest problem I see is the genesis information you have is slightly off.
On lines 31,41 Bignumber division might be safer.
const totalReward = baseReward + baseReward * (1 / 32) * block.uncles.length;
Hi,
Please forgive my ignorance as I'm relatively new to Ethereum. I was wondering shouldn't we include transaction fees in block reward calculation?
When looking at various Statistics websites, I always see three numbers adding up to the total block reward:
static block reward + trx fees + uncle inclusion rewards + uncle rewards
Why are transaction fees not included in total supply calculation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.