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 Call
button 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 Deploy
button, the following interface will appear after clicking.
COMPILED CONTRACTS displays the current working directory out directory has been compiled contract, if there is no display View Source
button, 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 REFRESH
a 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
- Click to
COMPILED CONTRACTS
view the contract, the far right will come out a Deploy panel, after the contract for the corresponding constructor parameter assignment, clickDeploy
, you can see the success of the deployment corresponding to the TxID , in the leftDEPLOYED CONTRACTS
corresponding instance view will appear, click on the instance of the contract theView Tx
button, you can open a browser to view the corresponding Tx
amount
And opReturn
are 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
Call
button , 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.
Method call is successful, DEPLOYED CONTRACTS
the view corresponding method of item, there will be View Tx
a 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!