/IOTA-SC-test

Primary LanguageGoMIT LicenseMIT

IOTA smart contracts - Template used to develop in any supported language

A simple template used to start developing your own smart contracts for ISCP (IOTA Smart Contract Protocol) in Rust and write unit tests in Go. In order to develop using the environment set up by this template, you need to have good understanding of the Rust and Go languages.

This is a repository for myself but I welcome anyone interested in playing around with the current state of development of the IOTA Smart Contract Protocol (ISCP). Feel free to contact me on IOTA Foundation's discord server under Th3B0Y#8380.

Simple structure prepared to start with development right away

This is how the templated file structure looks like:

View of the template on VSCode


Requirements for both, Rust and Go development

Extra requirements for development in Rust

Set code up!

  • Use this template repository to create your own.
  • Open VSCode and a terminal in it (In the menu : Terminal > New Terminal)
  • In the terminal, clone your git repository:
git clone <your_git_repository> && cd <your_git_repositories_name>
  • In the terminal, initialize the submodule for the language you want to develop in, with git submodule update --init --recursive -- smartcontract/<language> and replace <language> for rust or go (go is not available yet). Example for development in Rust:
git submodule update --init --recursive -- smartcontract/rust
  • In the terminal, open your git repository on VSCode
code -r .
  • For Windows only, open file ".vscode/settings.json" and uncomment the setting "go.testFlags" entry "-buildmode=exe": Go.testFlags for Windows
  • On VSCode, open the replace functionality (Edit > Replace in files)
    • Replace brunoamancio/IOTA-SmartContracts for <your_username>/<your_project_name> [How to]

Done! Now you can write your smart contract in smartcontract/<language>, compile it, run and debug unit tests in tests/smartcontract/my_iota_smart_contract_test.go!


MIT License