In the world of digital currencies, when should one use the 'public' visibility modifier in solidity instead of 'external'?
sholevvNov 24, 2021 · 3 years ago1 answers
When should one use the 'public' visibility modifier in Solidity instead of 'external' when dealing with digital currencies?
1 answers
- Nov 24, 2021 · 3 years agoWhen it comes to digital currencies, the choice between using the 'public' or 'external' visibility modifier in Solidity depends on the specific requirements of your contract. The 'public' modifier allows the function or variable to be accessed both internally and externally, making it suitable for cases where you need the function to be accessible by other contracts as well as external entities. On the other hand, the 'external' modifier restricts the access to only external accounts or contracts, which can be useful when you want to limit the access to certain functions or variables. For example, if you have a function that should only be called by external parties, you can use the 'external' modifier to ensure that it cannot be accessed internally. Ultimately, the choice between 'public' and 'external' depends on the specific use case and security requirements of your contract.
Related Tags
Hot Questions
- 87
How does cryptocurrency affect my tax return?
- 84
How can I protect my digital assets from hackers?
- 78
How can I minimize my tax liability when dealing with cryptocurrencies?
- 75
What are the tax implications of using cryptocurrency?
- 75
Are there any special tax rules for crypto investors?
- 74
What are the best digital currencies to invest in right now?
- 70
What are the best practices for reporting cryptocurrency on my taxes?
- 62
What are the advantages of using cryptocurrency for online transactions?