Skip to content

Commit

Permalink
Fix solidity contract warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ziogaschr committed Apr 2, 2019
1 parent ae4665d commit 12b3660
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/CryptoHerosGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract CryptoHerosGame is Ownable {

maxSingleGameId = singleGames.push(_singleGame) - 1;

uint256[] userSingleGames = usersSingleGames[msg.sender];
uint256[] storage userSingleGames = usersSingleGames[msg.sender];
userSingleGames.push(maxSingleGameId);

return maxSingleGameId;
Expand All @@ -85,7 +85,7 @@ contract CryptoHerosGame is Ownable {

function rand(uint min, uint max) private returns (uint){
nonce++;
return uint(sha3(nonce))%(min+max)-min;
return uint(keccak256(nonce))%(min+max)-min;
}

function withdraw(uint amount) public payable onlyOwner returns(bool) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/CryptoHerosToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ contract CryptoHerosToken is ERC721Token, Ownable {

function rand(uint min, uint max) private returns (uint){
nonce++;
return uint(sha3(nonce))%(min+max)-min;
return uint(keccak256(nonce))%(min+max)-min;
}

function getHerosLength() external view returns (uint) {
return heros.length;
}

function withdraw(uint amount) public payable onlyOwner returns(bool) {
require(amount <= this.balance);
require(amount <= address(this).balance);
owner.transfer(amount);
return true;
}
Expand Down

0 comments on commit 12b3660

Please sign in to comment.