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

[JSHooks] Add sfFee validation at Hook Install #344

Open
tequdev opened this issue Aug 5, 2024 · 0 comments
Open

[JSHooks] Add sfFee validation at Hook Install #344

tequdev opened this issue Aug 5, 2024 · 0 comments
Labels

Comments

@tequdev
Copy link
Collaborator

tequdev commented Aug 5, 2024

The following validation must be applied not only at the time of Hook creation but also at the time of Install.

                if (hookSetObj.isFieldPresent(sfFee) &&
                    isXRP(hookSetObj.getFieldAmount(sfFee)))
                {
                    STAmount amt = hookSetObj.getFieldAmount(sfFee);
                    uint64_t fee = amt.xrp().drops();
                    if (amt < beast::zero || fee < 1 || fee > 1000000)
                    {
                        JLOG(ctx.j.trace())
                            << "HookSet(" << hook::log::JS_FEE_TOO_HIGH << ")["
                            << HS_ACC()
                            << "]: Malformed transaction: When creating a JS Hook "
                            << "you must include a Fee <= 1000000.";
                        return false;

                    }
                }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant