最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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)遵守國家法律
龙川县| 泽普县| 台东市| 易门县| 昭觉县| 韶关市| 鱼台县| 奉贤区| 安徽省| 沙河市| 江源县| 灵璧县| 梧州市| 贞丰县| 友谊县| 普宁市| 大埔区| 岢岚县| 武夷山市| 荣昌县| 淮安市| 罗山县| 兴和县| 桐乡市| 磐石市| 漠河县| 自治县| 专栏| 蒲城县| 晋州市| 石狮市| 永胜县| 阿荣旗| 内江市| 囊谦县| 长岛县| 隆子县| 云浮市| 历史| 芜湖县| 乐陵市|