Skip to content

Latest commit

 

History

History
60 lines (34 loc) · 1.73 KB

tip-178.md

File metadata and controls

60 lines (34 loc) · 1.73 KB
tip:  178
title: TOKENISSUE and UPDATEASSET Instruction in TVM
author: [email protected]
status: Draft
type: Standards Track
category : Core
created: 2020-08-12

Simple Summary

To provide TOKENISSUE and UPDATEASSET Instructions in TVM.

Abstract

Provide TRC10 asset issue and update functionalities for smart contract.

Motivation

Asset issued in smart contract is feasible for developers to provide asset management according to a smart contract status. Asset issue related instruction is a big plus to the whole life cycle of TRC10. Previous implementation only consider about TRC10 transfer cases. However, a coinbase for TRC10 token is never mentioned in TVM level. ASSETISSUE instruction pefect the whole logic system. And makes TRC10 fully controlled by decentralized exchanges and apps to be possible.

Specification

0xda: TOKENISSUE

TOKENISSUE takes 4 operands pop up from stack.

name: the name of the TRC10 token. No more than 32 bytes.

abbreviation: the abbreviation of the TRC10 token. No more than 32 bytes.

total_supply: the total supply of the TRC10 token. A uint64 value.

precision: the precision of the TRC10 token. A uint8 value.

The return value the current address account balance.

0xdb: UPDATEASSET

UPDATEASSET takes 4 operands pop up from stack.

TRC10_token_id: the TRC10 token id. Should bigger than 1000000.

url_offset: read the token url as a string, and the value is the string offset in TVM memory.

description_offset: read the token description as a string, and the value is the string offset in TVM memory.

The return value the current address account balance.

Rationale

TOKENISSUE tier.ExtTier

25000 Energy

UPDATEASSET tier.ExtTier

5000 Energy