DAPP代幣合約做市流動性質押挖礦分紅系統開發技術詳細及程式碼部署

xiaofufu發表於2023-03-10

  區塊鏈技術概括起來是指透過去中心化和去信任的方式集體維護一個可靠資料庫的技術。


  In fact,blockchain technology is not a single and new technology,but the result of the integration of many existing technologies.These technologies and databases are ingeniously combined to form a new way of data recording,transmission,storage and presentation


  //Contract to sell and distribute VEN tokens


  contract VENSale is Owned{


  ///chart of stage transition


  ///


  ///deploy initialize startTime endTime finalize


  ///|<-earlyStageLasts->||<-closedStageLasts->|


  ///Created Initialized Early Normal Closed Finalized


  enum Stage{


  NotCreated,


  Created,


  Initialized,


  Early,


  Normal,


  Closed,


  Finalized


  }


  using SafeMath for uint256;


  uint256 public constant totalSupply=(10**9)*(10**18);//1 billion VEN,decimals set to 18


  uint256 constant privateSupply=totalSupply*9/100;//9%for private ICO


  uint256 constant commercialPlan=totalSupply*23/100;//23%for commercial plan


  uint256 constant reservedForTeam=totalSupply*5/100;//5%for team


  uint256 constant reservedForOperations=totalSupply*22/100;//22 for operations


  //59%


  uint256 public constant nonPublicSupply=privateSupply+commercialPlan+reservedForTeam+reservedForOperations;


  //41%


  uint256 public constant publicSupply=totalSupply-nonPublicSupply;


  uint256 public constant officialLimit=64371825*(10**18);


  uint256 public constant channelsLimit=publicSupply-officialLimit;


  //packed to 256bit


  struct SoldOut{流程及詳情:MrsFu123


  uint16 placeholder;//placeholder to make struct pre-alloced


  //amount of tokens officially sold out.


  //max value of 120bit is about 1e36,it's enough for token amount


  uint120 official;


  uint120 channels;//amount of tokens sold out via channels


  }


  SoldOut soldOut;


  uint256 constant venPerEth=3500;//normal exchange rate


  uint256 constant venPerEthEarlyStage=venPerEth+venPerEth*15/100;//early stage has 15%reward


  uint constant minBuyInterval=30 minutes;//each account can buy once in 30 minutes


  uint constant maxBuyEthAmount=30 ether;


  VEN ven;//VEN token contract follows ERC20 standard


  address ethVault;//the account to keep received ether


  address venVault;//the account to keep non-public offered VEN tokens


  uint public constant startTime=1503057600;//time to start sale


  uint public constant endTime=1504180800;//tiem to close sale


  uint public constant earlyStageLasts=3 days;//early bird stage lasts in seconds


  bool initialized;


  bool finalized;


  function VENSale(){


  soldOut.placeholder=1;


  }


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69956839/viewspace-2939008/,如需轉載,請註明出處,否則將追究法律責任。

相關文章