DAO代幣流動性質押挖礦分紅系統開發(規則及方案)案例原始碼

xiaofufu發表於2023-03-05

  智慧合約:Web3.0支援智慧合約,這是一種透過程式設計實現的合約,其程式碼執行在區塊鏈上,可以自動執行合約條件。


  去中心化應用程式(DApps):Web3.0使得開發者可以構建去中心化應用程式(DApps),這些應用程式不依賴於中心化伺服器,而是依賴於區塊鏈上的智慧合約和去中心化儲存來提供服務


  event Sync(uint112 reserve0,uint112 reserve1);


  function MINIMUM_LIQUIDITY()external pure returns(uint);


  function factory()external view returns(address);


  function token0()external view returns(address);


  function token1()external view returns(address);


  function getReserves()external view returns(uint112 reserve0,uint112 reserve1,uint32 blockTimestampLast);


  function price0CumulativeLast()external view returns(uint);

  function price1CumulativeLast()external view returns(uint);


  function kLast()external view returns(uint);開發需求:MrsFu123


  function mint(address to)external returns(uint liquidity);


  function burn(address to)external returns(uint amount0,uint amount1);


  function swap(uint amount0Out,uint amount1Out,address to,bytes calldata data)external;


  function skim(address to)external;


  function sync()external;


  function initialize(address,address)external;


  }


  interface IUniswapV2Router01{


  function factory()external pure returns(address);


  function WETH()external pure returns(address);


  function addLiquidity(


  address tokenA,


  address tokenB,


  uint amountADesired,


  uint amountBDesired,


  uint amountAMin,


  uint amountBMin,


  address to,


  uint deadline


  )external returns(uint amountA,uint amountB,uint liquidity);


  function addLiquidityETH(


  address token,


  uint amountTokenDesired,


  uint amountTokenMin,


  uint amountETHMin,


  address to,


  uint deadline


  )external payable returns(uint amountToken,uint amountETH,uint liquidity);


  function removeLiquidity(


  address tokenA,


  address tokenB,


  uint liquidity,


  uint amountAMin,


  uint amountBMin,


  address to,


  uint deadline


  )external returns(uint amountA,uint amountB);


  function removeLiquidityETH(


  address token,


  uint liquidity,


  uint amountTokenMin,


  uint amountETHMin,


  address to,


  uint deadline


  )external returns(uint amountToken,uint amountETH);


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

相關文章