-
Notifications
You must be signed in to change notification settings - Fork 15
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: PIP-42 change token to POL #4
Conversation
Quality Gate passedIssues Measures |
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.
The successful conversion from MATIC
to POL
is assured, whereas the reverse may not be as reliable. This discrepancy warrants further discussion. Presently, there is a trend of conversions from POL
to MATIC
occurring in the following operational contexts:
The _transferToken
function includes an option to convert POL
to MATIC
, through following paths -
- Drain actions performed by Governance
unstakeClaim
_liquidateRewards
function, further segmented into:withdrawRewards
function_unstake
operations, encompassing:forceUnstakeLegacy
functionunstakeLegacy
functiondethroneAndStakeLegacy
function
uint256 heimdallFee /** for new validator */ | ||
) external onlyWhenUnlocked { | ||
function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee) | ||
/** |
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.
This comment seems out of place.
|
||
function _delegationDeposit(uint256 amount, address delegator, bool pol) internal returns (bool) { | ||
IERC20 token_ = _getToken(pol); | ||
bool result = token_.transferFrom(delegator, address(this), amount); |
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.
Can refactor this -
_transferTokenFrom(delegator, address(this), amount, pol)
Unstake only active validators
Fix/pol upgrade review
Quality Gate failedFailed conditions |
Motivation
Transition
StakeManager
to POL.See PIP-42 discussion
Solution
Use POL by default in
StakeManager
.Add legacy support for MATIC <> POL conversion in
StakeManager
andValidatorShare
.Todo
StakeManager
.StakeManager
to POL.DefaultEmissionManager
inpol-token
repo to not unmigrate rewards. See pol-token/pull/60