-
Notifications
You must be signed in to change notification settings - Fork 82
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(contracts): fix interface of ValidatorManager
, AssetManager
#346
feat(contracts): fix interface of ValidatorManager
, AssetManager
#346
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
4495f08
to
5e002ca
Compare
packages/contracts/contracts/L1/interfaces/IValidatorManager.sol
Outdated
Show resolved
Hide resolved
uint128 lastDelegatedAt; | ||
uint128 rewardPerKghPaid; | ||
uint256 kghNum; | ||
mapping(uint256 => uint128) delegationHistory; |
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.
Why do we need this?
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.
Since kroShares
can be 0, there are no way to confirm if a tokenId is delegated exactly by the delegator without this mapping. Welcome for any other idea!
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.
If we have delegationHistory
, we can remove lastDelegatedAt
and manage undelegation using the history mapping
5e002ca
to
738760a
Compare
uint256 tokenId | ||
) external view returns (uint128); | ||
address delegator | ||
) external view returns (uint256); |
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 about this, is the return data of uint256 intended?
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.
Do you think it's better to be uint128?
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.
Unify the types. uint128
is used above.
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.
I was just wondering if it will be used in other parts like in ValidatorManager. Then uint128
will be better, but if it is only used for retrieving information on frontend, uint256
fits better imo.
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.
I changed the return type for can~At
functions to uint128
. I thought these view functions can be used in AssetManager
as canFinalizeCommissionChangeAt
used in ValidatorManager
.
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.
Btw then shouldn't it be public, not external function?
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.
Yep but since it's interface, the function cannot be public. We need to change it to public in implementation contract.
cccc3e8
to
1ecf373
Compare
1ecf373
to
e8ab665
Compare
104b313
into
feat/implement-validator-system-v2
No description provided.