diff --git a/tutorial-04/testLibrary.sol b/tutorial-04/testLibrary.sol index 96208d1..a4074e8 100644 --- a/tutorial-04/testLibrary.sol +++ b/tutorial-04/testLibrary.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.0; -import "browser/library.sol"; +import "./library.sol"; contract TestLibrary { using IntExtended for uint; diff --git a/tutorial-07/TestStrings.sol b/tutorial-07/TestStrings.sol index f290c9e..5fb8a97 100644 --- a/tutorial-07/TestStrings.sol +++ b/tutorial-07/TestStrings.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.0; -import "browser/Strings.sol"; +import "./Strings.sol"; contract TestStrings { diff --git a/tutorial-09/MyToken.sol b/tutorial-09/MyToken.sol index 635e9d3..8262699 100644 --- a/tutorial-09/MyToken.sol +++ b/tutorial-09/MyToken.sol @@ -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"; @@ -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; @@ -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]; } } diff --git a/tutorial-10/MyFirstToken.sol b/tutorial-10/MyFirstToken.sol index 36321be..15e2895 100644 --- a/tutorial-10/MyFirstToken.sol +++ b/tutorial-10/MyFirstToken.sol @@ -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 {