code-423n4 / 2022-12-tigris-findings

8 stars 4 forks source link

Gas Optimizations #556

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

See the markdown file with the details of this report here.

GalloDaSballo commented 1 year ago

BondNFT#createLock can cache epoch[_asset]

100

BondNFT#extendLock can cache epoch[bond.asset] and avoid double calculation of bond.amount + _amount and bond.period + _period in order to save gas

100

BondNFT#claim math operation can be simplified

20

 BondNFT#claim can avoid multiple bondPaid[_id][bond.asset] access

300

BondNFT#distribute can cache epoch[_tigAsset] and move it calculation outside the for loop

5k

BondNFT#distribute can use storage pointer to save gas

100

Rest will save roughly another 1k

6620

c4-sponsor commented 1 year ago

GainsGoblin marked the issue as sponsor confirmed

c4-judge commented 1 year ago

GalloDaSballo marked the issue as grade-c