DeFiCh / ain

DeFi Blockchain - enabling decentralized finance on Bitcoin
https://defichain.com
MIT License
408 stars 122 forks source link

Token creation with Client with wrong settings #93

Closed DanielZirkel closed 4 years ago

DanielZirkel commented 4 years ago

I created a Token on DefiChain via App with specific settings. The result was not like the specification

The token should have the following setting:

After the creation I got the following result:

Not tried to create another Token. But Daniel Mustermann reported same behavior for the ArbitrageToken and the mintable-Feature

all from WebSite, Client-Version 2.0.0

DanielZirkel commented 4 years ago

It seems not to be a viewing problem in the app. Also the CLI with defi-cli gettoken 133 delivers the same result image

ShengguangXiao commented 4 years ago

@DanielZirkel Right now token decimal is fixed to 8. Check the below code, only symbol, name and isDAT is configurable.

token.symbol = trim_ws(metaObj["symbol"].getValStr()).substr(0, CToken::MAX_TOKEN_SYMBOL_LENGTH);
    token.name = trim_ws(metaObj["name"].getValStr()).substr(0, CToken::MAX_TOKEN_NAME_LENGTH);
    token.flags = metaObj["isDAT"].getBool() ? token.flags | (uint8_t)CToken::TokenFlags::DAT : token.flags; // setting isDAT
//    token.decimal = metaObj["name"].get_int(); // fixed for now, check range later
//    token.limit = metaObj["limit"].get_int(); // fixed for now, check range later
//    token.flags = metaObj["mintable"].get_bool() ? token.flags | CToken::TokenFlags::Mintable : token.flags; // fixed for now, check later
//    token.flags = metaObj["tradeable"].get_bool() ? token.flags | CToken::TokenFlags::Tradeable : token.flags; // fixed for now, check later
monstrobishi commented 4 years ago

Thanks for spotting this @ShengguangXiao , then we will remove those fields from the next version of the front end, as changing them does nothing for now

DanielZirkel commented 4 years ago

ok, Limit and decimal seems not to be parameter in token creation. Thanks for the quick response.

What happened with the minting support? should this not be a setting parameter while creating a token?

ShengguangXiao commented 4 years ago

@DanielZirkel Do you mean the mintable flag, during create it is always true, but later can change it by updatetoken

monstrobishi commented 4 years ago

Closing as we discovered this is only changeable when updating, fixing in next hardfork