It's a bad example of an inherited constructor. I say "bad" because naming conventions would call for a CapsCase function name that would provide more of a hint.
This function can only be explained in a wider context of a contract with inheritance. Something like:
contract ParentToken {
function ParentToken(currentSupply, tokenName ...) {} // this is the constructor
}
contract foo is Class { // should be "Foo"
uint currentSupply; // need to get this value from somewhere ...
function foo()
ParentToken(currentSupply, tok...) { // stuff to pass to Parent's constructor
}
}
In older versions of Solidity, the convention was a function with the same name as the contract itself was treated as a constructor. In more recent versions, this is replaced with the keyword constructor
. It's less ambiguous and less error-prone.
contract ParentToken {
constructor(currentSupply, tokenName ...) {} // this is the constructor
}
contract foo is Class { // should be "Foo"
uint currentSupply; // need to get this value from somewhere ...
constructor foo()
ParentToken(currentSupply, tok...) { // stuff to pass to Parent's constructor
}
}
This answer may be deleted by the mods because the answer is the same as a previous question. I'm not sure that makes it a duplicate question.
Hope it helps.