defi/nft流动性质押挖矿分红开发正式版,defi/nft流动性质押挖矿分红系统开发(成熟案例及源码)

简介: Liquidity mining usually requires pledge of loan vouchers or LP vouchers. That is to say, instead of pledging the original token to get the reward of liquidity mining, users need to pledge the original token in DeFi first, and then pledge the voucher to the specified contract to get the reward of li

  Liquidity mining usually requires pledge of loan vouchers or LP vouchers. That is to say, instead of pledging the original token to get the reward of liquidity mining, users need to pledge the original token in DeFi first, and then pledge the voucher to the specified contract to get the reward of liquidity mining.

1、interface-2.6.0node_modules uniswapsdkdistconstants.d.ts(chainID,工厂)

  增加chainID,替换factory,initcode

  //line3,增加BSC 97

  export declare enum ChainId{

  MAINNET=1,

  ROPSTEN=3,

  RINKEBY=4,

  GÖRLI=5,

  KOVAN=42,

  BSC=97

  }

  //line20,替换工厂和initcode

  export declare const FACTORY_ADDRESS="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f";

  export declare const INIT_CODE_HASH="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";

  

  2、interface-2.6.0node_modules uniswapsdkdistsdk.esm.js(chainID,工厂,weth)

  增加chainID,替换factory,initcode

  增加weth

  同目录下sdk.cjs.development.js,如有需要,也一样的方式替换

  //line18,增加BSC

  (function(ChainId){

  ChainId[ChainId["MAINNET"]=1]="MAINNET";

  ChainId[ChainId["ROPSTEN"]=3]="ROPSTEN";

  ChainId[ChainId["RINKEBY"]=4]="RINKEBY";

  ChainId[ChainId["GxD6RLI"]=5]="GxD6RLI";

  ChainId[ChainId["KOVAN"]=42]="KOVAN";

  ChainId[ChainId["BSC"]=97]="BSC";

  })(ChainId||(ChainId={}));

  //替换factory,initcode

  var FACTORY_ADDRESS='0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f';

  var INIT_CODE_HASH='0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f';

  //line442,增加对应的weth

  var WETH=(_WETH={},_WETH[ChainId.MAINNET]=/#__PURE__/new Token(ChainId.MAINNET,'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',18,'WETH','Wrapped Ether'),_WETH[ChainId.ROPSTEN]=/#__PURE__/new Token(ChainId.ROPSTEN,'0xc778417E063141139Fce010982780140Aa0cD5Ab',18,'WETH','Wrapped Ether'),_WETH[ChainId.RINKEBY]=/#__PURE__/new Token(ChainId.RINKEBY,'0xc778417E063141139Fce010982780140Aa0cD5Ab',18,'WETH','Wrapped Ether'),_WETH[ChainId.GÖRLI]=/#__PURE__/new Token(ChainId.GÖRLI,'0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6',18,'WETH','Wrapped Ether'),_WETH[ChainId.KOVAN]=/#__PURE__/new Token(ChainId.KOVAN,'0xd0A1E359811322d97991E03f863a0C30C2cF029C',18,'WETH','Wrapped Ether'),_WETH[ChainId.BSC]=/#__PURE__/new Token(ChainId.BSC,'0x替换成自己的WETH地址',18,'WETH','Wrapped Ether'),_WETH);

  3、interface-2.6.0node_modules uniswapdefault-token-listbuilduniswap-default.tokenlist.json(weth)

  WETH

  //文件最下面按照格式增加一个weth

  {

  "name":"Wrapped Ether",

  "address":"0x替换自己部署的weth",

  "symbol":"WETH",

  "decimals":18,

  "chainId":97,

  "logoURI":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xd0A1E359811322d97991E03f863a0C30C2cF029C/logo.png"

  }

  4、interface-2.6.0node_modules uniswapsdkdistentitiestoken.d.ts(weth)

  WETH

  export declare const WETH:{

  1:Token;

  3:Token;

  4:Token;

  5:Token;

  42:Token;

  97:Token;

  };

  5、interface-2.6.0srcconnectorsindex.ts(网页支持的chainID)

  增加支持的chainID

  //line29,支持的网络增加97

  export const injected=new InjectedConnector({

  supportedChainIds:[1,3,4,5,42,97]

  })

  

  6、interface-2.6.0srcconstantsindex.ts(路由,weth)

  替换路由,增加weth

  //line6,替换路由地址

  export const ROUTER_ADDRESS='0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'

  //line20,增加BSC

  const WETH_ONLY:ChainTokenList={

  [ChainId.MAINNET]:[WETH[ChainId.MAINNET]],

  [ChainId.ROPSTEN]:[WETH[ChainId.ROPSTEN]],

  [ChainId.RINKEBY]:[WETH[ChainId.RINKEBY]],

  [ChainId.GÖRLI]:[WETH[ChainId.GÖRLI]],

  [ChainId.KOVAN]:[WETH[ChainId.KOVAN]],

  [ChainId.BSC]:[WETH[ChainId.BSC]]

  }

 

  7、interface-2.6.0srcconstantsmulticallindex.ts(multicall)

  替换multicall合约地址

  合约代码https://cn.etherscan.com/address/0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441#code

  直接复制下,部署一个即可

  const MULTICALL_NETWORKS:{[chainId in ChainId]:string}={

  [ChainId.MAINNET]:'0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441',

  [ChainId.ROPSTEN]:'0x53C43764255c17BD724F74c4eF150724AC50a3ed',

  [ChainId.KOVAN]:'0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A',

  [ChainId.RINKEBY]:'0x42Ad527de7d4e9d9d011aC45B31D8551f8Fe9821',

  [ChainId.GÖRLI]:'0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e',

  [ChainId.BSC]:'0x替换成自己部署的地址'

  }

  8、interface-2.6.0srcconstantsv1index.ts(v1 factory避免报错)

  v1的factory,增加一个空的就好了

  const V1_FACTORY_ADDRESSES:{[chainId in ChainId]:string}={

  [ChainId.MAINNET]:'0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95',

  [ChainId.ROPSTEN]:'0x9c83dCE8CA20E9aAF9D3efc003b2ea62aBC08351',

  [ChainId.RINKEBY]:'0xf5D915570BC477f9B8D6C0E980aA81757A3AaC36',

  [ChainId.GÖRLI]:'0x6Ce570d02D73d4c384b46135E87f8C592A8c86dA',

  [ChainId.KOVAN]:'0xD3E51Ef092B2845f10401a0159B2B96e8B6c3D30',

  [ChainId.BSC]:''

  }

 

  9、interface-2.6.0srcstatelistshooks.ts(增加chainID配置)

  //line33,增加一个

  /**

  *An empty result,useful as a default.

  */

  const EMPTY_LIST:TokenAddressMap={

  [ChainId.KOVAN]:{},

  [ChainId.RINKEBY]:{},

  [ChainId.ROPSTEN]:{},

  [ChainId.GÖRLI]:{},

  [ChainId.MAINNET]:{},

  [ChainId.BSC]:{}

  }

 
  10、interface-2.6.0srcutilsindex.ts(浏览器跳转查看hash)

  该修改主要用于交易后的提示hash,可以直接点击到浏览器查看

  注意host不要斜杠/结尾

  //line20-30,直接用下面的替换

  const ETHERSCAN_PREFIXES:{[chainId in ChainId]:string}={

  1:'https://etherscan.io',

  3:'https://ropsten.etherscan.io',

  4:'https://rinkeby.etherscan.io',

  5:'https://goerli.etherscan.io',

  42:'https://kovan.etherscan.io',

  97:'https://testnet.bscscan.com'

  }

  export function getEtherscanLink(chainId:ChainId,data:string,type:'transaction'|'token'|'address'):string{

  const prefix=${ETHERSCAN_PREFIXES[chainId]||ETHERSCAN_PREFIXES[1]}

  
  11、interface-2.6.0srccomponentsHeaderindex.tsx(显示的网络名称)

  网页右上角显示网络名称

  //line129,ChainId.BSC是在sdk中添加的,对应的值Bsc只是一个展示

  const NETWORK_LABELS:{[chainId in ChainId]:string|null}={

  [ChainId.MAINNET]:null,

  [ChainId.RINKEBY]:'Rinkeby',

  [ChainId.ROPSTEN]:'Ropsten',

  [ChainId.GÖRLI]:'Görli',

  [ChainId.KOVAN]:'Kovan',

  [ChainId.BSC]:'Bsc'

  }

  

相关文章
|
11月前
|
存储 区块链
NFT+defi质押流动性系统开发技术分析
智能合约采用的是区块链技术,其中数据和程序的完整性得到了高度保障
|
6月前
|
存储 算法 安全
NFT代币铸造分红系统开发|技术方案
区块链是利用块链式数据结构来验证和存储数据、利用分布式节点共识算法来生成和更新数据、
|
区块链
Defi代币质押持币生息系统技术开发/源代码/质押挖矿dapp
Defi代币质押持币生息系统技术开发/源代码/质押挖矿dapp
|
算法 区块链
Defi+NFT质押流动性挖矿系统开发/LP质押挖矿功能开发解析
Defi+NFT质押流动性挖矿系统开发/LP质押挖矿功能开发解析
|
JavaScript 前端开发 区块链
DAPP代币合约流动性质押分红挖矿系统开发丨技术分析
DAPP代币合约流动性质押分红挖矿系统开发丨技术分析
|
机器学习/深度学习 人工智能 安全
PtahDao/ProTradex/Meta2032流动性质押挖矿分红系统开发(NFT质押挖矿开发)丨成熟及源码
 区块链技术由此可以从多方面为企业赋能:提供可靠的共享数据,在各方之间建立信任;消除数据孤岛,即通过去中心化的,在一个网络中共享并支持获许可方访问的账本将数据集成到一个系统中;为数据赋予高度安全性
|
区块链
defi/lp/nft/dapp代币预售合约流动性质押挖矿开发正式版,defi/lp/nft/dapp代币预售合约流动性质押挖矿系统开发(方案及详细)
 智能合约(Smart contract)是依托计算机在网络空间运行的合约,它以信息化方式传播、验证或执行合同,由计算机读取、执行,具备自助的特点。而区块链的去中心化,数据的防篡改,决定了智能合约更加适合于在区块链上来实现
|
存储 缓存 算法
流动性质押挖矿分红开发源码版,流动性质押挖矿分红系统开发技术详细及分析
共识模块主要由几个组件组成,世代epoch、提案消息缓存服务msgcache、共识消息处理引擎engine、共识消息验证器verifier、提案消息存储服务forest、投票处理器voter、共识活性服务pacemaker、wal存储wal、节点间共识信息同步服务compensator、各模块相互配合实现maxbft流水线共识算法
dapp/defi/nft/lp借贷理财流动性质押挖矿开发功能版,dapp/defi/nft/lp借贷理财流动性质押挖矿系统开发(开发方案)
From the perspective of conceptual model,the metauniverse is the superposition of technology system,content system,economic system,cooperation system and governance system.The core of the technical system is integration,and its technical system should be characterized by open
NFT流动性质押挖矿开发功能丨NFT流动性质押挖矿系统开发(开发详细)丨NFT流动性质押挖矿系统源码部署
  Liquidity mining is an incentive mechanism to promote the use of DeFi and a new decentralized token distribution mechanism.Most DeFi applications require users to lock tokens into the contract.The larger the amount of lock-in the contract has,the better financial services can be obtained.Liquidity
下一篇
无影云桌面