Giter Club home page Giter Club logo

bit-nft-smart-contract's Introduction

neow3j-boilerplate

This is a boilerplate project setup for Java smart contracts. It brings the minimum amount of code to compile and test a "Hello World" smart contract for Neo N3.

Quickstart

Java 1.8 (or higher) is required. Docker is required for running smart contract tests.

  1. Clone this git repo:
git clone https://github.com/neow3j/neow3j-boilerplate.git
  1. Go to the project directory:
cd neow3j-boilerplate
  1. Compile the smart contract:
./gradlew neow3jCompile
  1. You will see the following output in the directory ./build/neow3j:
$ ls -la build/neow3j 
total 24
drwxr-xr-x  5 user  wheel  160 23 Feb 17:40 .
drwxr-xr-x  7 user  wheel  224 23 Feb 17:40 ..
-rw-r--r--  1 user  wheel  425 23 Feb 17:40 HelloWorldSmartContract.manifest.json
-rw-r--r--  1 user  wheel   94 23 Feb 17:40 HelloWorldSmartContract.nef
-rw-r--r--  1 user  wheel  430 23 Feb 17:40 HelloWorldSmartContract.nefdbgnfo
  1. Run the contract test
./gradlew test
  1. Give us a GitHub star! ⭐⭐⭐

Adapting the Boilerplate Code

To adapt the boilerplate project to your own smart contract project, here are some things that you will have to change in the code.

  • Project name. I.e., the root folder's name and the rootProject.name property in the settings.gradle file.
  • Name of the contract. I.e., the name of the class and the value in the @DisplayName annotation on the contract class.
  • Name of the author. I.e., the value in the @ManifestExtra(key = "author", value = "Your Name") annotation on the contract class.
  • Package name.
  • Group name. I.e., the group 'org.example' property in the build.gradle file.
  • Neow3j Gradle plugin property className = "org.example.HelloWorldSmartContract" in the build.gradle file according to the new package and class name you chose.
  • And of course the contract tests in HelloWorldSmartContractTest.

About

Neow3j is a development toolkit that provides easy and reliable tools to build Neo dApps and Smart Contracts using the Java platform (Java, Kotlin, Android).

It is an open-source project developed by the community and maintained by AxLabs.

Check out neow3j.io for more information on neow3j and the technical documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.