Skip to content

Commit

Permalink
Adds transferFromTokens error to token addresses text box
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Mar 18, 2024
1 parent a3a2ea8 commit c291aaf
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1767,15 +1767,19 @@ const initializeFormElements = () => {
};

transferFromTokens.onclick = async () => {
const result = await hstContract.transferFrom(
transferFromSenderInput.value,
transferFromRecipientInput.value,
decimalUnitsInput.value === '0'
? 1
: `${1.5 * 10 ** decimalUnitsInput.value}`,
{ from: accounts[0] },
);
console.log('result', result);
try {
const result = await hstContract.transferFrom(
transferFromSenderInput.value,
transferFromRecipientInput.value,
decimalUnitsInput.value === '0'
? 1
: `${1.5 * 10 ** decimalUnitsInput.value}`,
{ from: accounts[0] },
);
console.log('result', result);
} catch (error) {
tokenAddresses.innerHTML = error.message;

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML Medium

Exception text
is reinterpreted as HTML without escaping meta-characters.
Exception text
is reinterpreted as HTML without escaping meta-characters.
}
};

transferTokensWithoutGas.onclick = async () => {
Expand Down

0 comments on commit c291aaf

Please sign in to comment.