sCrypt IDE major update at the end of 2020: one-click deployment and invocation of testnet contracts

On the last day of 2020, our sCrypt IDE has launched an important update: sCrypt Deploy . This function is convenient for developers to quickly deploy and debug the contracts they wrote . Let me give you a brief introduction below.

Before launching this function, if developers want to deploy their own contracts to the testnet to verify whether the contract methods can be called normally, they can only manually write js in the deployments directory and send transactions to the testnet. sCrypt Deploy feature provides a common UI interface, simply fill in the relevant parameters, you can deploy a key contract, click on the Callbutton to call the contract method.

  • sCrypt IDE after updating to the latest 0.5.0, VSCode left of Activitybar will be more out of a sCrypt Deploybutton, the following interface will appear after clicking.

Insert picture description here
COMPILED CONTRACTS displays the current working directory out directory has been compiled contract, if there is no display View Sourcebutton, is because you do not open after SourceMap option in the compilation settings of the IDE, recompile the need to open the contract and click next to the title of REFRESHa button . (Currently recompiling needs to manually click the refresh button to take effect)

  • Since deploying the contract to the test network requires the private key of the test network, if it is detected that you have not set the private key, it will automatically open the VSCode setting interface and prompt you to set the test network private key

    Warning: currently does not support deployment to the mainnet, do not expose the mainnet private key here

Insert picture description here

  • Click to COMPILED CONTRACTSview the contract, the far right will come out a Deploy panel, after the contract for the corresponding constructor parameter assignment, click Deploy, you can see the success of the deployment corresponding to the TxID , in the left DEPLOYED CONTRACTScorresponding instance view will appear, click on the instance of the contract the View Txbutton, you can open a browser to view the corresponding Tx

Insert picture description here
amountAnd opReturnare optional, represent the state of balance and contract satoshi stored contract data to be stored.

  • Click on the contract constructor example, you can see the argument when the constructor call, click on the public way to the right will appear Call panel method, and the process of deploying the same contract, just give the corresponding method parameter assignment, click the Callbutton , You can call the method of the contract. If the call is successful, you will see the corresponding txid , and if it fails, the corresponding error will be printed.

Insert picture description here
Method call is successful, DEPLOYED CONTRACTSthe view corresponding method of item, there will be View Txa button, you can click to open the browser to view the corresponding Tx

Tip: Currently, method calls with Sig and SigHashPreimage are not supported

If you have any questions when using this feature, you can also communicate with us through any of the contact methods listed on https://www.scrypt.io/, Happy Coding!

Guess you like

Origin blog.csdn.net/freedomhero/article/details/112055604