Flow Fungible Token 项目教程
1. 项目的目录结构及介绍
flow-ft/
├── contracts/
│ ├── FungibleToken.cdc
│ └── ...
├── docs/
│ ├── README.md
│ └── ...
├── scripts/
│ ├── deploy.sh
│ └── ...
├── tests/
│ ├── test_fungible_token.py
│ └── ...
├── .gitignore
├── LICENSE
├── README.md
└── ...
目录结构介绍
- contracts/: 存放智能合约文件,核心文件为
FungibleToken.cdc
。 - docs/: 存放项目文档,包括
README.md
等。 - scripts/: 存放部署和脚本文件,如
deploy.sh
。 - tests/: 存放测试文件,如
test_fungible_token.py
。 - .gitignore: Git 忽略文件配置。
- LICENSE: 项目许可证文件。
- README.md: 项目主文档。
2. 项目的启动文件介绍
项目的启动文件主要集中在 scripts/
目录下,其中 deploy.sh
是主要的启动脚本。
deploy.sh
文件介绍
#!/bin/bash
# 部署智能合约
flow deploy contracts/FungibleToken.cdc
# 运行测试
python tests/test_fungible_token.py
该脚本主要用于部署智能合约并运行测试。
3. 项目的配置文件介绍
项目的配置文件主要包括 .gitignore
和 LICENSE
。
.gitignore
文件介绍
# 忽略临时文件
*.log
*.tmp
# 忽略生成的文件
/build/
/dist/
# 忽略 IDE 配置文件
.idea/
.vscode/
该文件用于配置 Git 忽略的文件和目录。
LICENSE
文件介绍
MIT License
Copyright (c) 2023 onflow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
该文件为项目的许可证文件,采用 MIT 许可证。