wipAdd VM Version Paris and new built in function `prevrandaoAdd VM Version Paris and new built in function prevrandao`

This commit is contained in:
Marenz
2022-10-04 19:25:45 +02:00
parent 70b0fb6366
commit 2dc5435c19
32 changed files with 249 additions and 34 deletions
@@ -0,0 +1,6 @@
function f() view returns (uint) {
return block.difficulty;
}
// ====
// EVMVersion: <paris
// ----
@@ -0,0 +1,18 @@
contract C {
function f() public view returns (uint ret) {
assembly {
let difficulty := sload(0)
ret := difficulty
}
}
function g() public pure returns (uint ret) {
assembly {
function difficulty() -> r {
r := 1000
}
ret := difficulty()
}
}
}
// ----
// ParserError 5568: (98-108): Cannot use builtin function name "difficulty" as identifier name.
@@ -0,0 +1,7 @@
function f() view returns (uint) {
return block.difficulty;
}
// ====
// EVMVersion: >=paris
// ----
// Warning 8417: (43-59): "difficulty" was renamed and supplanted by "prevrandao" in the VM version paris.
@@ -0,0 +1,6 @@
function f() view returns (uint) {
return block.prevrandao;
}
// ====
// EVMVersion: >=paris
// ----
@@ -0,0 +1,20 @@
contract C {
function f() public view returns (uint ret) {
assembly {
let prevrandao := sload(0)
ret := prevrandao
}
}
function g() public pure returns (uint ret) {
assembly {
function prevrandao() -> r {
r := 1000
}
ret := prevrandao()
}
}
}
// ====
// EVMVersion: >=paris
// ----
// ParserError 5568: (98-108): Cannot use builtin function name "prevrandao" as identifier name.
@@ -0,0 +1,7 @@
function f() view returns (uint) {
return block.prevrandao;
}
// ====
// EVMVersion: <paris
// ----
// Warning 9432: (43-59): "prevrandao" is not supported by the VM version and will be treated like "difficulty".