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
6035bd52
Commit
6035bd52
authored
Jul 14, 2017
by
Jakub Wojciechowski
Committed by
Francisco Giordano
Jul 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify crowdsale weiRaised update
parent
b8884687
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
Crowdsale.sol
contracts/crowdsale/Crowdsale.sol
+3
-6
No files found.
contracts/crowdsale/Crowdsale.sol
View file @
6035bd52
...
@@ -70,17 +70,14 @@ contract Crowdsale {
...
@@ -70,17 +70,14 @@ contract Crowdsale {
require(beneficiary != 0x0);
require(beneficiary != 0x0);
require(validPurchase());
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 updatedWeiRaised = weiRaised.add(weiAmount);
// calculate token amount to be created
// calculate token amount to be created
uint256 tokens =
weiAmount
.mul(rate);
uint256 tokens =
msg.value
.mul(rate);
// update state
// update state
weiRaised =
updatedWeiRaised
;
weiRaised =
weiRaised.add(msg.value)
;
token.mint(beneficiary, tokens);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary,
weiAmount
, tokens);
TokenPurchase(msg.sender, beneficiary,
msg.value
, tokens);
forwardFunds();
forwardFunds();
}
}
...
...
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