Skip to content

Docs: Add ERC20StakingFacet example to Design for Composition guide#206

Merged
mudgen merged 2 commits into
Perfect-Abstractions:mainfrom
isihin-3:docs/extending-facets-example
Nov 20, 2025
Merged

Docs: Add ERC20StakingFacet example to Design for Composition guide#206
mudgen merged 2 commits into
Perfect-Abstractions:mainfrom
isihin-3:docs/extending-facets-example

Conversation

@isihin-3

@isihin-3 isihin-3 commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds an "Extending Facets" example to the Design for Composition guide. The new section demonstrates, with code snippets.

Changes Made

https://compose.diamonds/docs/design/design-for-composition added an "Extending Facets Example" section with explanatory text and code snippets illustrating how to extend an existing facet in a composable way.

Checklist

Before submitting this PR, please ensure:

  • Code follows the Solidity feature ban - No inheritance, constructors, modifiers, public/private variables, external library functions, using for directives, or selfdestruct

  • Code follows Design Principles - Readable, uses diamond storage, favors composition over inheritance

  • Code matches the codebase style - Consistent formatting, documentation, and patterns (e.g. ERC20Facet.sol)

  • Code is formatted with forge fmt

  • Existing tests pass - Run tests to be sure existing tests pass.

  • New tests are optional - If you don't provide tests for new functionality or changes then please create a new issue so this can be assigned to someone.

  • All tests pass - Run forge test and ensure everything works

  • Documentation updated - If applicable, update relevant documentation

#202

@netlify

netlify Bot commented Nov 20, 2025

Copy link
Copy Markdown

👷 Deploy request for compose-diamonds pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 922012c

@mudgen

mudgen commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

@isihin-3 I looked this over and it looks very good. Well done!

if (s.stakingStartTimes[msg.sender] == 0) {
s.stakingStartTimes[msg.sender] = block.timestamp;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to emit the ERC20 Transfer event here. For example:

emit Transfer(msg.sender, address(this), _amount);

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 did the changes in the latest commit please check it

@mudgen mudgen merged commit 5c1a8ac into Perfect-Abstractions:main Nov 20, 2025
1 check passed
@mudgen

mudgen commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Thanks @isihin-3. Good work!

@isihin-3 isihin-3 deleted the docs/extending-facets-example branch November 20, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants