Description
There are a couple of gas inefficiencies in KittyMinting that could be resolved for significantly lower gas consumption:
- promoCreationLimit and gen0CreationLimit are both defined as variables. Making them
constant would allow the compiler to optimise them out, saving 40k of deployment-time gas, and ~200 gas each time they are read.
- createPromoKitty increments both variables, costing ~10k. Incrementing only
promoCreatedCount, and checking the sum of the two variables instead of each separately, would save ~5k gas at update time.
Description
There are a couple of gas inefficiencies in
KittyMintingthat could be resolved for significantly lower gas consumption:constantwould allow the compiler to optimise them out, saving 40k of deployment-time gas, and ~200 gas each time they are read.promoCreatedCount, and checking the sum of the two variables instead of each separately, would save ~5k gas at update time.