Skip to content

Commit

Permalink
Updating lesson 2
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulianaBYUI authored Feb 6, 2019
1 parent e159726 commit e43e089
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions es/2/9-internalfunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ material:
language: sol
startingCode:
"zombiefactory.sol": |
pragma solidity ^0.4.19;
pragma solidity ^0.4.25;
contract ZombieFactory {
Expand All @@ -30,11 +30,11 @@ material:
uint id = zombies.push(Zombie(_name, _dna)) - 1;
zombieToOwner[id] = msg.sender;
ownerZombieCount[msg.sender]++;
NewZombie(id, _name, _dna);
emit NewZombie(id, _name, _dna);
}
function _generateRandomDna(string _str) private view returns (uint) {
uint rand = uint(keccak256(_str));
uint rand = uint(keccak256(abi.encodePacked(_str)));
return rand % dnaModulus;
}
Expand All @@ -46,7 +46,7 @@ material:
}
"zombiefeeding.sol": |
pragma solidity ^0.4.19;
pragma solidity ^0.4.25;
import "./zombiefactory.sol";
Expand All @@ -62,7 +62,7 @@ material:
}
answer: >
pragma solidity ^0.4.19;
pragma solidity ^0.4.25;
contract ZombieFactory {
Expand All @@ -85,11 +85,11 @@ material:
uint id = zombies.push(Zombie(_name, _dna)) - 1;
zombieToOwner[id] = msg.sender;
ownerZombieCount[msg.sender]++;
NewZombie(id, _name, _dna);
emit NewZombie(id, _name, _dna);
}
function _generateRandomDna(string _str) private view returns (uint) {
uint rand = uint(keccak256(_str));
uint rand = uint(keccak256(abi.encodePacked(_str)));
return rand % dnaModulus;
}
Expand Down

0 comments on commit e43e089

Please sign in to comment.