I am programmaticlly deployment multiple contracts. I would like verify these on EtherScan. I have stued how OpenZeppelin cli does it internally. But to make sure I do it correctly I need to bridge the gap in the following bit:
I assume that the volume of contracts to be verified makes programmatic verification worthwhile (compared with doing it manually)?
You could look at the Etherscan documentation on using their API too, as this may be easier than repurposing some of the CLI code: https://etherscan.io/apis#contracts
I have now solved this issue. I lifted EtherScan verification code from OpenZeppelin SDK. I made some changes in it, so that it has better separation of concern . No dependencies in ZWeb3 or SDK internal classes. Then I also modified it to support constructor arguments in the contracts.
Now you can verify programmatically deployed contracts with one JavaScript function call.