Skip to content

Vara-Lab/VFT-Manager-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

VFT Manager

VFT-Manager template that manages the vft contract. It controls the swap between Varas and the tokens specified on VFT contract.

Instructions to use both contracts:

  1. Compile both contracts.
  2. Upload the extended-vft contract to the IDEA, you have to put the necesary data for your token.
  3. Upload the mini_dexs contract, you can put an initial value for the contract (or you can put that info in each call to the contract):
    • vft_contract_id: Some or None, it is the contract if of the vft contract.
    • min_tokens_to_add: Min tokens to the contract in the vft contract.
    • tokens_per_vara: cost of tokens for a Vara (will also be used to change tokens to a Vara).
  4. In the vft contract you need to grant admin, burn and minter role to the mini_dexs contract.
  5. Add balance to VFT-Manager with add_tokens_to_contract function.
  6. With that, you can swap Varas and your tokens!

Step 1: Open Contract on Gitpod

Gitpod

Step 2: Compile and Deploy the Smart Contract

Rust: You need to have rust 1.80 or newer to be able to compile your contract:

rustup install 1.81
rustup default 1.81
rustup target add wasm32-unknown-unknown

Compile the smart contract by running the following command:

cargo build --release

Once the compilation is complete, locate the *.opt.wasm file in the target/wasm32-unknown-unknown/release directory.

Step 3: Interact with Your Contract on Vara Network

  1. To interact with the Gear IDEA and deploy your contract, you will need to download a wallet extension such as Polkadot-JS, Talisman, or Subwallet to interact with Substrate-based chains.
Polkadot-JS Extension

Step 4: Interact with Your Contract on Vara Network

  1. Access Gear IDE using your web browser.
  2. Connect your Substrate wallet to Gear IDE.
  3. Upload the *.opt.wasm and metadata.txt files by clicking the "Upload Program" button.

Vara Standards: Standards

Try ut on gitpod!

Gitpod

About

Contract Manager for VFT contract

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages