You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some cases where the contract source code have been verified in Etherscan, for example this one dai, in those cases would be great if there is an option to start repl mode without passing the abi explicitly. Like how is it doing for ERC20 tokens.
Perhaps it could be something like: eth repl etherscanAbi@contractAddress
The text was updated successfully, but these errors were encountered:
Some notes for whomever implements this (including maybe my future self) after a failed attempt at doing it.
Interface
I think the most ergonomic interface is:
eth repl --mainnet https://etherscan.io/token/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359
You could argue that the --mainnet is redundant, since the network could be inferred from the etherscan URL, but let's just not go there. Note that the token in the URL could also be address and the result should be pretty much the same.
Also, I have no idea what name should be used for the loaded contract.
This might be an unauthorized use of the Etherscan API, I don't know. If that's the case, we could require an Etherscan API Key, although that would make this feature a lot less useful. Alternatively, we could bundle an API Key with eth-cli, if that's allowed.
Where to fetch the ABI
This is the part where I stumbled. I tried to do it inside loadABI, but that means converting it to an async function, and that caused a lot of other dependent functions to be converted too. I think we should do a big refactor and make a function that receives the raw arg and returns an object with the name, address and ABI. This function should be completely tested, since it would implement a logic that will be used in a lot of places.
There are some cases where the contract source code have been verified in Etherscan, for example this one dai, in those cases would be great if there is an option to start repl mode without passing the abi explicitly. Like how is it doing for ERC20 tokens.
Perhaps it could be something like:
eth repl etherscanAbi@contractAddress
The text was updated successfully, but these errors were encountered: