code-423n4 / 2021-04-marginswap-findings

1 stars 0 forks source link

[Gas] Error codes #54

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Vulnerability details

Gas optimization suggestion:

If you want to reduce the deployment costs, consider using error codes as error messages. Now on revert, it returns long messages like "Contract not authorized to deposit for user". Longer messages need more space so a possible optimization is to store error codes (e.g. "F1") and map them with messages on the UI part.

Email address

pauliax6@gmail.com

Handle

paulius.eth

Eth address

0x523B5b2Cc58A818667C22c862930B141f85d49DD