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

Staking example #58

Merged
merged 10 commits into from
Sep 1, 2023
Merged

Staking example #58

merged 10 commits into from
Sep 1, 2023

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Aug 29, 2023

A simple staking contract with rewards.

There are two types of users: stakers and beneficiaries.

A staker deposits tokens on ZetaChain and provides a beneficiary address. A staker can have only one beneficiary.

Only the beneficiary can claim rewards. Only the staker can unstake. When the tokens are unstaked by the staker, the beneficiary receives the rewards. To prevent the staker from changing the beneficiary by staking more tokens (by calling stakeZRC), the beneficiary is only set when the first staking happens. It would be interesting to add an ability for the staker to change beneficiary if the staking amount is 0.

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@zetachain/toolkit 2.1.1 network +55 12 MB lucasjanon
@typescript-eslint/eslint-plugin 5.62.0 None +1 2.52 MB jameshenry

@socket-security
Copy link

socket-security bot commented Aug 31, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: [email protected]

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@fadeev fadeev marked this pull request as ready for review August 31, 2023 13:48
@fadeev
Copy link
Member Author

fadeev commented Aug 31, 2023

@SocketSecurity ignore es5-ext@*

@fadeev fadeev merged commit 0a58ada into main Sep 1, 2023
4 checks passed
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