40,000 USDC
View results
Submission Details
Severity: gas
Valid

Switch OZ to Solmate

Summary

Solmate's implementation of the libraries used on the protocol are more optimized saving gas to the user.
The changes on the gas consumption could be seen below:

Test result: ok. 25 passed; 0 failed; 0 skipped; finished in 118.07ms
testSameSaltReverts() (gas: -3184 (-0.000%))
testConstructorBuyerZeroReverts() (gas: -109 (-0.184%))
testConstructorTokenZeroReverts() (gas: -109 (-0.185%))
testRevertsIfTokenTxFails() (gas: -6468 (-0.857%))
testRevertIfFeeGreaterThanPrice() (gas: -1472 (-1.044%))
testSellerZeroReverts() (gas: -1472 (-1.049%))
testConfirmReceiptRevertsOnTokenTxFail() (gas: -109687 (-7.714%))
testResolveDisputeWithBuyerAward() (gas: -103808 (-12.229%))
testResolveDisputeTransfersTokens() (gas: -103808 (-12.235%))
testResolveDisputeZeroSellerTransfer() (gas: -103208 (-12.866%))
testResolveDisputeChangesState() (gas: -103201 (-12.934%))
testCanOnlyResolveInDisputedState() (gas: -102569 (-13.244%))
testCanOnlyConfirmInCreatedState() (gas: -102561 (-13.363%))
testCanOnlyInitiateDisputeInConfirmedState() (gas: -102575 (-13.384%))
testTransfersTokenOutOfContract() (gas: -102575 (-13.386%))
testResolveDisputeFeeExceedsBalance() (gas: -101977 (-13.386%))
testConfirmReceiptEmitsEvent() (gas: -102575 (-13.395%))
testStateChangesOnConfirmedReceipt() (gas: -102575 (-13.397%))
testCreatingEscrowEmitsEvent() (gas: -103830 (-13.408%))
testInitiateDisputeEmitsEvent() (gas: -101974 (-13.436%))
testInitiateDisputeChangesState() (gas: -101974 (-13.449%))
testCreatingEscrowHasBuyerActuallyBeBuyer() (gas: -101974 (-13.533%))
testComputedAddressEqualsDeployedAddress() (gas: -102511 (-13.583%))
testDeployEscrowFromFactory() (gas: -101974 (-13.818%))
testOnlyArbiterCanCallResolveDispute(address) (gas: -101974 (-13.822%))
testInitiateDisputeWithoutArbiterReverts() (gas: -101974 (-13.838%))
testConfirmReceiptOnlyByBuyer() (gas: -101976 (-13.853%))
testOnlyBuyerOrSellerCanCallinitiateDispute(address) (gas: -101974 (-13.867%))
testConfirmReceiptOnlyByBuyerFuzz(address) (gas: -101975 (-13.874%))
testTokenZeroReverts() (gas: 55174 (234.056%))
Overall gas change: -2322869

Impact

Tools Used

Manual Review

Recommendations

Change OZ to Solmate on every file.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.