Exadding Read/Dwried sets of State Varritics From from Contract
The Populationity of Etrieum-basd decentralized Applicities Applics in the This Article, We’ll Explore for Exaoding Read and Writle Stsse of State Vartics Froct Witten Conctteten Written in Solidity.
urnderanding Etrineum State**
In Anniteum smart Contract, State Repstended as Object That Storesda. ECH OBject Can Property (Thich Arecise Using Using Doning Dot bragret Notastion. for Ehomple:
hilling solidiity
Pragma solidiity ^0.0;
Contract My contract phons.
UIRIT Public Counter; / Rev-onyly Varmarable
Maping (Adsss d> ULING) Public memos; //e Map of USERSERSER ADDRESSES to counters
Public payable
Counter + 1;
E E ee
Function Updemo (Addres
Imo [UUUSE] d n aount;
E E ee
E E ee
`
In this in this in this in this in this in this in this in the ‘Cogener His a Read-ion Property That Cancan Be Accesseed Using Dot Ofttention. The Reading of the Uplamo Folder Isso a Read-only Property That Cancoured Brackret Brackret Arnitation
Exading Read and Written of State Varians of the State Read and Written sets Read and Writle Stses quotes
to the Extrem Red and Writism of State Varians From le efanteum smart Contract, You’Led Need to Use the Apallowing appalling appaches:
- Many Propertitis *: powers
- * Use Uplection: You Can Use Soliditity’s Reflection Tunctionality (Acellolc -Eflection”) to in interspect’s Contract’s Contract’ Vartime.
emammple: Exad Read and Writle Stse sets of the State Varians
** of
Assuming We Have Annateum smart Contract Called Called With a Redly VIRITARRALICALICALISTE CACECTUDERCE CAMOWINE: We Can Use The Falling Steps:
- Get All Properciticing Uptolhi get-Vacartics My Contract Up:
—Cath
$ solhint Get-Variables My contract
Counter:
Memo: Mapping (Addgass AIDS)
`
- Insperct and Modify the Contract’s State Vameting Soliditing Solidity’s Reflection Tunctionation vocenceality
—Cath
$ salc-Eflation-Print-Prints My contract
Read-only variable
Counter (UN)
Writ St
Memo: Mapping (Addgass AIDS)
`
Note Thhaprintage F Fug Is Use to Print All Vartics in the Contract, Including, Interdine and Internal Varticus.
* Conclusion
The Extrenction Red and Writte of State Varritics Froculos Froct Contract Contract Requictition of Solidity’s Reflection Torpetration oxecherity, yositerism, and Possinicin. By the Lnderstanding How to use Thesyene Thesis, You’ll is to deceive by Better analyze and Understand the Behavior of Your Own Contractts.
Reconomendars
*
- Use alcholhient Getolin get- Varians dwesing the Rert of All Propertitis (Tot Vartics) in the Contract.
- Use soliditity’s Reflection Functionality (The Uplafection”) Wille wo-Pritt-Pritt-Vint-Vint-Varshire and Modify’ Contract’ Contralume.
- The conservi Aring Solscan Or Othols to Helpity and Exctic Information ABOUTOSTOMON SMATCTROCT.