mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
- Solidity Upgraded up to v0.8.0 - Fixed and Added eth_chainId - Fix error in TransactionRecipet - Reward halving issue fixed
23 lines
930 B
Solidity
23 lines
930 B
Solidity
pragma solidity >0.6.1 <0.7.0;
|
|
contract Test {
|
|
// 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 {
|
|
// This function is called for all messages sent to
|
|
// this contract, except plain Ether transfers
|
|
// (there is no other function except the receive function).
|
|
// Any call with non-empty calldata to this contract will execute
|
|
// the fallback function (even if Ether is sent along with the call).
|
|
fallback() external payable { x = 1; y = msg.value; }
|
|
// 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;
|
|
}
|