DAPP合約LP質押挖礦原始碼搭建系統開發

lxqy16688發表於2023-05-05

  從合約原始碼可看到,該合約中有四個全域性變數(balances,head,owner,secret),在solidity中,全域性變數儲存在storage當中,對於複雜的資料型別,比如array(陣列)和struct(結構體),在函式中作為區域性變數時,也會預設儲存在storage當中。並且solidity的狀態變數儲存時,都是按照狀態在合約中的先後順序進行依次儲存。


  num_stocks=len(stock_codes)


  stock_daily_quotes={}


  In[3]:,I88智慧合約I928系統開發8024


  import time


  for code in stock_codes:


  print(code)


  df=ts.get_k_data(code=code,start='2015-10-01',end='2019-10-01')


  df=df.set_index(['date'])


  df[code]=df['close']


  stock_daily_quotes[code]=df[code]


  time.sleep(1)


  }


  function symbol()public view virtual override returns(string memory){


  return _symbol;


  }


  function decimals()public view virtual override returns(uint8){


  return 18;


  }


  function totalSupply()public view virtual override returns(uint256){


  return _totalSupply;


  }


  function balanceOf(address account)public view virtual override returns(uint256){


  return _balances[account];


  }


  function transfer(address to,uint256 amount)public virtual override returns(bool){


  address owner=_msgSender();


  _transfer(owner,to,amount);


  return true;


  }


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

相關文章