-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPropertyFixedArrayMappingStructSmoke.t.sol
More file actions
50 lines (46 loc) · 2.21 KB
/
PropertyFixedArrayMappingStructSmoke.t.sol
File metadata and controls
50 lines (46 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.33;
import "./yul/YulTestBase.sol";
/**
* @title PropertyFixedArrayMappingStructSmokeTest
* @notice Auto-generated baseline property stubs from `verity_contract` declarations.
* @dev Source: Contracts/Smoke.lean
*/
contract PropertyFixedArrayMappingStructSmokeTest is YulTestBase {
address target;
address alice = address(0x1111);
function setUp() public {
target = deployYul("FixedArrayMappingStructSmoke");
require(target != address(0), "Deploy failed");
}
// Property 1: writeRoot1 has no unexpected revert
function testAuto_WriteRoot1_NoUnexpectedRevert() public {
vm.prank(alice);
(bool ok,) = target.call(abi.encodeWithSignature("writeRoot1(uint256,bytes32)", uint256(1), bytes32(uint256(0xBEEF))));
require(ok, "writeRoot1 reverted unexpectedly");
}
// Property 2: TODO decode and assert `readRoot1` result
function testTODO_ReadRoot1_DecodeAndAssert() public {
vm.prank(alice);
(bool ok, bytes memory ret) = target.call(abi.encodeWithSignature("readRoot1(uint256)", uint256(1)));
require(ok, "readRoot1 reverted unexpectedly");
assertEq(ret.length, 32, "readRoot1 ABI return length mismatch (expected 32 bytes)");
// TODO(#1011): decode `ret` and assert the concrete postcondition from Lean theorem.
ret;
}
// Property 3: writeProof11 has no unexpected revert
function testAuto_WriteProof11_NoUnexpectedRevert() public {
vm.prank(alice);
(bool ok,) = target.call(abi.encodeWithSignature("writeProof11(uint256,uint256)", uint256(1), uint256(1)));
require(ok, "writeProof11 reverted unexpectedly");
}
// Property 4: TODO decode and assert `readProof11` result
function testTODO_ReadProof11_DecodeAndAssert() public {
vm.prank(alice);
(bool ok, bytes memory ret) = target.call(abi.encodeWithSignature("readProof11(uint256)", uint256(1)));
require(ok, "readProof11 reverted unexpectedly");
assertEq(ret.length, 32, "readProof11 ABI return length mismatch (expected 32 bytes)");
// TODO(#1011): decode `ret` and assert the concrete postcondition from Lean theorem.
ret;
}
}