Skip to content

Commit

Permalink
migrate readme's to #[storage] macro
Browse files Browse the repository at this point in the history
  • Loading branch information
qalisander committed Dec 11, 2024
1 parent 200c2c0 commit b52baa6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ Once defined as a dependency, use one of our pre-defined implementations by
importing them:
```rust
use stylus_sdk::prelude::*;
use openzeppelin_stylus::token::erc20::Erc20;
sol_storage! {
#[entrypoint]
struct Erc20Example {
#[borrow]
Erc20 erc20;
}
#[entrypoint]
#[storage]
struct Erc20Example {
#[borrow]
pub erc20: Erc20,
}
#[public]
Expand Down
11 changes: 5 additions & 6 deletions contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ importing them:
use stylus_sdk::prelude::*;
use openzeppelin_stylus::token::erc20::Erc20;
sol_storage! {
#[entrypoint]
struct MyContract {
#[borrow]
Erc20 erc20;
}
#[entrypoint]
#[storage]
struct MyContract {
#[borrow]
pub erc20: Erc20,
}
#[public]
Expand Down

0 comments on commit b52baa6

Please sign in to comment.