polygon链佛萨奇2.0NFT矩阵公排dapp系统开发|玩法规则详情|源代码

简介: polygon链佛萨奇2.0NFT矩阵公排dapp系统开发|玩法规则详情

目录结构
src
│ ├── App.vue
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ ├── ConnectWallteExample.vue
│ │ └── HelloWorld.vue
│ ├── hooks
│ │ └── useWallte.js // 核心逻辑
│ ├── main.js
│ ├── registerServiceWorker.js
│ └── web3
│ ├── abis.js // 提供abis
│ ├── chains.js
│ ├── config.js // 配置项
│ ├── constants.dev.js
│ ├── constants.js
│ └── tools.js
src/web3/config.js, 默认使用Metamask的web3提供者 ,providerOptions 配置可以参考 https://github.com/Web3Modal/...,

Metamask 默认使用 Infura 的服务器做为 web3 提供者。 就像我们上面做的那样。不过它还为用户提供了选择他们自己 Web3 提供者的选项。所以使用 Metamask 的 web3 提供者,你就给了用户选择权,而自己无需操心这一块。
//默认使用Metamask的web3提供者
const providerOptions = {
// Example with injected providers
injected: {

display: {
  logo: "data:image/gif;base64,INSERT_BASE64_STRING",
  name: "Injected",
  description: "Connect with the provider in your Browser"
},
package: null

},
// Example with WalletConnect provider
walletconnect: {

display: {
  logo: "data:image/gif;base64,INSERT_BASE64_STRING",
  name: "Mobile",
  description: "Scan qrcode with your mobile wallet"
},
package: WalletConnectProvider,
options: {
  infuraId: "INFURA_ID" // required
}

}
};
src/hooks/useWallte.js 这里暴露出来的web3、userAddress、chainId、networkId、resetApp、assets、getAccountAssets 等,
可以参考ConnectWallteExample.vue这个demo 。
这就是 vue-cli-plugin 的好处 ,你可以随便的 自定义 操作增删改 useWallter.js
一旦你有了合约的地址和 ABI,你可以像这样来实例化 Web3.js,就可以愉快的调用我们合约的函数: call and send

相关文章
|
区块链 存储
NFT链游铸造合成项目系统开发(详情方案)|NFT链游模式开发项目原理
Web3技术的兴起已经带来了我们与互联网互动方式的重大转变using(MySqlCommand cmd=new MySqlCommand(select,Conn))
|
5月前
|
Python 容器 索引
BRC-20铭文合约NFT铸造交易平台系统开发规则玩法/详细步骤/项目方案/成熟技术/源码功能
有时候,像定义add2()这类简单的函数,用def来正式地写个命名、计算和返回显得稍有点麻烦,Python支持用lambda对简单的功能定义“行内函数”
|
5月前
|
网络协议 算法 区块链
DAPP公排互助矩阵合约系统开发|方案详情
智能合约是指一种独立的、自动执行的代码。它可以被应用于多种类型的区块链中,智能合约也是一个网络协议
|
存储 安全 API
NFT/dapp卡牌链游智能合约系统开发详细指南/案例设计/规则玩法/源码项目
DApp智能合约系统开发功能是指为构建去中心化应用程序(DApp)而设计和开发的智能合约的功能。
NFT卡牌游戏链游系统开发(开发方案)/详情规则/成熟技术/设计界面/案例项目/源码程序
NFT (Non Homogeneous Token) card chain game refers to a game based on blockchain technology where NFT is used as the card in the game. NFT is a unique and non interchangeable digital asset that can represent various virtual cards, props, or characters in the game.
|
安全 前端开发 关系型数据库
NFT卡牌游戏链游系统开发(方案逻辑)丨NFT卡牌游戏(链游)系统开发指南功能/规则需求/方案设计/项目逻辑/源码步骤
Blockchain Platform: Choose a blockchain platform that suits your needs, such as Ethereum, Coin Security Smart Chain, Poka, etc. These platforms provide scalable and secure infrastructure for creating and managing NFT cards.
DApp合约众筹矩阵互助系统开发案例详情丨DApp矩阵互助众筹合约系统开发步骤方案/设计需求/功能开发/项目程序/源码逻辑
The DApp Crowdfunding Matrix Mutual Assistance Contract System is a decentralized application (DApp) system based on blockchain technology, aimed at achieving crowdfunding and mutual assistance operations between users
NFT/dapp卡牌游戏链游系统开发需求方案丨逻辑项目丨案例规则丨源码部署
The development of the DApp game pledge mining system plays an important role in the game ecosystem. By introducing a pledge mining mechanism, players can participate in the game by pledging tokens and receive mining rewards. This system motivates more players to join the game, increasing its activi
|
安全 区块链
NFT元宇宙游戏链游戏统开发(智能合约开发详情)丨规则方案丨案例详细丨源码说明
The NFT metaverse refers to a digital asset trading platform that builds a virtual world based on blockchain technology. The development of a game chain game system is a process of developing gamified interactive experiences and social functions based on the NFT metaverse. By combining blockchain wi