diff --git a/x/asset/ft/keeper/before_send.go b/x/asset/ft/keeper/before_send.go index dacd47c29..169169030 100644 --- a/x/asset/ft/keeper/before_send.go +++ b/x/asset/ft/keeper/before_send.go @@ -162,7 +162,7 @@ func (k Keeper) ApplyRate(ctx sdk.Context, rate sdk.Dec, issuer, sender sdk.AccA } // we do not apply burn and commission rate if sender is a smart contract address. - if k.isSmartContract(ctx, sender) { + if k.isSmartContract(sender) { return sdk.ZeroInt() } @@ -178,7 +178,7 @@ func (k Keeper) ApplyRate(ctx sdk.Context, rate sdk.Dec, issuer, sender sdk.AccA return rate.MulInt(taxableOutputSum).Ceil().RoundInt() } -func (k Keeper) isSmartContract(ctx sdk.Context, addr sdk.AccAddress) bool { +func (k Keeper) isSmartContract(addr sdk.AccAddress) bool { return len(addr) == wasmtypes.ContractAddrLen } diff --git a/x/asset/ft/keeper/keeper.go b/x/asset/ft/keeper/keeper.go index ac333494f..432a88bc9 100644 --- a/x/asset/ft/keeper/keeper.go +++ b/x/asset/ft/keeper/keeper.go @@ -670,7 +670,7 @@ func (k Keeper) isCoinReceivable(ctx sdk.Context, addr sdk.AccAddress, def types } // TODO: To be discussed: Should it be allowed to create such tokens by smart contract? - if def.IsFeatureEnabled(types.Feature_sending_to_smart_contracts_blocked) && !def.IsIssuer(addr) && k.isSmartContract(ctx, addr) { + if def.IsFeatureEnabled(types.Feature_sending_to_smart_contracts_blocked) && !def.IsIssuer(addr) && k.isSmartContract(addr) { return sdkerrors.Wrapf(cosmoserrors.ErrUnauthorized, "transfers to smart contracts are disabled for %s", def.Denom) }