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

Fixes to improve readability and gas usage #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kyriediculous
Copy link
Member

  • Use OwnableUpgradeable instead of custom modifier
  • Fix typo
  • Use named struct params upon initialisation
  • Initialise checkpoints when registering a protocol
  • improve readability and gas usage of depositChecker
    • There's no need to store block.timestamp in a variable. MSTORE is at least 3 gas, MLOAD is also at least 3 gas while the TIMESTAMP opcode is 2 gas
    • The call to check the balance only needs to take place if the interval to check has elapsed
    • No need to call abi.encode with empty arguments. The memory is already initialized with a zero value bytes array because of named function params.

@kyriediculous kyriediculous requested a review from reubenr0d May 31, 2022 16:04
@height
Copy link

height bot commented May 31, 2022

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

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