Skip to content

Commit aa6f290

Browse files
authored
build: v0.2.0 (#714)
1 parent 0e43964 commit aa6f290

36 files changed

+118
-94
lines changed

CHANGELOG.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,45 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [v0.2.0] - 2025-06-20
9+
10+
> **Heads-up:** this is the production release after four pre-releases
11+
> (`alpha.1-4`, `rc.0`). The items below aggregate the _user-facing_ changes
12+
> since **v0.1.2**. For the step-by-step evolution, see the individual
13+
> pre-release sections further down.
914
1015
### Added
1116

17+
- **ERC-1155 token** (`Erc1155`, `Burnable`, `MetadataUri`, `Supply`, `UriStorage`).
18+
- **ERC-4626** “Tokenized Vault Standard” and **ERC-20 Flash Mint** extension.
19+
- **ERC-2981** on-chain royalties.
20+
- **ERC-20 Utils**: `SafeErc20`.
21+
- **Finance**: `VestingWallet`.
22+
- **Ownership**: `Ownable2Step`.
23+
- **Token wrappers**: `Erc20Wrapper`, `Erc721Wrapper`.
24+
- **Cryptography**: Poseidon2 hash, Pedersen hash (Starknet params), Short-Weierstrass Curves.
25+
- **Math & utils**: optimised `Uint<_>` big-integer ops (`mul_div`, shift-left/right, checked/unchecked add/sub).
26+
- **Constructors** now supported across all contracts.
27+
- All events derive `Debug`; contracts implement `MethodError` and `IErc165`.
28+
1229
### Changed
1330

14-
- Custom Solidity selector names in traits with `#[interface_id]` error out on conflicting function selectors. #702
15-
- Bump `cargo-stylus` to `v0.6.0`. #683
31+
- Keccak constants pre-computed at compile-time.
32+
- Optimisations across contracts and crypto libraries.
1633

1734
### Changed (Breaking)
1835

19-
- Read-only functions in `IErc4626` now accept `&self`. #698
36+
- **Stylus SDK** ↑ to **v0.9.0** (`cargo-stylus` ↑ to v0.6.0)
37+
- Contracts refactored to new inheritance model.
38+
- Interface IDs now returned by `fn interface_id()`; `IErc165::supports_interface` takes `&self`; `Erc165` struct removed.
39+
- Public state fields made private.
40+
- Feature **`std` removed** from libraries.
2041

2142
### Fixed
2243

23-
- `#[interface_id]` does not skip now `unsafe` keyword for unsafe traits. #705
24-
- `#[interface_id]` now correctly retains full trait generics. #705
25-
- `Erc20Wrapper::decimals` matches Solidity implementation. #699
44+
- Correct ERC-165 IDs for `IErc721Metadata`, `IErc721Enumerable`, etc.
45+
- `#[interface_id]` macro now propagates super-traits correctly.
46+
- Edge-cases in Merkle proofs, big-int overflows and re-entrancy bugs resolved.
2647

2748
## [v0.2.0-rc.0] - 2025-05-22
2849

Cargo.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ authors = ["OpenZeppelin"]
7070
edition = "2021"
7171
license = "MIT"
7272
repository = "https://github.com/OpenZeppelin/rust-contracts-stylus"
73-
version = "0.2.0-rc.0"
73+
version = "0.2.0"
7474

7575
[workspace.lints.rust]
7676
missing_docs = "warn"
@@ -130,7 +130,7 @@ motsu = "=0.9.1"
130130

131131
# members
132132
openzeppelin-stylus = { path = "contracts" }
133-
openzeppelin-stylus-proc = { path = "contracts-proc", version = ">=0.2.1, <=0.2.2" }
133+
openzeppelin-stylus-proc = { path = "contracts-proc", version = "=0.2.2" }
134134
openzeppelin-crypto = { path = "lib/crypto" }
135135
e2e = { path = "lib/e2e" }
136136
e2e-proc = { path = "lib/e2e-proc" }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ line to your `Cargo.toml` (We recommend pinning to a specific version):
2121

2222
```toml
2323
[dependencies]
24-
openzeppelin-stylus = "=0.1.2"
24+
openzeppelin-stylus = "=0.2.0"
2525
```
2626

2727
If you want to use some of our newest features before they are fully stable or audited, you can try the latest alpha version of the library. We release a new alpha version every ~3 weeks.

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: contracts-stylus
22
title: Contracts for Stylus
3-
version: 0.1.1
3+
version: 0.2.0
44
nav:
55
- modules/ROOT/nav.adoc

docs/modules/ROOT/nav.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
* xref:index.adoc[Overview]
22
3+
* xref:access-control.adoc[Access Control]
4+
5+
* xref:crypto.adoc[Cryptography]
6+
7+
* xref:finance.adoc[Finance]
8+
39
* xref:tokens.adoc[Tokens]
410
** xref:erc20.adoc[ERC-20]
511
*** xref:erc20.adoc#erc20-token-extensions[Extensions]
@@ -8,6 +14,4 @@
814
** xref:erc1155.adoc[ERC-1155]
915
*** xref:erc1155.adoc#erc1155-token-extensions[Extensions]
1016
11-
* xref:access-control.adoc[Access Control]
12-
* xref:crypto.adoc[Cryptography]
1317
* xref:utilities.adoc[Utilities]

docs/modules/ROOT/pages/access-control.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Access control—that is, "who is allowed to do this thing"—is incredibly impo
77

88
The most common and basic form of access control is the concept of _ownership_: there's an account that is the `owner` of a contract and can do administrative tasks on it. This approach is perfectly reasonable for contracts that have a single administrative user.
99

10-
OpenZeppelin Contracts for Stylus provides https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/ownable/struct.Ownable.html[`Ownable`] for implementing ownership in your contracts.
10+
OpenZeppelin Contracts for Stylus provides https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/ownable/struct.Ownable.html[`Ownable`] for implementing ownership in your contracts.
1111

1212
[source,rust]
1313
----
@@ -74,12 +74,12 @@ impl IOwnable for MyContract {
7474
}
7575
----
7676

77-
At deployment, the https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.owner[`owner`] of an `Ownable` contract is set to the provided `initial_owner` parameter.
77+
At deployment, the https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.owner[`owner`] of an `Ownable` contract is set to the provided `initial_owner` parameter.
7878

7979
Ownable also lets you:
8080

81-
* https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.transfer_ownership[`transfer_ownership`] from the owner account to a new one, and
82-
* https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.renounce_ownership[`renounce_ownership`] for the owner to relinquish this administrative privilege, a common pattern after an initial stage with centralized administration is over.
81+
* https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.transfer_ownership[`transfer_ownership`] from the owner account to a new one, and
82+
* https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/ownable/struct.Ownable.html#method.renounce_ownership[`renounce_ownership`] for the owner to relinquish this administrative privilege, a common pattern after an initial stage with centralized administration is over.
8383

8484
WARNING: Removing the owner altogether will mean that administrative tasks that are protected by `only_owner` will no longer be callable!
8585

@@ -100,7 +100,7 @@ Most software uses access control systems that are role-based: some users are re
100100
[[using-access-control]]
101101
=== Using `AccessControl`
102102

103-
OpenZeppelin Contracts provides https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/control/struct.AccessControl.html[`AccessControl`] for implementing role-based access control. Its usage is straightforward: for each role that you want to define,
103+
OpenZeppelin Contracts provides https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/control/struct.AccessControl.html[`AccessControl`] for implementing role-based access control. Its usage is straightforward: for each role that you want to define,
104104
you will create a new _role identifier_ that is used to grant, revoke, and check if an account has that role.
105105

106106
Here's a simple example of using `AccessControl` in an xref:erc20.adoc[ERC-20 token] to define a 'minter' role, which allows accounts that have it create new tokens. Note that the example is unassuming of the way you construct your contract.
@@ -256,7 +256,7 @@ impl IAccessControl for Example {
256256
}
257257
----
258258

259-
NOTE: Make sure you fully understand how https://docs.rs/openzeppelin-stylus/0.2.0-rc.0/openzeppelin_stylus/access/control/struct.AccessControl.html[`AccessControl`] works before using it on your system, or copy-pasting the examples from this guide.
259+
NOTE: Make sure you fully understand how https://docs.rs/openzeppelin-stylus/0.2.0/openzeppelin_stylus/access/control/struct.AccessControl.html[`AccessControl`] works before using it on your system, or copy-pasting the examples from this guide.
260260

261261
While clear and explicit, this isn't anything we wouldn't have been able to achieve with `Ownable`. Indeed, where `AccessControl` shines is in scenarios where granular permissions are required, which can be implemented by defining _multiple_ roles.
262262

0 commit comments

Comments
 (0)