Skip to content

Commit

Permalink
Update cap
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifen committed Dec 20, 2021
1 parent e557698 commit 8a6edf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions contracts/Pools.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ contract Pools is Ownable {
_goal <= _TotalTokenAmount,
"Goal cannot be more than TotalTokenAmount"
);
require(_cap <= _goal, "Cap per user cannot be more than goal");

require(projectToken.owner() == address(this), "Pools: not owner");

// TransferInToken(address(projectToken), msg.sender, _TotalTokenAmount);
require(
SafeMath.add(Cap, _cap) <= SafeMath.add(Goal, _goal),
"Cap per user cannot be more than goal"
);

PoolStartTime = _StartingTime;
PoolEndTime = _StartingTime + (86400 * 7);
Expand Down Expand Up @@ -251,6 +254,11 @@ contract Pools is Ownable {
}

function updateCapPerUser(uint256 _cap) public onlyOwner {
require(
SafeMath.add(Cap, _cap) <= Goal,
"Cap per user cannot be more than goal"
);

Cap = _cap;
}

Expand Down
1 change: 1 addition & 0 deletions scripts/deploy-datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function main() {

const PoolsDataStore = await hre.ethers.getContractFactory("PoolsDataStore");

console.log("Deploying data store contract...")
const poolsDataStore = await PoolsDataStore.deploy();
await poolsDataStore.deployed();
console.log("PoolsDataStore deployed to:", poolsDataStore.address);
Expand Down

0 comments on commit 8a6edf2

Please sign in to comment.