Changelog for odra
.
- More public methods in
CEP18
module.
deploy_with_cfg
to handleodra_cfg
args inlivenet
.odra-cli
is now in the repository.
- Calling
init
fails inodra_vm
.
OdraContract
trait grouping module-related structures.
Deployer
is no longer implemented forHostRef
but forOdraContract
.chainspec.toml
file has been updated to be compatible with the latest version ofcasper-execution-engine
.
Extern
type for simple external calls.
- Allow for reminting tokens in
CEP78
. - Include custom types into schema.
- Support for CSPR.cloud's auth token.
new
method forAddress
to create an address from a string.transfer
function in theHostEnv
allowing native token transfers between accounts.- Reverse lookup feature for
CEP78
. Addressable
trait for types that can be converted toAddress
.
- Fix
get_block_time
incasper-rpc-client
. - Calling
try_
functions in the livenet context now returns aResult
instead of panicking. - Improve error messages in the livenet context.
- Update
HostEnv
functions acceptAddressable
instead ofAddress
.
- Add
try_deploy
function to theDeployer
trait, which allows deploying a contract and returning an error if the deployment fails. - Add
Cep18
toodra-modules
- a standard for fungible tokens. - Add
Cep78
toodra-modules
- a standard for non-fungible tokens. - Add
cep18
andcep78
templates.
- Update casper crates to the latest versions.
- Fix minor bugs in generated code.
- Fix events collection in submodules.
#[odra::odra_type]
attribute can be applied to all flavors of enums (before applicable to unit-only enums).
Maybe<T>
- a type that represents an entrypoint arg that may or may not be present.EntrypointArgument
- a trait for types that can be used as entrypoint arguments.- an example of using
Maybe<T>
inodra-examples
crate. get_opt_named_arg_bytes(&str)
inContractEnv
odra::contract_def::Argument
has a newis_required
field.odra-schema
crate for generating contract schema that aligns with Casper Contract Schema.odra::event
proc macro that combines Casper Event Standard and Casper Contract Schema boilerplate code.odra::module
acceptserror
attribute to generate custom error in the schema.
- update modules and examples to reflect the changes.
OdraType
derive macro is now an attribute macro[odra::odra_type]
.OdraError
derive macro is now an attribute macro[odra::odra_error]
.
- #391 - compile error when using a type reference in the constructor signature.
ContractRef
trait withnew
andaddress
functions. All contract references now implement it.disable-allocator
feature forodra
crate. It allows to disable the allocator used by Odra Framework in wasm build.odra-build
crate for including the code in contract's build.rs file.
- Traits implemented by modules are now also implemented by their
ContractRefs
andHostRefs
.
- Replaced
contract_env::
withself.env()
in the contract context (of typeContractEnv
). For example, instead ofcontract_env::caller()
useself.env.caller()
. - Replaced
test_env
withodra_test::env()
in the test context (of typeHostEnv
). - It is no longer possible to put a Mapping inside a Mapping. Use tuple keys instead, for example, instead of
allowances: Mapping<Address, Mapping<Address, U256>>
use
allowances: Mapping<(Address, Address), U256>
Ref
has been divided into two:HostRef
andContractRef
depending on the context.- Storage keys are constructed differently, keep that in mind when querying the storage outside the contract.
token_balance(address: Address)
in test context is nowbalance_of(address: &Address)
.- Modules needs to be wrapped in SubModule<> when used in another module.
HostRef
(formerlyRef
) methods parameters accept values even if endpoints expect references.unwrap_or_revert
andunwrap_or_revert_with
now require&HostEnv
as a first parameter.Variable
has been renamed toVar
.- Spent Gas is taken into account when checking an account balance. This means that all calls appear to cost 0 gas to the test accounts, but it is still possible to check the costs of the calls.
- Various changes of method signatures in
odra-modules
, e.g.&[U256]
changed toVec<U256>
inon_erc1155_batch_received
method. get_block_time()
now returnsu64
instead of wrapped typeBlocktime(u64)
.- The
name
property inOdra.toml
is not required anymore. odra-casper-backend
crate is nowodra-casper-wasm-env
odra-mock-vm
crate is nowodra-vm
odra-proc-macros
is the only code generation point.
- Removed
#[odra::init]
macro - now only one method can be a constructor, and it has to be namedinit
. - Removed
emit()
method from events. Useself.env.emit_event(event)
instead. - Removed
assert_events!
macro. Useenv.emitted_event
and similar methods instead. - Removed
native_token_metadata()
and its respective structs. - Removed
assert_exception!
macro. Usetry_
prefix for endpoints instead. It returns aResult
which can be used with a regularassert_eq!
macro.` - Removed
odra(using)
macro. - Removed
default()
method fromDeployer
. Useinit()
instead. - Removed
StaticInstance
andDynamicInstance
traits. UseModule
instead. - Removed
Node
trait. - Removed
odra-types
,odra-ir
,odra-codegen
,odra-casper-backend
,odra-casper-shared
,odra-utils
crates. - Removed
OdraEvent
trait,odra
reexportscasper_event_standard
crate instead.
last_call()
in test env withContractCallResult
struct which holds all information about the last call.odra::prelude::*
module which reexports all basic types and traits. It is recommended to use it in the module code.odra-test
crate providingHostEnv
for testing purposes.odra-core
crate providing framework core functionalities.odra-casper-rcp-client
crate providingCasperClient
for interacting with Casper node.odra-casper-livenet-env
crate providing a host environment fo for the Casper livenet.HostRef
trait - a host side reference to a contract.HostRefLoader
trait for loading a contract from the host environment.EntryPointsCallerProvider
trait.Deployer
trait - a struct implementing that trait can deploy a contract.InitArgs
trait - a struct implementing that trait can be used as a constructor argument.NoArgs
struct, an implementation ofInitArgs
for empty/none (no constructor) arguments.
- Copy
bin
folder andbuild.rs
files from a freshly generated project usingcargo-odra
at version at least0.1.0
. - Update
Cargo.toml
by removing features and adding [[bin]] sections (SeeCargo.toml
from generated project). - Update the code to reflect changes in the framework.
no_std
is now the default mode for WASM.odra-types
are the only types crate.
- Removed
odra-casper-types
andodra-mock-vm-types
. - Removed
OdraType
in favor ofToBytes
andFromBytes
traits.
std
feature for odra crate.odra::prelude
reexports basic types and traits based on std feature.
- Replace
WeeAlloc
withink!
'sBumpAllocator
.
- Signature verification in contract_envs.
- Signature creation in test_envs.
- StaticInstance and DynamicInstance traits.
- Node trait to build static keys at the compilation time.
List
now can contain modules.
- Crypto module from odra-modules.
- Instance trait.
- derive PartialEq, Eq, Debug from storage building block (Var, Mapping, List).
- utilize
KeyMaker
to create storage keys incasper
andcasper-livenet
. - Only
payable
entrypoints checks incoming Casper purse and it is optional. - Casper contract's
cargo_purse
is now created just once and reused.
odra-casper-livenet
has new resource:proxy_caller.wasm
.odra-casper-shared
,odra-casper-types
andodra-types
are nowno_std
.- Modules can have arguments that are references.
odra-casper-test-env
has newgas_report()
function, that shows gas usages.
- Casper gas counting.
test-env/getter-proxy
is nowproxy-caller
.proxy_getter.wasm
is nowproxy_caller_with_result.wasm
.- Casper's
call
methods for wasm build has a new set of arguments including upgradable contracts. - Support for the Casper 1.5.1 version.
casper-node
is no longer a dependency forodra-casper-livenet
.Composer
Composer
- a tool for composing Odra modules' instances.- Casper's
chainspec.yaml
added to the repository. - Improvements to numeric conversions.
Typed
trait is implemented automatically forOdraType
types.test_env
exposestotal_gas_used()
function to allow better native token usage tracking.RUST_BACKTRACE=-1
will show the backtrace of the contract calls that panicked.- Panicked contract calls will print the information about the call.
- Better handling of call stack in MockVM.
- Better handling of native transfers in MockVM.
- Genesis in the MockVM generates more addresses with more tokens.
- Improved
assert_exception!
macro. It no longer needs new instance of Ref.
transfer_tokens()
now reverts if the transfer failed instead of returning false.advance_block_time_by()
now uses milliseconds instead of seconds.
- new module -
Sequence
- for storing single value in the storage that can be incremented. - Casper contracts now generate schemas automatically. containing contract structure and Events schemas following the Casper Event Standard.
- Modules and Mappings now can be a part of a Mapping allowing to nest them.
- Namespaces can be generated manually for a finer control over nesting.
#[odra::module(events = [Event1, Event2, ...])]
attribute for modules to generate events.delegate!
macro for delegating calls to other modules.#[odra(non_reeentrant)]
attribute for modules to enable reentrancy guard.#[derive(OdraType)]
for derivingOdraType
trait for custom types.- Unit-type Enums can now be OdraTypes.
- New Odra Modules:
Erc721
,Erc1155
,Ownable
,Ownable2Step
,AccessControl
.
- Experimental
odra-casper-livenet
crate for deploying contracts to Casper Livenet.
last_call_contract_cost()
is nowlast_call_contract_gas_used()
.- It is no longer possible to build zero address in casper.
new
method for Address.
- Global
CHANGELOG.md
. odra
List
collection.- Add tests for
Var
andMapping
. - Contract refs (
*Ref
struct) haswith_tokens()
function to attach tokens to the call.
odra-mock-vm
- Add
AccountBalance
to store the native token amount associated with theAddress
. - Add
CallstackElement
to stack contract execution along with the attached value.
- Add
- New crate
odra-mock-vm-types
- encapsulatesmock-vm
-specific types. - New crate
odra-casper-codegen
- generates Casper contracts, moved fromodra-casper-backend
. - New crate
odra-casper-types
- encapsulatesCasper
-specific types. odra-casper-test-env
- Add
dummy_contract_env
module.
- Add
- New crate
odra-examples
Ownable
- simple storage, errors, events.Erc20
- erc-20 standard implementation.OwnedToken
- modules reuse.BalanceChecker
- external contract calls.TimeLockWallet
- payable.
- New crate
odra-modules
a set of reusable modules.Erc20
- erc-20 token.WrappedNativeToken
- erc20-based wrapped token.
CONTRIBUTING.md
andSECURITY.md
.justfile
odra
- Features update: rename
wasm
tocasper
, removewasm-test
. - Features check: setting
casper
andmock-vm
causes compile error. Mapping
's functions:set()
,add()
,subtract()
.Var
's functions:set()
,add()
,subtract()
.Var
andMapping
are implemented forOdraType
.- Add
amount
parameter tocall_contract
. contract_env
andtest_env
are modules not structs.- To deploy contract in test, structs no longer have
deploy_*
function,*Deployer
structs are generated. - The default contract constructor is called
*Deployer::default
.
- Features update: rename
odra-types
- Add
Type
enum describing all supported types. - Rename
Event
toOdraEvent
. - Remove all dependencies.
- Update
VmError
s. - Bring
contract_def
module fromodra
crate. - Remove
casper
dependencies fromcontract_def
.
- Add
odra-utils
- Remove
odra-types
dependency. - Change
event_absolute_position
signature - the function returnsOption<usize>
.
- Remove
odra-codegen
- Handle
odra(payable)
attribute. - Adjust generated code to framework changes.
- Handle
odra-mock-vm
MockVM
refactor.test_env
is a module not a struct.- Change
call_contract()
signature. - Add
advance_block_time_by()
,token_balance()
,one_token()
functions.
odra-casper-backend
,odra-casper-shared
,odra-casper-test-env
moved from a separate repository.odra-casper-backend
contract_env
is a module not a struct.- Add
one_token()
,self_balance()
,attached_value()
,transfer_tokens()
functions. - Change
call_contract()
signature odra-casper-test-env
test_env
is a module not a struct.- Change
call_contract()
signature. - Add
advance_block_time_by()
,token_balance()
,one_token()
functions.
odra
extern bindings.odra-test-env-wrapper
crate.- Separate changelog files per crate.
odra-casper-backend
,odra-casper-shared
,odra-casper-test-env
documentation.
odra
contract_def
provides an abstract definition of a smart contract.external_api
module that defines the api to be implemented by a backed blockchain.instance
module exposing a trait used to instantiate a module.variable
andmapping
modules that allow to read and write single values and collections in smart contracts.test_utils
module that defines functions and macros to utilize smart contracts testing.unwrap_or_revert
module that provides a trait for unwrapping values in the context of smart contract.CHANGELOG.md
andREADME.md
files.
odra-types
address
module defines a blockchain-agnostic address struct that can be used for storing contract and account addresses.arithmetic
module defines traits for safe (revertable), overflowing addition, and subtraction.event
module that defines an event interface and companion errors.error
module encapsulates errors that may occur during smart contract execution.ToBytes
andFromBytes
traits for structs serialization and deserialization, e.g. events.CHANGELOG.md
andREADME.md
files.- Re-export
casper-types
asodra-types
.
odra-utils
camel_to_snake
function for the contract name conversion.event_absolute_position
function to calculate the event absolute position.CHANGELOG.md
andREADME.md
files.
odra-test-env-wrapper
TestBackend
defines the api oflibodra_test_env.so
.on_backend
function to interact withlibodra_test_env.so
.CHANGELOG.md
andREADME.md
files.
odra-mock-vm
TestEnv
andContractEnv
implementations used to run tests.MockVM
, a lightweight blockchain virtual machine.CHANGELOG.md
andREADME.md
files.
odra-proc-macros
- Procedural macro
odra::module
. - Procedural macro
odra::instance
. - Procedural macro
odra::external_contract
. - Procedural macro
odra::execution_error
. - Procedural macro
odra::odra_error
. - Derive macro
Event
. CHANGELOG.md
andREADME.md
files.
- Procedural macro
odra-ir
- structs responsible for capturing code used to generate code for
odra::module
,odra::instance
,odra::external_contract
,odra::execution_error
,odra::odra_error
, andEvent
macros. CHANGELOG.md
andREADME.md
files.
- structs responsible for capturing code used to generate code for
odra-codegen
- code generators for
odra::module
,odra::instance
,odra::external_contract
,odra::execution_error
,odra::odra_error
, andEvent
macros. CHANGELOG.md
andREADME.md
files.
- code generators for
odra-casper-test-env
getter_proxy
child crate.CHANGELOG.md
andREADME.md
files.env::CasperTestEnv
that wraps Casper'sInMemoryWasmTestBuilder
.#[no_mangle]
functions used to communicate with thelibodra_test_env.so
odra-casper-shared
casper_address::CasperAddress
struct.CHANGELOG.md
andREADME.md
files.
odra-casper-backend
codegen
module that is used to generate wasm file.backend
module that exports all required#[no_mangle]
functions and interacts with the Casper Host.CHANGELOG.md
andREADME.md
files.
odra-casper-getter-proxy
getter_proxy.rs
binary file.