Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sym exec returns solutions when tx should revert #109

Closed
ggballas opened this issue Dec 20, 2022 · 2 comments
Closed

Sym exec returns solutions when tx should revert #109

ggballas opened this issue Dec 20, 2022 · 2 comments
Assignees

Comments

@ggballas
Copy link

I ran this command:

thoth local ./artifacts/ArgentAccount.json --symbolic -function contracts.account.library.ArgentModel.initialize -constraint v551_res==1 -solve v556

on this piece of compiled code (full file available as attachment):

// Function 48
func contracts.account.library.ArgentModel.initialize{syscall_ptr : felt*, pedersen_ptr : starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr : felt}(signer : felt, guardian : felt){
    v548 = v541_syscall_ptr
    v549 = v542_pedersen_ptr
    v550 = v543_range_check_ptr
    let (v551_res) = read()
    assert v551_res = 0    // 0x0
    v552 = v544_signer
    assert_not_zero(v552)
    v553 = v546_callers_function_frame
    v554 = v547_return_instruction
    v555 = v548
    v556 = v544_signer
    write(v556)
    v557 = v545_guardian
    write(v557)
    ret
}

and received a solution (v556: 0). however, the tx would've reverted since v551_res is asserted to be 0 (whereas it was constrained to be 1). to the best of my knowledge Thoth should return No solution.

ArgentAccount.json.zip

@Rog3rSm1th Rog3rSm1th self-assigned this Dec 20, 2022
@ggballas
Copy link
Author

hey fellas, please let me know if a fix for this is planned for anytime soon?

@pventuzelo
Copy link
Member

@ggballas It's fixed with version 0.7.0 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants