Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long Revert Strings #66

Open
code423n4 opened this issue Dec 17, 2021 · 2 comments
Open

Long Revert Strings #66

code423n4 opened this issue Dec 17, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

Handle

Jujic

Vulnerability details

Impact

Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met.

Proof of Concept

https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/Dependencies/Whitelist.sol#L204

require(_ratio < 1100000000000000000, "ratio must be less than 1.10 => greater than 1.1 would mean taking out more YUSD than collateral VC");

Tools Used

https://planetcalc.com/9029/

Recommended Mitigation Steps

Shorten the revert strings to fit in 32 bytes.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Dec 17, 2021
code423n4 added a commit that referenced this issue Dec 17, 2021
@kingyetifinance
Copy link
Collaborator

@LilYeti: Related to issue #3 but saying shorten strings instead of for existing ones.

@0xtruco
Copy link
Collaborator

0xtruco commented Jan 14, 2022

Resolved this and #266 #249 #176 #161 #90 in
code-423n4/2021-12-yetifinance#28

@CloudEllie CloudEllie reopened this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

5 participants