当前位置:网站首页>PancakeSwap技术:夹子机器人系统开发原理
PancakeSwap技术:夹子机器人系统开发原理
2022-06-29 17:02:00 【KFZ433】
Pancake.php 开发包适用于为PHP应用快速增加对PancakeSwap协议的支持能力。即支持使用自有部署BSC区块链节点的应用场景,也支持使用第三方节点的轻量级部署场景。
1、开发包概述
Pancake.php开发包主要包含以下特性:
一键部署PancakeSwap协议,便于快速开发与测试
支持PancakeSwap协议的全部接口,并提供开发人员友好的API
支持BEP20/BEP20、BNB/BEP20等各种交易对的流动性添加、移除与兑换交易
支持自动做市价格计算与滑点计算
支持BSC交易gas用量与gas价格的自动估算与手动设定
支持EIP712签名授权,单一交易内完成流动性维护
Pancake.php开发包运行在 Php 7.1+ 环境下,当前版本1.0.0,主要类/接口及关系如下图所示:
Pancake.php开发包的主要代码文件清单如下:
2、使用示例代码 2.1 编译合约 在终端进入项目目录,执行如下命令编译PancakeSwap及开发包提供的测试Token合约:
登录后复制 ~$ cd ~/pancake.php ~/pancake.php$ bin/build-contracts
执行结果如下:
2.2 部署合约
首先在另一个终端启动开发私链:
~$ ganache-cli -d
然后进入项目demo目录,执行如下命令部署合约:
登录后复制
~$ cd ~/pancake.php/demo
~/pancake.php/demo$ php deploy-contracts.php
执行结果如下:
注意 :如果需要在BSC测试链或主链部署上述合约,或者使用其他参数 启动ganache-cli,需要修改demo/config.php中的账号配置
边栏推荐
- 卷妹带你学数据库---5天冲刺Day4
- Comment configurer logback? 30 minutes pour apprendre à coder et à frapper tard.
- PHP删除目录
- Perhaps in two years, ASML will be free to supply EUV lithography machines to China
- What's the difference between isempty and isblank? Half of the people can't answer it?
- Us chips are hit hard again, and Intel may be defeated by TSMC and reduced to the third place in the world
- Advanced webgl performance optimization
- Redis布隆过滤器和布谷鸟过滤器
- 我的远程办公初体验 | 社区征文
- [R language data science]: Text Mining (taking Trump's tweet data as an example)
猜你喜欢

从Mpx资源构建优化看splitChunks代码分割

基于深度学习的Wiki中文语料词word2vec向量模型

Tencent cloud released the upgraded version of CDW Clickhouse to provide a fast experience for massive data real-time analysis scenarios

如何配置 logback?30分钟让你彻底学会代码熬夜敲

如何创建虚拟形象

知道创宇为能源行业资产管理助力,入选工信部2021物联网示范项目

What are the project management systems suitable for small and medium-sized enterprises?

使用kalibr標定工具進行單目相機和雙目相機的標定

基于opencv进行双目相机的标定

微信小程序开发储备知识
随机推荐
@Difference between component and @configuration
卷妹带你学数据库---5天冲刺Day4
Information | Zuckerberg was rated as the most careless CEO in the global IT industry; China Mobile R & D tethered UAV emergency communication high altitude base station
[untitled]
XAMPP Apache安装时问题总结
图文带你彻底弄懂MySQL事务原子性之UndoLog
6.25AtCoderABC257E - Addition and Multiplication 2题解
自己实现一个ThreadLocal
What are the Commonwealth countries
curl: (56) Recv failure: Connection reset by peer
SLAM中的子图
ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法
Summary of problems during xampp Apache installation
Problem solving metauniverse, multi communication scheme in online games
【现代信号处理第六次作业】
Calibration of binocular camera based on OpenCV
C language microblog user management system
从Mpx资源构建优化看splitChunks代码分割
redolog和binlog
Tencent cloud released the upgraded version of CDW Clickhouse to provide a fast experience for massive data real-time analysis scenarios