diff --git a/contracts/CorePad.sol b/contracts/CorePad.sol index 2e70bb4..d35d4df 100644 --- a/contracts/CorePad.sol +++ b/contracts/CorePad.sol @@ -173,10 +173,6 @@ contract CorePad is Ownable { uint256 platformFee = totalRaisedAmount.mul(ratePercent).div(1e5); uint256 payoutAmount = totalRaisedAmount.sub(platformFee); - console.log("totalRaisedAmount is ", totalRaisedAmount); - console.log("platFormFee is ", platformFee); - console.log("payout amount is ", payoutAmount); - _totalPlatformFee += platformFee; ProjectInfo memory projectInfo = projectInfoMapping[projectId_]; diff --git a/contracts/OFLaunch/CommunitySaleOF.sol b/contracts/OFLaunch/CommunitySaleOF.sol new file mode 100644 index 0000000..783b393 --- /dev/null +++ b/contracts/OFLaunch/CommunitySaleOF.sol @@ -0,0 +1,173 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import "../library/SafeERC20.sol"; +import "../library/FixedPoint.sol"; +import "../library/LowGasSafeMath.sol"; + +contract CommunitySaleOF { + + using SafeERC20 for IERC20; + using FixedPoint for *; + using LowGasSafeMath for uint256; + using LowGasSafeMath for uint32; + + mapping(address => uint256) public userToTokenAmount; + mapping(address => uint8) public whiteListedUser; + uint256 public totalTokenSupply; + uint256 public totalAmountRaised; + uint256 public totalAmountToRaise; + uint256 public price; + uint32 public totalParticipatedUser; + uint32 public startTimestamp; + uint32 public endTimestamp; + uint256 public maxTokenPerUser; + bool public contractStatus; + + IERC20 private projectToken; + IERC20 private principalToken; + address private _owner; + + modifier onlyCaller() { + require(_owner == msg.sender, "Owner Invalid"); + _; + } + + constructor ( + address tokenAdd_, + address principal_, + uint256 price_, + uint256 totalAmountToRaise_, + uint256 totalTokenSupply_, + uint256 maxTokenPerUser_, + uint32 startTime_, + uint32 endTime_) + { + _owner = msg.sender; + projectToken = IERC20(tokenAdd_); + principalToken = IERC20(principal_); + price = price_; + totalAmountToRaise = totalAmountToRaise_; + totalTokenSupply = totalTokenSupply_; + maxTokenPerUser = maxTokenPerUser_; + startTimestamp = startTime_; + endTimestamp = endTime_; + } + + receive() external payable{ + } + + // ============= Owner/Admin Actions ================= + + function changeContractStatus(bool status) external onlyCaller { + contractStatus = status; + } + + function withdrawRemainingTokens(address to_) external onlyCaller returns(uint256) { + uint256 balance = projectToken.balanceOf(address(this)); + projectToken.safeTransfer(to_, balance); + return balance; + } + + function withdrawRaisedAmount() external onlyCaller returns(uint256) { + uint256 balance = principalToken.balanceOf(address(this)); + principalToken.safeTransfer(msg.sender, balance); + return balance; + } + + function setTimeInfo(uint32 startTime_, uint32 endTime_) external onlyCaller { + require(startTime_ != 0 || endTime_ != 0, "Both timestamp cannot be 0"); + if(startTime_ != 0){ + startTimestamp = startTime_; + } + if(endTime_!= 0){ + endTimestamp = endTime_; + } + } + + // ============= User Actions ================= + + function _whitelistUser(address to_) internal { + whiteListedUser[to_] = 1; + } + + function removeWhitelistedUser(address to_) external onlyCaller { + whiteListedUser[to_] = 0; + } + + function whitelistUser(address to_) external onlyCaller { + _whitelistUser(to_); + } + + function whitelistUsers(address[] calldata userList) external onlyCaller { + for(uint32 i=0; i 0, "invalid amount"); + require(startTimestamp < block.timestamp, "project not live"); + require(endTimestamp > block.timestamp, "project has ended"); + require(totalAmountRaised.add(amount_) <= totalAmountToRaise, "Amount exceeds total amount to raise"); + + uint256 value = payoutFor(amount_); + require(userToTokenAmount[msg.sender].add(value) <= maxTokenPerUser, "Token amount exceed"); + if(userToTokenAmount[msg.sender] == 0){ + totalParticipatedUser += 1; + } + + totalAmountRaised += amount_; + userToTokenAmount[msg.sender] = userToTokenAmount[msg.sender].add(value); + principalToken.safeTransferFrom(msg.sender, address(this), amount_); + projectToken.safeTransfer(msg.sender, value); + } + + function payoutFor(uint256 amount) internal view returns(uint256){ + return ((FixedPoint.fraction(amount, price).decode112with18()).div(1e15)).mul(1e15); + } + + function owner() external view returns(address){ + return _owner; + } + + function getProjectTokenAddress() external view returns(address){ + return address(projectToken); + } + + function getProjectDetails() external view returns( + address projectToken_, + address principalToken_, + bool contractStatus_ + ){ + principalToken_ = address(principalToken); + projectToken_ = address(projectToken); + contractStatus_ = contractStatus; + } + + function getTokenInfo() external view returns( + uint256 totalTokenSupply_, + address projectToken_, + uint256 tokenPrice_ + ){ + totalTokenSupply_ = totalTokenSupply; + projectToken_ = address(projectToken); + tokenPrice_ = price; + } + + function getAmountInfo() external view returns( + uint256 totalAmountToRaise_, + uint256 totalAmountRaised_ + ) { + totalAmountRaised_ = totalAmountRaised; + totalAmountToRaise_ = totalAmountToRaise; + } +} + diff --git a/contracts/OFLaunch/PrivateSaleOF.sol b/contracts/OFLaunch/PrivateSaleOF.sol new file mode 100644 index 0000000..81bd27f --- /dev/null +++ b/contracts/OFLaunch/PrivateSaleOF.sol @@ -0,0 +1,261 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import "../library/SafeERC20.sol"; +import "../library/FixedPoint.sol"; +import "../library/LowGasSafeMath.sol"; +import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +contract EIP712Whitelisting { + using ECDSA for bytes32; + address private _owner; + + // The key used to sign whitelist signatures. + address private _whitelistSigningKey = address(0); + + bytes32 public DOMAIN_SEPARATOR; + + bytes32 public constant MINTER_TYPEHASH = + keccak256("WhitelistedStruct(address walletAddress)"); + + constructor() { + DOMAIN_SEPARATOR = keccak256( + abi.encode( + keccak256( + "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" + ), + // This should match the domain you set in your client side signing. + keccak256(bytes("WhitelistAddress")), + keccak256(bytes("1")), + block.chainid, + address(this) + ) + ); + _owner = msg.sender; + } + + function setWhitelistSigningAddress(address newSigningKey) external { + require(msg.sender == _owner); + require(newSigningKey != address(0)); + _whitelistSigningKey = newSigningKey; + } + + modifier requiresWhitelist(bytes calldata signature) { + require(_whitelistSigningKey != address(0), "whitelist not enabled"); + bytes32 digest = keccak256( + abi.encodePacked( + "\x19\x01", + DOMAIN_SEPARATOR, + keccak256(abi.encode(MINTER_TYPEHASH, msg.sender)) + ) + ); + + address recoveredAddress = digest.recover(signature); + require(recoveredAddress == _whitelistSigningKey, "Invalid Signature"); + _; + } + + function whitelistSigningKey() external view returns(address){ + require(msg.sender == _owner, "Caller not Owner"); + return _whitelistSigningKey; + } +} + +contract PrivateSaleOF { + + using SafeERC20 for IERC20; + using FixedPoint for *; + using LowGasSafeMath for uint256; + using LowGasSafeMath for uint32; + + mapping(address => uint256) public userToTokenAmount; + + uint256 public totalTokenSupply; + uint256 public totalAmountRaised; + uint256 public totalAmountToRaise; + uint256 public price; + uint32 public totalParticipatedUser; + uint32 public startTimestamp; + uint32 public endTimestamp; + uint256 public maxTokenPerUser; + bool public contractStatus; + address private _whitelistSigningKey = address(0); + + IERC20 private projectToken; + IERC20 private principalToken; + address private _owner; + + modifier onlyCaller() { + require(_owner == msg.sender, "Caller Invalid"); + _; + } + + constructor ( + address tokenAdd_, + address principal_, + uint256 price_, + uint256 totalAmountToRaise_, + uint256 totalTokenSupply_, + uint256 maxTokenPerUser_, + uint32 startTime_, + uint32 endTime_) + { + _owner = msg.sender; + projectToken = IERC20(tokenAdd_); + principalToken = IERC20(principal_); + price = price_; + totalAmountToRaise = totalAmountToRaise_; + totalTokenSupply = totalTokenSupply_; + maxTokenPerUser = maxTokenPerUser_; + startTimestamp = startTime_; + endTimestamp = endTime_; + } + + receive() external payable { + } + + function setWhitelistSigningAddress(address newSigningKey) external { + require(msg.sender == _owner); + require(newSigningKey != address(0)); + _whitelistSigningKey = newSigningKey; + } + + // ============= Owner/Admin Actions ================= + + function changeContractStatus(bool status) external onlyCaller { + contractStatus = status; + } + + function withdrawRemainingTokens(address to_) external onlyCaller returns(uint256) { + uint256 balance = projectToken.balanceOf(address(this)); + projectToken.safeTransfer(to_, balance); + return balance; + } + + function withdrawRaisedAmount() external onlyCaller returns(uint256) { + uint256 balance = principalToken.balanceOf(address(this)); + principalToken.safeTransfer(msg.sender, balance); + return balance; + } + + function setTimeInfo(uint32 startTime_, uint32 endTime_) external onlyCaller { + require(startTime_ != 0 || endTime_ != 0, "Both timestamp cannot be 0"); + if(startTime_ != 0){ + startTimestamp = startTime_; + } + if(endTime_!= 0){ + endTimestamp = endTime_; + } + } + + // ============= User Actions ================= + + // don't forget to approve the principal token + function participate(uint256 amount_, bytes memory signature, bytes32 data) + external { + address signer = recoverSigner(data, signature); + require(signer == _whitelistSigningKey, "Nice try !!"); + + require(contractStatus, "Sale Contract is Inactive"); + require(amount_ > 0, "invalid amount"); + require(startTimestamp < block.timestamp, "project not live"); + require(endTimestamp > block.timestamp, "project has ended"); + require(totalAmountRaised.add(amount_) <= totalAmountToRaise, "Amount exceeds total amount to raise"); + + uint256 value = payoutFor(amount_); + require(userToTokenAmount[msg.sender].add(value) <= maxTokenPerUser, "Token amount exceed"); + if(userToTokenAmount[msg.sender] == 0){ + totalParticipatedUser += 1; + } + + totalAmountRaised += amount_; + userToTokenAmount[msg.sender] = userToTokenAmount[msg.sender].add(value); + principalToken.safeTransferFrom(msg.sender, address(this), amount_); + projectToken.safeTransfer(msg.sender, value); + } + + + // ============= GETTER ================= + function payoutFor(uint256 amount) public view returns(uint256){ + return ((FixedPoint.fraction(amount, price).decode112with18()).div(1e15)).mul(1e15); + } + + function owner() external view returns(address){ + return _owner; + } + + function getProjectTokenAddress() external view returns(address){ + return address(projectToken); + } + + function getProjectDetails() external view returns( + address projectToken_, + address principalToken_, + bool contractStatus_ + ){ + principalToken_ = address(principalToken); + projectToken_ = address(projectToken); + contractStatus_ = contractStatus; + } + + function getTokenInfo() external view returns( + uint256 totalTokenSupply_, + address projectToken_, + uint256 tokenPrice_ + ){ + totalTokenSupply_ = totalTokenSupply; + projectToken_ = address(projectToken); + tokenPrice_ = price; + } + + function getAmountInfo() external view returns( + uint256 totalAmountToRaise_, + uint256 totalAmountRaised_ + ) { + totalAmountRaised_ = totalAmountRaised; + totalAmountToRaise_ = totalAmountToRaise; + } + + function getProjectTimeInfo() external view returns( + uint32 startTimestamp_, + uint32 endTimestamp_ + ){ + startTimestamp_ = startTimestamp; + endTimestamp_ = endTimestamp; + } + function recoverSigner(bytes32 message, bytes memory sig) internal pure + returns (address) + { + uint8 v; + bytes32 r; + bytes32 s; + + (v, r, s) = splitSignature(sig); + + return ecrecover(message, v, r, s); + } + + function splitSignature(bytes memory sig) + internal + pure + returns (uint8, bytes32, bytes32) + { + require(sig.length == 65); + + bytes32 r; + bytes32 s; + uint8 v; + + assembly { + // first 32 bytes, after the length prefix + r := mload(add(sig, 32)) + // second 32 bytes + s := mload(add(sig, 64)) + // final byte (first byte of the next 32 bytes) + v := byte(0, mload(add(sig, 96))) + } + + return (v, r, s); + } + +} diff --git a/contracts/interface/IORCL.sol b/contracts/interface/IORCL.sol deleted file mode 100644 index 91a56e2..0000000 --- a/contracts/interface/IORCL.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; - -interface IORCL { - function burnFrom(address account_, uint256 amount_) external; - - function mint(address account_, uint256 amount_) external; - - function totalSupply() external view returns (uint256); -} diff --git a/package-lock.json b/package-lock.json index 4e7f117..0681eac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { - "name": "hardhat-project", + "name": "oracle-launchpad-contracts", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "hardhat-project", + "name": "oracle-launchpad-contracts", + "version": "1.0.0", "dependencies": { "@openzeppelin/contracts": "^4.5.0", "@openzeppelin/contracts-upgradeable": "^4.5.1", + "csv-parser": "^3.0.0", "hardhat-tracer": "^1.0.0-alpha.6" }, "devDependencies": { @@ -4137,6 +4140,20 @@ "node": "*" } }, + "node_modules/csv-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/csv-parser/-/csv-parser-3.0.0.tgz", + "integrity": "sha512-s6OYSXAK3IdKqYO33y09jhypG/bSDHPuyCme/IdEHfWpLf/jKcpitVFyOC6UemgGk8v7Q5u2XE0vvwmanxhGlQ==", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "csv-parser": "bin/csv-parser" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -26790,6 +26807,14 @@ "randomfill": "^1.0.3" } }, + "csv-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/csv-parser/-/csv-parser-3.0.0.tgz", + "integrity": "sha512-s6OYSXAK3IdKqYO33y09jhypG/bSDHPuyCme/IdEHfWpLf/jKcpitVFyOC6UemgGk8v7Q5u2XE0vvwmanxhGlQ==", + "requires": { + "minimist": "^1.2.0" + } + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", diff --git a/package.json b/package.json index bc7eb17..f900ae2 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "dependencies": { "@openzeppelin/contracts": "^4.5.0", "@openzeppelin/contracts-upgradeable": "^4.5.1", + "csv-parser": "^3.0.0", "hardhat-tracer": "^1.0.0-alpha.6" } } diff --git a/scripts/OFLaunchScript/CommunitySaleOF.ts b/scripts/OFLaunchScript/CommunitySaleOF.ts new file mode 100644 index 0000000..6a79422 --- /dev/null +++ b/scripts/OFLaunchScript/CommunitySaleOF.ts @@ -0,0 +1,45 @@ +import { ethers } from "hardhat"; +// eslint-disable-next-line node/no-missing-import +import { readContractAddress, saveFrontendFiles } from "../helpers"; +// eslint-disable-next-line node/no-missing-import +import { constants } from "../constants"; + +async function main() { + const [deployer] = await ethers.getSigners(); + + const mockProjectToken = readContractAddress("/MockProjectToken.json"); + const mockStableCoin = readContractAddress("/MockStableCoin.json"); + const price = constants.tokenPrice; + const totalAmountToRaise = constants.amountToRaise; + const totalSupply = constants.totalTokenSupply; + const maxTokenPerUser = "100000000000000000000"; + const startTime = Math.round(Date.now() / 1000); + const endTime = startTime + 60 * 60 * 1000; + + const CommunitySaleOF = await ethers.getContractFactory("CommunitySaleOF"); + const communitySaleOF = await CommunitySaleOF.deploy( + mockProjectToken, + mockStableCoin, + price, + totalAmountToRaise, + totalSupply, + maxTokenPerUser, + startTime, + endTime + ); + await communitySaleOF.deployed(); + + console.log("Token address of communitySaleOF:", communitySaleOF.address); + + saveFrontendFiles(communitySaleOF, "CommunitySaleOF"); + + const projectTokenFact = await ethers.getContractFactory("MockProjectToken"); + const projectToken = await projectTokenFact.attach(mockProjectToken); + + await projectToken.mint(deployer.address, constants.totalTokenSupply); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/scripts/OFLaunchScript/PrivateSaleOF.ts b/scripts/OFLaunchScript/PrivateSaleOF.ts new file mode 100644 index 0000000..e3fbf97 --- /dev/null +++ b/scripts/OFLaunchScript/PrivateSaleOF.ts @@ -0,0 +1,48 @@ +import { ethers } from "hardhat"; +// eslint-disable-next-line node/no-missing-import +import { readContractAddress, saveFrontendFiles } from "../helpers"; +// eslint-disable-next-line node/no-missing-import +import { constants } from "../constants"; + +async function main() { + const [deployer, whitelistSigningKey] = await ethers.getSigners(); + + const mockProjectToken = readContractAddress("/MockProjectToken.json"); + const mockStableCoin = readContractAddress("/MockStableCoin.json"); + const price = constants.tokenPrice; + const totalAmountToRaise = constants.amountToRaise; + const totalSupply = constants.totalTokenSupply; + const maxTokenPerUser = constants.maxTokenPerUser; + const startTime = Math.round(Date.now() / 1000); + const endTime = startTime + 60 * 60 * 1000; + + const PrivateSaleOF = await ethers.getContractFactory("PrivateSaleOF"); + const privateSaleOF = await PrivateSaleOF.deploy( + mockProjectToken, + mockStableCoin, + price, + totalAmountToRaise, + totalSupply, + maxTokenPerUser, + startTime, + endTime + ); + await privateSaleOF.deployed(); + + console.log("Token address of privateSaleOF:", privateSaleOF.address); + + saveFrontendFiles(privateSaleOF, "PrivateSaleOF"); + + const projectTokenFact = await ethers.getContractFactory("MockProjectToken"); + const projectToken = await projectTokenFact.attach(mockProjectToken); + + await projectToken.mint(deployer.address, constants.totalTokenSupply); + + console.log(whitelistSigningKey.address); + await privateSaleOF.setWhitelistSigningAddress(whitelistSigningKey.address); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/scripts/OFLaunchScript/data/whitelist.csv b/scripts/OFLaunchScript/data/whitelist.csv new file mode 100644 index 0000000..e69de29 diff --git a/scripts/OFLaunchScript/whitelistUsers.ts b/scripts/OFLaunchScript/whitelistUsers.ts new file mode 100644 index 0000000..c68e01a --- /dev/null +++ b/scripts/OFLaunchScript/whitelistUsers.ts @@ -0,0 +1,34 @@ +import { ethers } from "hardhat"; +// eslint-disable-next-line node/no-missing-import +import { readContractAddress } from "../helpers"; +import csv from "csv-parser"; + +import fs from "fs"; + +async function main() { + const communitySaleOFAdd = readContractAddress("/CommunitySaleOF.json"); + + const CommunitySaleOFFact = await ethers.getContractFactory( + "CommunitySaleOF" + ); + const communitySaleOF = await CommunitySaleOFFact.attach(communitySaleOFAdd); + + console.log("Token address of communitySaleOF:", communitySaleOF.address); + + fs.createReadStream( + "/data/whitelist.csv" + ) + .pipe(csv()) + .on("data", async (row: string) => { + await communitySaleOF.whitelistUser(row); + console.log("whitelisting completed for:", row); + }) + .on("end", () => { + console.log("CSV file successfully processed"); + }); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/scripts/initCommunitySaleOF.sh b/scripts/initCommunitySaleOF.sh new file mode 100755 index 0000000..93543b6 --- /dev/null +++ b/scripts/initCommunitySaleOF.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +npx hardhat run ./OFLaunchScript/CommunitySaleOF.ts --network localhost && +npx hardhat run ./OFLaunchScript/whitelistUsers.ts --network localhost \ No newline at end of file diff --git a/test/communitySale.test.ts b/test/communitySale.test.ts index 912fa95..24ce3bf 100644 --- a/test/communitySale.test.ts +++ b/test/communitySale.test.ts @@ -5,7 +5,7 @@ import signWhitelist from "../scripts/utils/signWhitelist"; import { constants } from "../scripts/constants"; import { Contract } from "ethers"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -describe("Public Sale Contract", async () => { +describe("Community Sale Contract", async () => { let projectToken: Contract, stableCoin: Contract, deployer: SignerWithAddress, diff --git a/test/communitySaleOF.test.ts b/test/communitySaleOF.test.ts new file mode 100644 index 0000000..a09d820 --- /dev/null +++ b/test/communitySaleOF.test.ts @@ -0,0 +1,53 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +// eslint-disable-next-line node/no-missing-import +import { constants } from "../scripts/constants"; +import { Contract } from "ethers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +describe("OF Community Sale Contract", async () => { + let projectToken: Contract, + stableCoin: Contract, + deployer: SignerWithAddress, + corePad: SignerWithAddress, + user1: SignerWithAddress, + user2: SignerWithAddress, + user3: SignerWithAddress, + admin1: SignerWithAddress, + whitelistSigningKey: SignerWithAddress, + communitySaleOF: Contract; + + const startTime = Math.round(Date.now() / 1000); + const endTime = startTime + 60 * 60 * 5; + + before(async () => { + [deployer, corePad, user1, user2, user3, admin1] = + await ethers.getSigners(); + + const projectTokenFact = await ethers.getContractFactory( + "MockProjectToken" + ); + projectToken = await projectTokenFact.deploy(); + const stableCoinFact = await ethers.getContractFactory("MockStableCoin"); + stableCoin = await stableCoinFact.deploy(); + + const CommunitySaleOF = await ethers.getContractFactory("CommunitySaleOF"); + communitySaleOF = await CommunitySaleOF.deploy( + projectToken.address, + stableCoin.address, + constants.tokenPrice, + constants.amountToRaise, + constants.totalTokenSupply, + constants.maxTokenPerUser, + startTime, + endTime + ); + }); + + it("Check initialized", async function () { + expect(await communitySaleOF.owner()).to.equal(deployer.address); + }); + + it("Whitelist and address and Check Participate reverts", async function () { + + }); +}); diff --git a/test/corePad.test.ts b/test/corePad.test.ts index 0826523..467344c 100644 --- a/test/corePad.test.ts +++ b/test/corePad.test.ts @@ -52,7 +52,7 @@ describe("Core Pad", async () => { constants.maxTokenPerUser, startTime, endTime, - "" + "" ); project2 = await project2Fact.deploy( projectToken.address, @@ -64,10 +64,8 @@ describe("Core Pad", async () => { constants.maxTokenPerUser, startTime, endTime, - "" + "" ); - - console.log(project1.address); }); it("Check Staked Address", async function () { @@ -128,7 +126,7 @@ describe("Core Pad", async () => { constants.tokenPrice, constants.maxTokenPerUser, constants.totalTokenSupply, - "" + "" ); // const projectInfo = await corePad.projectInfoMapping(1); diff --git a/test/privateSale.test.ts b/test/privateSale.test.ts index 3623d25..91b1cd8 100644 --- a/test/privateSale.test.ts +++ b/test/privateSale.test.ts @@ -40,6 +40,7 @@ describe("Private Sale Contract", async () => { constants.amountToRaise, constants.totalTokenSupply, nft.address, + constants.maxTokenPerUser, startTime, endTime, ""