Skip to content

Conversation

@isihin-3
Copy link
Contributor

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

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
Copy link

netlify bot commented Nov 20, 2025

👷 Deploy request for compose-diamonds pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 922012c

@mudgen
Copy link
Contributor

mudgen commented Nov 20, 2025

@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
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
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
Copy link
Contributor

mudgen commented Nov 20, 2025

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