mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
21 lines
505 B
Solidity
21 lines
505 B
Solidity
contract C {
|
|
function balance() public returns (uint) {
|
|
this.balance; // to avoid pureness warning
|
|
return 1;
|
|
}
|
|
function transfer(uint amount) public {
|
|
address(this).transfer(amount); // to avoid pureness warning
|
|
}
|
|
function() payable external {
|
|
}
|
|
}
|
|
contract D {
|
|
function f() public {
|
|
uint x = (new C()).balance();
|
|
x;
|
|
(new C()).transfer(5);
|
|
}
|
|
}
|
|
// ----
|
|
// Warning: (17-134): Function state mutability can be restricted to view
|