Skip to content

Commit

Permalink
Merge pull request #44 from OffchainLabs/add-warning-multi-inheritance
Browse files Browse the repository at this point in the history
Add warning about Stylus not supporting contract multi-inheritance
  • Loading branch information
anegg0 authored Oct 31, 2024
2 parents 806762a + 6855bee commit d8a878e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/basic_examples/inheritance/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const metadata = {

The Stylus Rust SDK replicates the composition pattern of Solidity. The `#[public]` macro provides the [Router](https://docs.rs/stylus-sdk/latest/stylus_sdk/abi/trait.Router.html) trait, which can be used to connect types via inheritance, via the `#[inherit]` macro.

**Please note:** Stylus doesn't support contract multi-inheritance yet.

Let's see an example:

```rust
Expand Down Expand Up @@ -128,4 +130,4 @@ In the example above, even though `B` has an implementation for `foo()`, calling
- [`inheritance, #[inherit] and #[borrow]`](https://docs.rs/stylus-sdk/latest/stylus_sdk/prelude/attr.public.html#inheritance-inherit-and-borrow)
- [`Router trait`](https://docs.rs/stylus-sdk/latest/stylus_sdk/abi/trait.Router.html)
- [`Borrow trait`](https://doc.rust-lang.org/core/borrow/trait.Borrow.html)
- [`BorrowMut trait`](https://doc.rust-lang.org/core/borrow/trait.BorrowMut.html)
- [`BorrowMut trait`](https://doc.rust-lang.org/core/borrow/trait.BorrowMut.html)

0 comments on commit d8a878e

Please sign in to comment.