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

Does the return data of precompile need abi.encode? #200

Closed
wuminzhe opened this issue Jun 30, 2022 · 1 comment
Closed

Does the return data of precompile need abi.encode? #200

wuminzhe opened this issue Jun 30, 2022 · 1 comment

Comments

@wuminzhe
Copy link
Collaborator

I prefer to remove abi_encode_bytes as it adds an unnecessary encoding and decoding process.

Ok(PrecompileOutput {
	exit_status: ExitSucceed::Returned,
	cost: helper.used_gas(),
	output: abi_encode_bytes(&output.unwrap_or_default()), <---
	logs: Default::default(),
})
@boundless-forest
Copy link
Member

It's not entirely correct. If playing with smart contracts with remix, it will do ethabi decode automatically. If we remove it, the code remix shows are wrong.

@wuminzhe wuminzhe added this to the v1.0 - S2S SDK milestone Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants