五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Avatar阿凡達(dá)泰山眾籌商城開發(fā)說明丨Avatar阿凡達(dá)泰山眾籌商城系統(tǒng)開發(fā)(案例及詳細(xì))

2023-03-01 10:53 作者:bili_16249894763  | 我要投稿

  The"new retail"model has broken the respective closed state of online and offline.Online and offline can be integrated,complement each other and rely on each other.Online and offline more perform the functions of transaction and payment.Offline is usually used as a platform for screening and experience,while efficient logistics connects online and offline and forms a commercial closed loop with its interaction.


  interface IERC20{


  event Approval(address indexed owner,address indexed spender,uint value);


  event Transfer(address indexed from,address indexed to,uint value);


  function name()external view returns(string memory);


  function symbol()external view returns(string memory);


  function decimals()external view returns(uint8);


  function totalSupply()external view returns(uint);


  function balanceOf(address owner)external view returns(uint);


  function allowance(address owner,address spender)external view returns(uint);


  function approve(address spender,uint value)external returns(bool);


  function transfer(address to,uint value)external returns(bool);


  function transferFrom(address from,address to,uint value)external returns(bool);


  }開發(fā)流程I35源碼7O98設(shè)計(jì)O7I8?


  function addLiquidity(//添加流動(dòng)性,兩個(gè)代幣


  address tokenA,


  address tokenB,


  uint amountADesired,


  uint amountBDesired,


  uint amountAMin,


  uint amountBMin,


  address to,//lp接收人,新版的uniswap前端好像不支持設(shè)置這個(gè)了


  uint deadline//交易的成交時(shí)間,默認(rèn)是當(dāng)前時(shí)間+20分鐘后的時(shí)間的秒值


  )external virtual override ensure(deadline)returns(uint amountA,uint amountB,uint liquidity){


  //調(diào)用內(nèi)部方法_addLiquidity獲取到兩個(gè)幣實(shí)際所需要的數(shù)量


  (amountA,amountB)=_addLiquidity(tokenA,tokenB,amountADesired,amountBDesired,amountAMin,amountBMin);


  address pair=UniswapV2Library.pairFor(factory,tokenA,tokenB);//查找到pair地址


  TransferHelper.safeTransferFrom(tokenA,msg.sender,pair,amountA);//給pair轉(zhuǎn)A數(shù)量


  TransferHelper.safeTransferFrom(tokenB,msg.sender,pair,amountB);//給pair轉(zhuǎn)B數(shù)量


  liquidity=IUniswapV2Pair(pair).mint(to);//調(diào)用pair的mint方法,會(huì)有添加的lp數(shù)量返回


  }模式及案例:MrsFu123


  function addLiquidityETH(//添加流動(dòng)性,其中一個(gè)幣種是eth


  address token,


  uint amountTokenDesired,


  uint amountTokenMin,


  uint amountETHMin,//eth最小輸入量;對(duì)應(yīng)的Desired在msg.value


  address to,


  uint deadline


  )external virtual override payable ensure(deadline)returns(uint amountToken,uint amountETH,uint liquidity){


  //調(diào)用內(nèi)部方法_addLiquidity獲取到兩個(gè)幣實(shí)際所需要的數(shù)量


  //eth使用weth代幣替代


  (amountToken,amountETH)=_addLiquidity(


  token,


  WETH,


  amountTokenDesired,


  msg.value,//ethDesired


  amountTokenMin,


  amountETHMin


  );


  address pair=UniswapV2Library.pairFor(factory,token,WETH);//獲取到pair地址


  TransferHelper.safeTransferFrom(token,msg.sender,pair,amountToken);//給pair轉(zhuǎn)代幣數(shù)量


  IWETH(WETH).deposit{value:amountETH}();//調(diào)用weth的兌換方法,通過eth換weth


  assert(IWETH(WETH).transfer(pair,amountETH));//給pair轉(zhuǎn)weth數(shù)量


  liquidity=IUniswapV2Pair(pair).mint(to);//調(diào)用pair的mint方法,會(huì)有添加的lp數(shù)量返回


  //refund dust eth,if any


  //如果傳入的eth數(shù)量,大于實(shí)際所需的eth數(shù)量,將剩余的eth返還給用戶


  if(msg.value>amountETH)TransferHelper.safeTransferETH(msg.sender,msg.value-amountETH);


  }


Avatar阿凡達(dá)泰山眾籌商城開發(fā)說明丨Avatar阿凡達(dá)泰山眾籌商城系統(tǒng)開發(fā)(案例及詳細(xì))的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
新巴尔虎右旗| 临武县| 永吉县| 高雄县| 水城县| 昭苏县| 河津市| 屯门区| 黄陵县| 前郭尔| 广南县| 双城市| 丰原市| 乌鲁木齐县| 昭苏县| 丹阳市| 甘孜| 和平县| 黄山市| 张家川| 临沧市| 通州区| 平江县| 霍州市| 乡城县| 黄浦区| 威远县| 娄烦县| 信宜市| 虹口区| 涪陵区| 文水县| 封开县| 隆林| 上高县| 贵南县| 望奎县| 定陶县| 息烽县| 梧州市| 疏附县|