Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] SmartContract Usability Improvements #62

Open
navis83 opened this issue Sep 9, 2020 · 0 comments
Open

[Feature Request] SmartContract Usability Improvements #62

navis83 opened this issue Sep 9, 2020 · 0 comments

Comments

@navis83
Copy link

navis83 commented Sep 9, 2020

Hello, in last week I tried to create, deploy and use my own SmartContract that in few words provides both methods changing the internal contract variable status and others that won't change them.
Here I report my analysis and possible suggestions to improve SmartContract definition and usability

  • SmartContract SDK: there is not any SDK allowing to define a smart contract with latest available sc-api-support which I had to extract from contract-executor.jar to make tests on implemented functionalities --> It would be better to have an example project including different SmartContract templates (Token Template, Elaboration Template, etc) which user can easily clone and use in its workspace before to deploy on BlockChain

  • SmartContract Search Engine: there is not any service allowing to search for available SmartContracts, making the first creation more difficult as the online documentation is not always aligned to latest available sources --> it might be useful to create a service to search deployed smartcontracts based on their main description/name or method description/name avoiding to create new SCs if there is one already created for something

  • SmartContract Update: there is no way to update/change/fix/delete/invalidate a smartcontract, so once performed the deployment of a wrong Smartcontract, it cannot be removed anymore from blockchain, allowing anyone to loose money using that. More, if there is a little bug (because I remember there is not SDK to test it exhaustively before MainNet) the owner cannot fix it. --> it might be have sense to consider a possible way to update smartcontracts, for example adding a status on it which owner can change in order to make it ONLINE, OFFLINE, INVALIDATED, causing respectively the usability, not usability or dis-mission of specific SC. About SC update, it might be considered an INVALIDATION of previously defined SC, new deployment of new one and redirect from INVALIDATED to new ONLINE one which has also its own Address.

  • Java Based SmartContract, Inheritance and Overloading: currently, the only way to reuse a smartcontract is to directly request it from new smartcontract, causing double fees payment because of double smart contract execution --> I think that if "SmartContract Search Engine" is available, it would be easy to identify available SmartContract source to be extended and overloaded in some cases, as the contracts are available in the blockchain and can be identified as in java by package.Name, not necessarily with address. So my suggestion is to consider the inheritance and overloading for smart contracts, reducing their number and making them more used

  • SmartContract execution, status change and related fees:
    -- whenever a SC method is requested, the SC is executed on blockchain causing a consensus amount trusted nodes for its execution. I assume that such consensus is required if there is a smartcontract status change, but if there is not, why execute a consensus? --> I think that if the requested operation is an operation not changing the status, the consensus is not required as nothing is written on blockchain.
    -- From development point of view, there is a limitation about "failed status change operations": currently, the client using the smartcontract can provide the "notSaveNewState" parameter in order to inform the executor that the status has to be saved or not, but what happen if during the operation execution there is an error? The status is saved however without real change of Smartcontract status, charging the client about the status change fees.--> I think it would be better to introduce in smart contract operation like commit() / rallback() to be used in code when execution is finished in order to properly save the status of SmartContract on blockchain or rallback to previous status in case of failure, avoiding unuseful Blockchain change and extra client fees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant