daksh
@dakshk.eth
hey EVM devs, I had a question, I've seen many contracts having a internal function and then a public function, calling that function itself. what's wrong with making that internal fn an external/ public fn?
2 replies
0 recast
0 reaction
daksh
@dakshk.eth
eg: transfer function just calls the _transfer function. similarly many variables are private and there are view fn created for them, how would it be different from creating a public variable? https://i.imgur.com/jG3Ug9w.jpg
0 reply
0 recast
0 reaction
Naman
@alchemist
This solidity pattern is to firstly abstract the fundamental action i.e to make the necessary checks required for the "transfer"(internal) operation. Then the implementation of a new "transfer"(public) can be written according to the app by overriding it etc.
1 reply
0 recast
0 reaction