Skip to content

Commit

Permalink
[examples] swap pool implementation (MystenLabs#2510)
Browse files Browse the repository at this point in the history
- adds a liquidity pool implementation
- SUI for any T is allowed
  • Loading branch information
damirka authored Jul 21, 2022
1 parent 4e5bb18 commit c195f49
Show file tree
Hide file tree
Showing 2 changed files with 538 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/sui-framework/sources/balance.move
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ module sui::balance {
public fun join<T>(self: &mut Balance<T>, balance: Balance<T>): u64 {
let Balance { value } = balance;
self.value = self.value + value;
value
self.value
}

spec join {
ensures self.value == old(self.value) + balance.value;
ensures result == balance.value;
ensures result == self.value;
}

/// Split a `Balance` and take a sub balance from it.
Expand Down
Loading

0 comments on commit c195f49

Please sign in to comment.