Java/Kotlin/Android Development Toolkit for the Neo Blockchain
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 π
Full Changelog: https://github.com/neow3j/neow3j/compare/3.22.0...3.22.1
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 π»
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../gradlew wrapper --gradle-version 8.7
.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.
Full Changelog: https://github.com/neow3j/neow3j/compare/3.21.2...3.22.0
Hey neow3j devs! π€
This neow3j release brings us up to date with changes that happened in Neo's 3.6.2 releases.
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)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)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)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)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)io.neow3j.devpack.Runtime.currentSigners()
. (https://github.com/neow3j/neow3j/pull/1004)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.
ECPoint
in Storage
and StorageMap
classes. (#986)Hash160
and Hash256
in delete methods of storage classes. (#987)Neo 3.6.0
. (#990)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.
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.
ContractStorageEntry.getValue()
now returns a byte[]
instead of a string. (#968)TransactionAttribute.fromType()
to TransactionAttribute.fromSerializable()
. (#975)OracleResponse
class is now a BigInteger
instead of an integer. (#975)ContractManagement.getContractById(int)
changed to ContractManagement.getContractById(BigInteger)
. (#974)CoreContractState
and its child classes changed to a BigInteger
instead of an integer. (#974)findstorage
support with method Neo.findStorage()
and introducing utility class NeoFindStorage.FoundStorage
. (#968)getContractState
RPC, i.e., Neo.getContractState(BigInteger)
. (#974)NeoToken.unclaimedGas()
without needing to provide the block height. (#966)lastGasPerVote
to NeoToken.AccountState
. (#970)assert
statement with a string (#972), e.g.:assert Hash160.isValid(owner) : "Hash160 is not valid"
ASSERTMSG
. (#972)Helper.abort(String)
to abort the NeoVM and provide a reason. (#972)ABORTMSG
. (#972)FindOptions.Backwards
to iterate in reverse order. (#940)CryptoLib
contract supporting the BLS12-381
curve. (#943)NotValidBefore
. (#944)Conflicts
. (#944)put
methods for boolean
s as values in Storage
and StorageMap
. (#977)Hash160
and Hash256
as keys in put
and get
methods of Storage
and StorageMap
. (#980)PUSHF/PUSHT
instead of PUSH0/PUSH1
when the Java compiler uses Boolean.valueOf(0)
or Boolean.valueOf(1)
(#962)Transaction.toJson()
that deserialized transaction attributes without their values. This is related to the new method TransactionAttribute.fromSerializable()
. (#975)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.
Sign.recoverV()
to recover the value v
of a signature. (#951)JsonValue
annotation in enum NeoVMStateType
that breaks when using the latest Jackson version. (#950)This version is a small patch that fixes an issue with exception handling in neow3j's block streaming implementation.
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. πΈ
π¨ IMPORTANTπ¨
The following update is a critical breaking change and you must adapt your Java smart contract written using 3.19.+
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.
getStackItems().get(0)
can now be retrieved with getFirstStackItem()
or getStackItem(0)
. (#930)NeoBlock
dto class. (#932)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. πΈ
System.Runtime.LoadScript
. (#905)Runtime.loadScript()
to load a script dynamically. (#905)neo-express
version for the test-tools
module. (5fa2e14a3bd5410e66f2565cb027f78634cea039)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. πΈ
PUSHT
and PUSHF
. (#899)ContractManagement.getContractById()
and ContractManagement.getContractHashes()
(#901)ContractManagement.getContractById()
and ContractManagement.getContractHashes()
(#901)