摘要: 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 阅读(383) 评论(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 阅读(134) 评论(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 阅读(89) 评论(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 阅读(26) 评论(0) 推荐(0) 编辑