Neo: NEP5 inherit/extends from Native standard

Created on 23 May 2019  路  4Comments  路  Source: neo-project/neo

It would be incredibly safe for users if they manage to deploy some token contract that inherits from Native NEP5.
It could be something declared in the manifest, for example, "inheritsFrom" : "NEP5scripthash" (or done manually, or even as part of Contract.Create informing parent hashes). The expected result for a "transfer" operation is: before invoking my contract, first invoke NEP5scripthash "transfer" with the given parameters,then invoke my operations.
We could also do this manually if a native implementation is provided. For example:

Main (op , args )
if op == "transfer", invoke "super::transfer" with my own storage.

This would make it much safer and fast to develop contracts on Neo. Whats your thoughts ?

design feature ledger vm

Most helpful comment

Is a good feature, but instead of with native contracts, maybe with syscalls

All 4 comments

Very interesting.

Is a good feature, but instead of with native contracts, maybe with syscalls

Is a good feature, but instead of with native contracts, maybe with syscalls

I think that any hash can be provided as the "parent hash" (or multiple parents). If native, it will be like you said, syscall +name... anyway, it could be any deployed contract (even not native).

@igormcoelho would you like to work in this feature? We plan to have this in our next version. If you don't want to work on it, is it ok if we assign someone else to do it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canesin picture canesin  路  3Comments

doubiliu picture doubiliu  路  3Comments

vncoelho picture vncoelho  路  3Comments

lock9 picture lock9  路  4Comments

vncoelho picture vncoelho  路  4Comments