-
Notifications
You must be signed in to change notification settings - Fork 68
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
token standard: 0x address and fix token.lua code #941
base: main
Are you sure you want to change the base?
Conversation
return true | ||
end | ||
|
||
function isEthereumAddress(address) |
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've been using this:
function isEthereumAddress(address)
return #address == 42 and string.match(address, "^0x[%x]+$") ~= nil
end
But I should perhaps add the type(address) == "string"
to have:
function isEthereumAddress(address)
return type(address) == "string" and #address == 42 and string.match(address, "^0x[%x]+$") ~= nil
end
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.
This regular expression is more concise and my implementation is a bit more readable, I'm not very familiar with regulars, so the implementation is a bit more readable I guess
Cool @zyjblockchain. This would be cool to publish as an APM Module! |
I haven't tried APM, I'll check it out, oh it looks like you need a NEO token to use it. |
https://apm.betteridea.dev/pkg?id=6CodALD5aCaSByXrEqw2RcmkFWUQ8B9ZuN6VU-4IJtI |
Cool @zyjblockchain . I think developers can be directed to install your module from Perhaps instead, a note in the |
yes, I submitted it. |
Hello The token.lua in the standard library wasn't working, so I fixed it and submitted it to this pr |
The 0x address format implemented on ao is EIP55, which means that the recipient address for token transfers on ao must be in EIP55 format, or else the asset will be lost.
ao 0x address code:
https://github.com/permaweb/ao/blob/main/servers/cu/src/domain/utils.js#L487