Commit 5eea131f by Manuel Araoz

extract simpler version of Token into separate file

parent d1c57c28
pragma solidity ^0.4.0; pragma solidity ^0.4.0;
import './PullPayment.sol'; import './PullPayment.sol';
import './examples/ExampleToken.sol'; import './token/SimpleToken.sol';
/* /*
* Bounty * Bounty
* This bounty will pay out if you can cause a ExampleToken's balance * This bounty will pay out if you can cause a SimpleToken's balance
* to be lower than its totalSupply, which would mean that it doesn't * to be lower than its totalSupply, which would mean that it doesn't
* have sufficient ether for everyone to withdraw. * have sufficient ether for everyone to withdraw.
*/ */
...@@ -17,16 +17,17 @@ contract Bounty is PullPayment { ...@@ -17,16 +17,17 @@ contract Bounty is PullPayment {
if (claimed) throw; if (claimed) throw;
} }
function createTarget() returns(ExampleToken) { function createTarget() returns(SimpleToken) {
ExampleToken target = new ExampleToken(); SimpleToken target = new SimpleToken();
researchers[target] = msg.sender; researchers[target] = msg.sender;
return target; return target;
} }
function claim(ExampleToken target) { function claim(SimpleToken target) {
address researcher = researchers[target]; address researcher = researchers[target];
if (researcher == 0) throw; if (researcher == 0) throw;
// check ExampleToken contract invariants // Check SimpleToken contract invariants
// Customize this to the specifics of your contract
if (target.totalSupply() == target.balance) { if (target.totalSupply() == target.balance) {
throw; throw;
} }
......
...@@ -2,15 +2,17 @@ pragma solidity ^0.4.0; ...@@ -2,15 +2,17 @@ pragma solidity ^0.4.0;
import "../StandardToken.sol"; import "../StandardToken.sol";
contract ExampleToken is StandardToken { /*
* Simple ERC20 Token example, with crowdsale token creation
*/
contract CrowdsaleToken is StandardToken {
string public name = "ExampleToken"; string public name = "CrowdsaleToken";
string public symbol = "TOK"; string public symbol = "CRW";
uint public decimals = 18; uint public decimals = 18;
// 1 ether = 500 example tokens // 1 ether = 500 example tokens
uint PRICE = 500; uint PRICE = 500;
function () payable { function () payable {
createTokens(msg.sender); createTokens(msg.sender);
......
pragma solidity ^0.4.0;
import "../StandardToken.sol";
/*
* Very simple ERC20 Token example, where all tokens are pre-assigned
* to the creator. Note they can later distribute these tokens
* as they wish using `transfer` and other `StandardToken` functions.
*/
contract SimpleToken is StandardToken {
string public name = "SimpleToken";
string public symbol = "SIM";
uint public decimals = 18;
uint public INITIAL_SUPPLY = 10000;
function SimpleToken() {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment