I found a strange case and didn't find out why.
...
modifier onlyMaster() {
require(msg.sender == master || msg.sender == developer, "caller is not the master");
_;
}
...
Deploy Gas amount: 1183967
I tried to delete some words for saving deployment gas as follows.
...
modifier onlyMaster() {
require(msg.sender == master || msg.sender == developer, "caller is not master");
_;
}
...
Deploy Gas amount: 1186943
But the gas amount was increased against my prediction like this.
Other omissions decreased the gas amount but only this omission increased the gas amount.
So I created a very simple smart contract and tested it.
contract Demo {
address public master;
uint256 public callTimer;
function setMaster(address master_) external {
master = master_;
}
function demoFunction() external{
require(msg.sender == master, "caller is not the master");
callTimer++;
}
}
I removed "the" and the deploy gas amount was decreased just I thought.
I am sorry that I can't provide the whole code, but has anyone ever had a similar experience?
What's the reason?
FYI, the "caller is not the" string is not repeated in the smart contract.
onlyMaster
applies ?