# memez\_fun

<mark style="color:yellow;">destroy -</mark> destroys the Migrator hot potato to get the inner balances.

```rust
public fun destroy<Meme, Quote, Witness: drop>(
    migrator: MemezMigrator<Meme, Quote>,
    _: Witness,
): (address, Balance<Meme>, Balance<Quote>)
```

**Arguments:**

* **`migrator: MemezMigrator<Meme, Quote>`**\
  The migration hot potato representing a Memez pool in its migratable state.\
  Consuming this object finalizes the migration process and allows recovery of the underlying assets.
* **`_: Witness`**\
  A witness type ensuring only the authorized package can invoke `destroy` function.\
  Serves as a compile-time capability check (must have the `drop` ability).

<mark style="color:yellow;">update\_metadata -</mark> replaces the pool metadata.

```rust
public fun update_metadata<Curve, Meme, Quote>(
    self: &mut MemezFun<Curve, Meme, Quote>,
    metadata_cap: &MetadataCap,
    mut metadata: VecMap<String, String>,
)
```

**Arguments:**

* **`self: &mut MemezFun<Curve, Meme, Quote>`**\
  A mutable reference to the Memez pool instance (for any curve type).\
  This is the pool whose metadata will be updated.
* **`metadata_cap: &MetadataCap`**\
  A capability object that authorizes metadata updates.\
  Ensures only accounts with the correct permission can modify the pool’s metadata.
* **`metadata: VecMap<String, String>`**\
  A key–value map of metadata fields (as strings) to attach or update on the pool.\
  Typical entries may include name, symbol, description, or custom fields relevant to frontends or indexers.

<mark style="color:yellow;">metadata -</mark> returns the current pool metadata

```rust
public fun metadata<Curve, Meme, Quote>(
    self: &MemezFun<Curve, Meme, Quote>,
): VecMap<String, String>
```

**Arguments:**

* **`self: &MemezFun<Curve, Meme, Quote>`**\
  An immutable reference to the Memez pool instance (for any curve type).\
  The pool whose metadata will be read.

<mark style="color:yellow;">next\_nonce -</mark> returns the next nonce for the server to create a signature valid for the `user`.

```rust
public fun next_nonce<Curve, Meme, Quote>(self: &MemezFun<Curve, Meme, Quote>, user: address): u64
```

**Arguments:**

* **`self: &MemezFun<Curve, Meme, Quote>`**\
  An immutable reference to the Memez pool instance (for any curve type).\
  The pool from which the nonce will be queried.
* **`user: address`**\
  The address of the user whose next nonce is being requested.\
  It is used to prevent replay attacks and ensure transaction uniqueness for that user in the pool.
