diff --git a/src/kontrol/utils.py b/src/kontrol/utils.py index 138d2b5d5..fd92fe31f 100644 --- a/src/kontrol/utils.py +++ b/src/kontrol/utils.py @@ -248,6 +248,12 @@ def foundry_toml_extra_contents() -> str: """ +def foundry_toml_cancun_schedule() -> str: + return """ +evm_version = "cancun" +""" + + def _rv_yellow() -> str: return '#ffcc07' diff --git a/src/tests/integration/test-data/end-to-end-prove-all b/src/tests/integration/test-data/end-to-end-prove-all index 642fd998f..4e4c53ec1 100644 --- a/src/tests/integration/test-data/end-to-end-prove-all +++ b/src/tests/integration/test-data/end-to-end-prove-all @@ -1,4 +1,5 @@ CounterTest.test_Increment() +TransientStorageTest.testTransientStoreLoad(uint256,uint256) UnitTest.test_assertEq_address_err() UnitTest.test_assertEq_bool_err() UnitTest.test_assertEq_bytes32_err() diff --git a/src/tests/integration/test-data/src/TransientStorage.t.sol b/src/tests/integration/test-data/src/TransientStorage.t.sol new file mode 100644 index 000000000..c4006f525 --- /dev/null +++ b/src/tests/integration/test-data/src/TransientStorage.t.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/Test.sol"; + +contract TransientStorageTest is Test { + function testTransientStoreLoad(uint256 key, uint256 value) public { + // Store `value` at `key` in transient storage + assembly { + tstore(key, value) + } + + uint256 loadedValue; + + // Load `value` from `key` in transient storage + assembly { + loadedValue := tload(key) + } + + assertEq(loadedValue, value, "TLOAD did not return the correct value"); + } +} \ No newline at end of file diff --git a/src/tests/integration/test_kontrol.py b/src/tests/integration/test_kontrol.py index a9e81669e..ef4917a60 100644 --- a/src/tests/integration/test_kontrol.py +++ b/src/tests/integration/test_kontrol.py @@ -13,6 +13,7 @@ from kontrol.kompile import foundry_kompile from kontrol.options import BuildOptions, ProveOptions from kontrol.prove import foundry_prove +from kontrol.utils import append_to_file, foundry_toml_cancun_schedule from .utils import TEST_DATA_DIR, assert_pass @@ -59,6 +60,7 @@ def foundry_end_to_end(foundry_root_dir: Path | None, tmp_path_factory: TempPath if not foundry_root.is_dir(): init_project(project_root=foundry_root, skip_forge=False) copy_tree(str(TEST_DATA_DIR / 'src'), str(foundry_root / 'test')) + append_to_file(foundry_root / 'foundry.toml', foundry_toml_cancun_schedule()) foundry_kompile( BuildOptions( @@ -112,6 +114,7 @@ def test_kontrol_end_to_end( 'usegas': False, 'port': server_end_to_end.port, 'force_sequential': force_sequential, + 'schedule': 'CANCUN', } ), )