Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Eknir committed Nov 12, 2019
2 parents 1c0efac + 801cb3c commit d5cb868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/bondingcurve/CommonsToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ contract CommonsToken is BondingCurveToken {
uint256 lockedInternal = initialContributions[msg.sender].lockedInternal;

// The total amount of INTERNAL tokens that should have been unlocked.
uint256 shouldHaveUnlockedInternal = (paidExternal / initialRaise) * unlockedInternal;
uint256 shouldHaveUnlockedInternal = (paidExternal * unlockedInternal) / initialRaise;
// The amount of INTERNAL tokens that was already unlocked.
uint256 previouslyUnlockedInternal = (paidExternal / p0) - lockedInternal;
// The amount that can be unlocked.
Expand Down
4 changes: 3 additions & 1 deletion contracts/bondingcurve/FundingPoolMock.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pragma solidity ^0.5.0;

import "./CommonsToken.sol";
import "./vendor/ERC20/IERC20.sol";

contract FundingPoolMock {

Expand All @@ -10,8 +11,9 @@ contract FundingPoolMock {
commonsToken = CommonsToken(_commonsToken);
}

// Note: function not secure => via this function all fundingPool tokens can be withdrawn
function allocateFunds(address to, uint256 value) public {
commonsToken.fundsAllocated(value);
commonsToken.transfer(to, value);
IERC20(commonsToken.externalToken()).transfer(to, value);
}
}

0 comments on commit d5cb868

Please sign in to comment.