Skip to content

Commit d5cb868

Browse files
committed
2 parents 1c0efac + 801cb3c commit d5cb868

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

contracts/bondingcurve/CommonsToken.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ contract CommonsToken is BondingCurveToken {
210210
uint256 lockedInternal = initialContributions[msg.sender].lockedInternal;
211211

212212
// The total amount of INTERNAL tokens that should have been unlocked.
213-
uint256 shouldHaveUnlockedInternal = (paidExternal / initialRaise) * unlockedInternal;
213+
uint256 shouldHaveUnlockedInternal = (paidExternal * unlockedInternal) / initialRaise;
214214
// The amount of INTERNAL tokens that was already unlocked.
215215
uint256 previouslyUnlockedInternal = (paidExternal / p0) - lockedInternal;
216216
// The amount that can be unlocked.

contracts/bondingcurve/FundingPoolMock.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pragma solidity ^0.5.0;
22

33
import "./CommonsToken.sol";
4+
import "./vendor/ERC20/IERC20.sol";
45

56
contract FundingPoolMock {
67

@@ -10,8 +11,9 @@ contract FundingPoolMock {
1011
commonsToken = CommonsToken(_commonsToken);
1112
}
1213

14+
// Note: function not secure => via this function all fundingPool tokens can be withdrawn
1315
function allocateFunds(address to, uint256 value) public {
1416
commonsToken.fundsAllocated(value);
15-
commonsToken.transfer(to, value);
17+
IERC20(commonsToken.externalToken()).transfer(to, value);
1618
}
1719
}

0 commit comments

Comments
 (0)