Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
add decimal warning alert
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot committed Nov 5, 2020
1 parent 4a2d0d1 commit 7e59a85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/SmartContractExecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class SmartContractExecution extends Component {

signTransaction = () => {
const { from, contractAddress, to, amount, gas, decimal } = this.state
if (decimal > 20) {
return alert('decimal should be less than 21')
}

const data = caver.klay.abi.encodeFunctionCall(
{
name: 'transfer',
Expand Down
3 changes: 3 additions & 0 deletions src/components/SmartContractExecutionFD.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class SmartContractExecutionFD extends Component {

signTransaction = async () => {
const { from, to, amount, contractAddress, gas, decimal } = this.state
if (decimal > 20) {
return alert('decimal should be less than 21')
}

const data = caver.klay.abi.encodeFunctionCall(
{
Expand Down
3 changes: 3 additions & 0 deletions src/components/SmartContractExecutionFDRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class SmartContractExecutionFDRatio extends Component {
gas,
decimal
} = this.state
if (decimal > 20) {
return alert('decimal should be less than 21')
}

const data = caver.klay.abi.encodeFunctionCall(
{
Expand Down
4 changes: 4 additions & 0 deletions src/components/SmartContractExecutionLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class SmartContractExecutionLegacy extends Component {

signTransaction = () => {
const { from, contractAddress, to, amount, gas, decimal } = this.state
if (decimal > 20) {
return alert('decimal should be less than 21')
}

const data = caver.klay.abi.encodeFunctionCall(
{
name: 'transfer',
Expand Down

0 comments on commit 7e59a85

Please sign in to comment.