diff --git a/go.mod b/go.mod index 731acd23fa3..c6afe9f6406 100644 --- a/go.mod +++ b/go.mod @@ -314,8 +314,8 @@ replace ( github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.30.0-osmo-v15 // dragonberry github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v15.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/44b40d47f3108c29f07fd115e5a92b387fb7a6bd - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 + // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v16.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/4f857c6a941a3e3849aad40aae1781e80f8e1dda + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // Informal Tendermint fork diff --git a/go.sum b/go.sum index b0831365205..acdd486f7e8 100644 --- a/go.sum +++ b/go.sum @@ -932,8 +932,8 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= -github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 h1:3CTaTTiiFg/JoNLP2jGMjooQaeXSzQus/rZMllAlFy4= -github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310/go.mod h1:rud0OaBIuq3+qOqtwT4SR7Q7iSzRp7w41fjninTjfnQ= +github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a h1:ycdLQR3ZhY0wmPEzgh4iLQB7GWsxTK+Y0/DClc7zStA= +github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a/go.mod h1:rud0OaBIuq3+qOqtwT4SR7Q7iSzRp7w41fjninTjfnQ= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= github.com/osmosis-labs/osmosis/osmomath v0.0.0-20230105183030-bccf5202f260 h1:+EbINXzHQyDtHje2CND357A22H2zUpceTtwJClC9IAM= diff --git a/osmomath/go.mod b/osmomath/go.mod index 92209ad9f18..81eb0f293cc 100644 --- a/osmomath/go.mod +++ b/osmomath/go.mod @@ -90,8 +90,8 @@ require ( ) replace ( - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v15.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/44b40d47f3108c29f07fd115e5a92b387fb7a6bd - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 + // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v16.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/4f857c6a941a3e3849aad40aae1781e80f8e1dda + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // use grpc compatible with cosmos protobufs diff --git a/osmoutils/go.mod b/osmoutils/go.mod index 727cc99d487..6a5c1ea3e28 100644 --- a/osmoutils/go.mod +++ b/osmoutils/go.mod @@ -131,8 +131,8 @@ require ( ) replace ( - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v15.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/44b40d47f3108c29f07fd115e5a92b387fb7a6bd - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 + // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v16.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/4f857c6a941a3e3849aad40aae1781e80f8e1dda + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // use grpc compatible with cosmos protobufs diff --git a/tests/cl-go-client/go.mod b/tests/cl-go-client/go.mod index d7c977218f2..6f831a23d25 100644 --- a/tests/cl-go-client/go.mod +++ b/tests/cl-go-client/go.mod @@ -140,8 +140,8 @@ replace ( github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.30.0-osmo-v15 // dragonberry github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v15.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/44b40d47f3108c29f07fd115e5a92b387fb7a6bd - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 + // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v16.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/4f857c6a941a3e3849aad40aae1781e80f8e1dda + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 983e09309e9..ec64c353776 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -177,9 +177,6 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk if burn == nil { return wasmvmtypes.InvalidRequest{Err: "burn token null mint"} } - if burn.BurnFromAddress != "" && burn.BurnFromAddress != contractAddr.String() { - return wasmvmtypes.InvalidRequest{Err: "BurnFromAddress must be \"\""} - } coin := sdk.Coin{Denom: burn.Denom, Amount: burn.Amount} sdkMsg := tokenfactorytypes.NewMsgBurn(contractAddr.String(), coin) diff --git a/wasmbinding/test/messages_test.go b/wasmbinding/test/messages_test.go index 924ead78153..39dec5a8216 100644 --- a/wasmbinding/test/messages_test.go +++ b/wasmbinding/test/messages_test.go @@ -334,7 +334,7 @@ func TestBurn(t *testing.T) { Amount: mintAmount, BurnFromAddress: lucky.String(), }, - expErr: true, + expErr: false, }, "empty sub-denom": { burn: &bindings.BurnTokens{ diff --git a/x/gamm/keeper/gas_test.go b/x/gamm/keeper/gas_test.go index e43a8d0b086..16aaaef595d 100644 --- a/x/gamm/keeper/gas_test.go +++ b/x/gamm/keeper/gas_test.go @@ -82,8 +82,8 @@ func (suite *KeeperTestSuite) TestJoinPoolGas() { avgGas, maxGas := suite.measureAvgAndMaxJoinPoolGas(totalNumJoins, defaultAddr, poolIDFn, minShareOutAmountFn, maxCoinsFn) fmt.Printf("test deets: total %d of pools joined, begin average at %d\n", totalNumJoins, startAveragingAt) - suite.Assert().LessOrEqual(int(avgGas), 100000, "average gas / join pool") - suite.Assert().LessOrEqual(int(maxGas), 100000, "max gas / join pool") + suite.Assert().LessOrEqual(int(avgGas), 101000, "average gas / join pool") + suite.Assert().LessOrEqual(int(maxGas), 101000, "max gas / join pool") } func (suite *KeeperTestSuite) TestRepeatedJoinPoolDistinctDenom() { diff --git a/x/ibc-hooks/go.mod b/x/ibc-hooks/go.mod index 2af799ce39b..b5377963427 100644 --- a/x/ibc-hooks/go.mod +++ b/x/ibc-hooks/go.mod @@ -142,8 +142,8 @@ replace ( github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.30.0-osmo-v15 // dragonberry github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v15.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/44b40d47f3108c29f07fd115e5a92b387fb7a6bd - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230228211301-44b40d47f310 + // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current branch: v16.x. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/4f857c6a941a3e3849aad40aae1781e80f8e1dda + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 ) diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index 80fa39fd600..f638c476520 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -158,6 +158,9 @@ func (suite *KeeperTestSuite) TestBurnDenom() { balances[acc.String()] = 1000 } + // save sample module account address for testing + moduleAdress := suite.App.AccountKeeper.GetModuleAddress("developer_vesting_unvested") + for _, tc := range []struct { desc string burnMsg types.MsgBurn @@ -205,6 +208,15 @@ func (suite *KeeperTestSuite) TestBurnDenom() { ), expectPass: true, }, + { + desc: "fail case - burn from module account", + burnMsg: *types.NewMsgBurnFrom( + suite.TestAccs[0].String(), + sdk.NewInt64Coin(suite.defaultDenom, 10), + moduleAdress.String(), + ), + expectPass: false, + }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { _, err := suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), &tc.burnMsg) diff --git a/x/tokenfactory/keeper/before_send.go b/x/tokenfactory/keeper/before_send.go index 7d608a7da13..e00b0b79e28 100644 --- a/x/tokenfactory/keeper/before_send.go +++ b/x/tokenfactory/keeper/before_send.go @@ -2,9 +2,9 @@ package keeper import ( "encoding/json" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v15/x/tokenfactory/types" @@ -76,38 +76,58 @@ func (k Keeper) Hooks(wasmkeeper wasmKeeper.Keeper) Hooks { return Hooks{k, wasmkeeper} } -// implements BeforeSend hook in the Bank module. -// Calls the stored before send hook for the denom specificed. -func (h Hooks) BeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error { - cwCoins := CWCoinsFromSDKCoins(amount) +// TrackBeforeSend calls the before send listener contract surpresses any errors +func (h Hooks) TrackBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) { + _ = h.k.callBeforeSendListener(ctx, h.wasmkeeper, from, to, amount, false) +} + +// TrackBeforeSend calls the before send listener contract returns any errors +func (h Hooks) BlockBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error { + return h.k.callBeforeSendListener(ctx, h.wasmkeeper, from, to, amount, true) +} +// callBeforeSendListener iterates over each coin and sends corresponding sudo msg to the contract address stored in state. +// If blockBeforeSend is true, sudoMsg wraps BlockBeforeSendMsg, otherwise sudoMsg wraps TrackBeforeSendMsg. +func (k Keeper) callBeforeSendListener(ctx sdk.Context, wasmKeeper wasmKeeper.Keeper, from, to sdk.AccAddress, amount sdk.Coins, blockBeforeSend bool) error { for _, coin := range amount { - cosmwasmAddress := h.k.GetBeforeSendHook(ctx, coin.Denom) + cosmwasmAddress := k.GetBeforeSendHook(ctx, coin.Denom) if cosmwasmAddress != "" { cwAddr, err := sdk.AccAddressFromBech32(cosmwasmAddress) if err != nil { return err } - msg := types.SudoMsg{ - BeforeSend: types.BeforeSendMsg{ - From: from.String(), - To: to.String(), - Amount: cwCoins, - }, + var msgBz []byte + + // get msgBz, either BlockBeforeSend or TrackBeforeSend + if blockBeforeSend { + msg := types.BlockBeforeSendSudoMsg{ + BlockBeforeSend: types.BlockBeforeSendMsg{ + From: from.String(), + To: to.String(), + Amount: CWCoinFromSDKCoin(coin), + }, + } + msgBz, err = json.Marshal(msg) + } else { + msg := types.TrackBeforeSendSudoMsg{ + TrackBeforeSend: types.TrackBeforeSendMsg{ + From: from.String(), + To: to.String(), + Amount: CWCoinFromSDKCoin(coin), + }, + } + msgBz, err = json.Marshal(msg) } - - msgBz, err := json.Marshal(msg) if err != nil { return err } em := sdk.NewEventManager() - _, err = h.wasmkeeper.Sudo(ctx.WithEventManager(em), cwAddr, msgBz) - fmt.Println(err) + _, err = wasmKeeper.Sudo(ctx.WithEventManager(em), cwAddr, msgBz) if err != nil { - return err + return sdkerrors.Wrapf(err, "failed to call before send hook for denom %s", coin.Denom) } } } diff --git a/x/tokenfactory/keeper/before_send_test.go b/x/tokenfactory/keeper/before_send_test.go index b541a5ceac1..66a5c7e5192 100644 --- a/x/tokenfactory/keeper/before_send_test.go +++ b/x/tokenfactory/keeper/before_send_test.go @@ -28,7 +28,18 @@ func (suite *KeeperTestSuite) TestBeforeSendHook() { wasmFile: "./testdata/no100.wasm", sendMsgs: []SendMsgTestCase{ { - desc: "sending 100 of factorydenom should not work", + desc: "sending 1 of factorydenom should not error", + msg: func(factorydenom string) *banktypes.MsgSend { + return banktypes.NewMsgSend( + suite.TestAccs[0], + suite.TestAccs[1], + sdk.NewCoins(sdk.NewInt64Coin(factorydenom, 1)), + ) + }, + expectPass: true, + }, + { + desc: "sending 100 of non-factorydenom should not error", msg: func(factorydenom string) *banktypes.MsgSend { return banktypes.NewMsgSend( suite.TestAccs[0], @@ -50,12 +61,23 @@ func (suite *KeeperTestSuite) TestBeforeSendHook() { expectPass: false, }, { - desc: "sending 100 of a non-factorydenom should not work", + desc: "sending 100 of factorydenom should not work", + msg: func(factorydenom string) *banktypes.MsgSend { + return banktypes.NewMsgSend( + suite.TestAccs[0], + suite.TestAccs[1], + sdk.NewCoins(sdk.NewInt64Coin("foo", 100)), + ) + }, + expectPass: false, + }, + { + desc: "having 100 coin within coins should not work", msg: func(factorydenom string) *banktypes.MsgSend { return banktypes.NewMsgSend( suite.TestAccs[0], suite.TestAccs[1], - sdk.NewCoins(sdk.NewInt64Coin(factorydenom, 1), sdk.NewInt64Coin("uosmo", 100)), + sdk.NewCoins(sdk.NewInt64Coin(factorydenom, 100), sdk.NewInt64Coin("foo", 1)), ) }, expectPass: false, @@ -81,7 +103,10 @@ func (suite *KeeperTestSuite) TestBeforeSendHook() { denom := res.GetNewTokenDenom() // mint enough coins to the creator - suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(denom, 1000000000))) + _, err = suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(denom, 1000000000))) + suite.Require().NoError(err) + // mint some non token factory denom coins for testing + suite.FundAcc(sdk.AccAddress(suite.TestAccs[0].String()), sdk.Coins{sdk.NewInt64Coin("foo", 100000000000)}) // set beforesend hook to the new denom _, err = suite.msgServer.SetBeforeSendHook(sdk.WrapSDKContext(suite.Ctx), types.NewMsgSetBeforeSendHook(suite.TestAccs[0].String(), denom, cosmwasmAddress.String())) diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 16b5d869ba6..5a0916e6693 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/osmosis-labs/osmosis/v15/x/tokenfactory/types" ) @@ -95,6 +96,12 @@ func (server msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types. msg.BurnFromAddress = msg.Sender } + accountI := server.Keeper.accountKeeper.GetAccount(ctx, sdk.AccAddress(msg.BurnFromAddress)) + _, ok := accountI.(authtypes.ModuleAccountI) + if ok { + return nil, types.ErrBurnFromModuleAccount + } + err = server.Keeper.burnFrom(ctx, msg.Amount, msg.BurnFromAddress) if err != nil { return nil, err diff --git a/x/tokenfactory/keeper/testdata/no100.wasm b/x/tokenfactory/keeper/testdata/no100.wasm index b72f0dfddba..8f1e50fac68 100644 Binary files a/x/tokenfactory/keeper/testdata/no100.wasm and b/x/tokenfactory/keeper/testdata/no100.wasm differ diff --git a/x/tokenfactory/types/beforeSend.go b/x/tokenfactory/types/beforeSend.go deleted file mode 100644 index 149713c9866..00000000000 --- a/x/tokenfactory/types/beforeSend.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import ( - wasmvmtypes "github.com/CosmWasm/wasmvm/types" -) - -type SudoMsg struct { - BeforeSend BeforeSendMsg `json:"before_send"` -} - -type BeforeSendMsg struct { - From string `json:"from"` - To string `json:"to"` - Amount wasmvmtypes.Coins `json:"amount"` -} diff --git a/x/tokenfactory/types/before_send.go b/x/tokenfactory/types/before_send.go new file mode 100644 index 00000000000..e816a24e524 --- /dev/null +++ b/x/tokenfactory/types/before_send.go @@ -0,0 +1,25 @@ +package types + +import ( + wasmvmtypes "github.com/CosmWasm/wasmvm/types" +) + +type BlockBeforeSendSudoMsg struct { + BlockBeforeSend BlockBeforeSendMsg `json:"block_before_send,omitempty"` +} + +type TrackBeforeSendSudoMsg struct { + TrackBeforeSend TrackBeforeSendMsg `json:"track_before_send"` +} + +type TrackBeforeSendMsg struct { + From string `json:"from"` + To string `json:"to"` + Amount wasmvmtypes.Coin `json:"amount"` +} + +type BlockBeforeSendMsg struct { + From string `json:"from"` + To string `json:"to"` + Amount wasmvmtypes.Coin `json:"amount"` +} diff --git a/x/tokenfactory/types/errors.go b/x/tokenfactory/types/errors.go index 06991f19b91..93f691b6907 100644 --- a/x/tokenfactory/types/errors.go +++ b/x/tokenfactory/types/errors.go @@ -19,4 +19,5 @@ var ( ErrSubdenomTooLong = sdkerrors.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength)) ErrCreatorTooLong = sdkerrors.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) ErrDenomDoesNotExist = sdkerrors.Register(ModuleName, 10, "denom does not exist") + ErrBurnFromModuleAccount = sdkerrors.Register(ModuleName, 11, "burning from Module Account is not allowed") ) diff --git a/x/tokenfactory/types/expected_keepers.go b/x/tokenfactory/types/expected_keepers.go index ff064367210..5d7d137fdd1 100644 --- a/x/tokenfactory/types/expected_keepers.go +++ b/x/tokenfactory/types/expected_keepers.go @@ -23,12 +23,14 @@ type BankKeeper interface { } type AccountKeeper interface { + GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI) } // BankHooks event hooks type BankHooks interface { - BeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error // Must be called when a bank transfer happens + TrackBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) // Must be before any send is executed + BlockBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error // Must be before any send is executed } // CommunityPoolKeeper defines the contract needed to be fulfilled for community pool interactions.