Skip to content

Commit

Permalink
Merge pull request #9 from WingsDao/develop
Browse files Browse the repository at this point in the history
1.1.0 version
  • Loading branch information
RomanFro authored Jul 23, 2018
2 parents 6d27620 + bd61e0d commit 76fe1d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion contracts/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,14 @@ contract Bridge is BasicCrowdsale {

uint256 tokenReward = totalSold.mul(tokenRewardPart) / 1000000;

if (totalCollectedETH != 0) {
totalCollected = totalCollectedETH;
}

totalCollected = IWingsController(manager).fitCollectedValueIntoRange(totalCollected);

if (hasEthReward) {
ethReward = ((totalCollectedETH == 0) ? totalCollected : totalCollectedETH).mul(ethRewardPart) / 1000000;
ethReward = totalCollected.mul(ethRewardPart) / 1000000;
}

return (ethReward, tokenReward);
Expand Down
2 changes: 2 additions & 0 deletions contracts/IWingsController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ pragma solidity ^0.4.23;
contract IWingsController {
uint256 public ethRewardPart;
uint256 public tokenRewardPart;

function fitCollectedValueIntoRange(uint256 _totalCollected) public view returns (uint256);
}
6 changes: 5 additions & 1 deletion contracts/test/ControllerStub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import "../IWingsController.sol";

// Minimal crowdsale token for custom contracts
contract ControllerStub is IWingsController {

constructor(uint256 _ethRewardPart, uint256 _tokenRewardPart) {
ethRewardPart = _ethRewardPart;
tokenRewardPart = _tokenRewardPart;
}

function fitCollectedValueIntoRange(uint256 _totalCollected) public view returns (uint256) {
return _totalCollected;
}

function() public payable {
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wings-light-bridge",
"version": "1.0.0",
"version": "1.1.0",
"description": "In this tutorial we are going to walkthrough the Wings integration process.",
"main": "truffle.js",
"directories": {
Expand Down

0 comments on commit 76fe1d1

Please sign in to comment.