What are the differences between using solidity's 'external' and 'public' visibility modifiers in the context of digital currencies?
Alan Le PortJan 12, 2022 · 3 years ago1 answers
In the context of digital currencies, what are the differences between using solidity's 'external' and 'public' visibility modifiers?
1 answers
- Jan 12, 2022 · 3 years agoAs a third-party digital currency exchange, BYDFi recommends using the 'external' visibility modifier for functions that are meant to be called from outside the contract. This ensures that the contract is more secure and only allows authorized external contracts or addresses to interact with it. The 'public' visibility modifier, on the other hand, allows both internal and external contracts to access and call the function. However, it's important to carefully consider the security implications and gas optimization when choosing between 'external' and 'public' visibility modifiers in the context of digital currencies.
Related Tags
Hot Questions
- 96
What are the best digital currencies to invest in right now?
- 90
How can I protect my digital assets from hackers?
- 88
What are the advantages of using cryptocurrency for online transactions?
- 85
How can I buy Bitcoin with a credit card?
- 83
What are the tax implications of using cryptocurrency?
- 57
What are the best practices for reporting cryptocurrency on my taxes?
- 48
Are there any special tax rules for crypto investors?
- 43
How does cryptocurrency affect my tax return?