mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 01:41:00 +00:00
implement the blockhash opcode (#114)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8;
|
||||
|
||||
/* runner.json
|
||||
{
|
||||
"differential": false,
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "Context"
|
||||
}
|
||||
},
|
||||
"data": "4545454545454545454545454545454545454545454545454545454545454545"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract BlockHash {
|
||||
constructor(bytes32 expected) payable {
|
||||
assert(blockhash(0) == expected);
|
||||
assert(blockhash(1) == 0);
|
||||
assert(
|
||||
blockhash(
|
||||
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
) == 0
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user