Tutorials:Read Contract: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
A smart contract is not a “user account.” It’s code + on-chain storage living at an address. People (wallets) send transactions to the contract address, and the contract updates its internal storage according to its rules. | |||
=Read Contract= | =Read Contract= | ||
| Line 9: | Line 11: | ||
[[File:Smart01.jpg|800px]] | [[File:Smart01.jpg|800px]] | ||
By clicking in the "contract" tab | By clicking in the "contract" tab, and then "read code" we can get some information from the contract itself: | ||
Click on Read Contract and see the field number 4: Initial_Reward field. | |||
The initial reward was 168 Spring tokens, but the number is written with 18 zeroes because it is given in "Wei" units. | The initial reward was 168 Spring tokens, but the number is written with 18 zeroes because it is given in "Wei" units. | ||
| Line 15: | Line 19: | ||
Wei is the smallest denomination of Ether (ETH) on the Ethereum network, named after cryptographer Wei Dai; one Ether equals one quintillion (10¹⁸) Wei, making Wei essential for precise transaction fees (gas) and microtransactions, similar to how a Satoshi is the smallest unit of Bitcoin. It allows for granular calculations, preventing rounding errors in the complex operations of smart contracts and decentralized finance | Wei is the smallest denomination of Ether (ETH) on the Ethereum network, named after cryptographer Wei Dai; one Ether equals one quintillion (10¹⁸) Wei, making Wei essential for precise transaction fees (gas) and microtransactions, similar to how a Satoshi is the smallest unit of Bitcoin. It allows for granular calculations, preventing rounding errors in the complex operations of smart contracts and decentralized finance | ||
In the field 18 we see the result of calling "Get Mining Reward" method, and it gives the current number of tokens per reward. Other interesting field is number 29: Tokens Minted, showing how many tokens have been minted so far. | |||
[[File:Smart012.jpg|800px]] | [[File:Smart012.jpg|800px]] | ||
=Token Tracker= | |||
Etherscan provides a Token Tracker page that combines: | |||
On-chain data (supply, holders, transfers, contract, decimals) | |||
Off-chain / reference data (token name/symbol, links, sometimes reputation indicators) | |||
in a single token-focused dashboard. | |||
==Exercise:== | ==Exercise:== | ||
Revision as of 20:49, 12 January 2026
A smart contract is not a “user account.” It’s code + on-chain storage living at an address. People (wallets) send transactions to the contract address, and the contract updates its internal storage according to its rules.
Read Contract
Let's have a look at the Spring Tokens Smart Contract in Ethereum:
0xf04aF3f4E4929F7CD25A751E6149A3318373d4FE
By clicking in the "contract" tab, and then "read code" we can get some information from the contract itself:
Click on Read Contract and see the field number 4: Initial_Reward field. The initial reward was 168 Spring tokens, but the number is written with 18 zeroes because it is given in "Wei" units.
Wei is the smallest denomination of Ether (ETH) on the Ethereum network, named after cryptographer Wei Dai; one Ether equals one quintillion (10¹⁸) Wei, making Wei essential for precise transaction fees (gas) and microtransactions, similar to how a Satoshi is the smallest unit of Bitcoin. It allows for granular calculations, preventing rounding errors in the complex operations of smart contracts and decentralized finance
In the field 18 we see the result of calling "Get Mining Reward" method, and it gives the current number of tokens per reward. Other interesting field is number 29: Tokens Minted, showing how many tokens have been minted so far.
Token Tracker
Etherscan provides a Token Tracker page that combines:
On-chain data (supply, holders, transfers, contract, decimals)
Off-chain / reference data (token name/symbol, links, sometimes reputation indicators) in a single token-focused dashboard.
Exercise:
Click on the Transactions tab and find the latest MINT transaction:
We will use it in the next quest.