forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuiltin_functions.sol
24 lines (24 loc) · 1.16 KB
/
builtin_functions.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
contract C {
function f() public {
payable(this).transfer(1);
require(payable(this).send(2));
selfdestruct(payable(this));
(bool success,) = address(this).delegatecall("");
require(success);
(success,) = address(this).call("");
require(success);
}
function g() pure public {
bytes32 x = keccak256("abc");
bytes32 y = sha256("abc");
address z = ecrecover(bytes32(uint256(1)), uint8(2), bytes32(uint256(3)), bytes32(uint256(4)));
require(true);
assert(true);
x; y; z;
}
receive() payable external {}
}
// ====
// bytecodeFormat: legacy
// ----
// Warning 5159: (122-134): "selfdestruct" has been deprecated. Note that, starting from the Cancun hard fork, the underlying opcode no longer deletes the code and data associated with an account and only transfers its Ether to the beneficiary, unless executed in the same transaction in which the contract was created (see EIP-6780). Any use in newly deployed contracts is strongly discouraged even if the new behavior is taken into account. Future changes to the EVM might further reduce the functionality of the opcode.