五月天青色头像情侣网名,国产亚洲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ā)正式版丨幣安鏈盲盒游戲源碼案例的評論 (共 條)

分享到微博請遵守國家法律
福鼎市| 平江县| 怀远县| 天长市| 大理市| 忻城县| 通许县| 延寿县| 永丰县| 神农架林区| 揭东县| 洛宁县| 深水埗区| 罗甸县| 冷水江市| 灌云县| 肥西县| 阆中市| 彭泽县| 颍上县| 汉源县| 宿州市| 鄢陵县| 武安市| 朝阳市| 蓬安县| 尖扎县| 江山市| 望都县| 鲁山县| 荆门市| 阿勒泰市| 沙洋县| 彭州市| 梨树县| 清远市| 咸宁市| 绥江县| 玉田县| 克东县| 麦盖提县|