Giter Site home page Giter Site logo

cha0173 / stablecoin-contract Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ton-blockchain/stablecoin-contract

0.0 0.0 0.0 527 KB

Sample code for centralised stablecoin jetton. TEP-74 and TEP-89 compatible

Shell 0.08% JavaScript 0.04% TypeScript 99.89%

stablecoin-contract's Introduction

Jetton with Governance

Jetton-with-governance FunC smart contracts.

Targets and goals

This project was created to allow users to exchange and buy assets in the TON DeFi ecosystem for a jetton (token or currency) that is not subject to volatile fluctuations. To meet regulatory requirements, the issuer of the tokens must have additional control over the tokens.

Thus this jetton represents a standard TON jetton smart contracts with additional functionality:

  • Admin of jetton can make transfers from user's jetton wallet.

  • Admin of jetton can burn user's jettons.

  • Admin of jetton can lock/unlock user's jetton wallet (set_status). Admin can make transfer and burn even if wallet locked.

  • Admin of jetton can change jetton-minter code and it's full data.

⚠️ It is critically important for issuer to carefully manage the admin's account private key to avoid any potential risks of being hacked. It is highly recommend to use multi-signature wallet as admin account with private keys stored on different air-gapped hosts / hardware wallets.

⚠️ The contract does not check the code and data on upgrade message, so it is possible to brick the contract if you send invalid data or code. Therefore you should always check the upgrade in the testnet.

Local Development

Install Dependencies

npm install

Compile Contracts

npm run build

Run Tests

npm run test

Deploy or run another script

npx blueprint run or yarn blueprint run

use Toncenter API:

npx blueprint run --custom https://testnet.toncenter.com/api/v2/ --custom-version v2 --custom-type testnet --custom-key <API_KEY>

API_KEY can be obtained on https://toncenter.com or https://testnet.toncenter.com

Notes

  • The jetton-wallet contract does not include functionality that allows the owner to withdraw Toncoin funds from jetton-wallet Toncoin balance.

  • The contract prices gas based on the current blockchain configuration. It is worth keeping in mind the situation when the configuration has changed at the moment when the message goes from one jetton-wallet to another. Reducing fees in a blockchain configuration does not require additional actions. However, increasing fees in a blockchain configuration requires preliminary preparation - e.g. wallets and services must start sending Toncoins for gas in advance based on future parameters.

  • If you set the status of Jetton Wallet to prohibit receiving jettons - there is no guarantee that when you send jettons to such a jetton-wallet, jettons will bounce back and be credited to the sender. In case of gas shortage they can be lost. Toncoin for gas and forward will also not be returned to the sender but will remain on the sender’s jetton-wallet.

stablecoin-contract's People

Contributors

rise1507 avatar emelyanenkok avatar dariotarantini avatar tolya-yanot avatar pyandr3w avatar

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.