All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.2.0 - 2024-05-08
- Included
boa-test-constructor
to the installation.- Install it by using
pip install neo3-boa[test]
- Install it by using
- Support to type union annotations using
|
operator
- Changed all unit tests to use
boa-test-constructor
in place ofNeoTestRunner
- Raise deprecated warning when using deprecated typing aliases and removed their uses from the compiler code
Deprecated symbols from
typing
:List
,Dict
,Tuple
(use the builtins instead)Collection
,Mapping
,MutableSequence
,Sequence
(import fromcollections.abc
instead)
- Changed
NeoMetadata.add_permission
function signature to be more intuitive to add multiple methods permissions
- Dropped support to Python 3.10
- Removed
@metadata
decorator to identify metadata function. UseNeoMetadata
as function return instead.
- Fixed
tuple
annotation behavior runtime.script_container
returns aTransaction
instead ofAny
- Removed empty lines that were logged when compiling a smart contract
1.1.1 - 2024-02-02
- Support to Python 3.12
- Included
Nep17Contract
interface - Support to Python's builtins:
- fstrings and match-case with primitive types (
bool
,int
andstr
) str.replace
andlist.sort
methods
- fstrings and match-case with primitive types (
- Deprecated
@metadata
decorator to identify metadata function.
- Changed exit code on compilation error
- Fixed notify not being executed when calling it from the imported package
- Changed manifest abi types related to
Optional
andUnion
withNone
types
1.1.0 - 2023-10-16
- Support to Neo features up to Neo 3.6
- Added zero knowledge proof methods to
CryptoLib
interface - Support to ASSERTMSG and ABORTMSG opcodes
- Added zero knowledge proof methods to
to_hex_str
method to convertbytes
into printable strings
- Included
msg
optional argument toabort
- Validate if given
.nef
files exists before running TestRunner
- Dropped support to Python versions prior to 3.10
- Removed incorrect requirement of
filelock
to use NeoTestRunner class - Fixed imported variable value generation when it has the same identifier of a local variable
- Fixed NEP-11 validator to handle divisible NFT standard
1.0.0 - 2023-07-10
- Included an environment parameter to compilation that is accessible in the smart contract
- Added
hash
property to classes with@contract
decorator - New optional argument to stop compilation on first error found
- Changed the cli command to compile from
neo3-boa
toneo3-boa compile
- Limit logs to ERROR by default
- Support to
int
constructor withstr
argument - Change NEP-11 validator to accept both
str
andbytes
as argument types in some methods
- Removed TestEngine interface
- Fixed type warnings shown by IDEs
- Fixed Interop type check in event interfaces
- Fixed compilation to stop with keyboard interruption on cli
- Fixed compilation error with metadata and imported contract interfaces
- Fixed incorrect stack when calling
call_contract
0.14.0 - 2023-06-20
This version has breaking changes. Please refer to our migration guide to update your smart contracts.
- Moved
ByteString
class methodsto_int
,to_str
,to_bytes
andto_bool
to the moduleboa3.builtin.type.helper
- Removed
ByteString
type. - Removed
to_int
implementation fromstr
andbytes
types. - Removed
to_bytes
implementation fromint
andbytes
types. - Removed
to_str
implementation frombytes
types. - Removed
to_bool
implementation frombytes
type.
- Fixed debugging information for symbols of imported modules.
- Fixed incorrect import error caused by root folder path.
- Fixed generation of static variables that were duplicated.
- Fixed code generation for method calls on
return
statements in void methods. - Fixed compilation failure caused by imports in the file where
NeoMetadata
is defined. - Fixed standard validations when using imported symbols.
0.13.1 - 2023-05-29
- Imported contract interfaces are included on metadata permissions to ensure the expected executing behaviour
- Fixed inconsistent behaviour on metadata permission
0.13.0 - 2023-05-08
- Included execution tests in the unit tests using the Neo Test Runner.
- Deprecating TestEngine interface.
0.12.3 - 2023-04-26
- Fixed incorrect import error raised when importing modules in the same directory of the importer file
0.12.2 - 2023-03-30
- Included extra data to manifest and new types to better interface with manifest
Address
,BlockHash
,PublicKey
,ScriptHash
,ScriptHashLittleEndian
andTransactionId
interfaces were included in theboa3.builtin.type
package
- Improving of log messages for classes,
list
s anddict
s - Moved compiler internal packages that are not meant to be accessed from smart contracts to
boa3.internal
- Fixed incorrect behaviour when using variables with the same identifier in different scopes
- Don't generate files when internal errors are raised
- Incorrect output of
to_script_hash
when the input is a string that not represents an account address - Type hinting didn't accept sequences with
Optional
orUnion
defining its items type- i.e.
List[Optional[str]]
didn't work properly
- i.e.
0.12.1 - 2023-02-15
- CPM installer
0.12.0 - 2023-01-19
- Support to Neo features up to Neo 3.5
loadScript
interop- Contract Management native
hasMethod
method
- Included the enum
Opcode
in the available builtin types - Included nef
source
modifier toNeoMetadata
- Added
hash
property to native smart contract interfaces - Added
hash
property to smart contract interfaces using the@contract
decorator - Native smart contract methods called the interfaces are now included in the manifest permissions
- Support to
str
constructor
- Moved the following items from
boa3.buitin
:to_script_hash
method toboa3.builtin.contract
CreateNewEvent
method toboa3.builtin.compile_time
NeoMetadata
class toboa3.builtin.compile_time
public
decorator toboa3.builtin.compile_time
metadata
decorator toboa3.builtin.compile_time
contract
decorator toboa3.builtin.compile_time
display_name
decorator toboa3.builtin.compile_time
- Native contract method calls are now called using method tokens added to the contract NEF file
- Persist the cast type of variable after the casting
- Only types or class names can be used as type annotations
- i.e.
[int]
will fail on compilation, useList[int]
instead
- i.e.
- Inner object variable access caused an exception to be thrown
- Invalid script was generated when compiling a smart contract with classes and
_deploy
method - Smart contracts with methods with duplicated manifest identifiers was compiled even though the generated manifest was invalid.
- Events with the same name of some method weren't allowed by the compiler
- Internal compiler error raised when evaluating smart contract interfaces inside loops
0.11.4 - 2022-08-02
- Included Neo 3.2 features
getAddressVersion
interop- CryptoLib native
murmur32
method - Ledger native
getTransactionVMState
andgetTransactionSigners
methods - Neo native
getCandidateVote
,getAllCandidates
andunVote
methods
- Included manifest
groups
andtrusts
modifiers toNeoMetadata
- Contract standards detection if not explicitly stated in the metadata
- Supports NEO-11 and NEO-17
- Changed
print
behavior to log readable results depending on the type of the value - Support to
dict.pop
with thedefault
argument
isinstance
andis None
changing the type evaluated by the compiler- Calling methods inside another method call failed in runtime
0.11.3 - 2022-06-13
- Support to Python 3.10
to_script_hash
to convert ECPoint and public keysbytearray
constructor given array length
- Updated debug file generation to map imported modules
- Included
--debug
flag information in the docs x is None
andx is not None
now have the same behaviour as(not) isinstance(x, None)
- Importing packages inside
boa3
in a smart contract will always raise anUnresolvedReference
error, except forboa3.builtin
- Fixed
bytearray
set value - Fixed bytecode generation for imported modules
- Fixed standard validators event and type checking
- Fixed global variables usage inside classes
- Fixed
int.to_bytes(0)
return to a non-empty bytes
0.11.2 - 2022-04-01
- New compiling option to set the project root path
- Support to
pass
keyword
bool
functions that returnedInteger
values during runtime now returns actualBoolean
values- Logs when there are different symbols using the same identifier
- Fixed Circular import detection
- Fixed an error raised when using instance methods from variables in a user-created class
- Fixed manifest generation of
ByteString
type
0.11.0 - 2022-02-21
- Support to contract manifest modifiers. See NeoMetadata
- Initial support to inheritance on user-created classes
- Implemented Python
+
operator for lists - Implemented implicit conversion to
bool
on if statements - Support to Python's builtins:
pow
methodint
andbool
constructors
- Implemented
builtin.math
module- Methods
floor
andceil
with decimals argument
- Methods
- Implemented
ByteString
to interface when bothstr
andbytes
are supported.- Similar to
Union[str, bytes]
- Similar to
- Moved
boa3.builtin.sqrt
toboa3.builtin.math.sqrt
assert
message is actually logged at runtime
- Fixed class import with alias
- Fixed runtime errors with lists of lists
- Fixed runtime errors when using variables with the same name in classes and functions
0.10.1 - 2021-11-30
- Support to Neo 3.1.0
- Implemented class properties on user-created classes
- Support to Python 3.9
- Support to
WitnessScope
s in the TestEngine - Implemented keyword args on function definitions
- Custom contract interfaces
- Support to Python's builtins:
str
methods:join
,startswith
,upper
,lower
,index
,isdigit
andstrip
list
copy
method anddict
pop
andcopy
methods
- Changed operations implementation to work with custom types
- Moved
boa3.builtin.interop.blockchain.current_height
toboa3.builtin.nativecontract.Ledger.get_current_index()
- Fixed importing from different user packages
- Fixed issue with
insert
in the first position on lists - Fixed the runtime error raised when using instance variables
- Fixed incorrect implicit cast behavior
- Fixed incorrect code generation when calling class methods from objects
0.10.0 - 2021-09-13
- Support to user implemented classes
- Interfaces to N3 native contracts
- Support to wildcard imports
- Sequence slices with given strides
- Python's
max
andmin
withstr
andbytes
arguments
- Unified crypto methods
verify_with_ecdsa_secp256r1
andverify_with_ecdsa_secp256k1
intoverify_with_ecdsa
- Changed
json_serialize
return andjson_deserialize
argument types tostr
- Fixed the issue with functions with the same name in different scopes
- Fixed a bug with naming variables with the same name from interop packages
0.9.0 - 2021-08-02
- Support to N3-rc4
- Included new interops from Neo-rc4
get_network
get_random
- Included OracleRequestCode enum for better compatibility with Oracles
- Implemented Python's builtin
str
count
- Changed manifest's
features
from an empty array to an empty object - Included
maxsplit
optional argument onstr
split method
0.8.3 - 2021-07-19
- Included import of user modules
- Module variables are now linked to the contract's storage to persist their values
- Support to Python's builtins:
is
keywordreversed
str.split
list.count
andtuple.count
- Included the remaining Neo interops in the
builtin.interop
package - Included ECPoint type
- Included
find_options
optional argument toStorage.Find
interop - Included new smart contract example
- Update Contract
- Implemented compiler validation of
try else
branch
- Renamed
interop.binary
package tointerop.stdlib
min
andmax
methods now accept many arguments instead of just two
- Fixed
isinstance
forContract
boa3 builtin class - Fixed issue with not passing values to a vararg
0.8.2 - 2021-06-14
- Support to N3-rc3
- Implemented varargs on function definitions
- Allow importing modules and packages
- Only from
boa3.builtin
are accepted by the compiler
- Only from
- Implemented Neo interop functions:
- Runtime
script_container
andburn_gas
- StorageContext
as_read_only
- Transaction interops:
get_transaction
,get_transaction_from_block
andget_transaction_height
- Runtime
- Implemented
Optional
type annotation - Included
ON_PERSIST
andPOST_PERSIST
triggers
- Updated debug info generation to v1.2 format
- Included
data
argument tocall_contract
andupdate_contract
- Renamed
get_time
andget_platform
totime
andplatform
- Fixed variables access after casting types
- Fixed incorrect output when concatenation str and bytes values
- Fixed issue with control flow statements with many instructions
- Fixed issue with UInt160 and UInt256 constructors with slicing result
- Fixed unexpected result when comparing str values
- Fixed blocks and transactions hashes that TestEngine returns
- Fixed
isinstance
for boa3 builtin types - Fixed issue with incorrect stack sizes during runtime
0.8.1 - 2021-05-12
- Support to N3-rc2
- Implemented
itoa
,atoi
andget_block
interop methods - Included UInt256 type
- Implemented Python built-in
sum
function - Support to type casting
- Included an optional
CallFlags
argument incall_contract
method
0.8.0 - 2021-04-15
- Included StorageMap class
- Implemented
**
operator andsqrt
function - Supports
Oracle
in smart contracts - Implemented
abs
builtin
- Assert statements weren't included in
.nefdbgnfo
0.7.1 - 2021-03-24
- Support to Neo 3 rc1
- Implemented Python
in
operator for collections - Support to reassign types to existing variables in a function's scope
- Included StorageContext to the storage interop functions
- Included new smart contract example
- Automated Market Maker (AMM)
- Included
eventName
argument tonotify
interop - Renamed
trigger
method toget_trigger
- Fixed smart contract's storage access in TestEngine
- Null return in
update_contract
anddestroy_contract
interops get_contract
andcreate_contract
were returning contract's manifest as null- Fixed Union type bug when used in CreateNewEvent
0.7.0 - 2021-02-11
- Support to Neo 3 preview 5
- Included
Iterator
interops - Implemented Storage.Find interop
- Included new smart contract examples
- Atomic Swap
- Wrapped Token
- Included Python 3.7 unit tests in CircleCI workflow
- Implemented Python built-in functions
exit
,min
andmax
list
methodsinsert
andremove
- Improved compilation with
isinstance
function semantic for Python types - Updated README file with how to use TestEngine
- Fixed operation validation when using non-primitive types
- Couldn't use
UInt160
values inbytes
operations for example
- Couldn't use
- Invalid stack size when calling void functions
- Compilation failing because of concatenation with
bytes
values - Variable types in different scopes causing conflict during compilation
- Fixed conversion of sequence slicing with negative indexes
0.6.1 - 2020-12-18
- Included a NEP-17 example
- Implemented
Union
type annotation - Implemented
extend
to bytearray values
- Change Contract methods implementations to be compatible with Neo's preview4
- Bytes comparison was always returning False
- Get values from collection (
list
,dict
,tuple
) was returning the collection instead
0.6.0 - 2020-12-14
- Implemented cryptography methods
- SHA256, RIPEMD160, HASH160 and HASH256
- Included Contract methods
- Create, Update and Destroy contract
- Included
base58
andbase64
encoding/decoding - New Neo Interops
- GetExecutingScriptHash, GetEntryScriptHash and GetPlatform
- Json and Binary serialization/deserialization
- GetNotifications, for getting the list of events and values sent using
notify()
- Implemented a method to abort smart contract execution
- Included UInt160 type for compatibility with NEP17
- GetCurrentStorageContext, for Storage Interops
- New features in the TestEngine
- Included call other smart contracts
- Account witness
- Inclusion of blocks and transactions
- Improved examples' unit tests using TestEngine
- Changed
nef
andmanifest
generation to be compatible with Neo's preview4
- Fixed the type checking for sequence slices
- If-else branches inside each other weren't having the same execution flow as expected
- Type attribution in
for
variable - was getting iterable type instead of iterable's values type
is_application_trigger
andis_verification_trigger
methods
0.5.0 - 2020-10-27
- Converted
time
,height
,gasLeft
andinvocationCounter
interops - Implemented compiler validation of
try finally
branch - Included execution tests in the unit tests using the TestEngine from the C# compiler
- Replaced the markdown Python Supported Features table to a html table in the README
0.4.0 - 2020-10-01
- Included a neo3-boa's structure diagram in the README
- Added conversion of
continue
andbreak
statements - Included support to
range
- Implemented compiler validation of
try except
statements - Implemented
list.pop()
method - Added
global
keyword validation - Implemented
isinstance
method - Support to chained assignments
- Optimization in the code generation of literal operations
- Implemented
print
method - Converted the smart contract
call
interop - Included an ICO example
- Raises a compiler error if a method specifies a return type but doesn't have a return statement
- Compiler's exception handling when compiling a smart contract that uses unsupported or not yet implemented builtin methods
- Return value of storage's get method when the key is not found
0.3.0 - 2020-08-27
0.2.2 - 2020-08-21
0.2.1 - 2020-08-21
0.2.0 - 2020-08-21
0.0.3 - 2020-06-16
- ModuleNotFoundError that was raised when running the executable