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

perf: optimized gas consumption by verifying deposit limit first #7

Closed
wants to merge 1 commit into from

Conversation

merdan-9
Copy link

I feel that the original order would consume more gas fees when the deposit amount exceeds the limit, so I changed the order.

original

uint256 amount = _depositFunds(msg.sender, IERC20(_l1Token), _amount);
_verifyDepositLimit(_l1Token, msg.sender, _amount, false);

new

_verifyDepositLimit(_l1Token, msg.sender, _amount, false);
uint256 amount = _depositFunds(msg.sender, IERC20(_l1Token), _amount);

@vladbochok
Copy link
Member

@merdan-9 Thank you for the PR! Do you have any evidence of gas consumption difference?

StanislavBreadless pushed a commit that referenced this pull request Sep 14, 2023
Rename diamondupgrade for matching the scripts
@vladbochok
Copy link
Member

Closing this PR as we are going to remove AllowList in one of the next upgrades.

@vladbochok vladbochok closed this Nov 3, 2023
koloz193 pushed a commit that referenced this pull request Dec 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants