Skip to content

Smart Contracts API

viac92 edited this page Feb 14, 2022 · 3 revisions

DataGen.sol

Description:

DataGen utility erc-20 token(#DG) the utility token for the Datagen infrastructure.

totalSupply 30000000
decimal 18
name DataGen
symbol #DG

VCPrivateSale.sol

Description:

This smart contract is used for private sale for VCs. They can buy #DG tokens with invest() functions. #DG tokenPrice: 0.7; 0.9; 1.1 USDC (it depends when they bought). Before lockTime the token owner sends 1/10 VCs #DG token to VCs wallets. After lockTime the token owner sends 1/10 of the remaining #DG (the total #DG amount sub the 10%) amount per 30 days. The USDC can be claimed by the token owner during the sale.

Functions:

constructor:

Function constructor (
  IERC20 _token,
  uint256 _startTime,
  uint256 _endTime,
  uint256 _lockTime,
  address _USDC_ADDRESS )
Description Constructor of VCPrivateSale smart contract.
Parameter IERC20 _token: DataGen Token Address.

Uint256 _startTime: startTime for VCPrivateSale.

Uint256 _endTime: endTime for VCPrivateSale.

Uint256 _lockTime: set LockTime – during LockTime, Only the token Owner can call the function to send 1/10 of investors #DG token to VCs wallets.

Address _USDC_ADDRESS: sets USDC token address.

checkFunds:

Function checkFunds( address addr ) public view returns(uint256)
Description This function gets the USDC balance of the addr user.
Parameter address addr: address of the user to get USDC balance.
Return This function returns the balance of USDC of addr wallet in uint256.

checkDataGenFunds:

Function checkDataGenFunds( address addr ) public view returns(uint256)
Description This function gets the #DG token balance of the addr user.
Parameter address addr: address of the user to get #DG token balance
Return This function returns the balance of #DG token of addr wallet in uint256.

setLockTime:

Function setLockTime(uint256 _lockTime) public
Description This function sets lockTime.

invest:

Function invest( uint256 amountDG) external
Description This function makes an investment.

Investors can call this function after startTime and before endTime of VCPrivateSale amountDG should be bigger than 20000 #DG and less than 2350000 #DG.

tokenPrice:
  if amountDG <= 300000 #DG → 1#DG = 0.7 USD
  if amountDG <= 1300000 #DG → 1#DG = 0.9 USDC
  if amountDG > 1300000 #DG → 1#DG = 1.1 USDC

warning: Before calling this function the user must approve to use USDC first.

Parameter uint256 amountDG: #DG token amount for investment.

claimDataGen:

Function claimDataGen( ) public afterClosed nonReentrant onlyOwner
Description This function distributes #DG tokens that they bought during VCPrivateSale.
This function can only be called after VCPrivateSale finishes and only the owner can call.
Before lockTime, only the token owner can call the function to send 1/10 VCs #DG token to VCs wallets.
After lockTime, only the token owner can call the function to send only 1/10 of the remaining (the total amount sub the 10%) amount per 30 days.

withdrawUSDC:

Function withdrawUSDC( ) public onlyOwner
Description This function withdraws USDC from the smart contract to the owner's wallet.
This function can only be called by the owner.

withdrawDataGen:

Function withdrawDataGen( ) public onlyOwner afterClosed
Description This function withdraws the correct amount of #DG token from smart contract to owner wallet leaving the #DG for the claim.
This function can only be called by the owner, after the private sale is finished.
Clone this wiki locally