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

Gas optimization uint8 to uint256 #2

Open
cleanunicorn opened this issue Apr 1, 2020 · 0 comments
Open

Gas optimization uint8 to uint256 #2

cleanunicorn opened this issue Apr 1, 2020 · 0 comments

Comments

@cleanunicorn
Copy link

https://github.com/bowd/defi-collector/blob/master/contracts/DYDXCollector.sol#L66

for (uint8 mi = 0; mi < numMarkets; mi++) {

It's not obvious but it's cheaper to use uint256 everywhere as opposed to uint8 because it doesn't need to "trim" the variables to the smaller size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant