fix spacing
This commit is contained in:
@ -7,28 +7,28 @@ import "../StandardToken.sol";
|
|||||||
*/
|
*/
|
||||||
contract CrowdsaleToken is StandardToken {
|
contract CrowdsaleToken is StandardToken {
|
||||||
|
|
||||||
string public name = "CrowdsaleToken";
|
string public name = "CrowdsaleToken";
|
||||||
string public symbol = "CRW";
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTokens(address recipient) payable {
|
function createTokens(address recipient) payable {
|
||||||
if (msg.value == 0) throw;
|
if (msg.value == 0) throw;
|
||||||
|
|
||||||
uint tokens = safeMul(msg.value, getPrice());
|
|
||||||
|
|
||||||
totalSupply = safeAdd(totalSupply, tokens);
|
uint tokens = safeMul(msg.value, getPrice());
|
||||||
balances[recipient] = safeAdd(balances[recipient], tokens);
|
|
||||||
}
|
totalSupply = safeAdd(totalSupply, tokens);
|
||||||
|
balances[recipient] = safeAdd(balances[recipient], tokens);
|
||||||
// replace this with any other price function
|
}
|
||||||
function getPrice() constant returns (uint result){
|
|
||||||
return PRICE;
|
// replace this with any other price function
|
||||||
}
|
function getPrice() constant returns (uint result){
|
||||||
|
return PRICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,14 +9,14 @@ import "../StandardToken.sol";
|
|||||||
*/
|
*/
|
||||||
contract SimpleToken is StandardToken {
|
contract SimpleToken is StandardToken {
|
||||||
|
|
||||||
string public name = "SimpleToken";
|
string public name = "SimpleToken";
|
||||||
string public symbol = "SIM";
|
string public symbol = "SIM";
|
||||||
uint public decimals = 18;
|
uint public decimals = 18;
|
||||||
uint public INITIAL_SUPPLY = 10000;
|
uint public INITIAL_SUPPLY = 10000;
|
||||||
|
|
||||||
function SimpleToken() {
|
function SimpleToken() {
|
||||||
totalSupply = INITIAL_SUPPLY;
|
totalSupply = INITIAL_SUPPLY;
|
||||||
balances[msg.sender] = INITIAL_SUPPLY;
|
balances[msg.sender] = INITIAL_SUPPLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user