cowprotocol/ethcontract-rs

Detect artifact formats automatically

Opened this issue · 0 comments

We could detect format of JSON artifacts automatically by inspecting their contents and looking at presence of certain keys. We could also use artifact source, i.e. etherscan artifacts are always plain ABI.

Not sure if it should be a separate format with its own struct, settings etc., or just a function. If we go with a separate format, I'd think about ArtifactLoader trait.

Also we could implement AbiFormat for plain ABIs, and stop wrapping etherscan response into curly brackets.