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

feat(staking): implement new staking design changes #189

Merged
merged 14 commits into from
Oct 15, 2024
Merged

Conversation

Ramarti
Copy link
Contributor

@Ramarti Ramarti commented Oct 11, 2024

  • removes slashing contract, unjail goes to staking
  • staking periods
  • delegation id
  • token type

issue: #184

@Ramarti Ramarti changed the title feat(staking): implement new staking design changesStaking changes feat(staking): implement new staking design changes Oct 11, 2024
@limengformal limengformal marked this pull request as ready for review October 15, 2024 19:39
contracts/script/GenerateAlloc.s.sol Outdated Show resolved Hide resolved
contracts/script/GenerateAlloc.s.sol Outdated Show resolved Hide resolved
contracts/script/GenerateAlloc.s.sol Show resolved Hide resolved
contracts/script/GenerateAlloc.s.sol Outdated Show resolved Hide resolved
contracts/script/GenerateAlloc.s.sol Show resolved Hide resolved
Copy link
Contributor

@ezreal1997 ezreal1997 left a comment

Choose a reason for hiding this comment

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

setup a single node network locally based on this branc, it works
LGTM

@limengformal limengformal merged commit f021bb9 into main Oct 15, 2024
6 checks passed
@limengformal limengformal deleted the staking-changes branch October 15, 2024 21:02
Copy link

Binary uploaded successfully 🎉

📦 Version Name: 0.12.0-unstable-f021bb9
📦 Download Source: AWS S3

)
external
payable
override

Choose a reason for hiding this comment

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

The override modifier might not be necessary here, since this contract doesn’t inherit from any other contract.

Comment on lines +473 to +477
(uint256 stakeAmount, ) = roundedStakeAmount(msg.value);
if (stakeAmount < minStakeAmount) {
revert Errors.IPTokenStaking__StakeAmountUnderMin();
}
emit Redelegate(delegatorUncmpPubkey, validatorUncmpSrcPubkey, validatorUncmpDstPubkey, delegationId, amount);

Choose a reason for hiding this comment

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

It would be add comments to explain why we don't need to refund remainder of roundedStakeAmount().

Choose a reason for hiding this comment

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

If I understand correctly, the remainder will stay in the source validator. If that’s the case, we might explain how do we handle the remainder in the source validator, especially since it’s likely that the remainder will be less than the minStakeAmount. we might better add comments to explain why it is expected state/behavior.

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