mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 09:08:00 +00:00
30 lines
626 B
Solidity
30 lines
626 B
Solidity
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8;
|
|
|
|
contract ExtCode {
|
|
function ExtCodeSize(address who) public view returns (uint ret) {
|
|
assembly {
|
|
ret := extcodesize(who)
|
|
}
|
|
}
|
|
|
|
function CodeSize() public pure returns (uint ret) {
|
|
assembly {
|
|
ret := codesize()
|
|
}
|
|
}
|
|
|
|
function ExtCodeHash(address who) public view returns (bytes32 ret) {
|
|
assembly {
|
|
ret := extcodehash(who)
|
|
}
|
|
}
|
|
|
|
function CodeHash() public view returns (bytes32 ret) {
|
|
assembly {
|
|
ret := extcodehash(address())
|
|
}
|
|
}
|
|
}
|