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 Optimizations #85

Open
code423n4 opened this issue Apr 2, 2022 · 1 comment
Open

Gas Optimizations #85

code423n4 opened this issue Apr 2, 2022 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

1. Can use stricter visibility: public constant variables can be set as private as code is open source and they are also in the docs
https://github.com/code-423n4/2022-03-paladin/blob/main/contracts/HolyPaladinToken.sol#L17-L39

2. Slight change in protocol design can save lots of gas paid for by users: function _updateDropPerSecond() is called with almost every interaction with the contract. This function adds minimum 2k gas to 6 different functions called by users and also on every transfer of tokens. Consider using a function that updates drop per second separately and allow anyone to call it, reward those who call it with a successful update with a small (slightly more than the price of gas) incentive, maybe in the native token. This will utilize MEV to the protocols advantage.
https://github.com/code-423n4/2022-03-paladin/blob/main/contracts/HolyPaladinToken.sol#L713-L742

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Apr 2, 2022
code423n4 added a commit that referenced this issue Apr 2, 2022
@Kogaroshi Kogaroshi added the duplicate This issue or pull request already exists label Apr 3, 2022
@Kogaroshi
Copy link
Collaborator

QA & gas optimizations changes are done in the PR: PaladinFinance/Paladin-Tokenomics#6
(some changes/tips were implemented, others are noted but won't be applied)

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

2 participants