Skip to content

Commit

Permalink
[move] Adds Coin::zero() (MystenLabs#823)
Browse files Browse the repository at this point in the history
- adds Coin::zero() method
  • Loading branch information
damirka authored Mar 14, 2022
1 parent 3ea6050 commit 1aa9f8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sui_programmability/framework/sources/Coin.move
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ module Sui::Coin {

// === Registering new coin types and managing the coin supply ===

/// Make any Coin with a zero value. Useful for placeholding
/// bids/payments or preemptively making empty balances.
public fun zero<T>(ctx: &mut TxContext): Coin<T> {
Coin { id: TxContext::new_id(ctx), value: 0 }
}

/// Create a new currency type `T` as and return the `TreasuryCap`
/// for `T` to the caller.
/// NOTE: It is the caller's responsibility to ensure that
Expand Down

0 comments on commit 1aa9f8f

Please sign in to comment.