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

minor typo fix and added extra security checks #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ App = {
var amount = parseInt($('#TTTransferAmount').val());
var toAddress = $('#TTTransferAddress').val();

console.log('Transfering ' + amount + ' TT to ' + toAddress);
console.log('Transferring ' + amount + ' TT to ' + toAddress);

var tutorialTokenInstance;

Expand All @@ -57,10 +57,10 @@ App = {

var account = accounts[0];

// user cannot transfer tokens to himself
// cannot transfer tokens to ownself
if (toAddress.toLowerCase() == account.toLowerCase()) {
alert('Sorry, you cannot transfer token to yourself');
throw new Error('cannot transfer token to yourself');
alert('Sorry, you cannot transfer tokens nto yourself');
Copy link

Choose a reason for hiding this comment

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

typo: nto should be to

throw new Error('Sorry, you cannot transfer tokens to yourself');
}

App.contracts.TutorialToken.deployed().then(function(instance) {
Expand Down Expand Up @@ -112,4 +112,4 @@ $(function() {
$(window).load(function() {
App.init();
});
});
});