64 releases (26 stable)

3.12.0 Apr 4, 2024
3.7.0 Feb 13, 2024
3.3.0 Oct 11, 2023
3.0.0 Jul 2, 2023
0.14.0 Jul 25, 2022

#977 in Magic Beans

Download history 30/week @ 2023-12-21 28/week @ 2023-12-28 12/week @ 2024-01-04 49/week @ 2024-01-11 42/week @ 2024-01-18 27/week @ 2024-01-25 3/week @ 2024-02-01 117/week @ 2024-02-08 170/week @ 2024-02-15 138/week @ 2024-02-22 89/week @ 2024-02-29 108/week @ 2024-03-07 61/week @ 2024-03-14 59/week @ 2024-03-21 317/week @ 2024-03-28 666/week @ 2024-04-04

1,125 downloads per month
Used in 22 crates (21 directly)

Apache-2.0

9KB
134 lines

SG1 Spec: Fair Burn

TODO 7/28/23 add deprecation note in favor of core/fairburn

Fair Burn is a specification for processing fees in Stargaze, influenced by EIP-1559.

With Fair Burn, a portion of fees are burned, and the remaining portion is distributed to stakers. Currently, 50% is burned, and 50% go to stakers.

Fair Burn also includes a way to incentivize custom smart contract development by distributing some of the fee to a developer address. This developer fee is substracted from the amount burned.

For example, if a developer address is provided, 40% fees will be burned, 10% will go to the developer address, and 50% will go to the Community Pool.

Governance Parameters

const FEE_BURN_PERCENT: u64 = 50;      // 50%
const DEV_INCENTIVE_PERCENT: u64 = 10; // 10%

API

Contracts can use Fair Burn via one of the following functions.

/// Burn and distribute fees and return an error if the fee is not enough
checked_fair_burn(info: &MessageInfo, fee: u128, developer: Option<Addr>) -> Result<Vec<SubMsg>, FeeError>

/// Burn and distribute fees, assuming the right fee is passed in
fair_burn(fee: u128, developer: Option<Addr>) -> Vec<SubMsg>

Custom contract developers can pass in a a developer address that will receive 10% of all fees.

Dependencies

~4–5.5MB
~120K SLoC