fn store_string(ctx: &ScFuncContext) {
    // take parameter paramString
    let params = ctx.params();
    let param_string = string_to_bytes(PARAM_STRING);
    ctx.require(params.exists(&param_string), "string parameter not found");

    let state = ctx.raw_state();
    // store the string in "storedString" variable
    let var_string = string_to_bytes(VAR_STRING);
    let value = params.get(&param_string);
    state.set(&var_string, &value);
     // log the text
    let msg = "Message stored: ".to_string() + &string_from_bytes(&value);
    ctx.log(&msg);
}
// storeString entry point stores a string provided as parameters
// in the state as a value of the key 'storedString'
// panics if parameter is not provided
storeString entry point stores a string provided as parameters
in the state as a value of the key 'storedString'
panics if parameter is not provided
storeString entry point stores a string provided as parameters in the state as a value of the key ' storedString ' panics if parameter is not provided
fn store_string(ctx: &ScFuncContext) {
    // take parameter paramString
    let params = ctx.params();
    let param_string = string_to_bytes(PARAM_STRING);
    ctx.require(params.exists(&param_string), "string parameter not found");
    let state = ctx.raw_state();
    // store the string in "storedString" variable
    let var_string = string_to_bytes(VAR_STRING);
    let value = params.get(&param_string);
    state.set(&var_string, &value);
     // log the text
    let msg = "Message stored: ".to_string() + &string_from_bytes(&value);
    ctx.log(&msg);
}
fn store_string ( ctx : & ScFuncContext ) { // take parameter paramString let params = ctx . params ( ) ; let param_string = string_to_bytes ( PARAM_STRING ) ; ctx . require ( params . exists ( & param_string ) , " " ) ; let state = ctx . raw_state ( ) ; // store the string in "storedString" variable let var_string = string_to_bytes ( VAR_STRING ) ; let value = params . get ( & param_string ) ; state . set ( & var_string , & value ) ; // log the text let msg = " " . to_string ( ) + & string_from_bytes ( & value ) ; ctx . log ( & msg ) ; }
storeString entry point stores a string provided as parameters
in the state as a value of the key 'storedString'
panics if parameter is not provided
storeString entry point stores a string provided as parameters in the state as a value of the key ' storedString ' panics if parameter is not provided
ctx
&ScFuncContext