Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
e2861e75
Commit
e2861e75
authored
Oct 18, 2016
by
Manuel Araoz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spacing
parent
6de19c59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
30 deletions
+30
-30
CrowdsaleToken.sol
contracts/token/CrowdsaleToken.sol
+21
-21
SimpleToken.sol
contracts/token/SimpleToken.sol
+9
-9
No files found.
contracts/token/CrowdsaleToken.sol
View file @
e2861e75
...
@@ -7,28 +7,28 @@ import "../StandardToken.sol";
...
@@ -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;
}
}
}
contracts/token/SimpleToken.sol
View file @
e2861e75
...
@@ -9,14 +9,14 @@ import "../StandardToken.sol";
...
@@ -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;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment