Skip to content

IStandardToken256 Support#71

Merged
StratisIain merged 2 commits intostratisproject:masterfrom
Opdex:feature/StandardToken256
Jan 5, 2022
Merged

IStandardToken256 Support#71
StratisIain merged 2 commits intostratisproject:masterfrom
Opdex:feature/StandardToken256

Conversation

@mrtpain
Copy link
Contributor

@mrtpain mrtpain commented Dec 24, 2021

Overview

  • Adds support for tracking new IStandardToken256 SRC tokens and user balances
  • Adds support for sending IStandardToken256 SRC tokens
  • Removes support for creating old IStandardToken SRC tokens
  • Adds support for creating new IStandardToken256 SRC tokens

Complete Details

  • Modifies Add Token Flow
    • Removes population of known tokens list (MEDI only currently)
    • Instead of known tokens and custom tokens, users paste the token contract address
    • Token contract is validated by getting token Name, Symbol, Decimals, and Type (IStandardToken vs IStandardToken256)
    • Users validate the token, review its properties, then choose to track in their wallet
    • Stores token details with newly tracked type in local storage
  • Modifies SRC Token send component
    • Depending on token IStandardToken or IStandardToken256 types and adjusts call parameters respectively
  • Modifies create SRC Token component and flow
    • Only creates IStandardToken256 typs going forward
    • Allows for 0 to 18 decimals
    • Shows preview of total supply including decimal places
    • Validates total supply is not larger than UInt256 max value

image

image

Prior to Release

Prior to release, the pull request for IStandardToken256 SRC tokens for Mainnet needs to be voted through. It has been on Testnet for quite some time.

The PR can be found here: stratisproject/CirrusSmartContracts#32


<div [hidden]="submitting">
<div class="modal-body ModalSend pt-0">
<form [formGroup]="form" (submit)="submit()">
Copy link
Contributor Author

@mrtpain mrtpain Dec 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed because its unnecessary, the actual submit button calls via (click)="submit()".

import { Pipe, PipeTransform } from "@angular/core";

@Pipe({ name: 'formatNumber' })
export class FormatNumberPipe implements PipeTransform {
Copy link
Contributor Author

@mrtpain mrtpain Dec 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this extra pipe which can add comma's to help format numbers, a bit easier on the eyes if used. Currently only implemented when previewing the total supply of a token being created.

Comment on lines +270 to +276
this.decimals = new FormControl(null, [Validators.min(0), Validators.max(18), integerValidator, Validators.required]);
// eslint-disable-next-line @typescript-eslint/unbound-method
this.totalSupply = new FormControl(21 * 1000 * 1000, [Validators.min(1), Validators.max(ULONG_MAXVALUE), integerValidator, Validators.required]);
this.totalSupply = new FormControl('', [integerValidator, Validators.required]);
// eslint-disable-next-line @typescript-eslint/unbound-method
this.tokenName = new FormControl('My token', [Validators.required]);
this.tokenName = new FormControl('', [Validators.required]);
// eslint-disable-next-line @typescript-eslint/unbound-method
this.tokenSymbol = new FormControl('MTK', [Validators.required]);
this.tokenSymbol = new FormControl('', [Validators.required]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly removes hard coded initial values and replaces with placeholder in the forms. Some validators removed due to the new maximum value being UInt256, not javascript number safe to use angular validators.

gasCallRecommendedLimit = 125000;
gasCreateLimitMinimum = 12000;
gasCreateTokenLimitMinimum = 15000;
gasCreateTokenLimitMinimum = 20000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted default gas to create a token, it's juuust over 15k, gave it 20 for some wiggle room.


// tslint:disable-next-line: max-line-length
newTokenByteCode = '4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C010200E1F046E10000000000000000E00022200B013000000E00000002000000000000522C0000002000000040000000000010002000000002000004000000000000000400000000000000006000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000002C00004F000000000000000000000000000000000000000000000000000000004000000C000000E42B00001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E74657874000000580C000000200000000E000000020000000000000000000000000000200000602E72656C6F6300000C000000004000000002000000100000000000000000000000000000400000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000342C000000000000480000000200050050230000940800000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C20203280500000A0204280700000602052805000006020E0428030000060202280600000A6F0700000A0428090000062A4602280800000A72010000706F0900000A2A4A02280800000A7201000070036F0A00000A2A4602280800000A720F0000706F0900000A2A4A02280800000A720F000070036F0A00000A2A4602280800000A72190000706F0B00000A2A4A02280800000A7219000070036F0C00000A2A7202280800000A7231000070038C08000001280D00000A6F0B00000A2A7602280800000A7231000070038C08000001280D00000A046F0C00000A2A0013300400A600000001000011042D34021201FE1503000002120102280600000A6F0700000A7D010000041201037D020000041201166A7D0300000407280100002B172A0202280600000A6F0700000A28080000060A06043402162A0202280600000A6F0700000A0604DB280900000602030203280800000604D72809000006021201FE1503000002120102280600000A6F0700000A7D010000041201037D020000041201047D0300000407280100002B172A000013300500AA00000002000011052D2A021202FE15030000021202037D010000041202047D020000041202166A7D0300000408280100002B172A020302280600000A6F0700000A280E0000060A020328080000060B0605370407053402162A020302280600000A6F0700000A0605DB280D00000602030705DB280900000602040204280800000605D72809000006021202FE15030000021202037D010000041202047D020000041202057D0300000408280100002B172A00001330040065000000030000110202280600000A6F0700000A03280E000006042E02162A0202280600000A6F0700000A0305280D000006021200FE1504000002120002280600000A6F0700000A7D040000041200037D050000041200057D070000041200047D0600000406280200002B172A8E02280800000A7249000070038C08000001048C08000001280F00000A056F0C00000A2A8A02280800000A7249000070038C08000001048C08000001280F00000A6F0B00000A2A42534A4201000100000000000C00000076342E302E33303331390000000005006C00000098030000237E0000040400000403000023537472696E67730000000008070000700000002355530078070000100000002347554944000000880700000C01000023426C6F6200000000000000020000015717A201090A000000FA013300160000010000000E00000004000000070000000E00000017000000010000000F00000007000000030000000100000003000000060000000100000003000000020000000200000000007E010100000000000600EB00440206001A0144020600D70010020F00640200000A00A10283020E00C60123020A008B0083020A007302830206008100AD010A000B0183020A00550083020A00B200830206005301AD010600AF02AD01000000001500000000000100010001001000C70100001500010001000A01100066010000250001000F000A0110005A010000250004000F000600BC0174000600DD0174000600C70278000600FE0174000600EE0174000600B60278000600C702780050200000000086180A027B000100812000000000860890018400050093200000000081089B0188000500A6200000000086086A0084000600B820000000008108730088000600CB2000000000E609D5028D000700DD20000000008108E50291000700F02000000000E6013500960008000D2100000000810040009C0009002C2100000000E601D501A3000B00E02100000000E601B401AA000D00982200000000E6013E01B300100009230000000081007201BB0013002D2300000000E6014B00C4001600000001009F0000000200F502000003007C0000000400A601000001003801000001003801000001003801000001007B02000001007B0200000200380100000100E00100000200CE0200000100C10100000200E00100000300CE0200000100F60100000200C00200000300CE0200000100040200000200F60100000300380100000100040200000200F6010200190009000A02010011000A02060019000A020A0051000A02060029000A02100029005E0016005900E3011B002900C3002000610046012500610050012A0061000100300061000B00350069009A023B0029006E01470069009A0264002100230005012E000B00D4002E001300DD002E001B00FC00410023000501810023000501A10023000501410053005A000200010000009F01CC0000007700CC000000E902D000020002000300010003000300020004000500010005000500020006000700010007000700048000000000000000000000000000000000A10200000400000000000000000000006B001E00000000000100020001000000000000000000830200000000010000000000000000000000000023020000000003000200040002001D004E001D005F00000000000047657455496E7436340053657455496E743634003C4D6F64756C653E0053797374656D2E507269766174652E436F72654C69620047657442616C616E63650053657442616C616E636500416C6C6F77616E636500494D657373616765006765745F4D657373616765006765745F4E616D65007365745F4E616D65006E616D650056616C7565547970650049536D617274436F6E7472616374537461746500736D617274436F6E74726163745374617465004950657273697374656E745374617465006765745F50657273697374656E7453746174650044656275676761626C6541747472696275746500436F6D70696C6174696F6E52656C61786174696F6E7341747472696275746500496E6465784174747269627574650052756E74696D65436F6D7061746962696C6974794174747269627574650076616C756500417070726F766500476574537472696E6700536574537472696E6700417070726F76616C4C6F67005472616E736665724C6F6700536574417070726F76616C00536D617274436F6E74726163742E646C6C006765745F53796D626F6C007365745F53796D626F6C0073796D626F6C0053797374656D005472616E7366657246726F6D0066726F6D00495374616E64617264546F6B656E005472616E73666572546F00746F006765745F53656E646572005370656E646572007370656E646572004F776E6572006F776E6572002E63746F720053797374656D2E446961676E6F737469637300537472617469732E536D617274436F6E7472616374732E5374616E64617264730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300446562756767696E674D6F6465730041646472657373006164647265737300537472617469732E536D617274436F6E74726163747300466F726D617400536D617274436F6E7472616374004F626A656374004F6C64416D6F756E740063757272656E74416D6F756E7400616D6F756E74006765745F546F74616C537570706C79007365745F546F74616C537570706C7900746F74616C537570706C7900000000000D530079006D0062006F006C0000094E0061006D006500001754006F00740061006C0053007500700070006C0079000017420061006C0061006E00630065003A007B0030007D00002341006C006C006F00770061006E00630065003A007B0030007D003A007B0031007D0000000000F5148117F9C6F840A461EEE65ADF72F40004200101080320000105200101111105200101121D042000122D042000112104200012310420010E0E052002010E0E0420010B0E052002010E0B0500020E0E1C0507020B110C06300101011E00040A01110C0607030B0B110C0407011110040A0111100600030E0E1C1C087CEC85D7BEA7798E0306112102060B08200401121D0B0E0E0320000E042001010E0320000B042001010B0520010B11210620020111210B0620020211210B08200302112111210B0720030211210B0B08200301112111210B0720020B112111210328000E0328000B0801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F7773010801000200000000000401000000000000000000000000000000000010000000000000000000000000000000282C00000000000000000000422C0000002000000000000000000000000000000000000000000000342C0000000000000000000000005F436F72446C6C4D61696E006D73636F7265652E646C6C0000000000FF250020001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000C000000543C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
standardToken256ByteCode = '4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C0102004F7450990000000000000000E00022200B0130000010000000020000000000002A2E0000002000000040000000000010002000000002000004000000000000000400000000000000006000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000D82D00004F000000000000000000000000000000000000000000000000000000004000000C000000BC2D00001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E74657874000000300E0000002000000010000000020000000000000000000000000000200000602E72656C6F6300000C0000000040000000020000001200000000000000000000000000004000004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C2E0000000000004800000002000500D0230000EC0900000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E20203280500000A0204280900000602052805000006020E042803000006020E0528070000060202280600000A6F0700000A04280B0000062A4602280800000A72010000706F0900000A2A4A02280800000A7201000070036F0A00000A2A4602280800000A720F0000706F0900000A2A4A02280800000A720F000070036F0A00000A2A4E02280800000A72190000706F0B00000A16912A6E02280800000A7219000070178D0E0000012516039C6F0C00000A2A4602280800000A722B0000706F0D00000A2A4A02280800000A722B000070036F0E00000A2A7202280800000A7243000070038C09000001280F00000A6F0D00000A2A7602280800000A7243000070038C09000001280F00000A046F0E00000A2A0013300400C2000000010000110416281000000A281100000A2C38021201FE1503000002120102280600000A6F0700000A7D010000041201037D02000004120116281000000A7D0300000407280100002B172A0202280600000A6F0700000A280A0000060A0604281300000A2C02162A0202280600000A6F0700000A0604281400000A280B00000602030203280A00000604281500000A280B000006021201FE1503000002120102280600000A6F0700000A7D010000041201037D020000041201047D0300000407280100002B172A000013300500CF000000020000110516281000000A281100000A2C2E021202FE15030000021202037D010000041202047D02000004120216281000000A7D0300000408280100002B172A020302280600000A6F0700000A28100000060A0203280A0000060B0605281300000A2D090705281300000A2C02162A020302280600000A6F0700000A0605281400000A280F00000602030705281400000A280B00000602040204280A00000605281500000A280B000006021202FE15030000021202037D010000041202047D020000041202057D0300000408280100002B172A00133004006A000000030000110202280600000A6F0700000A03281000000604281600000A2C02162A0202280600000A6F0700000A0305280F000006021200FE1504000002120002280600000A6F0700000A7D040000041200037D050000041200057D070000041200047D0600000406280200002B172A8E02280800000A725B000070038C09000001048C09000001281700000A056F0E00000A2A8A02280800000A725B000070038C09000001048C09000001281700000A6F0D00000A2A00000042534A4201000100000000000C00000076342E302E33303331390000000005006C0000000C040000237E0000780400009403000023537472696E6773000000000C08000080000000235553008C0800001000000023475549440000009C0800005001000023426C6F6200000000000000020000015717A201090A000000FA013300160000010000001000000004000000070000001000000019000000010000001700000007000000030000000100000004000000080000000100000003000000020000000200000000008D010100000000000600F50079020600240179020600E10045020F00990200000A000B03ED020E00010058020A00A900ED020A002100ED020A00DD02ED0206009500BC010A001501ED020A006900ED020A00D000ED0206004201BC0106006201BC0106001903BC01000000002900000000000100010001001000E10100001500010001000A011000750100002900010011000A011000690100002900040011000600CB019D00060012029D0006003D03A100060033029D00060023029D0006002C03A10006003D03A10050200000000086183F02A500010089200000000086089F01B00006009B20000000008108AA01B4000600AE200000000086087E00B0000700C0200000000081088700B4000700D32000000000E609BA02B9000800E720000000008108C702BD000800032100000000E6094B03C200090015210000000081085B03C7000900282100000000E6014900CD000A0045210000000081005400D4000B00642100000000E6010A02DC000D00342200000000E601C301E4000F00102300000000E6014D01EE00120086230000000081008101F8001500AA2300000000E6015F000201180000000100BD00000002006B0300000300900000000400B50100000500D40200000100470100000100470100000100470100000100470100000100E50200000100E50200000200470100000100150200000200440300000100D001000002001502000003004403000001002B02000002003603000003004403000001003902000002002B02000003004701000001003902000002002B020200190009003F02010011003F02060019003F020A0059003F02060029003F021000290072001600610018021B0029009F00200069005501250069005F012A006900A80230006900B1023600690013003D0069001E004300790004034A00410020035700410077035D0029007D0165004100D5015D004100EF0171004100FE017100410083035D00790004038D002100230049012E000B0018012E00130021012E001B004001410023004901810023004901A1002300490150007A008300020001000000AE010B0100008B000B010000CB020F0100005F0313010200020003000100030003000200040005000100050005000200060007000100070007000200080009000100090009000480000000000000000000000000000000000B03000004000000000000000000000094003200000000000200000000000000000000000000ED02000000000200000000000000000000000000580200000000030002000400020025006C0025008800000000495374616E64617264546F6B656E3235360047657455496E743235360053657455496E74323536003C4D6F64756C653E0053797374656D2E507269766174652E436F72654C69620047657442616C616E63650053657442616C616E636500416C6C6F77616E636500494D657373616765006765745F4D657373616765006765745F4E616D65007365745F4E616D65006E616D650056616C756554797065006765745F53746174650049536D617274436F6E7472616374537461746500736D617274436F6E74726163745374617465004950657273697374656E7453746174650044656275676761626C6541747472696275746500436F6D70696C6174696F6E52656C61786174696F6E7341747472696275746500496E6465784174747269627574650052756E74696D65436F6D7061746962696C69747941747472696275746500427974650076616C756500417070726F766500476574537472696E6700536574537472696E6700417070726F76616C4C6F67005472616E736665724C6F6700536574417070726F76616C00536D617274436F6E74726163742E646C6C006765745F53796D626F6C007365745F53796D626F6C0073796D626F6C0053797374656D005472616E7366657246726F6D0066726F6D006F705F4C6573735468616E005374616E64617264546F6B656E006F705F5375627472616374696F6E006F705F4164646974696F6E005472616E73666572546F00746F006765745F53656E646572005370656E646572007370656E646572004F776E6572006F776E6572002E63746F720053797374656D2E446961676E6F737469637300537472617469732E536D617274436F6E7472616374732E5374616E64617264730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300446562756767696E674D6F646573004765744279746573005365744279746573006765745F446563696D616C73007365745F446563696D616C7300646563696D616C730041646472657373006164647265737300537472617469732E536D617274436F6E74726163747300466F726D617400536D617274436F6E7472616374004F626A656374006F705F496D706C69636974004F6C64416D6F756E740063757272656E74416D6F756E7400616D6F756E74006765745F546F74616C537570706C79007365745F546F74616C537570706C7900746F74616C537570706C79006F705F457175616C697479006F705F496E657175616C69747900000000000D530079006D0062006F006C0000094E0061006D006500001144006500630069006D0061006C007300001754006F00740061006C0053007500700070006C0079000017420061006C0061006E00630065003A007B0030007D00002341006C006C006F00770061006E00630065003A007B0030007D003A007B0031007D000000DDF72CC17C666E4FA9162D348C993F730004200101080320000105200101111105200101121D0420001231042000112504200012350420010E0E052002010E0E0520011D050E062002010E1D0505200111210E062002010E11210500020E0E1C0607021121110C050001112108070002021121112106300101011E00040A01110C08000211211121112108070311211121110C0407011110040A0111100600030E0E1C1C087CEC85D7BEA7798E03061125030611210A200501121D11210E0E050320000E042001010E032000050420010105042000112105200101112106200111211125072002011125112107200202112511210920030211251125112109200302112511211121092003011125112511210820021121112511250328000E0328000504280011210801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F7773010801000200000000000401000000000000000000000000000000000010000000000000000000000000000000002E000000000000000000001A2E00000020000000000000000000000000000000000000000000000C2E0000000000000000000000005F436F72446C6C4D61696E006D73636F7265652E646C6C0000000000FF25002000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000C0000002C3E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is noted in PR description, this bytecode is whitelisted on Testnet with an open PR for Mainnet which should be whitelisted prior to this release.

Comment on lines +115 to +119
/**
* @summary Attempts a local-call TransferTo with 0 tokens only to verify the token is of an IStandardToken or IStandardToken256 type
* @returns null or supported interface
*/
private findTokenType$(): Observable<string> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted to find a token's type via local call of a TransferTo for 0 tokens. Doesn't cost the user anything.

  • IStandardToken will require 7#0 for the amount and will return true if valid
  • IStandardToken256 will require 12#0 for the amount and will return true if valid

Attempted to resolve this using /smartcontracts/code endpoint however, this doesn't isolate smart contract code based on address when contracts use inheritance such as Opdex contracts. Bytecode and C# code returned are from all compiled contracts creating room for error in token type selection strictly based on this response.

}

private createModel() {
const tokenValueType = this.token.type === TokenType.IStandardToken256 ? '12' : '7';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to sending SRC tokens, we just need to figure out if its UInt256(12) or ulong(7)

receipt => {
const newTokenAddress = receipt['newContractAddress'];
const token = new SavedToken(value.symbol, newTokenAddress, "0", value.name, value.decimals);
const token = new SavedToken(value.symbol, newTokenAddress, "0", value.name, value.decimals, TokenType.IStandardToken256);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tokens created will always be IStandardToken256 here

Comment on lines 38 to 44
GetAvailableTokens(): Token[] {
const tokens = [];
if (!this.globalService.getTestnetEnabled()) {
tokens.push(new Token('MEDI', 'CUwkBGkXrQpMnZeWW2SpAv1Vu9zPvjWNFS', 'Mediconnect', 8));
tokens.push(new Token('MEDI', 'CUwkBGkXrQpMnZeWW2SpAv1Vu9zPvjWNFS', 'Mediconnect', 8, 'IStandardToken'));
}
return tokens;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer being used but I didn't remove it just yet. Tracking tokens in this manner can quickly get out of hand, its probably best it be removed.

Comment on lines -104 to -112
// Temporary workaround for non-camel-cased API response
const anyResponse = (<any>response);
const result = new LocalExecutionResult();
result.gasConsumed = anyResponse.hasOwnProperty('GasConsumed') ? anyResponse.GasConsumed : anyResponse.gasConsumed;
result.return = anyResponse.hasOwnProperty('Return') ? anyResponse.Return : anyResponse.return;
result.revert = anyResponse.hasOwnProperty('Revert') ? anyResponse.Revert : anyResponse.revert;
result.logs = anyResponse.hasOwnProperty('Logs') ? anyResponse.Revert : anyResponse.logs;
result.internalTransfers = anyResponse.hasOwnProperty('InternalTransfers') ? anyResponse.Revert : anyResponse.internalTransfers;
return result;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required

@mrtpain mrtpain mentioned this pull request Dec 24, 2021
@mrtpain mrtpain marked this pull request as ready for review December 24, 2021 05:01
<label for="tokenName">Token Symbol</label>
<input formControlName="tokenSymbol" id="tokenName" type="text" class="form-control"
placeholder="Token Symbol"
placeholder="MTK"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the placeholder more "instructive", i.e. "Give the new token a symbol" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine too, no preference, lmk what you prefer. "MTK" was hard-coded before, forcing the user to backspace to clear it and type their token symbol, so I just moved it to the placeholder to give them an idea.

I think in general, placeholders are examples of what to type rather than instructions. Instructions usually placed below the label, above the form field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont really have a preference either, perhaps @StratisIain can comment here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with this approach

Copy link
Contributor

@fassadlr fassadlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @mrtpain, just 2 small comments.

@StratisIain StratisIain merged commit ff17e1f into stratisproject:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants