mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 14:01:02 +00:00
implement immutable variables codegen
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 912,
|
||||
"Computation": 4413,
|
||||
"DivisionArithmetics": 40689,
|
||||
"ERC20": 54374,
|
||||
"Events": 1726,
|
||||
"FibonacciIterative": 3015,
|
||||
"Flipper": 3612,
|
||||
"SHA1": 32865
|
||||
"Baseline": 962,
|
||||
"Computation": 4463,
|
||||
"DivisionArithmetics": 40756,
|
||||
"ERC20": 54427,
|
||||
"Events": 1792,
|
||||
"FibonacciIterative": 3065,
|
||||
"Flipper": 3665,
|
||||
"SHA1": 32923
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8;
|
||||
|
||||
/* runner.json
|
||||
{
|
||||
"differential": true,
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "Immutables"
|
||||
}
|
||||
},
|
||||
"data": "000000000000000000000000000000000000000000000000000000000000007b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
},
|
||||
"data": "c2985578"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
},
|
||||
"data": "febb0f7e"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
},
|
||||
"data": "7b6a8777"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract Immutables {
|
||||
uint public immutable foo;
|
||||
uint public immutable bar;
|
||||
uint public immutable zoo;
|
||||
|
||||
constructor(uint _foo) payable {
|
||||
foo = _foo;
|
||||
bar = foo + 1;
|
||||
zoo = bar + 2;
|
||||
}
|
||||
|
||||
fallback() external {
|
||||
assert(foo > 0);
|
||||
assert(bar > 0);
|
||||
assert(zoo > 0);
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ test_spec!(create, "CreateB", "Create.sol");
|
||||
test_spec!(call, "Caller", "Call.sol");
|
||||
test_spec!(transfer, "Transfer", "Transfer.sol");
|
||||
test_spec!(return_data_oob, "ReturnDataOob", "ReturnDataOob.sol");
|
||||
test_spec!(immutables, "Immutables", "Immutables.sol");
|
||||
|
||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||
vec![Instantiate {
|
||||
|
||||
Reference in New Issue
Block a user