1. state variables can be packed into fewer storage slots
If variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (20000 gas). Reads of the variables are also cheaper.
change the position of line 26 to after a address state variable:
1. state variables can be packed into fewer storage slots
If variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (20000 gas). Reads of the variables are also cheaper.
change the position of line 26 to after a address state variable:
2. state variables should be cached in stack variables rather than re-reading them from storage
marketPlace
in functionsetMarketPlace
:maturityRate
in functionaddNotional
:maturityRate
in functionremoveNotional
:maturityRate
in functionredeemInterest
:maturityRate
in functiontransferNotionalFrom
:maturityRate
in functiontransferNotionalFee
:feeChange
in functionsetFee
:3. x = x + y is cheaper than x += y
Erc20.sol#L92
Erc20.sol#L114
Erc20.sol#L197
Erc20.sol#L202
Erc20.sol#L87
Erc20.sol#L109
Erc20.sol#L209
Erc20.sol#L214
VaultTracker.sol#L67
VaultTracker.sol#L68
VaultTracker.sol#L102
VaultTracker.sol#L174
VaultTracker.sol#L193
VaultTracker.sol#L194
VaultTracker.sol#L230
VaultTracker.sol#L234
VaultTracker.sol#L103
VaultTracker.sol#L175
VaultTracker.sol#L213
ZcToken.sol#L115
ZcToken.sol#L134
Swivel.sol#L121
Swivel.sol#L158
Swivel.sol#L193
Swivel.sol#L222
Swivel.sol#L287
Swivel.sol#L318
Swivel.sol#L348
Swivel.sol#L383
4. better to use
++i
thani++