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 #1

Merged
merged 77 commits into from
Apr 30, 2019
Merged

Staking #1

merged 77 commits into from
Apr 30, 2019

Conversation

bingen
Copy link
Contributor

@bingen bingen commented Nov 21, 2018

No description provided.

@bingen bingen self-assigned this Nov 21, 2018
@sohkai sohkai modified the milestones: A1 Sprint: 3.2, A1 Sprint: 4.1 Feb 4, 2019
@sohkai sohkai modified the milestones: A1 Sprint: 4.1, A1 Sprint: 4.2 Feb 18, 2019
@sohkai sohkai modified the milestones: A1 Sprint: 4.2, A1 Sprint: 4.3 Mar 4, 2019
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Mostly some small setup-related comments from an in-progress review


contract TestImports {
constructor() public {
// to avoid lint error
Copy link
Contributor

Choose a reason for hiding this comment

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

We can upgrade solium to eth-lint and use the new ignore syntax: https://github.com/aragon/aragon-apps/blob/master/apps/voting/contracts/test/TestImports.sol#L25

@@ -0,0 +1,218 @@
// Copied from https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/StandardToken.sol
Copy link
Contributor

@sohkai sohkai Mar 4, 2019

Choose a reason for hiding this comment

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

The token mocks used by aragon-apps are now available as part of @aragon/test-helpers

embark.json Outdated Show resolved Hide resolved
embark.json Outdated Show resolved Hide resolved
scripts/truffleit.sh Outdated Show resolved Hide resolved
"license": "(GPL-3.0-or-later OR MIT)",
"repository": "https://github.com/aragon/staking",
"devDependencies": {
"@aragon/apps-shared-migrations": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about just adding the file?

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated
},
"dependencies": {
"@aragon/test-helpers": "^1.0.1",
"@aragon/os": "^4.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's upgrade and pin this.

console.log(1)
const echidnaStaking = await EchidnaStaking.new()
//console.log(echidnaStaking.constructor._json)
console.log(2, echidnaStaking.address)
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we could clean this up a bit, or remove it (seems like we should be using the .sh version?)

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

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

Nice job @bingen! Looks really good, left some suggestions and questions as well, and some other cosmetic stuff. Let me know if I can help addressing those comments that you agree if it makes sense 🤗

contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Show resolved Hide resolved
contracts/Checkpointing.sol Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
contracts/Staking.sol Outdated Show resolved Hide resolved
bingen pushed a commit that referenced this pull request Apr 12, 2019
bingen pushed a commit that referenced this pull request Apr 15, 2019
- Add getLatestValue for Checkpointing
- Optimize Checkpointing binary search
- Add max locks per account
- Move stakedhistory into Account struct
bingen pushed a commit that referenced this pull request Apr 15, 2019
- Add getLatestValue for Checkpointing
- Optimize Checkpointing binary search
- Add max locks per account
- Move stakedhistory into Account struct
- Add getLatestValue for Checkpointing
- Optimize Checkpointing binary search
- Add max locks per account
- Move stakedhistory into Account struct
Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

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

LGTM! Left really minor comments 👏

contracts/Checkpointing.sol Show resolved Hide resolved
contracts/Checkpointing.sol Show resolved Hide resolved
contracts/Checkpointing.sol Outdated Show resolved Hide resolved
// assuming a safety max gas of ~6M, 5,000 locks is a safe value to avoid OOG issues
// it's a sanity check, because as lock uses unlockedBalanceOf, and it's the most expensive
// it's unlikely that locks enough could be created to brick the account
uint256 internal constant MAX_LOCKS = 5000;
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@bingen bingen merged commit 0840eac into master Apr 30, 2019
@sohkai sohkai deleted the embark branch July 24, 2020 09:37
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