Merge pull request from ethereum/viewpure-tests

Add more tests to ViewPureChecker
This commit is contained in:
Harikrishnan Mulackal 2020-10-02 14:36:28 +02:00 committed by GitHub
commit 756e21a888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,8 @@
contract C {
function f() public view returns (uint) {
return address(this).balance;
}
function g() public view returns (uint) {
return address(0).balance;
}
}

View File

@ -14,10 +14,16 @@ contract C {
function h() view public {
assembly { function g() { pop(blockhash(20)) } }
}
function j() public {
function i() public {
assembly { pop(call(0, 1, 2, 3, 4, 5, 6)) }
}
function k() public {
function j() public {
assembly { pop(call(gas(), 1, 2, 3, 4, 5, 6)) }
}
function k() public view {
assembly { pop(balance(0)) }
}
function l() public view {
assembly { pop(extcodesize(0)) }
}
}

View File

@ -0,0 +1,8 @@
contract C {
function f() public view {
assembly { pop(extcodehash(0)) }
}
}
// ====
// EVMVersion: >=constantinople
// ----

View File

@ -0,0 +1,8 @@
contract C {
function f() public pure {
assembly { pop(chainid()) }
}
}
// ====
// EVMVersion: >=istanbul
// ----