question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Permit all invocations of this type on this contract

See original GitHub issue

Describe the solution you’d like and the expected behavior

When a user is prompted to permit an invocation, provide a checkbox to “always permit this action for this contract”. If the user ticks the checkbox before approving the modal, then future invocations that will have prompt should instead be automatically approved.

Is your feature request related to a problem? Please describe.

There are some types of invocations that a user might always trust. An example would be invoking a “sendMessage” transaction in a chat app. Having to approve every single message being delivered via nOS would make this cumbersome.

screen shot 2018-07-28 at 9 36 45 am

Possible implementation / References

User setting should be saved in local storage.

The option to always approve invocations should be for a specific command on a specific smart contract (hash) on a specific network (e.g.: TestNet). If any of these three items does not match on a subsequent invocation request, then the user should still be prompted (and in turn given the option to auto-approve that invocation command as well).

Invocation occurs via the components under src/renderer/browser/components/RequestsProcessor/Invoke. The index.js container will need to be modified to automatically approve via onConfirm and render immediately (to prevent chaining children in the HOC). That logic will need to appear before the withPrompt HOC is called.

Additional context

nOS should be secure, but also convenient.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
deanpresscommented, Jul 29, 2018
  1. There should be a way so that a developer can update the info on the UI when the transaction is confirmed on blockchain. Not sure how this can be done - maybe websockets. This will prevent the multiple testinvocation calls to query whether the state has been updated.

We’re planning to integrate new block events into the API, see #54

1reaction
shashank-ezdiagnocommented, Jul 29, 2018

I would like to suggest an improvement for the way invocations are done. Invocations usually cost gas and the user might not be aware that it takes some time between invocation and the reflection of results. So, the user might try to make the same invocation multiple times. In order to save gas and possibly prevent bots:

  1. There should be a rate-limit on the number of invocations that can be made per unit time.
  2. Prevent multiple successive invocations of the smart contract with same parameters.
  3. There should be a way so that a developer can update the info on the UI when the transaction is confirmed on blockchain. Not sure how this can be done - maybe websockets. This will prevent the multiple testinvocation calls to query whether the state has been updated.
Read more comments on GitHub >

github_iconTop Results From Across the Web

All invocation on the mock must have a corresponding setup
I created a first moq test but I am getting the following exception: Moq.MockException:IConnection.SendRequest(ADF.Messaging.Contract.ConfigServer.
Read more >
Main function and Entrypoints - LIGO
A LIGO contract is made of a series of constant and function declarations. Only functions having a special type can be called when...
Read more >
Calling Between Programs | Solana Docs
The Solana runtime allows programs to call each other via a mechanism called cross-program invocation. Calling between programs is achieved by one program ......
Read more >
Invoking Smart Contracts - Neo Documentation
Invocation permission ; Permissions of contract A include contract B · Contract A and contract B are in the same groups and the...
Read more >
@Contract | IntelliJ IDEA Documentation - JetBrains
The @Contract annotation is used for defining a contract that a method must meet. This lets the IDE find problems in methods which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found