KyberNetwork / smart-contracts

Main smart contracts for Kyber Network, including the main platform contract, reserve contracts etc.
https://kyber.network
MIT License
378 stars 341 forks source link

call MetaAggregationRouterV2 from other contract #1102

Closed bakeiro closed 7 months ago

bakeiro commented 7 months ago

Hi!

I'm starting a project and I plan to call MetaAggregationRouterV2 from another contract, idea it's to call the swap method with the data generated from api/v1/route/build question is, is this possible? or has some kind of whitelist or something?

Also, it's always the swap method the main method or I need to check the first bytes of the transaction call to see if other method is called? (0xe21fd0e => swap but maybe isn't always 0xe21fd0e?)

I tried to join the telegram channel but I'm unable to write messages 🙃 any help is welcome!

manhlx3006 commented 7 months ago

Hi, yes, you can call the MetaAggregationRouterV2 with the data from the build route:

The API supports 2 different methods, so it may return either:

bakeiro commented 7 months ago

ok, thanks for the info!