Skip to content
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

Closed
wants to merge 105 commits into from
Closed

[WIP] ERC20 Token Program #942

wants to merge 105 commits into from

Conversation

dboehm-avalabs
Copy link
Contributor

No description provided.

x/programs/rust/wasmlanche-sdk/src/state.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 30 to 35
pub fn owner_check(program: &Program<StateKey>, actor: Address) {
assert!(
get_owner(program) == actor,
"caller is required to be owner"
)
}
Copy link
Collaborator

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.

x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/Cargo.toml Outdated Show resolved Hide resolved
x/programs/test/programs/simple_token/src/lib.rs Outdated Show resolved Hide resolved
dboehm-avalabs and others added 3 commits May 27, 2024 21:16
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");
Copy link
Contributor Author

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?

Copy link
Contributor

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

@EricForgy
Copy link

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.

@dboehm-avalabs dboehm-avalabs changed the base branch from ImproveTestUtils to main June 13, 2024 19:12
Copy link

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will exempt this PR from future lifecycle events..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants