Merge pull request #11320 from irnb/develop

change variable declaration place
This commit is contained in:
Harikrishnan Mulackal 2021-04-27 13:56:11 +02:00 committed by GitHub
commit a942e630d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,16 +389,18 @@ operations as long as there is enough gas passed on to it.
pragma solidity >=0.6.2 <0.9.0;
contract Test {
uint x;
// This function is called for all messages sent to
// this contract (there is no other function).
// Sending Ether to this contract will cause an exception,
// because the fallback function does not have the `payable`
// modifier.
fallback() external { x = 1; }
uint x;
}
contract TestPayable {
uint x;
uint y;
// This function is called for all messages sent to
// this contract, except plain Ether transfers
// (there is no other function except the receive function).
@ -409,8 +411,6 @@ operations as long as there is enough gas passed on to it.
// This function is called for plain Ether transfers, i.e.
// for every call with empty calldata.
receive() external payable { x = 2; y = msg.value; }
uint x;
uint y;
}
contract Caller {