pub struct ModuleParams {
pub denom_creation_gas_consume: u64,
}
Expand description
ModuleParams defines the parameters for the tokenfactory module.
§On Denom Creation Costs
We’d like for fees to be paid by the user/signer of a ransaction, but in many
casess, token creation is abstracted away behind a smart contract. Setting a
nonzero denom_creation_fee
would force each contract to handle collecting
and paying a fees for denom (factory/{contract-addr}/{subdenom}) creation on
behalf of the end user.
For IBC token transfers, it’s unclear who should pay the fee—the contract, the relayer, or the original sender?
“Charging fees will mess up composability, the same way Terra transfer tax caused all kinds of headaches for contract devs.” - @ethanfrey
§Recommended Solution
Have the end user (signer) pay fees directly in the form of higher gas costs. This way, contracts won’t need to handle collecting or paying fees. And for IBC, the gas costs are already paid by the original sender and can be estimated by the relayer. It’s easier to tune gas costs to make spam prohibitively expensive since there are per-transaction and per-block gas limits.
See https://github.com/CosmWasm/token-factory/issues/11 for the initial discussion of the issue with @ethanfrey and @valardragon.
Fields§
§denom_creation_gas_consume: u64
Adds gas consumption to the execution of MsgCreateDenom
as a method of
spam prevention. Defaults to 10 NIBI.
Trait Implementations§
Source§impl Clone for ModuleParams
impl Clone for ModuleParams
Source§fn clone(&self) -> ModuleParams
fn clone(&self) -> ModuleParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ModuleParams
impl Debug for ModuleParams
Source§impl Default for ModuleParams
impl Default for ModuleParams
Source§impl Message for ModuleParams
impl Message for ModuleParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for ModuleParams
impl PartialEq for ModuleParams
impl StructuralPartialEq for ModuleParams
Auto Trait Implementations§
impl Freeze for ModuleParams
impl RefUnwindSafe for ModuleParams
impl Send for ModuleParams
impl Sync for ModuleParams
impl Unpin for ModuleParams
impl UnwindSafe for ModuleParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<M> NibiruProstMsg for Mwhere
M: Message,
impl<M> NibiruProstMsg for Mwhere
M: Message,
fn to_binary(&self) -> Binary
Source§fn try_into_stargate_msg(&self, type_url: &str) -> CosmosMsg
fn try_into_stargate_msg(&self, type_url: &str) -> CosmosMsg
Name.type_url()
function. This method attempts
to downcast the message to prost::Name, and if successful, constructs a
CosmosMsg::Stargate
object corresponding to the type.