All Projects → yu-tou → eth-self-token-example

yu-tou / eth-self-token-example

Licence: other
在本地网络发布一个名叫 YuTou 的 token

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
solidity
1140 projects

Projects that are alternatives of or similar to eth-self-token-example

web3jdemo
功能强大的web3j以太坊用例,支持批量生成钱包,批量不同账户转账,查询余额等,监控,定时任务,交易mint等方法,持续更新中... ...
Stars: ✭ 262 (+3175%)
Mutual labels:  ethereum-contract, web3
etherbrite
🗓 Clone eventbrite on Ethereum, built in Solidity, TruffleJS, Web3js and React/Redux.
Stars: ✭ 19 (+137.5%)
Mutual labels:  ethereum-contract, web3
ProveIt
Implements proof of historical data possession on the Ethereum blockchain
Stars: ✭ 37 (+362.5%)
Mutual labels:  ethereum-contract, web3
multisol
CLI application for verifying Solidity contracts on Etherscan
Stars: ✭ 94 (+1075%)
Mutual labels:  ethereum-contract, web3
Trust Wallet Ios
📱 Trust - Ethereum Wallet and Web3 DApp Browser for iOS
Stars: ✭ 1,228 (+15250%)
Mutual labels:  ethereum-contract, web3
React Ethereum Dapp Example
A starter boilerplate for an Ethereum dapp using web3.js v1.0, truffle, react, and parity
Stars: ✭ 384 (+4700%)
Mutual labels:  ethereum-contract, web3
niftygate
Drop-in Access Control via NFT Ownership
Stars: ✭ 61 (+662.5%)
Mutual labels:  ethereum-contract, web3
Eth Vue
Featured in Awesome Vue [https://github.com/vuejs/awesome-vue], a curated list maintained by vuejs of awesome things related to the Vue.js framework, and Awesome List [https://awesomelists.net/150-Vue.js/3863-Open+Source/18749-DOkwufulueze-eth-vue], this Truffle Box provides everything you need to quickly build Ethereum dApps that have authentication features with vue, including configuration for easy deployment to the Ropsten Network. It's also Gravatar-enabled. Connecting to a running Ganache blockchain network from Truffle is also possible -- for fast development and testing purposes. Built on Truffle 5 and Vue 3, eth-vue uses vuex for state management, vuex-persist for local storage of app state, and vue-router for routing. Authentication functionalities are handled by Smart Contracts running on the Ethereum blockchain.
Stars: ✭ 171 (+2037.5%)
Mutual labels:  ethereum-contract, web3
vue-web3
🐙 Web3 blockchain bindings for Vue.js (inspired by Vuefire and Drizzle)
Stars: ✭ 63 (+687.5%)
Mutual labels:  ethereum-contract, web3
blockchain-etl-streaming
Streaming Ethereum and Bitcoin blockchain data to Google Pub/Sub or Postgres in Kubernetes
Stars: ✭ 57 (+612.5%)
Mutual labels:  web3
oxo-chat-app
基于websocket、json、blockchain的公告、聊天(客户端到客户端加密)客户端。账号无需注册,本地生成!
Stars: ✭ 20 (+150%)
Mutual labels:  web3
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (+387.5%)
Mutual labels:  web3
tzindex
Tezos Blockchain Indexer
Stars: ✭ 64 (+700%)
Mutual labels:  web3
Solnet
Solana's .NET SDK and integration library.
Stars: ✭ 252 (+3050%)
Mutual labels:  web3
0x-tracker-worker
NodeJS worker which performs various ETL tasks related to the 0x protocol trading data and other information used on 0x Tracker
Stars: ✭ 28 (+250%)
Mutual labels:  web3
ethereum-dapp-ipfs-node.js-mongodb
以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台
Stars: ✭ 46 (+475%)
Mutual labels:  ethereum-contract
solana-mobile-wallet
💳 Non-custodial cross-platform wallet for Solana
Stars: ✭ 64 (+700%)
Mutual labels:  web3
ambianic-edge
The core runtime engine for Ambianic Edge devices.
Stars: ✭ 98 (+1125%)
Mutual labels:  web3
secureum-mind map
This repo is less actively maintained now but I still monitor it for PR's.
Stars: ✭ 422 (+5175%)
Mutual labels:  web3
subspace
Subspace Network reference implementation
Stars: ✭ 164 (+1950%)
Mutual labels:  web3

在以太坊发布自己的 token 代码示例

本合约为了方便大家学习,直接内置了一个私钥、一个账户地址、一个合约地址,请大家不要做破坏性的使用

文件结构

  • contracts 合约代码
  • scripts 部署脚本
  • test 一些测试代码,演示了如何使用 web3 和 ethers 连接合约

开发

yarn install
# 启动本地网络
yarn chain

token 代码在 ./contracts,其中 YuTou.sol 是 token 合约,YuTouMintable 是发币合约

部署

编辑合约后,部署脚本在 scripts/deploy.js,如合约名有变化则修改

# 部署到本地网络
yarn deploy

# 部署到bsc测试网络
yarn deploytest

执行成功后终端,有合约地址,将地址导入钱包,即可看到 token

发币

钱包使用测试网络连接合约后可以获取自己的一个地址,接下去向地址发 token

修改合约地址和账户地址,在 scripts/mint.js

# 发币到自己的账户
yarn mint

回币

在合约中有一段代码

//接收以太坊可以使用回退函数,在回退函数里给调用者地址发相同数量的代币
receive() external payable {
    require(msg.value > 0);
    _mint(msg.sender, msg.value);
}
constructor() public payable {
}

此段代码是监听 eth 主链上的转账通知,当 当前合约部署的合约地址收到 eth 转账的时候,会进入此逻辑,可以给转账发起方回复 token

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].