Skip to content

Commit

Permalink
Support contract withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchuangportal committed Jul 24, 2018
1 parent 072a3de commit 5cecaa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/CryptoHerosGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@ contract CryptoHerosGame is Ownable {
return uint(sha3(nonce))%(min+max)-min;
}

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

}
6 changes: 6 additions & 0 deletions contracts/CryptoHerosToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,11 @@ contract CryptoHerosToken is ERC721Token, Ownable {
function getHerosLength() public returns (uint) {
return heros.length;
}

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

}

0 comments on commit 5cecaa6

Please sign in to comment.