solidity/test/libsolidity/semanticTests/various/write_storage_external.sol
2020-03-19 14:42:25 +01:00

41 lines
570 B
Solidity

contract C {
uint256 public x;
function f(uint256 y) public payable {
x = y;
}
function g(uint256 y) external {
x = y;
}
function h() public {
this.g(12);
}
}
contract D {
C c = new C();
function f() public payable returns (uint256) {
c.g(3);
return c.x();
}
function g() public returns (uint256) {
c.g(8);
return c.x();
}
function h() public returns (uint256) {
c.h();
return c.x();
}
}
// ----
// f() -> 3
// g() -> 8
// h() -> 12