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

在 encodeScriptFunctionByResolve 传入参数为 0x1 时报错 #49

Closed
WGB5445 opened this issue May 17, 2022 · 2 comments
Closed

在 encodeScriptFunctionByResolve 传入参数为 0x1 时报错 #49

WGB5445 opened this issue May 17, 2022 · 2 comments

Comments

@WGB5445
Copy link
Contributor

WGB5445 commented May 17, 2022

bug 复现方式:
版本: 2.1.4

在使用 utils.tx.encodeScriptFunctionByResolve 时 如果传入的 args 的数组中带有 0x1 地址则会报错误
reason: 'hex data is odd-length',
code: 'INVALID_ARGUMENT',
argument: 'value',
value: '0x1'

解决办法:
将 0x1 改为 0x01

@WGB5445
Copy link
Contributor Author

WGB5445 commented May 18, 2022

SDK 中不处理此项问题,应该在 Dapp 中解决并传入正确值

@WGB5445 WGB5445 closed this as completed May 18, 2022
@WGB5445 WGB5445 changed the title [bug] 在 encodeScriptFunctionByResolve 传入参数为 0x1 时报错 在 encodeScriptFunctionByResolve 传入参数为 0x1 时报错 May 18, 2022
@jolestar
Copy link
Member

hex 不自动补全,补全会有安全风险。但我们的地址是支持自动填充 0 的,其实可以考虑 sdk 支持下。其实应该是解析 address 的地方支持一下。

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

No branches or pull requests

2 participants