A function signature is a summary the compiler keeps honest. Read the nine signatures in Solmate's ERC20 and you can say what a two hundred and six line contract does before you open a single body.
Your fourth contract, and your third token. This is Solmate's ERC20, the most modern of the three, and it is written to be inherited rather than deployed on its own. Two hundred and six lines, complete, banner comments and all.
Here is the claim this lesson rests on. Nine lines of this file will tell you almost everything it can be asked to do. Not the bodies, not the comments. Nine lines, after which you could describe the contract to someone who has never opened it.
There they are, and there are no others. One constructor and eight functions. Every remaining line in the file is a comment, a state declaration, or a body belonging to one of these nine.
The line that opens a function is called its signature, and it is the part the outside world deals with. A caller never sees a body. It sees a name, a list of what it must hand over, and a list of what comes back.
Take one and read it slowly. The word `function`, then the name `approve`, then a pair of brackets. Inside the brackets sit the parameters: each one a type and a label, in the order a caller must supply them.
So `address spender, uint256 amount` says this function needs an address and a number, in that order. You now know the exact shape of every call to it, and you have not looked below line 68.
After the brackets: `public virtual returns (bool)`. Three separate facts, each a single word or phrase, each one you can read without scrolling. We will take them one at a time over the next few steps.
So a signature answers four questions. What is it called, what must a caller bring, who is allowed to call it, and what comes back. Four answers for one line of reading. That is why signatures are the cheapest map of a file there is.
Function first: a marker saying a function may be called from outside the contract as well as from inside it. The name: public. Five functions carry it, and those five are the doors.
The other three carry `internal`, the word you met on Uniswap's helpers: reachable from this contract and from anything inheriting it, and from nowhere else. Two words, and the eight functions split into doors and machinery.