NFT盲盒質押挖礦理財系統開發詳情功能

lxqy1668發表於2023-04-14

 最終的聯盟鏈是公有鏈和私有鏈之間的中間地帶。有大量可識別的管理員可供有限數量的使用者使用。由於使用者數量比公鏈少,共識建立時間比公鏈短。此外,由於需要超過一定數量的協議,因此可以獲得比可以獨立更改規則的私有鏈更高的透明度。此外,由於多家公司各自採取了安全措施,可以說是三個區塊鏈中安全性最高的。I88智慧合約I928系統開發8024

  

  //The next token ID to be minted.

  

  uint256 private _currentIndex;

  

  //The number of tokens burned.

  

  uint256 private _burnCounter;

  

  //Token name

  

  string private _name;

  

  //Token symbol

  

  string private _symbol;

  

  //Mapping from token ID to ownership details

  

  //An empty struct value does not necessarily mean the token is unowned.

  

  //See{_packedOwnershipOf}implementation for details.

  

  //

  

  function onboardShop(address shopadr)public returns(uint){//callable only by network owner

  

  numshop++;//定義商店列表函式,買賣前需要註冊商店

  

  uint256 shopId=numshop;

  

  shops[shopId]=shop(shopId,shopadr,0);

  

  shopss[shopadr]=true;

  

  shopids[shopadr]=shopId;

  

  return shopId;

  

  }

  

  function issuePoint(uint shopId,uint point,address customer)public{//callable only by respective shop owner

  

  require(shopss[msg.sender]=true,"Only respective shop can issue points.");

  

  issuetime++;

  

  shoppoints[issuetime]=shoppoint(shopId,customer,point);//issuence

  

  shops[shopId].shopBalance+=point;//shop record

  

  }//定義積分傳送函式

  

  //To realize the freedom of amount,resum customer's balance everytime he redeems

  

  function redeemPoint(uint _shopId,uint _point,uint transactionId)public returns(uint){

  

  require((msg.sender!=owner)&&(shopss[msg.sender]==false),"Only customer can redeem points.");//callable by customer only


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

相關文章