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

NEP5 template Mint operation fails due to incorrect NEO/GAS token contract hash encoding #342

Closed
devhawk opened this issue Aug 26, 2020 · 1 comment · Fixed by #344
Closed

Comments

@devhawk
Copy link
Contributor

devhawk commented Aug 26, 2020

From the NEP 5 template:

static readonly byte[] NeoToken = "0xde5f57d430d3dece511cf975a8d37848cb9e0525".HexToBytes();
static readonly byte[] GasToken = "0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc".HexToBytes();

However, HexToBytes converts these directly to byte array w/o reversing the order.

2115 PUSHDATA1 DE-5F-57-D4-30-D3-DE-CE-51-1C-F9-75-A8-D3-78-48-CB-9E-05-25 # as script hash: 0x25059ecb4878d3a875f91c51ceded330d4575fde
2138 PUSHDATA1 66-8E-0C-1F-9D-7B-70-A9-9D-D9-E0-6E-AD-D4-C7-84-D6-41-AF-BC # as script hash: 0xbcaf41d684c7d4ad6ee0d99da9707b9d1f0c8e66

So when the Mint operation attempts to compare the script hashes from the notifications array to the NEO/GAS
script hashes stored in the contract, they never match

@ShawnYun
Copy link
Contributor

Yes, we should reverse it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants