I was going through 0x on-chain docs and I saw the official example here which calls an arbitrary contract swapTarget whose address is given as a parameter. It seems a huge security pitfall, as it can be exploited by a bad actor using an attacking contract passed as swapTarget parameter. Is there a proper way to obtain the swapTarget address, apart from calling the 0x API directly from the contract itself via Chainlink AnyAPI service?

1 Answer 1


The target is currently always the same, so you can just use a whitelist.

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.