Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring tutorial9 #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion tutorial-04/testLibrary.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.0;

import "browser/library.sol";
import "./library.sol";

contract TestLibrary {
using IntExtended for uint;
Expand Down
2 changes: 1 addition & 1 deletion tutorial-07/TestStrings.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.0;

import "browser/Strings.sol";
import "./Strings.sol";

contract TestStrings {

Expand Down
11 changes: 7 additions & 4 deletions tutorial-09/MyToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.0;

import "browser/ERC20.sol";
import "./ERC20.sol";

contract MyFirstToken is ERC20 {
string public constant symbol = "MFT";
Expand Down Expand Up @@ -37,10 +37,13 @@ contract MyFirstToken is ERC20 {
_value > 0 &&
__allowances[_from][msg.sender] >= _value &&
__balanceOf[_from] >= _value) {
__balanceOf[_from] -= _value;
__balanceOf[_to] += _value;

// Missed from the video
// Allowances are updated first to prevent the re-entrancy exploit
__allowances[_from][msg.sender] -= _value;

__balanceOf[_from] -= _value;
__balanceOf[_to] += _value;
return true;
}
return false;
Expand All @@ -51,7 +54,7 @@ contract MyFirstToken is ERC20 {
return true;
}

function allowance(address _owner, address _spender) public constant returns (uint remaining) {
function allowance(address _owner, address _spender) public constant returns (uint availableAllowance) {
return __allowances[_owner][_spender];
}
}
8 changes: 4 additions & 4 deletions tutorial-10/MyFirstToken.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.4.0;

import "browser/Token.sol";
import "browser/ERC20.sol";
import "browser/ERC223.sol";
import "browser/ERC223ReceivingContract.sol";
import "./Token.sol";
import "./ERC20.sol";
import "./ERC223.sol";
import "./ERC223ReceivingContract.sol";

contract MyFirstToken is Token("MFT", "My First Token", 18, 1000), ERC20, ERC223 {

Expand Down