-
Notifications
You must be signed in to change notification settings - Fork 40
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(misc): examples: validator rewards with ERC20 minting #1200
Conversation
Co-authored-by: Eric Tu <[email protected]> Co-authored-by: Mikers <[email protected]> Co-authored-by: raulk <[email protected]> Co-authored-by: Shashank Trivedi <[email protected]>
…pc into simple-genesis
Co-authored-by: Karel Moravec <[email protected]>
Co-authored-by: Karel Moravec <[email protected]>
…pc into simple-genesis
Co-authored-by: raulk <[email protected]>
…ard/ipc into integration/rewards
subnetId = id; | ||
} | ||
|
||
function disburseRewards(SubnetID calldata id, ValidatorSummary calldata summary) external { |
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.
Out of interest. How do we recommend to secure this? Surely not just everyone should be able to claim to rewards?
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.
only the subnet actor can call this function, there is a check below.
Co-authored-by: cryptoAtwill <[email protected]> Co-authored-by: cryptoAtwill <[email protected]>
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.
@cryptoAtwill LGTM! I adjusted this PR in minor ways:
- Removed your custom implementation of Ownable; let's always use OpenZeppelin's instead of reinventing the wheel.
- The minter can be the owner in this example; let's keep it simple.
- We don't need the MintableERC20 interface; you can use an actual contract as a contract type. Removed that.
Adding an example contract that mints erc20 token for validators to claim their rewards. Integration test is also included as an illustration purposes.