How to call a procedure of a public smart contract? #1146
Replies: 1 comment 2 replies
-
|
I'm assuming by "public smart contract" we mean an account that is managed by the network (e.g., there is an account deployed that anyone can update and the network will probably be the one updating it). This is different from foreign account though which is an account included in a given transaction as a "read-only" account. If the above is correct, the option 2 is the right way to go - but to touch on other options:
My assumption here is that if I'm interacting with a public smart contract, the creator of this smart built some "front end" for it. This front end would generate a transaction request which I'd be able to execute against my account. Let's take a counter contract as an example:
This whole process should be as transparent to the user as possible. For example, I go to the counter contract website, it prompts me to enter the increment value, once I do this a transaction request is generated and sent to my web wallet, the wallet prompts me to confirm the transaction, and then executes/submits it to the network. So, from the user's standpoint, they just enter the number and then click "confirm" on the message shown from the wallet. I think this all should be possible today - but we should double-check. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature description
What should be the standard behavior to call a public smart contract?
In Ethereum, it is quite normal to call smart contract functions of foreign accounts (to use the Miden terminology). In Miden, we need that feature whenever an account with a public shared state exists. As far as I understand, there are four ways to call a public smart contract function:
What should be the canonical way for which use case to use, and how would the smart contract owner and caller know and define it?
Especially when a builder of a public smart contract deploys such a contract. How does he express that it should be called via 2. or 4.? In MASM we cannot define that certain procedures should only be callable via note scripts but not transaction scripts. Do we need that?
Maybe this is already solved and thought through.
Why is this feature needed?
No response
Beta Was this translation helpful? Give feedback.
All reactions