国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

泰山眾籌avatar阿凡達(dá)系統(tǒng)開發(fā)(開發(fā)邏輯)及源碼部署

2023-03-01 18:18 作者:bili_28856027824  | 我要投稿

Blockchain technology can thus empower enterprises in many ways:providing reliable shared data and building trust between all parties;Eliminate data islands,that is,integrate data into a system through centralized ledgers that are shared in a network and support the access of licensees;Give high security to data; interface IWETH{ function deposit()external payable; function transfer(address to,uint value)external returns(bool); function withdraw(uint)external; } contract UniswapV2Router02 is IUniswapV2Router02{ using SafeMath for uint; address public immutable override factory; address public immutable override WETH; //交易時(shí)間是否過期,dapp中默認(rèn)設(shè)置時(shí)20分鐘內(nèi)成交有效 modifier ensure(uint deadline){ require(deadline>=block.timestamp,'UniswapV2Router:EXPIRED'); _; }邏輯及模式:I35流程7O98開發(fā)O7I8 constructor(address _factory,address _WETH)public{ factory=_factory; WETH=_WETH; } receive()external payable{ assert(msg.sender==WETH);//only accept ETH via fallback from the WETH contract } //****ADD LIQUIDITY**** //添加流動(dòng)性內(nèi)部方法,通過該方法計(jì)算出兩個(gè)幣的實(shí)際所需數(shù)量 function _addLiquidity( address tokenA,//代幣地址A address tokenB,//代幣地址B uint amountADesired,//代幣A期望添加量 uint amountBDesired,//代幣B期望添加量 uint amountAMin,//代幣A最小添加量(這兩個(gè)min,收益添加的時(shí)候可以和Desired一樣,二次添加的時(shí)候,一般都是小于Desired,具體小多少,算法可以查看uniswap前端代碼) uint amountBMin//代幣B最小添加量 )internal virtual returns(uint amountA,uint amountB){//返回值是兩個(gè) //create the pair if it doesn't exist yet //通過factory,查詢pair,如果等于0地址,就表示還沒有該交易對(duì),調(diào)用創(chuàng)建方法 if(IUniswapV2Factory(factory).getPair(tokenA,tokenB)==address(0)){ IUniswapV2Factory(factory).createPair(tokenA,tokenB);//創(chuàng)建交易對(duì) }功能及詳細(xì):MrsFu123 //可以先了解下UniswapV2Library中相關(guān)方法的意思 //如果查詢兩個(gè)值都是0,首次添加,直接使用期望值 (uint reserveA,uint reserveB)=UniswapV2Library.getReserves(factory,tokenA,tokenB); if(reserveA==0&&reserveB==0){ (amountA,amountB)=(amountADesired,amountBDesired);//直接使用這兩個(gè)值,比例就是相互的幣價(jià) }else{ //如果

泰山眾籌avatar阿凡達(dá)系統(tǒng)開發(fā)(開發(fā)邏輯)及源碼部署的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
依兰县| 上饶县| 离岛区| 綦江县| 黄陵县| 柘城县| 清苑县| 宁明县| 沙雅县| 乳山市| 迁安市| 大悟县| 商都县| 井研县| 河津市| 汶上县| 新营市| 布拖县| 邹城市| 定西市| 平南县| 满洲里市| 东台市| 青龙| 璧山县| 封丘县| 佛冈县| 醴陵市| 龙陵县| 商南县| 滕州市| 九台市| 云浮市| 沙洋县| 淮阳县| 庆元县| 三明市| 永登县| 伊春市| 普洱| 乾安县|