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

[KGA-19] dev: use Cairo1Helpers class for 'call_contract' for future-proofness #1625

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

enitrat
Copy link
Collaborator

@enitrat enitrat commented Nov 19, 2024

Uses a call to the Cairo1Helpers class to access the "new" call_contract syscall, that will in the future have the ability to gracefully handle failed contract calls.

NOTE: The change implemented in the following PR does not fix [KGA-19] (code-423n4/2024-09-kakarot-findings#49) because the Starknet network does not allow handling failed calls yet.

Attention to reviewer: The change to the Cairo1Helpers class needs to be merged in kakarot-ssj first. Discussion can be made here

@enitrat enitrat changed the title dev: use Cairo1Helpers class for 'call_contract' for future-proofness [KGA-19] dev: use Cairo1Helpers class for 'call_contract' for future-proofness Nov 19, 2024
Copy link

@enitrat enitrat requested a review from obatirou November 20, 2024 09:24
@obatirou
Copy link
Collaborator

Tests not passing

@enitrat
Copy link
Collaborator Author

enitrat commented Nov 20, 2024

@obatirou need to merge ssj first

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.8%. Comparing base (5cdbb52) to head (700a0d3).
Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1625     +/-   ##
=======================================
- Coverage   64.0%   63.8%   -0.2%     
=======================================
  Files         44      44             
  Lines       8363    8346     -17     
=======================================
- Hits        5354    5331     -23     
- Misses      3009    3015      +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@enitrat
Copy link
Collaborator Author

enitrat commented Nov 24, 2024

all good @obatirou

Copy link
Collaborator

@obatirou obatirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but ressources for ssj are not passing

@enitrat enitrat merged commit 0e61ea9 into main Nov 25, 2024
15 of 16 checks passed
@enitrat enitrat deleted the fix/graceful-contract-cal branch November 25, 2024 09:31
@@ -332,6 +332,5 @@ func execute_starknet_call{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range
to: felt, function_selector: felt, calldata_len: felt, calldata: felt*
) -> (retdata_len: felt, retdata: felt*, success: felt) {
Ownable.assert_only_owner();
let (retdata_len, retdata) = call_contract(to, function_selector, calldata_len, calldata);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call_contract could be removed from the imports at L15

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

Successfully merging this pull request may close these issues.

3 participants