From 1b5f99c95a7852584308786ae0c48f02d1c2e8ef Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Wed, 28 Dec 2022 04:55:28 +0400 Subject: [PATCH] Add balance tree and output message effects to CEI analysis (#3648) --- .../calling_contracts.md | 8 +- .../semantic_analysis/cei_pattern_analysis.rs | 99 ++++++++++++------- sway-error/src/warning.rs | 14 ++- .../cei_pattern_violation/test.toml | 2 +- .../test.toml | 2 +- .../Forc.lock | 3 + .../Forc.toml | 6 ++ .../src/main.sw | 18 ++++ .../test.toml | 3 + .../Forc.lock | 3 + .../Forc.toml | 6 ++ .../src/main.sw | 18 ++++ .../test.toml | 3 + .../Forc.lock | 13 +++ .../Forc.toml | 8 ++ .../src/main.sw | 23 +++++ .../test.toml | 3 + .../Forc.lock | 13 +++ .../Forc.toml | 8 ++ .../src/main.sw | 23 +++++ .../test.toml | 3 + .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../cei_pattern_violation_in_struct/test.toml | 2 +- .../cei_pattern_violation_in_tuple/test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 2 +- .../test.toml | 4 +- .../Forc.lock | 13 +++ .../Forc.toml | 8 ++ .../src/main.sw | 19 ++++ .../test.toml | 3 + .../test.toml | 4 +- .../test.toml | 2 +- 43 files changed, 294 insertions(+), 68 deletions(-) create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.lock create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/src/main.sw create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/test.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.lock create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/src/main.sw create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/test.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.lock create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/src/main.sw create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/test.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.lock create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/src/main.sw create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/test.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.lock create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.toml create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/src/main.sw create mode 100644 test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/test.toml diff --git a/docs/book/src/blockchain-development/calling_contracts.md b/docs/book/src/blockchain-development/calling_contracts.md index fee91dfb0ca..3146d48fd4f 100644 --- a/docs/book/src/blockchain-development/calling_contracts.md +++ b/docs/book/src/blockchain-development/calling_contracts.md @@ -141,7 +141,7 @@ warning 29 | | 30 | | // Storage update _after_ external call 31 | | storage.balances.insert(sender, 0); - | |__________________________________________- Storage modification after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract + | |__________________________________________- Storage write after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract 32 | } 33 | } | @@ -150,6 +150,12 @@ ____ In case there is a storage read after an interaction, the CEI analyzer will issue a similar warning. +In addition to storage reads and writes after an interaction, the CEI analyzer reports analogous warnings about: + +- balance tree updates, i.e. balance tree reads with subsequent writes, which may be produced by the `tr` and `tro` asm instructions or library functions using them under the hood; +- balance trees reads with `bal` instruction; +- changes to the output messages that can be produced by the `__smo` intrinsic function or the `smo` asm instruction. + ## Differences from the EVM While the Fuel contract calling paradigm is similar to the EVM's (using an ABI, forwarding gas and data), it differs in _two_ key ways: diff --git a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs index f9a93e59ba6..7b5379b55bf 100644 --- a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs +++ b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs @@ -5,6 +5,8 @@ // for more detail on vulnerabilities in case of storage modification after interaction // and this [blog post](https://chainsecurity.com/curve-lp-oracle-manipulation-post-mortem) // for more information on storage reads after interaction. +// We also treat the balance tree reads and writes separately, +// as well as modifying output messages. use crate::{ declaration_engine::{DeclarationEngine, DeclarationId}, @@ -15,6 +17,7 @@ use crate::{ Engines, }; use std::collections::HashSet; +use std::fmt; use sway_error::warning::{CompileWarning, Warning}; use sway_types::{Ident, Span, Spanned}; @@ -23,6 +26,38 @@ enum Effect { Interaction, // interaction with external contracts StorageWrite, // storage modification StorageRead, // storage read + // Note: there are no operations that only write to the balance tree + BalanceTreeRead, // balance tree read operation + BalanceTreeReadWrite, // balance tree read and write operation + OutputMessage, // operation creates a new `Output::Message` +} + +impl fmt::Display for Effect { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use Effect::*; + match self { + Interaction => write!(f, "Interaction"), + StorageWrite => write!(f, "Storage write"), + StorageRead => write!(f, "Storage read"), + BalanceTreeRead => write!(f, "Balance tree read"), + BalanceTreeReadWrite => write!(f, "Balance tree update"), + OutputMessage => write!(f, "Output message sent"), + } + } +} + +impl Effect { + fn to_suggestion(&self) -> String { + use Effect::*; + String::from(match self { + Interaction => "making all interactions", + StorageWrite => "making all storage writes", + StorageRead => "making all storage reads", + BalanceTreeRead => "making all balance tree reads", + BalanceTreeReadWrite => "making all balance tree updates", + OutputMessage => "sending all output messages", + }) + } } // The algorithm that searches for storage operations after interaction @@ -31,7 +66,7 @@ enum Effect { // storage reads or writes. enum CEIAnalysisState { LookingForInteraction, // initial state of the automaton - LookingForStorageReadOrWrite, + LookingForEffect, } pub(crate) fn analyze_program(engines: Engines<'_>, prog: &ty::TyProgram) -> Vec { @@ -100,7 +135,7 @@ fn impl_trait_methods<'a>( } // This is the main part of the analysis algorithm: -// we are looking for state effects after contract interaction +// we are looking for various effects after contract interaction fn analyze_code_block( engines: Engines<'_>, codeblock: &ty::TyCodeBlock, @@ -117,11 +152,11 @@ fn analyze_code_block( match analysis_state { CEIAnalysisState::LookingForInteraction => { if codeblock_entry_effects.contains(&Effect::Interaction) { - analysis_state = CEIAnalysisState::LookingForStorageReadOrWrite; + analysis_state = CEIAnalysisState::LookingForEffect; interaction_span = ast_node.span.clone(); } } - CEIAnalysisState::LookingForStorageReadOrWrite => warn_after_interaction( + CEIAnalysisState::LookingForEffect => warn_after_interaction( &codeblock_entry_effects, &interaction_span, &ast_node.span, @@ -306,27 +341,17 @@ fn analyze_expression( set_union(cond_then_effs, cond_else_effs) } WhileLoop { condition, body } => { - // if the loop (condition + body) contains both interaction and storage operations + // if the loop (condition + body) contains both interaction and state effects // in _any_ order, we report CEI pattern violation let cond_effs = analyze_expression(engines, condition, block_name, warnings); let body_effs = analyze_code_block(engines, body, block_name, warnings); let res_effs = set_union(cond_effs, body_effs); - if res_effs.is_superset(&HashSet::from([Effect::Interaction, Effect::StorageRead])) { - warnings.push(CompileWarning { - span: expr.span.clone(), - warning_content: Warning::StorageReadAfterInteraction { - block_name: block_name.clone(), - }, - }); - }; - if res_effs.is_superset(&HashSet::from([Effect::Interaction, Effect::StorageWrite])) { - warnings.push(CompileWarning { - span: expr.span.clone(), - warning_content: Warning::StorageWriteAfterInteraction { - block_name: block_name.clone(), - }, - }); - }; + if res_effs.contains(&Effect::Interaction) { + // TODO: the span is not very precise, we can do better here, but this + // will need a bit of refactoring of the CEI analysis + let span = expr.span.clone(); + warn_after_interaction(&res_effs, &span, &span, &block_name.clone(), warnings) + } res_effs } AsmExpression { @@ -386,11 +411,11 @@ fn analyze_expressions( match analysis_state { CEIAnalysisState::LookingForInteraction => { if expr_effs.contains(&Effect::Interaction) { - analysis_state = CEIAnalysisState::LookingForStorageReadOrWrite; + analysis_state = CEIAnalysisState::LookingForEffect; interaction_span = expr.span.clone(); } } - CEIAnalysisState::LookingForStorageReadOrWrite => warn_after_interaction( + CEIAnalysisState::LookingForEffect => warn_after_interaction( &expr_effs, &interaction_span, &expr.span, @@ -418,11 +443,11 @@ fn analyze_asm_block( match analysis_state { CEIAnalysisState::LookingForInteraction => { if asm_op_effs.contains(&Effect::Interaction) { - analysis_state = CEIAnalysisState::LookingForStorageReadOrWrite; + analysis_state = CEIAnalysisState::LookingForEffect; interaction_span = asm_op.span.clone(); } } - CEIAnalysisState::LookingForStorageReadOrWrite => warn_after_interaction( + CEIAnalysisState::LookingForEffect => warn_after_interaction( &asm_op_effs, &interaction_span, &asm_op.span, @@ -442,18 +467,14 @@ fn warn_after_interaction( block_name: &Ident, warnings: &mut Vec, ) { - if ast_node_effects.contains(&Effect::StorageRead) { - warnings.push(CompileWarning { - span: Span::join(interaction_span.clone(), effect_span.clone()), - warning_content: Warning::StorageReadAfterInteraction { - block_name: block_name.clone(), - }, - }); - }; - if ast_node_effects.contains(&Effect::StorageWrite) { + let interaction_singleton = HashSet::from([Effect::Interaction]); + let state_effects = ast_node_effects.difference(&interaction_singleton); + for eff in state_effects { warnings.push(CompileWarning { span: Span::join(interaction_span.clone(), effect_span.clone()), - warning_content: Warning::StorageWriteAfterInteraction { + warning_content: Warning::EffectAfterInteraction { + effect: eff.to_string(), + effect_in_suggestion: Effect::to_suggestion(eff), block_name: block_name.clone(), }, }); @@ -593,15 +614,19 @@ fn effects_of_intrinsic(intr: &sway_ast::Intrinsic) -> HashSet { match intr { StateStoreWord | StateStoreQuad => HashSet::from([Effect::StorageWrite]), StateLoadWord | StateLoadQuad => HashSet::from([Effect::StorageRead]), + Smo => HashSet::from([Effect::OutputMessage]), Revert | IsReferenceType | SizeOfType | SizeOfVal | Eq | Gtf | AddrOf | Log | Add | Sub - | Mul | Div | PtrAdd | PtrSub | GetStorageKey | Smo => HashSet::new(), + | Mul | Div | PtrAdd | PtrSub | GetStorageKey => HashSet::new(), } } fn effects_of_asm_op(op: &AsmOp) -> HashSet { match op.op_name.as_str().to_lowercase().as_str() { "sww" | "swwq" => HashSet::from([Effect::StorageWrite]), - "srw" | "srwq" | "bal" => HashSet::from([Effect::StorageRead]), + "srw" | "srwq" => HashSet::from([Effect::StorageRead]), + "tr" | "tro" => HashSet::from([Effect::BalanceTreeReadWrite]), + "bal" => HashSet::from([Effect::BalanceTreeRead]), + "smo" => HashSet::from([Effect::OutputMessage]), "call" => HashSet::from([Effect::Interaction]), // the rest of the assembly instructions are considered to not have effects _ => HashSet::new(), diff --git a/sway-error/src/warning.rs b/sway-error/src/warning.rs index b620b5fd034..227ba16d2ef 100644 --- a/sway-error/src/warning.rs +++ b/sway-error/src/warning.rs @@ -91,10 +91,9 @@ pub enum Warning { UnrecognizedAttribute { attrib_name: Ident, }, - StorageWriteAfterInteraction { - block_name: Ident, - }, - StorageReadAfterInteraction { + EffectAfterInteraction { + effect: String, + effect_in_suggestion: String, block_name: Ident, }, } @@ -222,10 +221,9 @@ impl fmt::Display for Warning { ), MatchExpressionUnreachableArm => write!(f, "This match arm is unreachable."), UnrecognizedAttribute {attrib_name} => write!(f, "Unknown attribute: \"{attrib_name}\"."), - StorageWriteAfterInteraction {block_name} => write!(f, "Storage modification after external contract interaction in function or method \"{block_name}\". \ - Consider making all storage writes before calling another contract"), - StorageReadAfterInteraction {block_name} => write!(f, "Storage read after external contract interaction in function or method \"{block_name}\". \ - Consider making all storage reads before calling another contract"), + EffectAfterInteraction {effect, effect_in_suggestion, block_name} => + write!(f, "{effect} after external contract interaction in function or method \"{block_name}\". \ + Consider {effect_in_suggestion} before calling another contract"), } } } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.lock new file mode 100644 index 00000000000..68bdd2f2707 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.lock @@ -0,0 +1,3 @@ +[[package]] +name = 'cei_pattern_violation_in_asm_block_bal' +source = 'member' diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.toml new file mode 100644 index 00000000000..a71de0c98d5 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/Forc.toml @@ -0,0 +1,6 @@ +[project] +name = "cei_pattern_violation_in_asm_block_bal" +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +implicit-std = false diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/src/main.sw new file mode 100644 index 00000000000..cc5568b9f31 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/src/main.sw @@ -0,0 +1,18 @@ +contract; + +abi TestAbi { + fn deposit(); +} + +impl TestAbi for Contract { + fn deposit() { + let other_contract = abi(TestAbi, 0x3dba0a4455b598b7655a7fb430883d96c9527ef275b49739e7b0ad12f8280eae); + + // interaction + other_contract.deposit(); + // effect -- therefore violation of CEI where effect should go before interaction + asm(r1, r2: 0, r3: 0) { + bal r1 r2 r3; + } + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/test.toml new file mode 100644 index 00000000000..a55415b16a4 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal/test.toml @@ -0,0 +1,3 @@ +category = "compile" + +# check: $()Balance tree read after external contract interaction in function or method "deposit". Consider making all balance tree reads before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.lock new file mode 100644 index 00000000000..e753c850beb --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.lock @@ -0,0 +1,3 @@ +[[package]] +name = 'cei_pattern_violation_in_asm_block_smo' +source = 'member' diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.toml new file mode 100644 index 00000000000..6266eae98d1 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/Forc.toml @@ -0,0 +1,6 @@ +[project] +name = "cei_pattern_violation_in_asm_block_smo" +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +implicit-std = false diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/src/main.sw new file mode 100644 index 00000000000..aeffb2b2735 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/src/main.sw @@ -0,0 +1,18 @@ +contract; + +abi TestAbi { + fn deposit(); +} + +impl TestAbi for Contract { + fn deposit() { + let other_contract = abi(TestAbi, 0x3dba0a4455b598b7655a7fb430883d96c9527ef275b49739e7b0ad12f8280eae); + + // interaction + other_contract.deposit(); + // effect -- therefore violation of CEI where effect should go before interaction + asm(r1: 0, r2: 0, r3: 0, r4: 0) { + smo r1 r2 r3 r4; + } + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/test.toml new file mode 100644 index 00000000000..4c45fa8c2a7 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo/test.toml @@ -0,0 +1,3 @@ +category = "compile" + +# check: $()Output message sent after external contract interaction in function or method "deposit". Consider sending all output messages before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.lock new file mode 100644 index 00000000000..c825da7c690 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.lock @@ -0,0 +1,13 @@ +[[package]] +name = 'cei_pattern_violation_in_asm_block_tr' +source = 'member' +dependencies = ['std'] + +[[package]] +name = 'core' +source = 'path+from-root-1F667E1725DAD261' + +[[package]] +name = 'std' +source = 'path+from-root-1F667E1725DAD261' +dependencies = ['core'] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.toml new file mode 100644 index 00000000000..98dff945de6 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/Forc.toml @@ -0,0 +1,8 @@ +[project] +name = "cei_pattern_violation_in_asm_block_tr" +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" + +[dependencies] +std = { path = "../../../../../../../sway-lib-std" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/src/main.sw new file mode 100644 index 00000000000..e1039bb118c --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/src/main.sw @@ -0,0 +1,23 @@ +contract; + +use std::token::force_transfer_to_contract; + +abi TestAbi { + fn deposit(); +} + +impl TestAbi for Contract { + fn deposit() { + let other_contract = abi(TestAbi, 0x3dba0a4455b598b7655a7fb430883d96c9527ef275b49739e7b0ad12f8280eae); + + // interaction + other_contract.deposit(); + // effect -- therefore violation of CEI where effect should go before interaction + let amount = 10; + let address = 0x0000000000000000000000000000000000000000000000000000000000000001; + let asset = ContractId::from(address); + let pool = ContractId::from(address); + // `force_transfer_to_contract` uses `tr` asm instruction + force_transfer_to_contract(amount, asset, pool); + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/test.toml new file mode 100644 index 00000000000..519ec977792 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr/test.toml @@ -0,0 +1,3 @@ +category = "compile" + +# check: $()Balance tree update after external contract interaction in function or method "deposit". Consider making all balance tree updates before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.lock new file mode 100644 index 00000000000..6a156513b58 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.lock @@ -0,0 +1,13 @@ +[[package]] +name = 'cei_pattern_violation_in_asm_block_tro' +source = 'member' +dependencies = ['std'] + +[[package]] +name = 'core' +source = 'path+from-root-D9AC6CFA47996221' + +[[package]] +name = 'std' +source = 'path+from-root-D9AC6CFA47996221' +dependencies = ['core'] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.toml new file mode 100644 index 00000000000..d640d6cd157 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/Forc.toml @@ -0,0 +1,8 @@ +[project] +name = "cei_pattern_violation_in_asm_block_tro" +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" + +[dependencies] +std = { path = "../../../../../../../sway-lib-std" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/src/main.sw new file mode 100644 index 00000000000..1c7f9079fdc --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/src/main.sw @@ -0,0 +1,23 @@ +contract; + +use std::token::transfer_to_address; + +abi TestAbi { + fn deposit(); +} + +impl TestAbi for Contract { + fn deposit() { + let other_contract = abi(TestAbi, 0x3dba0a4455b598b7655a7fb430883d96c9527ef275b49739e7b0ad12f8280eae); + + // interaction + other_contract.deposit(); + // effect -- therefore violation of CEI where effect should go before interaction + let amount = 10; + let address = 0x0000000000000000000000000000000000000000000000000000000000000001; + let asset = ContractId::from(address); + let user = Address::from(address); + // `transfer_to_address` uses `tro` asm instruction + transfer_to_address(amount, asset, user); + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/test.toml new file mode 100644 index 00000000000..519ec977792 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro/test.toml @@ -0,0 +1,3 @@ +category = "compile" + +# check: $()Balance tree update after external contract interaction in function or method "deposit". Consider making all balance tree updates before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-3/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-3/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-3/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-3/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-1/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-1/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-1/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-1/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-2/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-2/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-2/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_if_statement-2/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_intrinsic_call/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_intrinsic_call/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_intrinsic_call/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_intrinsic_call/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_match_statement-1/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_match_statement-1/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_match_statement-1/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_match_statement-1/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_standalone_function/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_standalone_function/test.toml index 0996a3a4213..09a1b7849cd 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_standalone_function/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_standalone_function/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "standalone_function". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "standalone_function". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_struct/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_struct/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_struct/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_struct/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_tuple/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_tuple/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_tuple/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_tuple/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-1/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-1/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-1/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-1/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-2/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-2/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-2/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-2/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-3/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-3/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-3/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-3/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-4/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-4/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-4/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_while_loop-4/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_more_complex_logic/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_more_complex_logic/test.toml index 4579305a12b..479dbe3f7be 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_more_complex_logic/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_more_complex_logic/test.toml @@ -1,7 +1,7 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "bid". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "bid". Consider making all storage writes before calling another contract # check: $()Storage read after external contract interaction in function or method "create". Consider making all storage reads before calling another contract -# check: $()Storage modification after external contract interaction in function or method "create". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "create". Consider making all storage writes before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.lock new file mode 100644 index 00000000000..5c1f9a884e6 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.lock @@ -0,0 +1,13 @@ +[[package]] +name = 'cei_pattern_violation_smo_intrinsic' +source = 'member' +dependencies = ['std'] + +[[package]] +name = 'core' +source = 'path+from-root-AB067E8F07DAC65E' + +[[package]] +name = 'std' +source = 'path+from-root-AB067E8F07DAC65E' +dependencies = ['core'] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.toml new file mode 100644 index 00000000000..414d05b960d --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/Forc.toml @@ -0,0 +1,8 @@ +[project] +name = "cei_pattern_violation_smo_intrinsic" +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" + +[dependencies] +std = { path = "../../../../../../../sway-lib-std" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/src/main.sw new file mode 100644 index 00000000000..0e494756d40 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/src/main.sw @@ -0,0 +1,19 @@ +contract; + +use std::message::send_typed_message; + +abi TestAbi { + fn deposit(); +} + +impl TestAbi for Contract { + fn deposit() { + let other_contract = abi(TestAbi, 0x3dba0a4455b598b7655a7fb430883d96c9527ef275b49739e7b0ad12f8280eae); + + // interaction + other_contract.deposit(); + // effect -- therefore violation of CEI where effect should go before interaction + let recipient = 0x0000000000000000000000000000000000000000000000000000000000000001; + send_typed_message(recipient, true, 42); + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/test.toml new file mode 100644 index 00000000000..4c45fa8c2a7 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_smo_intrinsic/test.toml @@ -0,0 +1,3 @@ +category = "compile" + +# check: $()Output message sent after external contract interaction in function or method "deposit". Consider sending all output messages before calling another contract diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_map_and_vec/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_map_and_vec/test.toml index 44860c9505d..b5c01dc8967 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_map_and_vec/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_map_and_vec/test.toml @@ -1,5 +1,5 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract -# check: $()Storage modification after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "withdraw". Consider making all storage writes before calling another contract # not: $()Storage read after external contract interaction in function or method diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_var_update/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_var_update/test.toml index bd3dfe65d20..f6101085024 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_var_update/test.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_storage_var_update/test.toml @@ -1,3 +1,3 @@ category = "compile" -# check: $()Storage modification after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract +# check: $()Storage write after external contract interaction in function or method "deposit". Consider making all storage writes before calling another contract