mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
20 lines
363 B
Solidity
20 lines
363 B
Solidity
contract C {
|
|
uint x;
|
|
uint y;
|
|
fallback () payable external { ++x; }
|
|
receive () payable external { ++y; }
|
|
function f() external returns (uint, uint) { return (x, y); }
|
|
}
|
|
// ====
|
|
// compileToEwasm: also
|
|
// ----
|
|
// f() -> 0, 0
|
|
// () ->
|
|
// f() -> 0, 1
|
|
// (), 1 ether ->
|
|
// f() -> 0, 2
|
|
// (): 1 ->
|
|
// f() -> 1, 2
|
|
// (), 1 ether: 1 ->
|
|
// f() -> 2, 2
|