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

TokenStaking: method to increase authorization to max #161

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

Conversation

vzotova
Copy link
Contributor

@vzotova vzotova commented Nov 29, 2023

Based on #159

This new method will be useful for new stakers especially when TokenStaking will have more than 2 approved applications

@vzotova vzotova self-assigned this Nov 29, 2023
Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7037152523 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7037171903 check.

Copy link

github-actions bot commented Dec 1, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7053764375 check.

@vzotova vzotova changed the title [WIP] TokenStaking: method to increase authorization to max TokenStaking: method to increase authorization to max Dec 1, 2023
@vzotova vzotova marked this pull request as ready for review December 1, 2023 00:13
manumonti
manumonti previously approved these changes Mar 13, 2024
Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👌

theref
theref previously approved these changes Mar 27, 2024
@cygnusv cygnusv changed the base branch from main to scripts-fix March 27, 2024 12:23
@cygnusv cygnusv changed the base branch from scripts-fix to main March 27, 2024 12:23
@cygnusv cygnusv dismissed stale reviews from theref and manumonti March 27, 2024 12:23

The base branch was changed.

Copy link
Member

@cygnusv cygnusv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor comment

Comment on lines +402 to +405
if (amount == tStake) {
stakingProviderStruct.authorizedApplications.push(application);
authorizedApplications++;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to put this if block inside the if (amount > 0) block below? This can remove the need to make this check when amount == 0, which in any case wouldn't imply pushing a new app.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fan of nested if(s) and for(s) so basically here I'm trying to make it easier to read in expense of one additional check. If you think it's not great approach then I can change it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a strong opinion. If you prefer it this way, I'm fine with that 👍

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.

4 participants