Vemo Network Docs
  • Overview
  • VEMO PROTOCOL
    • NFT Account
      • How it works
      • Integration
    • Smart Voucher
      • How it works
      • Integration
      • Examples
      • Voucher NFT Collection
  • VEMO APP
    • NFT Account Guidance
      • Create a NFT Account
      • Deposit & Withdraw
      • Connect to a DApp
      • Delegation
    • Marketplace Guidance
    • Smart Voucher Guidance
      • Admin Console
      • IVO Page
      • Portfolio
      • Marketplace
  • TOKENOMICS
    • $VEMO token
    • Vesting Schedule
  • REFERENCES
    • Audits
    • FAQ
Powered by GitBook
On this page
  • Sequence Diagram
  • The project owner conducts an IVO
  • Token holder creates a voucher
  • Voucher holder claims tokens
  • APIs
  • Data Structure
  • Events
  1. VEMO PROTOCOL
  2. Smart Voucher

Integration

PreviousHow it worksNextExamples

Last updated 9 months ago

The Voucher Factory, represented by the VoucherFactory.sol contract, is the control center for both the NFT collection and its related token-bound accounts. It provides Dapps, project owners, and users with the ability to create vouchers and serves as the entry point for generating ERC6551Accounts.

The deployment contract addresses of VoucherFactory.sol on different chains:

Chain
Address

Avalanche Fuji Testnet

0x65B903D7903d277bE600B8524a759aBEa3CC7e1A

Avalanche Mainnet

0xbB740E17f3c177172CaAcCef2F472DB41b9b1d19

Bnb Mainnet

0x9869524fd160fe3adDA6218883B6526c0977D3a5

Sequence Diagram

The project owner conducts an IVO

In this case, the project owner is preparing for an Initial Voucher Offering (IVO) as fundraising or airdrop strategies. They'll set up a vesting pool with a pre-set vesting scheme and terms, then deposit their tokens into this pool. This setup will enable participants to mint vouchers, which will contain tokens within them.

  • Project Owner creates a vesting pool:

  • Pool participant mints a voucher:

Token holder creates a voucher

In this case, a retail token holder chooses to convert his tokens into a voucher, setting the vesting scheme and terms himself. After creation, the voucher is returned to his account. He then has the option to sell the voucher in the secondary market.

Voucher holder claims tokens

Whoever holds the voucher at the end of the day has the right to claim the tokens from the voucher according to the vesting scheme.

The Voucher Factory, represented by the Voucher.sol contract, is the control center for both the NFT collection and its related token-bound accounts. It provides Dapps, project owners, and users with the ability to create vouchers and serves as the entry point for generating ERC6551Accounts.

The deployment contract addresses of Voucher.sol on different chains:

Chain
Address

Avalanche Fuji Testnet

0x65B903D7903d277bE600B8524a759aBEa3CC7e1A

Avalanche Mainnet

0xbB740E17f3c177172CaAcCef2F472DB41b9b1d19

Bnb Mainnet

0x9869524fd160fe3adDA6218883B6526c0977D3a5

APIs

  • VoucherFactory.createBatchFor: Allows an user to batch mint vouchers with tokens, multiple vesting schemes.

function createBatchFor(address tokenAddress, BatchVesting memory batch, uint96 royaltyRate, address receiver) public nonReentrant returns (address, uint256, uint256) {}
  • VoucherFactory.redeem: This function executes a vesting process for the voucher owner, with VoucherFactory acting as the portal.

function redeem(address nftAddress, uint256 tokenId, uint256 _amount) external returns (bool) {}

Data Structure

  • Voucher input structure:

struct VestingSchedule {
    uint256 amount;
    uint8 vestingType; // linear: 1 | staged: 2
    uint8 linearType; // day: 1 | week: 2 | month: 3 | quarter: 4
    uint256 startTimestamp;
    uint256 endTimestamp;
    uint8 isVested; // unvested: 0 | vested : 1 | vesting : 2
    uint256 remainingAmount;
}

struct VestingFee {
    uint8 isFee; // no-fee: 0 | fee : 1
    address feeTokenAddress;
    address receiverAddress;
    uint256 totalFee;
    uint256 remainingFee;
}

struct Vesting {
    uint256 balance;
    VestingSchedule[] schedules;
    VestingFee fee;
}

struct BatchVesting {
    Vesting vesting;
    uint256 quantity;
    string[] tokenUris;
}

Events

  • VoucherCreated: Emitted when a voucher is created.

event VoucherCreated(
        address indexed account,
        address indexed currency,
        uint256 amount,
        address indexed nftCollection,
        uint256 tokenId
    );
  • VoucherRedeem: Signals when a partial or full amount of vesting tokens is claimed from the voucher.

 event VoucherRedeem(
        address indexed account,
        address indexed currency,
        uint256 claimedAmount,
        address indexed nftCollection,
        uint256 tokenId
    );