feat: 添加 MiniSwap CLI 工具及相关文档

- 新增 CLI 工具,支持通过命令行与 MiniSwapAMM 合约交互
- 创建 CLI 使用指南文档,详细说明命令和操作流程
- 更新合约地址,确保与新部署的合约匹配
- 添加快速网络连接测试脚本,验证合约连接和网络状态
- 实现完整测试场景脚本,模拟用户操作和流动性管理
This commit is contained in:
2025-07-12 02:28:36 +08:00
parent 3faf89e0a1
commit 7cddf1d987
7 changed files with 1009 additions and 6 deletions

View File

@ -116,8 +116,7 @@ contract MiniSwapAMM is ERC20, ReentrancyGuard {
* @param amountBOutMin 最小输出的 tokenB 数量
* @return amountBOut 实际输出的 tokenB 数量
*/
function swapAForB(uint256 amountAIn, uint256 amountBOutMin)
external nonReentrant returns (uint256 amountBOut) {
function swapAForB(uint256 amountAIn, uint256 amountBOutMin) external nonReentrant returns (uint256 amountBOut) {
require(amountAIn > 0, "MiniSwapAMM: INSUFFICIENT_INPUT_AMOUNT");
amountBOut = getAmountOut(amountAIn, reserveA, reserveB);