solidity基础-Receive
test
pragma solidity >=0.7.0 <0.9.0; contract ReceiveTest { string public data; receive() external payable{ data = "receive call"; } fallback() external payable{ data = "fallback call"; } function getBalance() public view returns(uint){ return address(this).balance; } }
ganache
metamask 设置网络
设置部署选项为 Injected Web3
部署