Interest Protocol
  • 👋Welcome to Interest Protocol
  • Overview
    • Sui💧
      • Contracts
        • Memez
        • Libs 📚
      • Suicoins
        • Swap
        • Dollar-Cost Averaging (DCA)
        • Airdrop
          • Suiplay Airdrop
        • Incinerator
        • Send
        • Merger
        • Suicoins Terminal
      • Memez.gg
        • Coins on Memez.GG
        • Memez.Fun
          • SDK
            • Pump API
            • Interfaces
          • Configuration
          • Migrators
          • Bonding Curve
          • Fees
      • IPX Coin Standard
    • Movement
      • Interest Protocol Decentralized Exchange (DEX)
        • Key Features
        • Core Innovations
      • sr-AMM
      • Token
        • Tokenomics
        • Utility
      • GTM
    • Audits
    • Security
    • Deprecated
      • Coin X Oracle 🔮
        • Pyth Network
        • Switchboard
      • Sui Tears 💧
        • Airdrop
          • Airdrop
          • Airdrop Utils
          • Linear Vesting Airdrop
        • Capabilities
          • Access Control
          • Owner
          • Quest
          • Timelock
        • Collections
          • Bitmap
          • Coin Decimals
        • DeFi
          • Oracle
          • Farm
          • Fund
          • Linear Vesting Wallet
          • Linear Clawback Vesting Wallet
          • Vesting
        • Governance
          • DAO
          • DAO Admin
          • DAO Treasury
        • Utils
          • ASCII
          • Comparator
          • Merkle Proof
          • Vectors
        • Math
          • Fixed Point 64
          • Fixed Point Roll
          • Fixed Point Wad
          • Int
          • Math64
          • Math128
          • Math256
      • CLAMM🐚
        • Hooks
      • Whitepapers
  • Glossary
Powered by GitBook
On this page
  • Structs
  • Wallet
  • Interface
  • new
  • share
  • balance
  • start
  • released
  • duration
  • clawbacked
  • vesting_status
  • claim
  • clawback
  • destroy_zero

Was this helpful?

Export as PDF
  1. Overview
  2. Deprecated
  3. Sui Tears 💧
  4. DeFi

Linear Clawback Vesting Wallet

Creates a Wallet that allows the holder to claim coins linearly. The holder of the OwnerCap can reclaim any locked coins back.

Structs

Wallet

  struct Wallet<phantom T> has key, store {
    id: UID,
    balance: Balance<T>,
    start: u64,
    released: u64,
    duration: u64,
    clawbacked: u64
  }
  • balance - Amount of tokens to give to the holder of the wallet.

  • start - The holder can start claiming tokens after this date.

  • released - Total amount of `Coin<T>` released so far.

  • duration - The duration of the vesting.

  • clawbacked - The amount of tokens recalled.

Interface

new

It creates a new Wallet and two capabilities for the recipient and the clawback owner.

  public fun new<T>(
    token: Coin<T>, 
    c: &Clock, 
    start: u64, 
    duration: u64, 
    ctx: &mut TxContext
  ): (OwnerCap<ClawBackWitness>, OwnerCap<RecipientWitness>, Wallet<T>)
  • @param token: A sui::coin::Coin<T>.

  • @param c: The shared object sui::clock::Clock

  • @param start: Dictate when the vesting schedule starts.

  • @param duration: Dictate when the vesting schedule starts.

  • @return OwnerCap<ClawBackWitness>: The holder of this capability can claw back the coins.

  • @return OwnerCap<RecipientWitness>: The holder of this capability can claim tokens according to the linear schedule.

  • @return Wallet.

Aborts

  • start is in the past.

share

It shares the Wallet with the network.

public fun share<T>(self: Wallet<T>)
  • @param self: A Wallet.

balance

Returns the current amount of tokens in the self.

public fun balance<T>(self: &Wallet<T>): u64
  • @param self: A Wallet.

  • @return u64.

start

Returns the vesting schedule start time.

public fun start<T>(self: &Wallet<T>): u64
  • @param self: A Wallet.

  • @return u64.

released

Returns the current amount of total released tokens from the self.

public fun released<T>(self: &Wallet<T>): u64
  • @param self: A Wallet.

  • @return u64.

duration

Returns the duration of the vesting schedule.

public fun duration<T>(self: &Wallet<T>): u64
  • @param self: A Wallet.

  • @return u64.

clawbacked

Returns the number of tokens that were claw-backed by the holder of OwnerCap from the self.

public fun clawbacked<T>(self: &Wallet<T>): u64
  • @param self: A Wallet.

  • @return u64.

vesting_status

Returns the current amount of coins available to the caller based on the linear schedule.

public fun vesting_status<T>(self: &Wallet<T>, c: &Clock): u64
  • @param self: A Wallet.

  • @param c: The sui::clock::Clock shared object.

  • @return u64. A portion of the amount that can be claimed by the user.

claim

Releases the current amount of coins available to the caller based on the linear schedule.

public fun claim<T>(self: &mut Wallet<T>, cap: &OwnerCap<RecipientWitness>, c: &Clock, ctx: &mut TxContext): Coin<T>
  • @param self: A Wallet.

  • @param cap: The recipient capability that owns the self.

  • @param c: The sui::clock::Clock shared object.

  • @return Coin.

Aborts

  • cap does not own the self.

clawback

Returns all unreleased coins to the cap holder.

public fun clawback<T>(self: &mut Wallet<T>, cap: OwnerCap<ClawBackWitness>, c: &Clock, ctx: &mut TxContext): Coin<T>
  • @param self: A Wallet.

  • @param cap: The clawback capability that owns the self.

  • @param c: The sui::clock::Clock shared object.

  • @return Coin.

Aborts

  • cap does not own the self.

destroy_zero

Destroys a Wallet with no balance.

public fun destroy_zero<T>(self: Wallet<T>)
  • @param self: A Wallet.

PreviousLinear Vesting WalletNextVesting

Last updated 1 year ago

Was this helpful?