File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
basic/09-hardhat-react/frontend/src/components Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,8 @@ export class Dapp extends React.Component {
107
107
< p >
108
108
Welcome < b > { this . state . selectedAddress } </ b > , you have{ ' ' }
109
109
< b >
110
- { this . state . balance . toString ( ) } { this . state . tokenData . symbol }
110
+ { /* show human read balance (deployed contract with precise 1 in /scripts/deploy.js) */ }
111
+ { this . state . balance / 10 } { this . state . tokenData . symbol }
111
112
</ b >
112
113
.
113
114
</ p >
@@ -159,7 +160,8 @@ export class Dapp extends React.Component {
159
160
{ this . state . balance . gt ( 0 ) && (
160
161
< Transfer
161
162
transferTokens = { ( to , amount ) =>
162
- this . _transferTokens ( to , amount )
163
+ // convert to contract precise amount
164
+ this . _transferTokens ( to , amount * 10 ** 1 )
163
165
}
164
166
/>
165
167
) }
You can’t perform that action at this time.
0 commit comments