You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Witch.sol', 254, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 299, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 357, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 392, ' if (liquidatorCut > 0) {
'Witch.sol', 397, ' if (auctioneerCut > 0) {
'Witch.sol', 415, ' require(auction_.start > 0, "Vault not under auction");
G02: custom error save more gas
problem
Custom errors from Solidity 0.8.4 are cheaper than revert strings (cheaper deployment cost and runtime cost when the revert condition is met) while providing the same amount of information, as explained https://blog.soliditylang.org/2021/04/21/custom-errors/.
Custom errors are defined using the error statement.
gas optimization
G01: COMPARISONS WITH ZERO FOR UNSIGNED INTEGERS
problem
0 is less gas efficient than !0 if you enable the optimizer at 10k AND you’re in a require statement. Detailed explanation with the opcodes https://twitter.com/gzeon/status/1485428085885640706
prof
'Witch.sol', 254, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 299, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 357, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 392, ' if (liquidatorCut > 0) {
'Witch.sol', 397, ' if (auctioneerCut > 0) {
'Witch.sol', 415, ' require(auction_.start > 0, "Vault not under auction");
G02: custom error save more gas
problem
Custom errors from Solidity 0.8.4 are cheaper than revert strings (cheaper deployment cost and runtime cost when the revert condition is met) while providing the same amount of information, as explained https://blog.soliditylang.org/2021/04/21/custom-errors/.
Custom errors are defined using the error statement.
prof
'Witch.sol', 83, ' require(param == "ladle", "Unrecognized");
'Witch.sol', 101, ' require(initialOffer <= 1e18, "InitialOffer above 100%");
'Witch.sol', 102, ' require(proportion <= 1e18, "Proportion above 100%");
'Witch.sol', 103, ' require(
'Witch.sol', 107, ' require(proportion >= 0.01e18, "Proportion below 1%");
'Witch.sol', 188, ' require(cauldron.level(vaultId) < 0, "Not undercollateralized");
'Witch.sol', 199, ' require(limits_.sum <= limits_.max, "Collateral limit reached");
'Witch.sol', 254, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 255, ' require(cauldron.level(vaultId) >= 0, "Undercollateralized");
'Witch.sol', 299, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 312, ' require(liquidatorCut >= minInkOut, "Not enough bought");
'Witch.sol', 327, ' require(baseJoin != IJoin(address(0)), "Join not found");
'Witch.sol', 357, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 364, ' require(liquidatorCut >= minInkOut, "Not enough bought");
'Witch.sol', 394, ' require(ilkJoin != IJoin(address(0)), "Join not found");
'Witch.sol', 415, ' require(auction_.start > 0, "Vault not under auction");
'Witch.sol', 436, ' require(
G03: X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES
prof
'Witch.sol', 258, ' limits[auction_.ilkId][auction_.baseId].sum -= auction_.ink;
The text was updated successfully, but these errors were encountered: