Skip to content

Commit

Permalink
docs: update README for v0.1.0 (#365)
Browse files Browse the repository at this point in the history
Co-authored-by: Alisander Qoshqosh <[email protected]>
  • Loading branch information
bidzyyys and qalisander authored Oct 17, 2024
1 parent 1703d1e commit 68745a7
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 42 deletions.
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
**A library for secure smart contract development** written in Rust for
[Arbitrum Stylus](https://docs.arbitrum.io/stylus/stylus-gentle-introduction).

> [!WARNING]
> This project is still in a very early and experimental phase. It has never
> been audited nor thoroughly reviewed for security vulnerabilities. Do not use
> in production.
## Features

- Security-first smart contracts, ported from the [`openzeppelin-contracts`]
Expand All @@ -23,16 +18,21 @@

## Usage

The library has not been published yet to `crates.io`, and this will be the case
until we reach a stable version. However, one can [specify a git dependency] in
a `Cargo.toml`, like so:
You can import OpenZeppelin Contracts from crates.io by adding the following
line to your `Cargo.toml` (We recommend pinning to a specific version):

```toml
[dependencies]
openzeppelin-stylus = { git = "https://github.com/OpenZeppelin/rust-contracts-stylus" }
openzeppelin-stylus = "0.1.0"
```

We recommend pinning to a specific version -- expect rapid iteration.
Optionally, you can specify a git dependency if you want to have the latest
changes from the `main` branch:

```toml
[dependencies]
openzeppelin-stylus = { git = "https://github.com/OpenZeppelin/rust-contracts-stylus" }
```

Once defined as a dependency, use one of our pre-defined implementations by
importing them:
Expand All @@ -48,7 +48,7 @@ sol_storage! {
}
}

#[external]
#[public]
#[inherit(Erc20)]
impl Erc20Example { }
```
Expand All @@ -65,7 +65,7 @@ For more information on what this library will include in the future, see our
[specify a git dependency]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories
[examples]: ./examples
[basic]: ./examples/basic
[roadmap]: https://github.com/OpenZeppelin/rust-contracts-stylus/milestone/1
[roadmap]: https://github.com/OpenZeppelin/rust-contracts-stylus/milestone/2

## Contribute

Expand All @@ -75,10 +75,7 @@ the [contribution guide](CONTRIBUTING.md)!

## Security

> [!WARNING]
> This project is still in a very early and experimental phase. It has never
> been audited nor thoroughly reviewed for security vulnerabilities. Do not use
> in production.
Past audits can be found in [`audits/`](./audits).

Refer to our [Security Policy](SECURITY.md) for more details.

Expand Down
5 changes: 1 addition & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Security

> [!WARNING]
> This project is still in a very early and experimental phase. It has never
> been audited nor thoroughly reviewed for security vulnerabilities. Do not use
> in production.
Past audits can be found in [`audits/`](./audits).

Please report any security issues you find to [email protected].
6 changes: 1 addition & 5 deletions contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ A library for secure smart contract development written in Rust for
This library offers common smart contract primitives and affordances that take
advantage of the nature of Stylus.
> This project is still in a very early and experimental phase. It has never
> been audited nor thoroughly reviewed for security vulnerabilities. Do not use
> in production.
## Usage
To start using it, add `openzeppelin-stylus` to your `Cargo.toml`, or simply run
Expand All @@ -36,7 +32,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20)]
impl MyContract { }
```
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/access-control.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Ownable)]
impl MyContract {
fn normal_thing(&self) {
Expand Down Expand Up @@ -90,7 +90,7 @@ pub const MINTER_ROLE: [u8; 32] = [
166,
];
#[external]
#[public]
#[inherit(Erc20, AccessControl)]
impl Example {
pub const MINTER_ROLE: [u8; 32] = MINTER_ROLE;
Expand Down Expand Up @@ -136,7 +136,7 @@ pub const BURNER_ROLE: [u8; 32] = [
224, 87, 73, 143, 95, 0, 36, 97, 144, 234, 84, 34, 5, 118, 168, 72,
];
#[external]
#[public]
#[inherit(Erc20, AccessControl)]
impl Example {
pub const MINTER_ROLE: [u8; 32] = MINTER_ROLE;
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sol_storage! {
}
}
#[external]
#[public]
impl Counter {
pub fn number(&self) -> U256 {
self.number.get()
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20-burnable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20)]
impl Erc20Example {
pub fn burn(&mut self, value: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20-capped.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20, Capped)]
impl Erc20Example {
// Add token minting feature.
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20-metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20, Erc20Metadata, Capped, Pausable)]
impl Erc20Example {
// ...
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20-pausable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20, Pausable)]
impl Erc20Example {
pub fn burn(&mut self, value: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20-permit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl IEip712 for Eip712 {
const VERSION: &'static str = "1";
}
#[external]
#[public]
#[inherit(Erc20Permit<Eip712>)]
impl Erc20PermitExample {
// ...
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc20.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc20, Erc20Metadata)]
impl GLDToken {}
----
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-burnable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721)]
impl Erc721Example {
pub fn burn(&mut self, token_id: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-consecutive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721Consecutive)]
impl Erc721ConsecutiveExample {
pub fn burn(&mut self, token_id: U256) -> Result<(), Error> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-enumerable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721, Erc721Enumerable)]
impl Erc721Example {
pub fn burn(&mut self, token_id: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721, Erc721Metadata)]
impl Erc721Example {
// ...
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-pausable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721, Pausable)]
impl Erc721Example {
pub fn burn(&mut self, token_id: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721-uri-storage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721, Erc721Metadata, Erc721UriStorage)]
impl Erc721MetadataExample {
pub fn mint(&mut self, to: Address, token_id: U256) -> Result<(), Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/erc721.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sol_storage! {
}
}
#[external]
#[public]
#[inherit(Erc721, Metadata)]
impl GameItem {
pub fn award_item(
Expand Down

0 comments on commit 68745a7

Please sign in to comment.