-
Notifications
You must be signed in to change notification settings - Fork 7
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
Permissionless staking contract - Staker
#24
Conversation
Also removed package-lock.json from the git commit tree - not a good practice to include it for a package like our web3 contracts.
The docs it navigates are not easy to generate. I think doc generation should be subject of a different PR anyway.
Also made the following changes: - Gas profiling turned on or off using the `GAS_PROFILER` environment variable. Set it to `t`/`true`/`y`/`yes`/`1` in order to enable gas profiling. - Added prettier and prettier solidity plugin as dev dependencies.
That's the default value in mapping of staking pools for tokenType. Changed NATIVE_TOKEN_TYPE = 1.
Made it so that it updates on `make` when the contract is updated.
Working on tests.
... from staking pools which are configured to have non-transferable positions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example of tests template for hadhat:
https://github.com/G7DAO/achievo-contracts/blob/main/test/hardhatTests/englishAuctions.test.ts
Created a tool called `graffiti` to help with it.
In various conditions
Modified `initiateUnstake` to only emit in the first initiation
And added the corresponding tests. MAde a few small changes to the metadata itself.
Tests for 114 execution flows are ready:
|
Removed unused variables
uint256 tokenID; | ||
bool transferable; | ||
uint256 lockupSeconds; | ||
uint256 cooldownSeconds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking the total currently amount deposited into each staking pool.
This could aid in extension of smart contracts that wish to determine the amount their community has deposited for on chain/decentralized interactions. Such as a distribution mechanic. Since more then 1 pool can be created for Native, 20, 1155(tokenIds) and erc721.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrk-hub : This is a great suggestion. I will track:
- Total amount deposited into a pool.
- Number of positions opened under a pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current on page comments.
// TODO(zomglings): Change image URI | ||
'","image": "https://badges.moonstream.to/test/staking_logo.png"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: just double checking if this TODO needs to be addressed before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, confirmed. Working on getting an image from the design team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karacurt : We can change the URL once the design team has something for us.
These deploy and interact with Mock ERC20, ERC721, and ERC1155 token contracts for demo and testing purposes.
And split STAKER-120 into multiple flows. Renumbered the subsequent flows.
Added re-entrancy flows, need to write tests for these.
This pull request introduces a permissionless staking contract called the
Staker
.This contract is based on @kellan-simiotics 's design document: https://docs.google.com/document/d/14irHE06QxJDXJcNuXeN7UnVNTxqIGlOU8vwFe0CekQ4/edit?usp=sharing
It is also based on @kellan-simiotics 's earlier work on staking: #21
Invalidates #21 and #5