explorer
explorer copied to clipboard
[sandbox] Allow setting post conditions or switch deny/allow mode
Please review the existing enhancement issues at the link below before creating a new one to ensure you do not create a duplicate request. If you see an existing enhancement issues please comment on the issue or upvote the issue with a :thumbsup:
Is your feature request related to a problem? Please describe. When sending MNO with the explorer/sandbox it does not add a post condition and hence fails in the default deny mode. https://explorer.stacks.co/txid/0x29439a1d33fa835a34e8542b4cca3715801beaa6771f71496fa309a849a88664?chain=mainnet
Describe the solution you'd like When I use (an outdated) chrome plugin to send MNO or Wrapped Nothing it does supply the necessary post condition automatically. Users of the sandbox may be more technically inclined so perhaps allowing some flexibility is okay here by allowing multiple choice options of post-conditions that are likely wanted based on the users transaction?
Example 1: Add post condition options for a transfer of 1B MNO:
0
in addition to the default
0
Example 2: Add options for post conditions when using an unwrap function (example transaction):
0
in addition to the default
0
Describe alternatives you've considered In one of the previous versions of the sandbox setting post conditions was possible in the confirmation screen, perhaps also prone to user error because of the many options and needing to type out the input. That is why I suggest multiple choice options. Another option could be to switch between "allow" and "deny" mode on the confirmation screen.
Additional context Add any other context or screenshots about the feature request here.
I'm moving to our backlog after a request from @obycode:
It would make the sandbox much more useful for developers wanting to test contracts before their frontends are ready. With no post-conditions and deny mode, the usefulness is very limited currently.
https://explorer.syvita.org/sandbox/
@LunarPunks can you post a screenshot? I'm not seeing post-condition options on the Syvita sandbox.
No No what i meant was if you set the conditions in your app, Syvita will let you excute them succesfully, unlike stacks explorer which is restricted. So you could set the no more than, equals etc .
I have run into several instances personally where this has blocked me from accomplishing something with a live contract from my web wallet. Not a web dev so I was not able to figure out how to hack it in from the developer console. If anyone could offer some advice or updates on this it would be much appreciated.
The syvita explorer is not available anymore. That used to be configured to send any transaction in allow mode by default. Not necessarily safe for the user but very convenient for power users that have already checked the contract they are calling or for testing (self-deployed) contracts.
I am not sure if it is possible but I would love to see a toggle on the explorer sandbox before sending any transaction that would set the post conditions to allow mode
.
There are a couple of use cases that benefit from sending transactions via the explorer sandbox in allow mode:
- Sending/wrapping/swapping tokens generated by a self deployed contract
- Calling and testing other functions on (self-deployed) contracts before even getting into app integrations.
- Minting an NFT before the UI/dapp/website is ready
- Using smart contracts that are nolonger supported by a dapp.
- Using smart contracts of which the dapp is malfunctioning.
I know myself and others who use the Gamma contract manager as the only viable alternative, which builds all transactions in "allow" mode. However it has its own problems like not building the transaction correctly when it gets any more complex than a couple of basic arguments; lists and tuples are not handled correctly at all.
I've run into this a few times - generally when trying to test out a concept without building a full UI to interact with the contract. Clarity code is done, tests pass, deploy then want to interact.
I would prefer to set post-conditions rather than use allow mode if possible!
@BLuEScioN why was the PR https://github.com/hirosystems/explorer/pull/960 closed without merging?
It was live for a little bit, there are definitely some visual changes going on with the explorer, maybe the feature was rolled back?
I'm still +1 for this, and would prefer to manually define them rather than worry about detecting and automatically applying correct conditions.
In the meantime thought being able to switch to allow mode with a warning would be a quick temporary fix. Isn't that the default for contract deployments from the sandbox anyway?
@0xbabo Yes, this PR was rolled back due to a regression. I will be revisiting merging this work back in soon.
I could add sense to having a solution to interact with the deployed contracts before building a front end: gamma seems like the only alternative so far and this isn't convenient not being able to test our contract independently from any third-party app. I have nothing against gamma but I'm building my own solutions and don't like to rely/depend on someone else.
@juliencarbonnell as an alternative to a graphical front-end until this gets re-added to the explorer, you can write some simple node.js scripts to interact with your contract via the command line - https://www.npmjs.com/package/@stacks/transactions#smart-contract-function-call.
thanks