I found one link for my question at: 2016 Link
I have got the following code from:link
function GasCost(string memory name,
function () internal returns (string memory) fun)
internal returns (string memory)
{
uint u0 = gasleft();
string memory sm = fun();
uint u1 = gasleft();
uint diff = u0 - u1;
return concat(name, " GasCost: ", stringOfUint(diff),
" returns(", sm, ")");
}
Somebody please explain me what is the name of the above function defining technique? and how to invoke the function GasCost(...) and how to define fun? Provide me the link for the tutorial also.
Zulfi.
function () internal returns (string memory)and the name isfun. See the edit for an example how to use GasCost. – Ismael Jan 03 '22 at 06:23