# BEP20 Token Smart Contract
## Requirements
- [Truffle](https://www.trufflesuite.com/docs/truffle/overview)
- [Ganache CLI](https://github.com/trufflesuite/ganache-cli)
- Node: v8.9.4 or later
- [Jest](https://jestjs.io/)
## Configuration
- truffle.config.js
## How to run
### Install dependencies and devDependencies
```
npm install
```
### Development
Step 1: Run ganache-cli on development port (ex: 8545):
```
ganache-cli -p 8545
```
Step 2: Run migrate on development network
```
truffle migrate --network development
```
Step 3: Test smart contract's methods on development
```
truffle console --network development
check your function here
```
### Test
Step 1: Run ganache-cli on test port (ex: 7545):
```
ganache-cli -p 7545
```
Step2: Run test
```
truffle test --network test
```
### Custom network
Step 1: Add your `mnemonic` to `truffle.config.js`:
```
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = <your-mnemonic>;
```
Step 2: Configure custom network (ex: bsc testnet)
```
bsctest: {
provider: () => new HDWalletProvider(mnemonic, `https://data-seed-prebsc-1-s1.binance.org:8545`),
network_id: 97,
confirmations: 10,
timeoutBlocks: 200,
skipDryRun: true
},
```
Check document on [here](https://docs.binance.org/smart-chain/developer/deploy/truffle-verify.html)
Step 2: Deploy contract to custom network:
```
truffle migrate --network <your-custom-network>
```
没有合适的资源?快使用搜索试试~ 我知道了~
bep20-token:BEP20令牌示例
共19个文件
json:8个
sol:5个
js:3个
5星 · 超过95%的资源 18 下载量 188 浏览量
2021-04-16
17:48:33
上传
评论
收藏 418KB ZIP 举报
温馨提示
BEP20代币智能合约 要求 节点:v8.9.4或更高版本 配置 truffle.config.js 怎么跑 安装依赖项和devDependencies npm install 发展 步骤1:在开发端口(例如8545)上运行ganache-cli: ganache-cli -p 8545 步骤2:在开发网络上运行迁移 truffle migrate --network development 步骤3:在开发中测试智能合约的方法 truffle console --network development check your function here 测试 步骤1:在测试端口(例如7545)上运行ganache-cli: ganache-cli -p 7545 步骤2:执行测试 truffle test --network test 定制网络 步骤1:将mnemonic添加到tru
资源详情
资源评论
资源推荐
收起资源包目录
bep20-token-master.zip (19个子文件)
bep20-token-master
.gitignore 273B
README.md 1KB
test
util.js 352B
token.js 5KB
LICENSE 1KB
package.json 158B
truffle-config.js 5KB
build
contracts
TokoinToken.json 79KB
BEP20.json 583KB
IBEP20.json 88KB
Ownable.json 45KB
Context.json 20KB
SafeMath.json 197KB
contracts
Context.sol 1KB
BEP20.sol 9KB
Ownable.sol 929B
IBEP20.sol 3KB
Token.sol 593B
package-lock.json 1.53MB
共 19 条
- 1
xrxiong
- 粉丝: 19
- 资源: 4728
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1