Skip to content

Commit

Permalink
feat: add entry to CHANGELOG and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnordelo committed Jul 29, 2024
1 parent 6bd4ac8 commit 0af0fff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- TimelockController component (#996)
- HashCall implementation (#996)
- Separated package for each submodule (#1065)
- `openzeppelin_access`
- `openzeppelin_account`
- `openzeppelin_governance`
- `openzeppelin_introspection`
- `openzeppelin_presets`
- `openzeppelin_security`
- `openzeppelin_token`
- `openzeppelin_upgrades`
- `openzeppelin_utils`

### Changed

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ Edit `scarb.toml` and add:
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.15.0-rc.0" }
```

The previous example would import the entire library. we can also add each package as a separated dependency to improve the time for building by not including modules that won't be used:

```toml
[dependencies]
openzeppelin_token = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.15.0-rc.0" }
```

Build the project to download it:

```bash
Expand All @@ -65,7 +72,8 @@ For example, this is how to write an ERC20-compliant contract:
```cairo
#[starknet::contract]
mod MyToken {
use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl};
// If only the token package was added as a dependency, use `openzeppelin_token::` instead
use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl};
use starknet::ContractAddress;
component!(path: ERC20Component, storage: erc20, event: ERC20Event);
Expand Down

0 comments on commit 0af0fff

Please sign in to comment.