-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
contract C { | ||
uint public x = msg.value - 10; | ||
constructor() payable {} | ||
} | ||
|
||
contract E { | ||
uint public x = msg.value - 10; | ||
constructor() payable { | ||
unchecked { | ||
new C(); | ||
} | ||
} | ||
} | ||
|
||
contract D { | ||
function f() public { | ||
unchecked { | ||
new C(); | ||
} | ||
} | ||
} | ||
|
||
contract F { | ||
function f() public { | ||
unchecked { | ||
new E(); | ||
new D(); | ||
} | ||
} | ||
} | ||
// ---- | ||
// f() -> FAILURE, hex"4e487b71", 0x11 | ||
// g(), 100 wei -> 1 | ||
// gas legacy: 76780 | ||
// gas legacy code: 23600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
import os | ||
from argparse import Namespace | ||
from execution.main_execution import main | ||
|
||
|
||
class TestStructure: | ||
|
||
def test_nested_subcontracts(self): | ||
""" | ||
21/01/2025: in the version of solc that was provided in 15/01/2024, the subObjects appear as part of the | ||
keys of a CFG Object (with "blocks" and "functions"). We have adapted the structure to fit this str | ||
Solution: We have adapted the structure to fit this structure. | ||
""" | ||
# Args | ||
# -s tests/nested_subcontracts.sol -g -v -if sol -o prueba -solc ./solc-objects | ||
current_path = os.path.abspath(os.curdir) | ||
os.chdir("..") | ||
args = Namespace( | ||
source='tests/nested_subcontracts.sol', | ||
input_format='sol', contract=None, solc_executable='./solc-objects', folder='falla', | ||
visualize=True, greedy=True, builtin=False) | ||
main(args) | ||
os.chdir(current_path) | ||
assert True, "Falla test" |