-
Notifications
You must be signed in to change notification settings - Fork 105
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
[WIP] ERC20 Token Program #942
Conversation
pub fn owner_check(program: &Program<StateKey>, actor: Address) { | ||
assert!( | ||
get_owner(program) == actor, | ||
"caller is required to be owner" | ||
) | ||
} |
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.
You could actually write an extension trait for the Context
to call context.is_owner()
directly.
Co-authored-by: Richard Pringle <richard.pringle@avalabs.org> Signed-off-by: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com>
Co-authored-by: Richard Pringle <richard.pringle@avalabs.org> Signed-off-by: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com>
.expect("failed to get sender balance") | ||
.unwrap_or_default(); | ||
|
||
assert!(sender_balance >= amount, "invalid input"); |
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.
Is this the mechanism we want to be using for checking conditions?
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 think that we need to figure out #595
Is this PR doing what I think it is doing? If you are adding ERC20 to HyperSDK, that is such a sad thing for me to see. We have an opportunity to do something much better and ERC20 is a huge step backwards. |
This PR has become stale because it has been open for 30 days with no activity. Adding the |
No description provided.