Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about Stylus not supporting contract multi-inheritance #44

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading