Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improve example usage
  • Loading branch information
ernestognw committed Apr 22, 2024
commit f6d92b42219875987458863cd467f95434cef30d
11 changes: 10 additions & 1 deletion contracts/utils/structs/CircularBuffer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ import {Panic} from "../Panic.sol";
*
* * The struct is called `Bytes32CircularBuffer`. Other types can be cast to and from `bytes32`. This data structure
* can only be used in storage, and not in memory.
*
* Example usage:
*
* ```solidity
* CircularBuffer.Bytes32CircularBuffer buffer;
* contract Example {
* // Add the library methods
* using CircularBuffer for CircularBuffer.Bytes32CircularBuffer;
*
* // Declare a buffer storage variable
* CircularBuffer.Bytes32CircularBuffer private myBuffer;
* }
* ```
*/
library CircularBuffer {
Expand Down