Redspot is a contract integration builder that allows developers to simplify the process of testing and interacting with contracts by projecting the development of contracts such as ink! This tool is developed by Patract Labs. Kudos!
First of all, let's install Node.js. The version has to be version >= 12.0. You can check your version by using the following command.
$ node --version
Second, ink! contract requires a WASM compile environment. Let's install toolchain.
rustup install nightlyrustup component add rust-src --toolchain nightlyrustup target add wasm32-unknown-unknown --toolchain nightlyrustup component add rust-src --toolchain nightly
And let's install
cargo-contract provided by Patract and
cargo install cargo-contract --git https://github.com/patractlabs/cargo-contract --branch=v0.10.0 --forcenpm i wasm-opt
Redspot provides a sample contract like Truffle that accelerates secure smart contract developments.
npx redspot-new erc20
Before compiling, install
yarn dependencies first (you can do
npm install instead but yarn is recommended).
Then running the command
npx redspot compile . in the erc20 root directory will compile the contract.
After the compilation is complete, you can find the compiled product in the artifacts directory.
To use a local development environment, a Plasm node is necessary. Please install the latest Plasm node from here.
Then, run the local node via
plasm in your terminal of choice
Now you can run the deploy.ts file, adding
-no-compile to prevent duplicate compilation:
npx redspot run ./scripts/deploy.ts --no-compile
After a successful contract deployment, you will get a message like this.
Deploy successfully. the contract address: 5CqB5Mh9UdVbTE1Gt5PJfWSiCHydJaJsA31HjKGti1Z2fn78