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

QA Report #43

Open
code423n4 opened this issue Mar 9, 2022 · 0 comments
Open

QA Report #43

code423n4 opened this issue Mar 9, 2022 · 0 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

QA

  • get_decimals computation is inefficient. Consider something like this (not tested)

    fn get_decimals(value: Decimal) -> StdResult<Decimal> {
        // gets raw value (in 1e18) and does mod 1e18, construct Decimal from this new raw value
        let raw_fractional_part = value.0.u128() % Decimal::one().0.u128();
        Decimal(raw_fractional_part.into())
    }
  • addressproxy.execute: Authenticating on msg.sender (instead of info.sender) in execute is dangerous and it's easy to do mistakes in the future if this code is extended to handle more messages. Consider moving this authentication part to the receive_cw20 function.

  • String::from_utf8(denom)? can panic if malicious users provide non-UTF8 strings. The function will revert. Consider using from_utf8_lossy

@code423n4 code423n4 added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax bug Something isn't working labels Mar 9, 2022
code423n4 added a commit that referenced this issue Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

1 participant