To demonstrate how to develop DApps on Script using the Hardhat suite (https://hardhat.org/hardhat-runner/docs/getting-started#overview). This guide will walk you through the steps to deploy and test on Script using Hardhat and ethers.js (https://docs.ethers.org/v6/).
Setup the Hardhat project
Fund the test accounts with some SPAY
Execute the two commands below to fun the test accounts with some SPAY:
Next, go to the repository's root folder and run this to deploy your contract:
npx hardhat run scripts/deploy.js --network script_testnet
Special Notes on Testing with the Ethers.js+Waffle framework
Note 1: Currently the RPC Adaptor does NOT support non-standard methods such as evm_snapshot, evm_revert, and evm_mine. Thus, test cases using Fixtures (e.g. waffle.loadFixture()) are expected to fail when running against the Script blockchain.
Note 2: Currently the RPC Adaptor returns a generic "evm: execution reverted" messages in most case when the Script EVM execution fails. Some test cases may check the EVM errors with code like this: