I hope you are doing well!

How can one design and implement a fee rule on a substrate-based blockchain that is contingent on the transaction payment value?

I would like to create this fee rule based on the transaction value, where can I implement it? Where can I use it, Thank you for your help.

fn calculate_fee(value: Balance) -> Balance {
match value {
    0..=9 => 10000,
    10..=99 => 100000,
    100..=999 => 1000000,
    1000..=9999 => 10000000,
    10000..=99999 => 100000000,
    100000..=999999 => 1000000000,
    _ => 10000,
New contributor
Zacksys ME is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.


Your Answer

Zacksys ME is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.