Closed
Description
When one of the sides is not normalized you can get unintended results. E.g.
fn my_func(deps: Deps, user_provided_address: &str) {
let existing_address: Addr = CONFIG.load(deps.storage)?.blocked;
if user_provided_address != blocked {
return Err(ContractError::Unauthorized);
}
}
Now if blocked
is cosmos1jhg0e7s6gn44tfc5k37kr04sznyhedtc9rzys5
and user_provided_address
is cosmos1jhg0e7s6gn44tfc5k37kr04sznyhedtc9rzys5
the check works fine. But if the perfectly valid form COSMOS1JHG0E7S6GN44TFC5K37KR04SZNYHEDTC9RZYS5
is provided, this breaks.
I'm sure the example is bad here but I hope you get what I mean. Equality checkes between Addr and &str or String are just not safe.
Metadata
Metadata
Assignees
Labels
No labels