06 2022 档案

摘要:报错 Deploying 'Migrations' *** Deployment Failed *** "Migrations" -- only replay-protected (EIP-155) transactions allowed over RPC. Exiting: Review suc 阅读全文
posted @ 2022-06-16 10:12 apeNote 阅读(439) 评论(0) 推荐(0) 编辑
摘要:火币测试网参数 网络名称(可自定义,易于识别就好):HECO测试网 新增RPC URL: https://http-testnet.hecochain.com 链id (ChainID) 256 符号:HT 屏蔽管理器URL :https://scan-testnet.hecochain.com 货 阅读全文
posted @ 2022-06-15 09:13 apeNote 阅读(1) 评论(0) 推荐(0) 编辑
摘要:1、安装这个 npm install @truffle/hdwallet-provider 然后发现报错的话试试下面这个 npm i @truffle/hdwallet-provider@next 2、在 truffle-config.js 文件添加火币测试网 hecotest:{ provider 阅读全文
posted @ 2022-06-14 19:46 apeNote 阅读(136) 评论(0) 推荐(0) 编辑
摘要:1、安装truffle 安装 truffle 前,先安装 node npm install truffle --global 2、初始化 truffle init 初始化后的文件目录 3、实现demo pragma solidity ^0.8.4; contract Storage{ uint256 阅读全文
posted @ 2022-06-14 15:52 apeNote 阅读(302) 评论(0) 推荐(0) 编辑
摘要:父合约 contract fruit{ string public name = 'eat'; } 继承 import "/4_.sol"; contract Apple is fruit { function getType() external view returns(string memor 阅读全文
posted @ 2022-06-09 23:43 apeNote 阅读(22) 评论(0) 推荐(0) 编辑
摘要:合约创建合约 合约对 contract Pair { address public factory; string public token0; string public token1; constructor(string memory _token0, string memory _token 阅读全文
posted @ 2022-06-09 16:48 apeNote 阅读(258) 评论(0) 推荐(0) 编辑
摘要:A合约调用B合约 合约B contract B { uint public x; uint public value; function setX(uint _x) public returns (uint){ x = _x; return x; } function setXandSendEthe 阅读全文
posted @ 2022-06-08 23:29 apeNote 阅读(391) 评论(0) 推荐(0) 编辑
摘要:delegateCall 用于重定向父合约; A 合约越来调用B1, 将地址改为 B2 就可以调用 B2 合约B1 contract B { uint public num; uint public value; function setVars(uint _num) public payable{ 阅读全文
posted @ 2022-06-08 22:10 apeNote 阅读(138) 评论(0) 推荐(0) 编辑
摘要:例子 receive contract ReceiveTest { event Received(address caller, uint256 amount, string msg); function getBalance() public view returns(uint256){ retu 阅读全文
posted @ 2022-06-08 11:52 apeNote 阅读(90) 评论(0) 推荐(0) 编辑
摘要:test pragma solidity >=0.7.0 <0.9.0; contract ReceiveTest { string public data; receive() external payable{ data = "receive call"; } fallback() extern 阅读全文
posted @ 2022-06-08 09:55 apeNote 阅读(32) 评论(0) 推荐(0) 编辑
摘要:recieve 接收token函数 pragma solidity >=0.7.0 <0.9.0; contract ReceiveTest { receive() external payable{ } fallback() external payable{ } function getBala 阅读全文
posted @ 2022-06-06 15:21 apeNote 阅读(306) 评论(0) 推荐(0) 编辑
摘要:payable 的使用 合约可以接受 token, 也可以发送 token 通过使用 payable 关键字。 1、通过修饰方法, 例子1 一个充值函数,一个体现函数 pragma solidity >=0.7.0 <0.9.0; contract Payable { mapping(address 阅读全文
posted @ 2022-06-06 09:59 apeNote 阅读(451) 评论(2) 推荐(0) 编辑

点击右上角即可分享
微信分享提示