Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(x/swaprouter, x/gamm): unify swap routes in swaprouter #3880

Merged
merged 10 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#3763](https://github.com/osmosis-labs/osmosis/pull/3763) Remove Osmosis gamm and twap `bindings` that were previously supported as custom wasm plugins.
* [#3905](https://github.com/osmosis-labs/osmosis/pull/3905) Deprecate gamm queries `NumPools`, `EstimateSwapExactAmountIn` and `EstimateSwapExactAmountOut`.
* [#3907](https://github.com/osmosis-labs/osmosis/pull/3907) Add `NumPools`, `EstimateSwapExactAmountIn` and `EstimateSwapExactAmountOut` query in swaprouter module to stargate whitelist.
* [#3880](https://github.com/osmosis-labs/osmosis/pull/3880) Switch usage of proto-generated SwapAmountInRoute and SwapAmountOutRoute in x/gamm to import the structs from x/swaprouter module.

### Bug Fix

Expand Down
7 changes: 4 additions & 3 deletions app/apptesting/gamm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap"
gammtypes "github.com/osmosis-labs/osmosis/v13/x/gamm/types"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"
)

var DefaultAcctFunds sdk.Coins = sdk.NewCoins(
Expand Down Expand Up @@ -188,7 +189,7 @@ func (s *KeeperTestHelper) ModifySpotPrice(poolID uint64, targetSpotPrice sdk.De
s.FundAcc(s.TestAccs[0], swapIn)
msg := gammtypes.MsgSwapExactAmountIn{
Sender: s.TestAccs[0].String(),
Routes: []gammtypes.SwapAmountInRoute{{PoolId: poolID, TokenOutDenom: baseDenom}},
Routes: []swaproutertypes.SwapAmountInRoute{{PoolId: poolID, TokenOutDenom: baseDenom}},
TokenIn: swapIn[0],
TokenOutMinAmount: sdk.ZeroInt(),
}
Expand All @@ -204,7 +205,7 @@ func (s *KeeperTestHelper) ModifySpotPrice(poolID uint64, targetSpotPrice sdk.De
s.FundAcc(s.TestAccs[0], sdk.NewCoins(tokenIn))
msg := gammtypes.MsgSwapExactAmountOut{
Sender: s.TestAccs[0].String(),
Routes: []gammtypes.SwapAmountOutRoute{{PoolId: poolID, TokenInDenom: baseDenom}},
Routes: []swaproutertypes.SwapAmountOutRoute{{PoolId: poolID, TokenInDenom: baseDenom}},
TokenInMaxAmount: sdk.NewInt(int64Max),
TokenOut: swapOut[0],
}
Expand All @@ -224,7 +225,7 @@ func (s *KeeperTestHelper) RunBasicSwap(poolId uint64) {

msg := gammtypes.MsgSwapExactAmountIn{
Sender: s.TestAccs[0].String(),
Routes: []gammtypes.SwapAmountInRoute{{PoolId: poolId, TokenOutDenom: denoms[1]}},
Routes: []swaproutertypes.SwapAmountInRoute{{PoolId: poolId, TokenOutDenom: denoms[1]}},
TokenIn: swapIn[0],
TokenOutMinAmount: sdk.ZeroInt(),
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/CosmWasm/wasmd v0.30.0
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.45.11
github.com/cosmos/cosmos-sdk v0.46.7
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v4 v4.2.0
github.com/gogo/protobuf v1.3.3
Expand Down
5 changes: 3 additions & 2 deletions proto/osmosis/gamm/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package osmosis.gamm.v1beta1;

import "gogoproto/gogo.proto";
import "osmosis/gamm/v1beta1/tx.proto";
import "osmosis/swaprouter/v1beta1/swap_route.proto";

import "cosmos/base/v1beta1/coin.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
Expand Down Expand Up @@ -267,7 +268,7 @@ message QuerySwapExactAmountInRequest {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ];
repeated SwapAmountInRoute routes = 4 [
repeated osmosis.swaprouter.v1beta1.SwapAmountInRoute routes = 4 [
(gogoproto.moretags) = "yaml:\"routes\"",
(gogoproto.nullable) = false
];
Expand All @@ -287,7 +288,7 @@ message QuerySwapExactAmountOutRequest {
option deprecated = true;
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
repeated SwapAmountOutRoute routes = 3 [
repeated osmosis.swaprouter.v1beta1.SwapAmountOutRoute routes = 3 [
(gogoproto.moretags) = "yaml:\"routes\"",
(gogoproto.nullable) = false
];
Comment on lines +291 to 294
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ask dan lynch and front-end how breaking this is.

Its not clear to me that its worth breaking this in the gamm proto, vs just doing a conversion in the proto boilerplate handling code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I think it will break their compiled types, unless we can register a way for a type to get aliased or something in codegen)

Copy link

@pyramation pyramation Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as the interfaces/API don't change, it doesn't matter where the types live. Telescope will handle it.

from what I can see here it looks the the interface to the type doesn't change, so will be totally ok!

cc @p0mvn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, even w/o telescope, from what I can tell (since I believe osmosis-fe uses another tool) — nothing should break. But, we should probably all keep in sync when this update rolls out to update FE libs and repos.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @pyramation . I also spoke with Jon to make sure that there is no unexpected breakage for FE.

We will track this change and remind everyone to update before this is out.

This should be good to go

Expand Down
14 changes: 5 additions & 9 deletions proto/osmosis/gamm/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package osmosis.gamm.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "osmosis/swaprouter/v1beta1/swap_route.proto";

option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types";

Expand Down Expand Up @@ -83,7 +84,8 @@ message SwapAmountInRoute {

message MsgSwapExactAmountIn {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
repeated SwapAmountInRoute routes = 2 [ (gogoproto.nullable) = false ];
repeated osmosis.swaprouter.v1beta1.SwapAmountInRoute routes = 2
[ (gogoproto.nullable) = false ];
cosmos.base.v1beta1.Coin token_in = 3 [
(gogoproto.moretags) = "yaml:\"token_in\"",
(gogoproto.nullable) = false
Expand All @@ -103,16 +105,10 @@ message MsgSwapExactAmountInResponse {
];
}

// ===================== MsgSwapExactAmountOut
message SwapAmountOutRoute {
uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
string token_in_denom = 2
[ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
}

message MsgSwapExactAmountOut {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
repeated SwapAmountOutRoute routes = 2 [ (gogoproto.nullable) = false ];
repeated osmosis.swaprouter.v1beta1.SwapAmountOutRoute routes = 2
[ (gogoproto.nullable) = false ];
string token_in_max_amount = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.moretags) = "yaml:\"token_in_max_amount\"",
Expand Down
9 changes: 5 additions & 4 deletions x/gamm/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/osmosis-labs/osmosis/v13/x/gamm/client/cli"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"

"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/testutil/network"
Expand Down Expand Up @@ -215,7 +216,7 @@ func TestNewSwapExactAmountOutCmd(t *testing.T) {
Cmd: "10stake 20 --swap-route-pool-ids=1 --swap-route-denoms=node0token --from=" + testAddresses[0].String(),
ExpectedMsg: &types.MsgSwapExactAmountOut{
Sender: testAddresses[0].String(),
Routes: []types.SwapAmountOutRoute{{PoolId: 1, TokenInDenom: "node0token"}},
Routes: []swaproutertypes.SwapAmountOutRoute{{PoolId: 1, TokenInDenom: "node0token"}},
TokenInMaxAmount: sdk.NewIntFromUint64(20),
TokenOut: sdk.NewInt64Coin("stake", 10),
},
Expand All @@ -231,7 +232,7 @@ func TestNewSwapExactAmountInCmd(t *testing.T) {
Cmd: "10stake 3 --swap-route-pool-ids=1 --swap-route-denoms=node0token --from=" + testAddresses[0].String(),
ExpectedMsg: &types.MsgSwapExactAmountIn{
Sender: testAddresses[0].String(),
Routes: []types.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: "node0token"}},
Routes: []swaproutertypes.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: "node0token"}},
TokenIn: sdk.NewInt64Coin("stake", 10),
TokenOutMinAmount: sdk.NewIntFromUint64(3),
},
Expand Down Expand Up @@ -354,7 +355,7 @@ func TestGetCmdEstimateSwapExactAmountIn(t *testing.T) {
Sender: "osm11vmx8jtggpd9u7qr0t8vxclycz85u925sazglr7",
PoolId: 1,
TokenIn: "10stake",
Routes: []types.SwapAmountInRoute{{PoolId: 2, TokenOutDenom: "node0token"}},
Routes: []swaproutertypes.SwapAmountInRoute{{PoolId: 2, TokenOutDenom: "node0token"}},
},
},
}
Expand All @@ -370,7 +371,7 @@ func TestGetCmdEstimateSwapExactAmountOut(t *testing.T) {
Sender: "osm11vmx8jtggpd9u7qr0t8vxclycz85u925sazglr7",
PoolId: 1,
TokenOut: "10stake",
Routes: []types.SwapAmountOutRoute{{PoolId: 2, TokenInDenom: "node0token"}},
Routes: []swaproutertypes.SwapAmountOutRoute{{PoolId: 2, TokenInDenom: "node0token"}},
},
},
}
Expand Down
13 changes: 7 additions & 6 deletions x/gamm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"

"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -380,7 +381,7 @@ func stringArrayCoinsParser(flagName string, fs *flag.FlagSet) (sdk.Coins, error
return coins, nil
}

func swapAmountInRoutes(fs *flag.FlagSet) ([]types.SwapAmountInRoute, error) {
func swapAmountInRoutes(fs *flag.FlagSet) ([]swaproutertypes.SwapAmountInRoute, error) {
swapRoutePoolIds, err := fs.GetString(FlagSwapRoutePoolIds)
swapRoutePoolIdsArray := strings.Split(swapRoutePoolIds, ",")
if err != nil {
Expand All @@ -397,21 +398,21 @@ func swapAmountInRoutes(fs *flag.FlagSet) ([]types.SwapAmountInRoute, error) {
return nil, errors.New("swap route pool ids and denoms mismatch")
}

routes := []types.SwapAmountInRoute{}
routes := []swaproutertypes.SwapAmountInRoute{}
for index, poolIDStr := range swapRoutePoolIdsArray {
pID, err := strconv.Atoi(poolIDStr)
if err != nil {
return nil, err
}
routes = append(routes, types.SwapAmountInRoute{
routes = append(routes, swaproutertypes.SwapAmountInRoute{
PoolId: uint64(pID),
TokenOutDenom: swapRouteDenomsArray[index],
})
}
return routes, nil
}

func swapAmountOutRoutes(fs *flag.FlagSet) ([]types.SwapAmountOutRoute, error) {
func swapAmountOutRoutes(fs *flag.FlagSet) ([]swaproutertypes.SwapAmountOutRoute, error) {
swapRoutePoolIds, err := fs.GetString(FlagSwapRoutePoolIds)
swapRoutePoolIdsArray := strings.Split(swapRoutePoolIds, ",")
if err != nil {
Expand All @@ -428,13 +429,13 @@ func swapAmountOutRoutes(fs *flag.FlagSet) ([]types.SwapAmountOutRoute, error) {
return nil, errors.New("swap route pool ids and denoms mismatch")
}

routes := []types.SwapAmountOutRoute{}
routes := []swaproutertypes.SwapAmountOutRoute{}
for index, poolIDStr := range swapRoutePoolIdsArray {
pID, err := strconv.Atoi(poolIDStr)
if err != nil {
return nil, err
}
routes = append(routes, types.SwapAmountOutRoute{
routes = append(routes, swaproutertypes.SwapAmountOutRoute{
PoolId: uint64(pID),
TokenInDenom: swapRouteDenomsArray[index],
})
Expand Down
10 changes: 2 additions & 8 deletions x/gamm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,7 @@ func (q Querier) EstimateSwapExactAmountIn(ctx context.Context, req *types.Query

sdkCtx := sdk.UnwrapSDKContext(ctx)

// TODO: remove this redundancy after making routes be shared between x/gamm and x/swaprouter.
swaprouterRoutes := types.ConvertAmountInRoutes(req.Routes)

tokenOutAmount, err := q.Keeper.poolManager.MultihopEstimateOutGivenExactAmountIn(sdkCtx, swaprouterRoutes, tokenIn)
tokenOutAmount, err := q.Keeper.poolManager.MultihopEstimateOutGivenExactAmountIn(sdkCtx, req.Routes, tokenIn)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
Expand Down Expand Up @@ -461,10 +458,7 @@ func (q Querier) EstimateSwapExactAmountOut(ctx context.Context, req *types.Quer

sdkCtx := sdk.UnwrapSDKContext(ctx)

// TODO: remove this redundancy after making routes be shared between x/gamm and x/swaprouter.
swaprouterRoutes := types.ConvertAmountOutRoutes(req.Routes)

tokenInAmount, err := q.Keeper.poolManager.MultihopEstimateInGivenExactAmountOut(sdkCtx, swaprouterRoutes, tokenOut)
tokenInAmount, err := q.Keeper.poolManager.MultihopEstimateInGivenExactAmountOut(sdkCtx, req.Routes, tokenOut)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
Expand Down
10 changes: 2 additions & 8 deletions x/gamm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ func (server msgServer) SwapExactAmountIn(goCtx context.Context, msg *types.MsgS
return nil, err
}

// TODO: remove this redundancy after making routes be shared between x/gamm and x/swaprouter.
swaprouterRoutes := types.ConvertAmountInRoutes(msg.Routes)

tokenOutAmount, err := server.keeper.poolManager.RouteExactAmountIn(ctx, sender, swaprouterRoutes, msg.TokenIn, msg.TokenOutMinAmount)
tokenOutAmount, err := server.keeper.poolManager.RouteExactAmountIn(ctx, sender, msg.Routes, msg.TokenIn, msg.TokenOutMinAmount)
if err != nil {
return nil, err
}
Expand All @@ -191,10 +188,7 @@ func (server msgServer) SwapExactAmountOut(goCtx context.Context, msg *types.Msg
return nil, err
}

// TODO: remove this redundancy after making routes be shared between x/gamm and x/swaprouter.
swaprouterRoutes := types.ConvertAmountOutRoutes(msg.Routes)

tokenInAmount, err := server.keeper.poolManager.RouteExactAmountOut(ctx, sender, swaprouterRoutes, msg.TokenInMaxAmount, msg.TokenOut)
tokenInAmount, err := server.keeper.poolManager.RouteExactAmountOut(ctx, sender, msg.Routes, msg.TokenInMaxAmount, msg.TokenOut)
if err != nil {
return nil, err
}
Expand Down
21 changes: 11 additions & 10 deletions x/gamm/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/osmosis-labs/osmosis/v13/x/gamm/keeper"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"
)

const (
Expand All @@ -22,21 +23,21 @@ func (suite *KeeperTestSuite) TestSwapExactAmountIn_Events() {
)

testcases := map[string]struct {
routes []types.SwapAmountInRoute
routes []swaproutertypes.SwapAmountInRoute
tokenIn sdk.Coin
tokenOutMinAmount sdk.Int
expectError bool
expectedSwapEvents int
expectedMessageEvents int
}{
"zero hops": {
routes: []types.SwapAmountInRoute{},
routes: []swaproutertypes.SwapAmountInRoute{},
tokenIn: sdk.NewCoin("foo", sdk.NewInt(tokenIn)),
tokenOutMinAmount: sdk.NewInt(tokenInMinAmount),
expectError: true,
},
"one hop": {
routes: []types.SwapAmountInRoute{
routes: []swaproutertypes.SwapAmountInRoute{
{
PoolId: 1,
TokenOutDenom: "bar",
Expand All @@ -48,7 +49,7 @@ func (suite *KeeperTestSuite) TestSwapExactAmountIn_Events() {
expectedMessageEvents: 3, // 1 gamm + 2 events emitted by other keeper methods.
},
"two hops": {
routes: []types.SwapAmountInRoute{
routes: []swaproutertypes.SwapAmountInRoute{
{
PoolId: 1,
TokenOutDenom: "bar",
Expand All @@ -64,7 +65,7 @@ func (suite *KeeperTestSuite) TestSwapExactAmountIn_Events() {
expectedMessageEvents: 5, // 1 gamm + 4 events emitted by other keeper methods.
},
"invalid - two hops, denom does not exist": {
routes: []types.SwapAmountInRoute{
routes: []swaproutertypes.SwapAmountInRoute{
{
PoolId: 1,
TokenOutDenom: "bar",
Expand Down Expand Up @@ -121,21 +122,21 @@ func (suite *KeeperTestSuite) TestSwapExactAmountOut_Events() {
)

testcases := map[string]struct {
routes []types.SwapAmountOutRoute
routes []swaproutertypes.SwapAmountOutRoute
tokenOut sdk.Coin
tokenInMaxAmount sdk.Int
expectError bool
expectedSwapEvents int
expectedMessageEvents int
}{
"zero hops": {
routes: []types.SwapAmountOutRoute{},
routes: []swaproutertypes.SwapAmountOutRoute{},
tokenOut: sdk.NewCoin("foo", sdk.NewInt(tokenOut)),
tokenInMaxAmount: sdk.NewInt(tokenInMaxAmount),
expectError: true,
},
"one hop": {
routes: []types.SwapAmountOutRoute{
routes: []swaproutertypes.SwapAmountOutRoute{
{
PoolId: 1,
TokenInDenom: "bar",
Expand All @@ -147,7 +148,7 @@ func (suite *KeeperTestSuite) TestSwapExactAmountOut_Events() {
expectedMessageEvents: 3, // 1 gamm + 2 events emitted by other keeper methods.
},
"two hops": {
routes: []types.SwapAmountOutRoute{
routes: []swaproutertypes.SwapAmountOutRoute{
{
PoolId: 1,
TokenInDenom: "bar",
Expand All @@ -163,7 +164,7 @@ func (suite *KeeperTestSuite) TestSwapExactAmountOut_Events() {
expectedMessageEvents: 5, // 1 gamm + 4 events emitted by other keeper methods.
},
"invalid - two hops, denom does not exist": {
routes: []types.SwapAmountOutRoute{
routes: []swaproutertypes.SwapAmountOutRoute{
{
PoolId: 1,
TokenInDenom: "bar",
Expand Down
5 changes: 3 additions & 2 deletions x/gamm/simulation/sim_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/osmosis-labs/osmosis/v13/x/gamm/keeper"
balancertypes "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"
"github.com/osmosis-labs/osmosis/v13/x/gamm/types"
swaproutertypes "github.com/osmosis-labs/osmosis/v13/x/swaprouter/types"
)

var PoolCreationFee = sdk.NewInt64Coin("stake", 10_000_000)
Expand Down Expand Up @@ -129,7 +130,7 @@ func RandomSwapExactAmountIn(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk.Cont
}

// set the swap route to use this pool
route := []types.SwapAmountInRoute{{
route := []swaproutertypes.SwapAmountInRoute{{
PoolId: pool_id,
TokenOutDenom: coinOut.Denom,
}}
Expand Down Expand Up @@ -167,7 +168,7 @@ func RandomSwapExactAmountOut(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk.Con
}

// set the swap route to use this pool
route := []types.SwapAmountOutRoute{{
route := []swaproutertypes.SwapAmountOutRoute{{
PoolId: pool_id,
TokenInDenom: coinIn.Denom,
}}
Expand Down
Loading