Ergo P2S Playground

It’s really just a simple web tool at the moment, and there’s much more I’d like to add, but I thought I would share the Ergo P2S Playground with the community now and get early feedback.

You can input a contract in ErgoScript, and then click “Get P2S Address” to compile into a P2S address. Or, if there are errors, it will show an error trace.

As you type, the URL automatically updates, so you should be able to bookmark and/or share your contract with others.

Use at your own risk etc. since you are trusting my Ergo node to compile the script honestly, and you are trusting that my server hasn’t been hacked.

3 Likes

Nice work. Good to lower the barrier of entry for testing P2S addresses. Furthermore this could be a good tool to use for confirmation if one gets a P2S address from somewhere else and wants to do a quick double check.

In regards to removing trust in your node, maybe you can offer an option to have the website make requests to the user’s local node and the user simply needs to input the api key? That should be reasonably simple to add I would imagine and could offer both convenience for those who wish, and more safety when someone wishes to actually deploy.

1 Like

Good idea. I always like to err on the side of caution and make sure users realise they who/what they are trusting, in particular if money is involved.

2 Likes

Great tool. Sort of like scastie for ErgoScript :smiley:

I’m trying to do the simplest script, as described in section 2.1 in the docs, that is, a public key to which to send a payment (pk). How would I encode that with your web based tool?

1 Like

You can do something like this:

{
  PK("9h7daTDjpAa81VFNjWqFH9mevBpgfCwF6FCGkjFP8w1qrGbX9ff")
}

I’ve got some major updates in the works that should make things much easier. Watch this space!

2 Likes