Open code423n4 opened 2 years ago
isExercised
exercise
Setting the single attribute isExercised directly in exercise is cheaper than storing the full vault struct.
vault
Current:
Cally.sol#277
// mark the vault as exercised vault.isExercised = true; _vaults[vaultId] = vault;
Gas usage: 49631 avg, 65473 median, 87933 max
Optimized:
// mark the vault as exercised _vaults[vaultId].isExercised = true;
Gas usage: 48858 avg, 64413 median, 86873 max
Gas
Set
isExercised
directly inexercise
Setting the single attribute
isExercised
directly inexercise
is cheaper than storing the fullvault
struct.Current:
Cally.sol#277
Gas usage: 49631 avg, 65473 median, 87933 max
Optimized:
Gas usage: 48858 avg, 64413 median, 86873 max