mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-07-21 11:35:46 +00:00
implement the gas opcode (#136)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 1126,
|
||||
"Computation": 2405,
|
||||
"DivisionArithmetics": 14486,
|
||||
"ERC20": 22755,
|
||||
"Events": 1620,
|
||||
"FibonacciIterative": 1670,
|
||||
"Flipper": 2005,
|
||||
"SHA1": 16832
|
||||
"Baseline": 1115,
|
||||
"Computation": 2394,
|
||||
"DivisionArithmetics": 14470,
|
||||
"ERC20": 22747,
|
||||
"Events": 1609,
|
||||
"FibonacciIterative": 1659,
|
||||
"Flipper": 1994,
|
||||
"SHA1": 16817
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8;
|
||||
|
||||
/* runner.json
|
||||
{
|
||||
"differential": false,
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "GasLeft"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"VerifyCall": {
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract GasLeft {
|
||||
constructor() payable {
|
||||
assert(gasleft() > gasleft());
|
||||
assert(gasleft() > 0 && gasleft() < 0xffffffffffffffff);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@ test_spec!(transaction, "Transaction", "Transaction.sol");
|
||||
test_spec!(block_hash, "BlockHash", "BlockHash.sol");
|
||||
test_spec!(delegate, "Delegate", "Delegate.sol");
|
||||
test_spec!(gas_price, "GasPrice", "GasPrice.sol");
|
||||
test_spec!(gas_left, "GasLeft", "GasLeft.sol");
|
||||
|
||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||
vec![Instantiate {
|
||||
|
||||
Reference in New Issue
Block a user