File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ Add the dependency to your `Cargo.toml`:
1919
2020``` toml
2121[dependencies ]
22- openzeppelin-stylus = " =0.2 .0"
22+ openzeppelin-stylus = " =0.3 .0"
2323```
2424
2525Enable the ABI export feature:
@@ -34,26 +34,26 @@ export-abi = ["openzeppelin-stylus/export-abi"]
3434A minimal ERC-20 implementation using the library:
3535
3636``` rust
37- use openzeppelin_stylus :: token :: erc20 :: self , Erc20 , IErc20 ;
38- use stylus_sdk ::
39- alloy_primitives :: {Address , U256 ,
37+ use openzeppelin_stylus :: token :: erc20 :: { self , Erc20 , IErc20 } ;
38+ use stylus_sdk :: {
39+ alloy_primitives :: {Address , U256 } ,
4040 prelude :: * ,
4141};
4242
4343#[entrypoint]
4444#[storage]
45- struct Erc20Example
45+ struct Erc20Example {
4646 erc20 : Erc20 ,
47-
47+ }
4848
4949#[public]
5050#[implements(IErc20 <Error = erc20 :: Error >)]
5151impl Erc20Example {}
5252
5353#[public]
54- impl IErc20 for Erc20Example
54+ impl IErc20 for Erc20Example {
5555 // ERC-20 logic implementation...
56-
56+ }
5757```
5858
5959Explore more examples in the [ ` examples ` directory] ( https://github.com/OpenZeppelin/rust-contracts-stylus/tree/main/examples ) .
@@ -64,7 +64,7 @@ This library is designed to work with `no_std`. To keep your contracts compatibl
6464
6565``` toml
6666[dependencies ]
67- alloy-primitives = v ersion = " =0.8.20" , default-features = false
67+ alloy-primitives = " =0.8.20"
6868stylus-sdk = " =0.9.0"
6969```
7070
You can’t perform that action at this time.
0 commit comments