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

Fix ABI buffer encoding #1674

Closed
janniks opened this issue Apr 17, 2024 · 0 comments · Fixed by #1680
Closed

Fix ABI buffer encoding #1674

janniks opened this issue Apr 17, 2024 · 0 comments · Fixed by #1680
Assignees
Labels
bug Unwanted or unintended logic causing harm

Comments

@janniks
Copy link
Collaborator

janniks commented Apr 17, 2024

I remember we've discussed this before, but I can't find or remember the answer. When calling a function, the explorer processes buff argument inputs as ascii instead of as hex. Is there any way to make it process the input as hex bytes?

Actually I think the problem is in stacks.js

case ClarityAbiTypeId.ClarityAbiTypeBuffer:
return bufferCV(utf8ToBytes(val));

(https://github.com/hirosystems/stacks.js/blob/f39637c924cc8b221f890a8bd9f8e0c9fb1f90e6/packages/transactions/src/contract-abi.ts)
case ClarityAbiTypeId.ClarityAbiTypeBuffer:
return bufferCV(utf8ToBytes(val));

@janniks janniks added the bug Unwanted or unintended logic causing harm label Apr 17, 2024
@janniks janniks self-assigned this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted or unintended logic causing harm
Projects
Archived in project
1 participant