Gas Optimizations #200
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Custom error from solidity 0.8.4 are cheaper than revert strings, custom error are defined using the
error
statement can use inside and outside the contract.source https://blog.soliditylang.org/2021/04/21/custom-errors/
i suggest replacing revert error strings with custom error
POC :
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L56
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L61
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L66
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L67
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L69
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L89
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L91
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/factories/PairFactory.sol#L92
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L25
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L40
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L42
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L58
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L59
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L87
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L177
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L182
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L249
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L250
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L341
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L356
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L369
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L371
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L382
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L384
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Router.sol#L406
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L163
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L307
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L773
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L774
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L786
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L787
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L820
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L821
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L834
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L835
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L836
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L837
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L846
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L849
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1085
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1245
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1315
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1378
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1382
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/VotingEscrow.sol#L1386
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L303
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L322
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L336
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L338
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L344
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L353
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L361
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L467
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Pair.sol#L485
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Minter.sol#L65
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Minter.sol#L70
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Minter.sol#L75
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Minter.sol#L76
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Gauge.sol#L615
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Gauge.sol#L627
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Gauge.sol#L635
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Gauge.sol#L642
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Bribe.sol#L31
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Bribe.sol#L44
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Bribe.sol#L69
The text was updated successfully, but these errors were encountered: