Coder Social home page Coder Social logo

wtez-fa2's Introduction

Wrapped Tezos in FA2 token

This repository contains contract of FA2 token that can be used for wrapping native Tezos coin ($XTZ or $TEZ) into FA2 token.

How to use this contract

Contract implements FA2 interface token with some custom logic. Contract contains single-asset logic for wrapping native Tezos, delegating locked Tezos to bakers (as admin), transfer token and update operators. Token is designed for free minting and burning wrapped tokens.

All baking rewards for locked and delegated Tezos goes to admin

FA2 interface

Contract has all required FA2 entrypoints such as transfer, update_operators and balance_of callback view.

Get wrapped token

If Alice wants to wrap her $XTZ into $wXTZ, she should call Mint entrypoint to mint tokens for some receiver. $XTZ sent to contract will be locked inside contract untill call Burn.

Get Tezos back

When Alice owns $wXTZ and want to get back her $XTZs, she should call Burn entrypoint. This method sends amountof $XTZ from contract to the receiver passed inside call params. Also, if Bob is operator of Alices $wXTZs, he could call Burn with from_ param as Alice address and burn her tokens.

Requirements

  • Installed NodeJS (tested with NodeJS v16+)

  • Installed Yarn

  • Installed node modules with:

yarn install

Quick Start tests

yarn start-sandbox

#> wait for about 10 seconds

yarn test

#> executing tests

yarn stop-sandbox

Compile contract

yarn compile -c fa2

Deploy contract

yarn migrate
# Execute yarn migrate -h for more migrate params.

wtez-fa2's People

Contributors

dependabot[bot] avatar konchunas avatar likoilya avatar

Watchers

 avatar  avatar  avatar

Forkers

cryptobuks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.