Skip to content

Commit

Permalink
Add IBC transfer blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 15, 2022
1 parent 24d9596 commit 8220adb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
3 changes: 2 additions & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
)

type IsPausedDecorator struct {
Expand All @@ -27,7 +28,7 @@ func (ad IsPausedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool
msgs := tx.GetMsgs()
for _, m := range msgs {
switch m.(type) {
case *banktypes.MsgSend:
case *banktypes.MsgSend, *transfertypes.MsgTransfer:
paused, _ := ad.tokenfactory.GetPaused(ctx)
if paused.Paused {
return ctx, sdkerrors.Wrapf(tokenfactorytypes.ErrPaused, "can not perform token transfers")
Expand Down
38 changes: 19 additions & 19 deletions play.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# run ignite c serve -r

sleep 2
nobled tx tokenfactory update-master-minter $(nobled keys show masterminter -a) --from owner -y
nobled tx tokenfactory update-master-minter $(nobled keys show masterminter -a) --from owner -y --chain-id earth
sleep 2
nobled tx tokenfactory configure-minter $(nobled keys show minter -a) 1000usdc --from masterminter -y
nobled tx tokenfactory configure-minter $(nobled keys show minter -a) 1000usdc --from masterminter -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled q bank balances $(nobled keys show user -a)
sleep 2
nobled q tokenfactory list-minters
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 99999999999999usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 99999999999999usdc --from minter -y --chain-id earth
sleep 2
nobled tx tokenfactory update-blacklister $(nobled keys show blacklister -a) --from owner -y
nobled tx tokenfactory update-blacklister $(nobled keys show blacklister -a) --from owner -y --chain-id earth
sleep 2
nobled tx tokenfactory blacklist $(nobled keys show minter -a) --from blacklister -y
nobled tx tokenfactory blacklist $(nobled keys show minter -a) --from blacklister -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled tx tokenfactory unblacklist $(nobled keys show minter -a) --from blacklister -y
nobled tx tokenfactory unblacklist $(nobled keys show minter -a) --from blacklister -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled q bank balances $(nobled keys show user -a)
sleep 2
nobled tx tokenfactory blacklist $(nobled keys show user -a) --from blacklister -y
nobled tx tokenfactory blacklist $(nobled keys show user -a) --from blacklister -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled tx tokenfactory unblacklist $(nobled keys show user -a) --from blacklister -y
nobled tx tokenfactory unblacklist $(nobled keys show user -a) --from blacklister -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled tx tokenfactory update-pauser $(nobled keys show pauser -a) --from owner -y
nobled tx tokenfactory update-pauser $(nobled keys show pauser -a) --from owner -y --chain-id earth
sleep 2
nobled tx tokenfactory pause --from pauser -y
nobled tx tokenfactory pause --from pauser -y --chain-id earth
sleep 2
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled tx bank send $(nobled keys show user -a) $(nobled keys show alice -a) 100usdc --from minter -y
nobled tx bank send $(nobled keys show user -a) $(nobled keys show alice -a) 100usdc --from minter -y --chain-id earth
sleep 2
nobled tx tokenfactory unpause --from pauser -y
nobled tx tokenfactory unpause --from pauser -y --chain-id earth
sleep 2
nobled tx bank send $(nobled keys show user -a) $(nobled keys show alice -a) 100usdc --from minter -y
nobled tx bank send $(nobled keys show user -a) $(nobled keys show alice -a) 100usdc --from minter -y --chain-id earth

# nobled tx tokenfactory mint $(nobled keys show user -a) 100usdc --from minter -y
# sleep 2
Expand Down

0 comments on commit 8220adb

Please sign in to comment.