mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-20 16:11:00 +00:00
implement the blockhash opcode (#114)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 967,
|
||||
"Computation": 4022,
|
||||
"DivisionArithmetics": 31787,
|
||||
"ERC20": 44233,
|
||||
"Events": 1743,
|
||||
"FibonacciIterative": 2927,
|
||||
"Flipper": 3408,
|
||||
"SHA1": 26009
|
||||
"Baseline": 961,
|
||||
"Computation": 4024,
|
||||
"DivisionArithmetics": 31789,
|
||||
"ERC20": 44214,
|
||||
"Events": 1737,
|
||||
"FibonacciIterative": 2929,
|
||||
"Flipper": 3402,
|
||||
"SHA1": 26003
|
||||
}
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@ test_spec!(transfer, "Transfer", "Transfer.sol");
|
||||
test_spec!(return_data_oob, "ReturnDataOob", "ReturnDataOob.sol");
|
||||
test_spec!(immutables, "Immutables", "Immutables.sol");
|
||||
test_spec!(transaction, "Transaction", "Transaction.sol");
|
||||
test_spec!(block_hash, "BlockHash", "BlockHash.sol");
|
||||
|
||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||
vec![Instantiate {
|
||||
|
||||
Reference in New Issue
Block a user