Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mialbu committed Jul 31, 2024
2 parents ad881e6 + 8579079 commit 74896f6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 41 deletions.
10 changes: 5 additions & 5 deletions docs/neo-n3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img src="../images/neow3j-neo3.png" alt="Logo" id="logo">
</div>

<h1 id="cover-header">neow3j <small>3.22.1</small></h1>
<h1 id="cover-header">neow3j <small>3.23.0</small></h1>

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 Neo community and maintained by
Expand Down Expand Up @@ -58,7 +58,7 @@ To make use of all neow3j SDK features, add the `io.neow3j:contract` dependency
__Gradle__

```groovy
implementation 'io.neow3j:contract:3.22.1'
implementation 'io.neow3j:contract:3.23.0'
```

__Maven__
Expand All @@ -67,7 +67,7 @@ __Maven__
<dependency>
<groupId>io.neow3j</groupId>
<artifactId>contract</artifactId>
<version>3.22.1</version>
<version>3.23.0</version>
</dependency>
```

Expand All @@ -79,7 +79,7 @@ you want to play around with the devpack, add the `io.neow3j:devpack` dependency
__Gradle__

```groovy
implementation 'io.neow3j:devpack:3.22.1'
implementation 'io.neow3j:devpack:3.23.0'
```

__Maven__
Expand All @@ -88,7 +88,7 @@ __Maven__
<dependency>
<groupId>io.neow3j</groupId>
<artifactId>devpack</artifactId>
<version>3.22.1</version>
<version>3.23.0</version>
</dependency>
```

Expand Down
42 changes: 10 additions & 32 deletions docs/neo-n3/smart_contract_development/introduction.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,26 @@
# Smart Contract Development

Neo stands out from other blockchains in that it allows you to implement smart contracts in several well known
programming languages like C#, Go and JavaScript. Neow3j contributes to this and adds support for Java as a smart
contract language. The part of neow3j concerned with smart contract development is termed **neow3j devpack**.
It is composed of three modules.

- The `io.neow3j:devpack` is the module that your smart contract project will depend on. It is a Java library that
contains Neo-specific annotations, methods, and classes required for contract development. You will use it in your
contract, e.g., to fetch information about the current block, or to send out a notification. The API of this module is
described in the [Devpack](neo-n3/smart_contract_development/devpack.md) section.
- The `io.neow3j:compiler` contains the compiler that produces NeoVm code from Java classes. You can use it
programmatically, by invoking it in a Java program, but, most likely you will not need to access it directly.
- The `io.neow3j:gradle-plugin` implements a Gradle plugin that you apply to your smart contract project and offers a
simple Gradle task for contract compilation
Neo stands out from other blockchains in that it allows you to implement smart contracts in several well known programming languages like C#, Go and JavaScript. Neow3j contributes to this and adds support for Java as a smart contract language. The part of neow3j concerned with smart contract development is termed **neow3j devpack**. It is composed of three modules.

- The `io.neow3j:devpack` is the module that your smart contract project will depend on. It is a Java library that contains Neo-specific annotations, methods, and classes required for contract development. You will use it in your contract, e.g., to fetch information about the current block, or to send out a notification. The API of this module is described in the [Devpack](neo-n3/smart_contract_development/devpack.md) section.
- The `io.neow3j:compiler` contains the compiler that produces NeoVm code from Java classes. You can use it programmatically, by invoking it in a Java program, but, most likely you will not need to access it directly.
- The `io.neow3j:gradle-plugin` implements a Gradle plugin that you apply to your smart contract project and offers a simple Gradle task for contract compilation

## Java for the Neo Virtual Machine

It is important to understand that, even though, on the surface you will be writing Java code, the generated bytecode
and the executing virtual machine are not related to Java. Your smart contract code is compiled to byte code that runs
on the Neo Virtual Machine (NeoVM) and not on the Java Virtual Machine (JVM). Because of the differences between the JVM
and the NeoVM, the programming experience with Java for Neo is different. We, therefore, define Java for Neo as a Java
flavour or subset and name it NeowJava. Section [NeowJava](neo-n3/smart_contract_development/neowjava.md) discusses
in which ways NeowJava deviates from Java and what the pitfalls are when using NeowJava.
It is important to understand that, even though, on the surface you will be writing Java code, the generated bytecode and the executing virtual machine are not related to Java. Your smart contract code is compiled to byte code that runs on the Neo Virtual Machine (NeoVM) and not on the Java Virtual Machine (JVM). Because of the differences between the JVM and the NeoVM, the programming experience with Java for Neo is different. We, therefore, define Java for Neo as a Java flavour or subset and name it NeowJava. Section [NeowJava](neo-n3/smart_contract_development/neowjava.md) discusses in which ways NeowJava deviates from Java and what the pitfalls are when using NeowJava.

## Development Environment

You can write smart contracts in any editor or IDE you want. There are some environments, namely Visual Studio Code
and IntelliJ IDEA, that provide you with extra support for an improved developer experience.
You can write smart contracts in any editor or IDE you want. There are some environments, namely Visual Studio Code and IntelliJ IDEA, that provide you with extra support for an improved developer experience.

With [**Visual Studio Code**](https://code.visualstudio.com/) you can make use of the [Neo Blockchain
Toolkit](https://marketplace.visualstudio.com/items?itemName=ngd-seattle.neo-blockchain-toolkit) extension, that is
developed by [ngdenterprise](https://ngdenterprise.com/). It allows contract debugging, easy contract setup, and
provides a GUI for manipulating a local neo-express instance. Next to the Toolkit, we suggest to install the [Java
Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) and the [Gradle Extension
Pack](https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-gradle-extension-pack).
Toolkit](https://marketplace.visualstudio.com/items?itemName=ngd-seattle.neo-blockchain-toolkit) extension. It allows contract debugging, easy contract setup, and provides a GUI for manipulating a local neo-express instance. Next to the Toolkit, we suggest to install the [Java Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) and the [Gradle Extension Pack](https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-gradle-extension-pack).

[**IntelliJ**](https://www.jetbrains.com/idea/download/) is obviously a good choice because it has already great support
for Java. A [Neo plugin](https://plugins.jetbrains.com/plugin/17195-neo) has been implemented for IntelliJ too. It
provides basic control over neo-express via IntelliJ's UI. For usage instructions and a short video visit the plugin's
[github page](https://github.com/irshadnilam/intellij-neo). Debugging smart contracts is not possible with IntelliJ.
[**IntelliJ**](https://www.jetbrains.com/idea/download/) is obviously a good choice because it has already great support for Java. A [Neo plugin](https://plugins.jetbrains.com/plugin/17195-neo) has been implemented for IntelliJ too. It provides basic control over neo-express via IntelliJ's UI. For usage instructions and a short video visit the plugin's [github page](https://github.com/irshadnilam/intellij-neo). Debugging smart contracts is not possible with IntelliJ.

## Requirements

- A local installation of the [**Java 8 SDK**](https://adoptopenjdk.net/) (or higher) is required for smart contract
compilation.
- A local installation of the [**Java 8 SDK**](https://adoptopenjdk.net/) (or higher) is required for smart contract compilation.

- For running smart contract tests you need to have [**Docker**](https://www.docker.com/products/docker-desktop) installed locally.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract compilation via a Gradle task called `neow3jCompile`. The Java plugin i
```groovy
plugins {
id 'java'
id 'io.neow3j.gradle-plugin' version "3.22.1"
id 'io.neow3j.gradle-plugin' version "3.23.0"
}
```

Expand Down Expand Up @@ -90,13 +90,13 @@ Then we need to define the dependencies, which are `io.neow3j:devpack` for writi

```groovy
dependencies {
implementation 'io.neow3j:devpack:3.22.1'
implementation 'io.neow3j:devpack:3.23.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0',
'io.neow3j:devpack-test:3.22.1',
'io.neow3j:devpack-test:3.23.0',
'ch.qos.logback:logback-classic:1.2.11'
deployImplementation 'io.neow3j:compiler:3.22.1',
deployImplementation 'io.neow3j:compiler:3.23.0',
'ch.qos.logback:logback-classic:1.2.11'
}
```
Expand Down

0 comments on commit 74896f6

Please sign in to comment.