I know that you can't define optional parameters in solidity, but what are the best patterns to imitate it? The only way I know it is function overloading but sometimes it doesn't fit.
Asked
Active
Viewed 465 times
1 Answers
1
You can use unnamed parameters (function parameters without any name) in Solidity. Unnamed parameters can be useful if you have a function that overrides another function (as in inheritance), but you only need certain parameters from that function. They are also often used for return parameters.
See:
Yongjian P.
- 4,170
- 1
- 3
- 10