Skip to content

Update Stylus how-to guides for SDK 0.10.7#3410

Open
anegg0 wants to merge 8 commits into
masterfrom
stylus-docs-how-tos
Open

Update Stylus how-to guides for SDK 0.10.7#3410
anegg0 wants to merge 8 commits into
masterfrom
stylus-docs-how-tos

Conversation

@anegg0

@anegg0 anegg0 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Stylus docs update — part of a small set of PRs (tagged stylus) bringing docs/stylus/ in line with the current stack (stylus-sdk / cargo-stylus 0.10.7, Nitro v3.11.0).

  • how-tos/exporting-abi.mdx — remove phantom CLI (export-abi constructor, --license, --pragma); document cargo stylus constructor.
  • how-tos/using-constructors.mdx — fix the event-emission API; add --constructor-value for payable constructors.
  • how-tos/trait-based-composition.mdx — add required #[public] on interface traits; modernize the selector example.

Examples verified against the live toolchain (compiled/deployed on a local Nitro dev node where relevant) and conceptual claims against the Nitro source. Builds clean (yarn build, strict onBrokenLinks). Version strings are literals here; they are centralized into globalVars.js in a follow-up PR.

@anegg0 anegg0 added the stylus label Jun 24, 2026
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arbitrum-docs Ready Ready Preview Jun 30, 2026 5:29pm

Request Review

Comment thread docs/stylus/how-tos/exporting-abi.mdx Outdated
Comment thread docs/stylus/how-tos/exporting-abi.mdx

@EmreDincoglu EmreDincoglu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will continue the review on monday, but as of right now either stylus is just super hard to use or there is just a lot of changes that make previous things work no longer work

@EmreDincoglu

Copy link
Copy Markdown
Member

the updated code all seems to work, given the things I mentioned in the parts that were not updated (I went through the doc to learn and test thats how I caught it)

Co-authored-by: Emre Dincoglu <85258206+EmreDincoglu@users.noreply.github.com>
@anegg0

anegg0 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I will continue the review on monday, but as of right now either stylus is just super hard to use or there is just a lot of changes that make previous things work no longer work

Yes, same assessment here. There are quite a few things that have changed lately.

Co-authored-by: Emre Dincoglu <85258206+EmreDincoglu@users.noreply.github.com>
Comment on lines 235 to 257
use stylus_sdk::prelude::*;

sol! {
error InsufficientBalance(address account, uint256 requested, uint256 available);
error Unauthorized(address caller);
error InvalidAmount();
}

#[public]
impl Token {
pub fn transfer(&mut self, to: Address, amount: U256) -> Result<(), InsufficientBalance> {
let sender = self.vm().msg_sender();
let balance = self.balances.get(sender);
if balance < amount {
return Err(InsufficientBalance {
account: sender,
requested: amount,
available: balance,
});
}
// Transfer logic
Ok(())
}

@EmreDincoglu EmreDincoglu Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gotta be deleted, I cant add a suggestion due to the GH bug I was talking abt, I tried doing the suggestion removing all the lines in this chunk makes GH think im trying to delete other lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few more changes; this should compile.
Please let me know if that's acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants