Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brozorec committed Jan 29, 2025
1 parent 827f2cc commit 02bdf98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions contracts/token/fungible/src/extensions/metadata/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/// Unlike other extensions, `metadata` does not provide a separate trait
/// because the corresponding functions are already available in
/// [`crate::FungibleToken`].
///
/// The decision to keep `metadata` as a standalone extension allows developers
/// the flexibility to either use dynamic metadata functions or hardcode
/// values for `decimals`, `symbol`, and `name` when designing their token
/// contract.
mod storage;
pub use self::storage::{
decimals, get_metadata, name, set_metadata, symbol, Metadata, METADATA_KEY,
Expand Down
6 changes: 4 additions & 2 deletions examples/fungible-pausable/src/contract_token_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
//! [`openzeppelin_fungible_token::fungible::FungibleToken`] and
//! [`openzeppelin_fungible_token::burnable::FungibleBurnable`], whereas this
//! version directly implements [`soroban_sdk::token::TokenInterface`].
//!
//! Ultimately, it is up to the user to choose their preferred approach to
//! creating a SEP-41 token.
//! creating a SEP-41 token. We suggest the approach in "contract.rs" for better
//! organization of the code, consistancy and ease of inspection/debugging.

Check warning on line 12 in examples/fungible-pausable/src/contract_token_interface.rs

View workflow job for this annotation

GitHub Actions / check-for-typos

"consistancy" should be "consistency".
use openzeppelin_fungible_token::{self as fungible, mintable::FungibleMintable};
use openzeppelin_pausable::{self as pausable, Pausable};
Expand Down Expand Up @@ -41,7 +43,7 @@ impl ExampleContract {
}

/// `TokenInterface` doesn't require implementing `total_supply()` because
/// of the backwards compatibility with Stellar classic assets.
/// of the need for backwards compatibility with Stellar classic assets.
pub fn total_supply(e: &Env) -> i128 {
fungible::total_supply(e)
}
Expand Down

0 comments on commit 02bdf98

Please sign in to comment.