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

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

幣安鏈bsc盲盒游戲開發(fā)正式版丨幣安鏈盲盒游戲源碼案例

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

The universe is the successor of the mobile internet,and the doors of the virtual world and the real world have been opened.The metauniverse may become the new direction of the development of the Internet,and may also be the next form of the development of the digital economy.The exploration of the universe will promote the deep integration of the real economy and the digital economy,and promote the digital economy to a new stage. //given some amount of an asset and pair reserves,returns an equivalent amount of the other asset //添加流動性的時候,通過該方法查詢輸入A的數(shù)量,需要多少個B function quote(uint amountA,uint reserveA,uint reserveB)internal pure returns(uint amountB){ //判斷數(shù)量,首次添加流動性,隨意定價,不需要查詢該方法 require(amountA>0,'UniswapV2Library:INSUFFICIENT_AMOUNT'); require(reserveA>0&&reserveB>0,'UniswapV2Library:INSUFFICIENT_LIQUIDITY'); //B數(shù)量=預期輸入A的數(shù)量*B的儲備量/A的儲備量;//實際公式就是A/B=reserveA/reserveB,兩個幣的數(shù)量比例一致 amountB=amountA.mul(reserveB)/reserveA; }開發(fā)分析I35模式7O98開發(fā)O7I8 //given an input amount of an asset and pair reserves,returns the maximum output amount of the other asset //通過精確輸入金額,輸入幣的儲備量,輸出幣的儲備量,計算輸出幣的最大輸出量 function getAmountOut(uint amountIn,uint reserveIn,uint reserveOut)internal pure returns(uint amountOut){ require(amountIn>0,'UniswapV2Library:INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn>0&&reserveOut>0,'UniswapV2Library:INSUFFICIENT_LIQUIDITY'); //具體看下面的公式推導,要看該公式,首先要理解uniswap AMM,X*Y=K uint amountInWithFee=amountIn.mul(997);//手續(xù)費都是扣輸入額的千三,所以需要去掉千三后才是實際用于交易的金額 uint numerator=amountInWithFee.mul(reserveOut);//套下面公式理解吧?。? uint denominator=reserveIn.mul(1000).add(amountInWithFee); amountOut=numerator/denominator; /*需求及案例:MrsFu123 *查看下面的由in計算out公式out=in*f*rOut/rIn+in*f *手續(xù)費是千三,扣除手續(xù)費后去交易的金額是輸入額的0.997,公式中的f是0.997內(nèi)部計算用的uint,所以分子分母都*1000 *最終的公式是out=in*997*rOut/((rIn+in*f)*1000) *out=in*997*rOut/(rIn*1000+in*997) */ } /** * * *推導公式 *in輸入金額,out輸出金額 *rIn tokenIn的流動性,rOu

幣安鏈bsc盲盒游戲開發(fā)正式版丨幣安鏈盲盒游戲源碼案例的評論 (共 條)

分享到微博請遵守國家法律
合阳县| 英超| 南澳县| 岫岩| 定结县| 云安县| 婺源县| 花莲县| 漳浦县| 皋兰县| 五峰| 吉木乃县| 石门县| 琼中| 三江| 玛曲县| 文安县| 邵武市| 新宁县| 凭祥市| 静安区| 石台县| 周口市| 湛江市| 嫩江县| 湖州市| 乐清市| 阳山县| 平顶山市| 宝丰县| 万盛区| 阿拉善左旗| 禹城市| 崇仁县| 大安市| 托克逊县| 白沙| 建昌县| 高陵县| 靖江市| 策勒县|