2020-01-22 14:48:56 +00:00
|
|
|
contract A {
|
|
|
|
receive() external payable {
|
|
|
|
revert("no_receive");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
A a = new A();
|
|
|
|
receive() external payable {}
|
|
|
|
function f() public {
|
2020-12-14 15:51:07 +00:00
|
|
|
payable(a).transfer(1 wei);
|
2020-01-22 14:48:56 +00:00
|
|
|
}
|
|
|
|
function h() public {
|
2020-12-14 15:51:07 +00:00
|
|
|
payable(a).transfer(100 ether);
|
2020-01-22 14:48:56 +00:00
|
|
|
}
|
|
|
|
function g() public view returns (uint) {
|
2020-12-14 15:51:07 +00:00
|
|
|
return payable(this).balance;
|
2020-01-22 14:48:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// EVMVersion: >=byzantium
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2020-01-22 14:48:56 +00:00
|
|
|
// revertStrings: debug
|
|
|
|
// ----
|
2020-02-18 11:57:48 +00:00
|
|
|
// (), 10 wei ->
|
2020-01-22 14:48:56 +00:00
|
|
|
// g() -> 10
|
|
|
|
// f() -> FAILURE, hex"08c379a0", 0x20, 10, "no_receive"
|
|
|
|
// h() -> FAILURE
|