-
Notifications
You must be signed in to change notification settings - Fork 86
Decoded transactions should refer to classes/entities rather than standards #58
Comments
Do graphql interfaces factor into this at all? It seems like it might be hard to bucket multiple ERCs into one abstraction. Either way, I think ethql should expose the underlying ERC spec(s) that the contract implements. |
@pcardune I've had some doubt about this. My conclusion in that ERC specs can specify changes in behaviour that are not visible from the outside. For example ERC223 introduces a behaviour change in the This makes it inaccurate for ethql report a contract as ERC20 when it could be implementing ERC223 too. We could consider a type Furthermore, there could be an upcoming standard (let's call it ERCnnn) that introduces a new public function Additionally we have ERC777 which uses different naming for all functions (intentionally), but the abstraction at hand is token after all. End users could see this as an implementation detail – and will likely prefer not having to create polymorphic queries to cover both ERC20 and ERC777. WDYT? I do agree ethql should give users the ability to introspect a contract to determine possible ERC standard(s) it implements. I've come up with an algorithm for this. Was planning to work on it separately, but I could share the details if you want to collaborate. |
@pcardune ping, just wanted to check if the above ^^ makes sense to you? Will be sending a PR shortly with the change. Would you like to review? |
I guess the way I think about it is that providing higher level abstractions is a good thing, so long as there is an escape hatch. No matter how careful you are, your higher level abstraction is probably going to miss some detail that clients might need access to. The "escape hatch" is a mechanism for clients to get around the high level abstraction and go straight to the source. For example, solidity exposes an escape hatch by letting you write assembly inside your contracts. So, 👍 to having a higher level token API that covers all those ERCs. But, there should still be a way to dig under the covers and use the ERC-defined APIs directly, even if that means more complex queries. Perhaps this functionality would only be available to contracts that implement ERC165. |
An entity groups related ERC standards, providing an abstraction on what kind of concept they refer to. In this way, different token interfaces can co-exist while making it easy to filter for all token transactions in a block, regardless of the underlying ERC interface (e.g. ERC20, ERC777 or ERC20+ERC777). Resolves Consensys#58.
An entity groups related ERC standards, providing an abstraction on what kind of concept they refer to. In this way, different token interfaces can co-exist while making it easy to filter for all token transactions in a block, regardless of the underlying ERC interface (e.g. ERC20, ERC777 or ERC20+ERC777). Resolves Consensys#58.
An entity groups related ERC standards, providing an abstraction on what kind of concept they refer to. In this way, different token interfaces can co-exist while making it easy to filter for all token transactions in a block, regardless of the underlying ERC interface (e.g. ERC20, ERC777 or ERC20+ERC777). Resolves #58.
ethql should refer to classes or entities rather than specific standards. For example, all of ERC20, ERC223, ERC827 relate to tokens.
It is sometimes unfeasible (or hardly worthwhile) to distinguish exactly which standards a given contract implements (although it could be achieved if the contract implements ERC165, or by inspecting the bytecode). Users are generally concerned with the underlying entity.
In the future we might introduce "standards inference" as a functionality, but for now that's not the goal.
Tasks:
In the future, we'll introduce a NonFungibleTokenTxDecoder, in #33.
The text was updated successfully, but these errors were encountered: