目录
1.Call
call 是一个与其他合约交互的底层函数;
通过调用 fallback 函数发送 ether 时建议使用的方法;
但这不是调用现有函数的推荐方法;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract Receiver {
event Received(address caller, uint amount, string message);
fallback() external payable {
emit Received(msg.sender, msg.value, "Fallback was called");
}
function foo(string memory _message, uint _x) public payable returns (uint) {
emit Received(msg.sender, msg.value, _message);
return _x + 1;
}
}
contract Caller {
event Response(bool success, bytes data);
// Let's imagine that cont
订阅专栏 解锁全文
5874

被折叠的 条评论
为什么被折叠?



