0

I'm using the 0x API on my smart contract.

Is there any available API/tool to parse the bytecode from the 0x API ?

That would enhance my productivity.

2 Answers 2

0

Yes their is way you can decode.

    struct _0xSwapDescription {
    address inputToken;
    address outputToken;
    uint256 inputTokenAmount;
}

and then you can pass 0x api data to following line

            ( _0xSwapDescription memory swapDescriptionObj) = abi.decode(_0xData[4:], (_0xSwapDescription));

In Most cases it will solve this . But if 0x is trying to run feature like function sellTouniswap or sellToPancakeswap. then above will not return correct error.

0

We've also built a tool called 0x-debug that is quite helpful for ABI decoding calldata returned by the 0x API: https://github.com/0xProject/0x-debug

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.