Neow3j Versions Save

Java/Kotlin/Android Development Toolkit for the Neo Blockchain

3.22.1

3 months ago

Hey devs! Just a minor neow3j release with a single fix today. But still important for proper compilation of smart contracts. Many thanks to a new contributor @Lorenzobattistela who implemented this fix 😌

Fixes

Full Changelog: https://github.com/neow3j/neow3j/compare/3.22.0...3.22.1

3.22.0

3 months ago

Hello Neo Devs! 😺 It's neow3j's first release this year. We hope you've had a great start into 2024 and wish you a great year 🍻

Breaking Changes

  • https://github.com/neow3j/neow3j/pull/1018: We removed the updatehistory property from the NativeContractState class because it was removed from Neo. NativeContractState is the data class you get when calling the getnativecontracts JSON-RPC method on a Neo node.
  • https://github.com/neow3j/neow3j/pull/1013: Only breaking if you're using a Gradle Version below 6.0: We upgraded our internal Gradle version to 8 and with that updated the neow3j Gradle plugin. Minimum required Gradle version for users is now 6.0. If you are using a Gradle version below 6.0 make sure to upgrade your Gradle wrapper with ./gradlew wrapper --gradle-version 8.7.

Fixes

  • https://github.com/neow3j/neow3j/pull/1019: It's not possible anymore to add conflicting contract permissions (@Permission) or trusts (@Trust) to smart contracts. The neow3j compiler will abort the compilation and tell you what's wrong. More specifically the following is prevented:

    @Permission(contract = "0x0f46dc4287b70117ce8354924b5cb3a47215ad93")
    @Permission(contract = "*")
    static class PermissionManifestTestContractWithRedundantPermissions {
    ...
    
  • https://github.com/neow3j/neow3j/pull/1015: Fixed faulty resource handling in the neow3j compiler, that didn't close an input stream on the class to compile.

Other Changes

Full Changelog: https://github.com/neow3j/neow3j/compare/3.21.2...3.22.0

3.21.2

5 months ago

Hey neow3j devs! πŸ€“

This neow3j release brings us up to date with changes that happened in Neo's 3.6.2 releases.

New Features

sdk

  • The getversion JSON-RPC method now additionally includes a hardforks property that tells you the hardforks that the network is "using". (https://github.com/neow3j/neow3j/pull/1005)
  • Added two new methods in the native PolicyContract interface to set and fetch the GAS fees that need to be paid for transaction attributes. Setting the attribute fee is restricted to the Neo council. (https://github.com/neow3j/neow3j/pull/1006)
  • There's a new JSON-RPC method called canceltransaction, which does what the name says. You can use it if you want to cancel a previously transmitted transaction that was not yet included in a block. (https://github.com/neow3j/neow3j/issues/999)

devpack

  • The native StdLib contract now provides a method strLen(...) that returns the character count of a String. Mind that this is different to String.length() which will return the byte length of a String. (https://github.com/neow3j/neow3j/pull/1003)
  • Added two new methods in the native PolicyContract interface to set and fetch the GAS fees that need to be paid for transaction attributes. Setting the attribute fee is restricted to the Neo council. (https://github.com/neow3j/neow3j/pull/1006)
  • There's a new Syscall that allows you to get the signers of a transaction (in smart contract code). It's available via io.neow3j.devpack.Runtime.currentSigners(). (https://github.com/neow3j/neow3j/pull/1004)

3.21.1

7 months ago

Hey neow3j devs! ✌🏼

A new release is here, and with it the test framework is back! That means you can now use the devpack-test and test-tools with Neo 3.6.0 support. Besides that we've added support for ECPoint to be used as key and value in storage methods, and added missing functions to delete a storage entry by Hash160 or Hash256 keys. Besides that, we've updated some dependencies and reduced duplicate code in the neow3j codebase.

New Features

devpack

  • Support for ECPoint in Storage and StorageMap classes. (#986)
  • Support for Hash160 and Hash256 in delete methods of storage classes. (#987)
  • Support of test framework for Neo 3.6.0. (#990)

3.21.0

7 months ago

Hey neow3j devs, Neo 3.6.0 support is here! πŸ™ŒπŸΌ ✨

This release brings a lot of new features and also some breaking changes. The release covers all new features Neo 3.6.0 has to offer, from the new RPC findstorage, over using assert with a message, up to the new transaction attributes NotValidBefore and Conflicts. There was also a bug that was fixed, when trying to convert a serializable attribute to a DTO object. Read about all breaking changes, changes, new features, and fixes below.

πŸ’£ Important πŸ’£

Before reading further, for this release, neow3j does NOT include devpack-test and test-tools. That means, that the test framework is not supported as of now. The test tools rely upon neo-express and this tool is not yet ready to update to Neo 3.6.0. However, this should only be an issue in the short-term and we're planning to provide you with the test framework as soon as possible.

🚨 Breaking Changes 🚨

SDK

  • The method ContractStorageEntry.getValue() now returns a byte[] instead of a string. (#968)
  • Renamed TransactionAttribute.fromType() to TransactionAttribute.fromSerializable(). (#975)
  • The id in the OracleResponse class is now a BigInteger instead of an integer. (#975)
  • The method header of ContractManagement.getContractById(int) changed to ContractManagement.getContractById(BigInteger). (#974)
  • The contract id of the class CoreContractState and its child classes changed to a BigInteger instead of an integer. (#974)

Changes

  • Stronger restrictions when adding transaction attributes to a transaction apply. For any attribute that is only allowed once, adding another one will now throw an exception instead of overwriting the existing one. (#944)

New Features

SDK

  • New RPC findstorage support with method Neo.findStorage() and introducing utility class NeoFindStorage.FoundStorage. (#968)
  • Support contract id in getContractState RPC, i.e., Neo.getContractState(BigInteger). (#974)
  • Added NeoToken.unclaimedGas() without needing to provide the block height. (#966)
  • Added lastGasPerVote to NeoToken.AccountState. (#970)

devpack

  • Support of Java's assert statement with a string (#972), e.g.:
assert Hash160.isValid(owner) : "Hash160 is not valid"
  • New opcode ASSERTMSG. (#972)
  • New method Helper.abort(String) to abort the NeoVM and provide a reason. (#972)
  • New opcode ABORTMSG. (#972)
  • New FindOptions.Backwards to iterate in reverse order. (#940)
  • Interface for new methods of the native CryptoLib contract supporting the BLS12-381 curve. (#943)
  • New transaction attribute NotValidBefore. (#944)
  • New transaction attribute Conflicts. (#944)
  • New put methods for booleans as values in Storage and StorageMap. (#977)
  • Support for Hash160 and Hash256 as keys in put and get methods of Storage and StorageMap. (#980)

Fixes

devpack

  • Use of PUSHF/PUSHT instead of PUSH0/PUSH1 when the Java compiler uses Boolean.valueOf(0) or Boolean.valueOf(1) (#962)
  • Fixed the method Transaction.toJson() that deserialized transaction attributes without their values. This is related to the new method TransactionAttribute.fromSerializable(). (#975)

3.20.2

9 months ago

Hello fellow neow3j devs!

This release fixes a bug when deserializing RPC responses using a newer Jackson version (2.15.+), and introduces a new utility method for working with signatures.

New Features

SDK

  • Added utility method Sign.recoverV() to recover the value v of a signature. (#951)

Fixes

SDK

  • Removed a redundant second JsonValue annotation in enum NeoVMStateType that breaks when using the latest Jackson version. (#950)

3.20.1

11 months ago

This version is a small patch that fixes an issue with exception handling in neow3j's block streaming implementation.

Fixes

SDK

3.20.0

1 year ago

Neowww, it's been a while and it's time for a new neow3j version! 😻

The new version includes an improved placeholder feature for smart contract compilation that restricts replacing only string values that adhere to a specified structure. When compiling a smart contract and accidentally using SDK-related methods of neow3j within it, the compiler will now throw specific exception messages. Finally, frequently used methods to access lists in the SDK (e.g., getStackItems()) have now utility methods that allows retrieving an item directly providing an index (e.g., getStackItem(1)).

Have a look at the neow3j documentation at neow3j.io, open a Github issue, or contact us on the Neo Discord #java channel for any question you might have about neow3j. 😸

Breaking Changes

🚨 IMPORTANT🚨

The following update is a critical breaking change and you must adapt your Java smart contract written using 3.19.+

Improved Placeholders (#928)

Placeholders now have a fixed format: "${placeholder}". Starting with neow3j 3.20.0, a dollar sign and curly brackets are required for placeholder values.

Previously, all string values in a smart contract could be replaced. Now, only string values that start with ${ and end with } are taken into account for replacing. Let's say you want to set the placeholder value (i.e., "${ownerName}") like in the following smart contract code:

Storage.put(ctx, ownerNameKey, "${ownerName}");

While in earlier versions you had to use the full string as key in the replace map (i.e., "${ownerName}"):

HashMap<String, String> replaceMap = new HashMap<>();
replaceMap.put("${ownerName}", "AxLabs");
[...]

you now can use just the embedded string (i.e., "ownerName"):

[...]
replaceMap.put("ownerName", "AxLabs");
CompilationUnit compUnit = new Compiler().compile(MyContract.class.getName(), replaceMap);

Have a look at our example contract with placeholders here and the code to compile and replace these placeholders here.

Changes

devpack

  • Improved the placeholder feature with a defined structure. For more, read the Breaking Changes above. (#928)

New Features

devpack

  • Added type and method checks for accidental use of SDK-related neow3j code in smart contract development and providing useful exception messages for it. (#933)

SDK

  • Added utility methods to access the first list item directly and retrieve list items providing an index in frequently used methods. For example, getStackItems().get(0) can now be retrieved with getFirstStackItem() or getStackItem(0). (#930)

Fixes

SDK

  • Added missing nonce in NeoBlock dto class. (#932)

3.19.3

1 year ago

Hey neow3j friends, happy 2023! We have a new minor release for you! 🐈 πŸŽ‰

We've mainly fixed the test-tools module to work with Neo 3.5.0 by updating the neo-express version accordingly. Additionally, we've added a new method Runtime.loadScript() that allows users to dynamically load a script into the NeoVM and execute it.

Check out the list of changes below.

Have a look at the neow3j documentation at neow3j.io, open a Github issue, or contact us on the Neo Discord #java channel for any question you might have about neow3j. 😸

New Features

devpack

  • Add new syscall System.Runtime.LoadScript. (#905)
  • Add method Runtime.loadScript() to load a script dynamically. (#905)

Fixes

SDK

  • Updated the neo-express version for the test-tools module. (5fa2e14a3bd5410e66f2565cb027f78634cea039)

3.19.2

1 year ago

Neoww, dev cats, I now support Neo v3.5.0! πŸŽ‰

With this release, neow3j makes use of the newly introduced opcodes PUSHT and PUSHF and you can use the interfaces for the new methods in the native ContractManagement contract. Further, the conversion to a boolean in the devpack has been optimized by a whopping factor of 1000x (previously, the cost was 8192, now it's 8 πŸ₯³ ).

Check out the list of what has changed below.

Have a look at the neow3j documentation at neow3j.io, open a Github issue, or contact us on the Neo Discord #java channel for any question you might have about neow3j. 😸

New Features

devpack

  • Added new opcodes PUSHT and PUSHF. (#899)
  • Added new native methods ContractManagement.getContractById() and ContractManagement.getContractHashes() (#901)

SDK

  • Added new native methods ContractManagement.getContractById() and ContractManagement.getContractHashes() (#901)

Changes

devpack

  • Optimised the cost of converting a stack item to a boolean. (#900)