I'm busy optimising my Solidity contract and I noticed some behaviour I don't understand.
When I add the following two getter functions:
function getBaseReward() external view returns (uint256) {
return _baseReward;
}
function getMaxBonuses() external view returns (uint256) {
return _maxBonuses;
}
The compiled contract size increases by 0.12kb and the text size of the functions on their own is 0.16kb. They are not very different.
However when I add this function:
function burn(uint256 amount) external {
onlyOwner();
_burn(msg.sender, amount);
}
The compiled contract size increases by 0.87kb but the text size of the function is only 0.08kb. That's about 10x more and it's just calling two internal functions. Why is the size increase so out of proportion?