mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add fee burning and blackhole address (#703)
* Fix tlbc crash * Burn specified fraction of fees * Add "blackhole" for burning TONs --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
d5cd548502
commit
ef64b92f08
12 changed files with 187 additions and 57 deletions
|
@ -504,6 +504,22 @@ class ShardConfig {
|
|||
bool set_shard_info(ton::ShardIdFull shard, Ref<vm::Cell> value);
|
||||
};
|
||||
|
||||
struct BurningConfig {
|
||||
td::optional<td::Bits256> blackhole_addr;
|
||||
td::uint32 fee_burn_nom = 0, fee_burn_denom = 1;
|
||||
|
||||
td::RefInt256 calculate_burned_fees(const td::RefInt256& x) const {
|
||||
if (x.is_null()) {
|
||||
return x;
|
||||
}
|
||||
return x * fee_burn_nom / td::make_refint(fee_burn_denom);
|
||||
}
|
||||
|
||||
CurrencyCollection calculate_burned_fees(const CurrencyCollection& x) const {
|
||||
return CurrencyCollection{calculate_burned_fees(x.grams)};
|
||||
}
|
||||
};
|
||||
|
||||
class Config {
|
||||
enum {
|
||||
default_mc_catchain_lifetime = 200,
|
||||
|
@ -617,6 +633,7 @@ class Config {
|
|||
std::vector<ton::ValidatorDescr> compute_total_validator_set(int next) const;
|
||||
td::Result<SizeLimitsConfig> get_size_limits_config() const;
|
||||
std::unique_ptr<vm::Dictionary> get_suspended_addresses(ton::UnixTime now) const;
|
||||
BurningConfig get_burning_config() const;
|
||||
static std::vector<ton::ValidatorDescr> do_compute_validator_set(const block::CatchainValidatorsConfig& ccv_conf,
|
||||
ton::ShardIdFull shard,
|
||||
const block::ValidatorSet& vset, ton::UnixTime time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue