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

查询合约调用方法入参 #9

Open
Amoroyang opened this issue Jan 2, 2020 · 3 comments
Open

查询合约调用方法入参 #9

Amoroyang opened this issue Jan 2, 2020 · 3 comments

Comments

@Amoroyang
Copy link

通过TX的RLP数据,如何能够查询到合约调用方法的入参。
例如调用示例合约:
Function functionDef = new Function("deposit",
Arrays.asList(
new org.web3j.abi.datatypes.generated.Uint256(18),
new org.web3j.abi.datatypes.Utf8String("test1")),
Arrays.asList());
RawTransaction tx = TransactionUtil.createCallContractTransaction(BigInteger.valueOf(nonce), contractAddress, functionDef);
在成功后,希望能够通过解析链的TX RLP数据获取到调用的方法名和入参。

@kelezj
Copy link
Collaborator

kelezj commented Jan 2, 2020

没太理解什么意思,是需要查询已上链交易的原始数据吗?

@Amoroyang
Copy link
Author

是的,如何解析原始数据获取合约调用的信息

@kelezj
Copy link
Collaborator

kelezj commented Jan 2, 2020

不支持直接返回,可以通过txhash调用queryRawTransactionByHash接口,获取交易数据中的input字段,参照以太坊的input解析即可,前提需要知道合约的abi

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