Open mpetrunic opened 8 months ago
@mpetrunic Should I make a call to the upstream contract to get this information or just output what targets I have in this adapter?
I think you should make a call to our api endpoint (same one linked sdk is using) :)
Ah okay, since this seems to exist outside of the main tool, can I just write this in any language? Doing it with curl would make it easiest without having to add a chainlink dependency since this is all solidity. I could alternatively write it in Rust, but then that'd introduce a language dependency here that's unnecessary IMO.
But isn't foundry already using rust. I think other foundry packages added cli in rust I think
Foundry itself is written using Rust, but it encourages using solidity to write any scripts a project would need. This particular command would just be a utility that doesn't need to be in solidity (to avoid oracles), so as long as it's a command the user can run, it could be written in anything. I don't mind writing it in Rust, just that I can't find any example of a utility to a foundry project being written in it. Could you point me to one so I understand how they packaged it?
Indeed, then until forge adds http request cheatcode, you could try to use https://github.com/memester-xyz/surl and foundry's parseJson cheatcodes
Command should be something like
multichain listTargets --source sepolia --env testnet
and should return list ofdomainId, networkName
pairs that are available from source chain.It should implemented method similar to https://github.com/sygmaprotocol/sygma-sdk/blob/main/packages/sdk/src/utils.ts#L118 that uses sygma indexer API and "type=gmp"