feat(misc): examples: validator rewards with ERC20 minting#1200
Merged
feat(misc): examples: validator rewards with ERC20 minting#1200
Conversation
Co-authored-by: Eric Tu <6364934+ec2@users.noreply.github.com> Co-authored-by: Mikers <snissn@gmail.com> Co-authored-by: raulk <raul@protocol.ai> Co-authored-by: Shashank Trivedi <100513286+lordshashank@users.noreply.github.com>
…pc into simple-genesis
Co-authored-by: Karel Moravec <moravec.wdd@gmail.com>
Co-authored-by: Karel Moravec <moravec.wdd@gmail.com>
…pc into simple-genesis
Co-authored-by: raulk <raul@protocol.ai>
added 3 commits
November 15, 2024 14:55
…ard/ipc into integration/rewards
karlem
reviewed
Nov 15, 2024
| subnetId = id; | ||
| } | ||
|
|
||
| function disburseRewards(SubnetID calldata id, ValidatorSummary calldata summary) external { |
Contributor
There was a problem hiding this comment.
Out of interest. How do we recommend to secure this? Surely not just everyone should be able to claim to rewards?
Contributor
Author
There was a problem hiding this comment.
only the subnet actor can call this function, there is a check below.
Co-authored-by: cryptoAtwill <willes.lau@protocol.ai> Co-authored-by: cryptoAtwill <108330426+cryptoAtwill@users.noreply.github.com>
raulk
approved these changes
Nov 27, 2024
Contributor
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding an example contract that mints erc20 token for validators to claim their rewards. Integration test is also included as an illustration purposes.