From b7ac05aec272364d9ee02245d6935a4123c21ea5 Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Sat, 19 Nov 2022 21:28:28 -0500 Subject: [PATCH 1/7] add script to run airdrop --- scripts/airdrop.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/airdrop.sh diff --git a/scripts/airdrop.sh b/scripts/airdrop.sh new file mode 100644 index 0000000000..35adbf6326 --- /dev/null +++ b/scripts/airdrop.sh @@ -0,0 +1,51 @@ +### AIRDROP TESTING FLOW +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source ${SCRIPT_DIR}/vars.sh + +# First, start the network with `make start-docker` +# Then, run this script with `bash scripts/airdrop.sh` + +# NOTE: First, store the keys using the following mnemonics +# distributor address: stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl +# distributor mnemonic: barrel salmon half click confirm crunch sense defy salute process cart fiscal sport clump weasel render private manage picture spell wreck hill frozen before +$STRIDE_MAIN_CMD keys add distributor-test --recover + +# airdrop-test address: stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr +# airdrop claimer mnemonic: royal auction state december october hip monster hotel south help bulk supreme history give deliver pigeon license gold carpet rabbit raw wool fatigue donate +$STRIDE_MAIN_CMD keys add airdrop-test --recover + + +## AIRDROP SETUP +# Transfer uatom from gaia to stride, so that we can liquid stake later +$GAIA_MAIN_CMD tx ibc-transfer transfer transfer channel-0 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000uatom --from ${GAIA_VAL_PREFIX}1 -y +sleep 5 + + +# Fund the distributor account +$STRIDE_MAIN_CMD tx bank send val1 stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl 600000ustrd --from val1 +sleep 5 +# Fund the airdrop account +$STRIDE_MAIN_CMD tx bank send val1 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000000ustrd --from val1 +sleep 5 + +# Create the airdrop, so that the airdrop account can claim tokens +$STRIDE_MAIN_CMD tx claim create-airdrop stride 1666792900 40000000 ustrd --from distributor-test +sleep 5 +# Set airdrop allocations +$STRIDE_MAIN_CMD tx claim set-airdrop-allocations stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1 --from distributor-test +sleep 5 + + +# AIRDROP CLAIMS +# Check balances before claims +$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr +# NOTE: You can claim here using the CLI, or from the frontend! +# Claim 20% of the free tokens +$STRIDE_MAIN_CMD tx claim claim-free-amount --from airdrop-test --gas 400000 +sleep 5 +# Stake, to claim another 20% +$STRIDE_MAIN_CMD tx staking delegate stridevaloper1nnurja9zt97huqvsfuartetyjx63tc5zrj5x9f 100ustrd --from airdrop-test --gas 400000 +sleep 5 +# Liquid stake, to claim the final 20% of tokens +$STRIDE_MAIN_CMD tx stakeibc liquid-stake 1000 uatom --from airdrop-test --gas 400000 +sleep 5 From 444d198cf40c884a84f1a330715a52f61530d5bc Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Sun, 20 Nov 2022 14:00:51 -0500 Subject: [PATCH 2/7] Add max claimable query --- go.mod | 4 +- go.sum | 12 +-- proto/stride/claim/query.proto | 1 + proto/stride/claim/tx.proto | 4 +- x/claim/client/cli/query.go | 5 +- x/claim/keeper/claim.go | 12 +-- x/claim/keeper/claim_test.go | 14 +-- x/claim/keeper/grpc_query.go | 4 +- x/claim/spec/04_keeper.md | 2 +- x/claim/types/query.pb.go | 159 +++++++++++++++++++++------------ 10 files changed, 130 insertions(+), 87 deletions(-) diff --git a/go.mod b/go.mod index b5f99788ff..daceb6dbb1 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.19 require ( github.com/cosmos/cosmos-proto v1.0.0-alpha8 - github.com/cosmos/cosmos-sdk v0.45.11 + github.com/cosmos/cosmos-sdk v0.45.9 github.com/cosmos/gogoproto v1.4.3 - github.com/cosmos/ibc-go/v3 v3.4.0 + github.com/cosmos/ibc-go/v3 v3.0.0-rc2 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 376eaa3e13..fd2c1790c9 100644 --- a/go.sum +++ b/go.sum @@ -159,8 +159,8 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= -github.com/cosmos/cosmos-sdk v0.45.11 h1:Pc44fFEkai0KXFND5Ys/2ZJkfVdstMIBzKBN8MY7Ll0= -github.com/cosmos/cosmos-sdk v0.45.11/go.mod h1:45z8Q1Ah4iypFycu2Kl4kBPIsQKUiND8G2CUX+HTtPM= +github.com/cosmos/cosmos-sdk v0.45.9 h1:Z4s1EZL/mfM8uSSZr8WmyEbWp4hqbWVI5sAIFR432KY= +github.com/cosmos/cosmos-sdk v0.45.9/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -172,8 +172,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro= -github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= +github.com/cosmos/ibc-go/v3 v3.0.0-rc2 h1:ttolImqsdf/KOGUSU3ok5yaf9rIMdTaaNNCwuBnHfNQ= +github.com/cosmos/ibc-go/v3 v3.0.0-rc2/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220811092532-036a277666f3 h1:BhuqnpAyHPHaVvcQ+Da9wiKvDLODugAsVUdUItMatLQ= @@ -246,8 +246,8 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -271,8 +271,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= diff --git a/proto/stride/claim/query.proto b/proto/stride/claim/query.proto index 90ec629528..0a03c87d03 100644 --- a/proto/stride/claim/query.proto +++ b/proto/stride/claim/query.proto @@ -94,6 +94,7 @@ message QueryTotalClaimableRequest { string airdrop_identifier = 1 [ (gogoproto.moretags) = "yaml:\"airdrop_identifier\"" ]; string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + bool include_claimed = 3; } message QueryTotalClaimableResponse { diff --git a/proto/stride/claim/tx.proto b/proto/stride/claim/tx.proto index a1b5b608a4..52c963d8b5 100644 --- a/proto/stride/claim/tx.proto +++ b/proto/stride/claim/tx.proto @@ -29,9 +29,7 @@ message MsgSetAirdropAllocations { message MsgSetAirdropAllocationsResponse {} -message MsgClaimFreeAmount { - string user = 1; -} +message MsgClaimFreeAmount { string user = 1; } message MsgClaimFreeAmountResponse { repeated cosmos.base.v1beta1.Coin claimed_amount = 3 [ diff --git a/x/claim/client/cli/query.go b/x/claim/client/cli/query.go index 9817b2a369..647c8b19b5 100644 --- a/x/claim/client/cli/query.go +++ b/x/claim/client/cli/query.go @@ -180,8 +180,8 @@ $ %s query claim claimable-for-action stride1h4astdfzjhcwahtfrh24qtvndzzh49xvqtf // GetCmdQueryClaimable implements the query claimables command. func GetCmdQueryTotalClaimable() *cobra.Command { cmd := &cobra.Command{ - Use: "total-claimable [airdrop-identifier] [address]", - Args: cobra.ExactArgs(2), + Use: "total-claimable [airdrop-identifier] [address] [include-claimed]", + Args: cobra.ExactArgs(3), Short: "Query the total claimable amount remaining for an account.", Long: strings.TrimSpace( fmt.Sprintf(`Query the total claimable amount remaining for an account. @@ -201,6 +201,7 @@ $ %s query claim total-claimable stride stride1h4astdfzjhcwahtfrh24qtvndzzh49xvq res, err := queryClient.TotalClaimable(context.Background(), &types.QueryTotalClaimableRequest{ AirdropIdentifier: args[0], Address: args[1], + IncludeClaimed: args[2] == "true", }) if err != nil { return err diff --git a/x/claim/keeper/claim.go b/x/claim/keeper/claim.go index 63f5bf5d29..caa286f8ed 100644 --- a/x/claim/keeper/claim.go +++ b/x/claim/keeper/claim.go @@ -343,7 +343,7 @@ func (k Keeper) GetAirdropClaimDenom(ctx sdk.Context, airdropIdentifier string) } // GetClaimable returns claimable amount for a specific action done by an address -func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string) (sdk.Coins, error) { +func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error) { claimRecord, err := k.GetClaimRecord(ctx, addr, airdropIdentifier) if err != nil { return nil, err @@ -353,8 +353,8 @@ func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress return sdk.Coins{}, nil } - // if action already completed, nothing is claimable - if claimRecord.ActionCompleted[action] { + // if action already completed (and we're not including claimed tokens), nothing is claimable + if !includeClaimed && claimRecord.ActionCompleted[action] { return sdk.Coins{}, nil } @@ -408,7 +408,7 @@ func (k Keeper) GetUserVestings(ctx sdk.Context, addr sdk.AccAddress) (vestingty } // GetClaimable returns claimable amount for a specific action done by an address -func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string) (sdk.Coins, error) { +func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error) { claimRecord, err := k.GetClaimRecord(ctx, addr, airdropIdentifier) if err != nil { return sdk.Coins{}, err @@ -420,7 +420,7 @@ func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, aird totalClaimable := sdk.Coins{} for action := range types.Action_name { - claimableForAction, err := k.GetClaimableAmountForAction(ctx, addr, types.Action(action), airdropIdentifier) + claimableForAction, err := k.GetClaimableAmountForAction(ctx, addr, types.Action(action), airdropIdentifier, includeClaimed) if err != nil { return sdk.Coins{}, err } @@ -486,7 +486,7 @@ func (k Keeper) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid airdrop identifier: ClaimCoinsForAction") } - claimableAmount, err := k.GetClaimableAmountForAction(ctx, addr, action, airdropIdentifier) + claimableAmount, err := k.GetClaimableAmountForAction(ctx, addr, action, airdropIdentifier, false) if err != nil { return claimableAmount, err } diff --git a/x/claim/keeper/claim_test.go b/x/claim/keeper/claim_test.go index 0030a6e77c..8435eb0610 100644 --- a/x/claim/keeper/claim_test.go +++ b/x/claim/keeper/claim_test.go @@ -99,12 +99,12 @@ func (suite *KeeperTestSuite) TestHookBeforeAirdropStart() { err = suite.app.ClaimKeeper.SetClaimRecordsWithWeights(suite.ctx, claimRecords) suite.Require().NoError(err) - coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride") + coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride", false) suite.NoError(err) // Now, it is before starting air drop, so this value should return the empty coins suite.True(coins.Empty()) - coins, err = suite.app.ClaimKeeper.GetClaimableAmountForAction(suite.ctx, addr1, types.ACTION_FREE, "stride") + coins, err = suite.app.ClaimKeeper.GetClaimableAmountForAction(suite.ctx, addr1, types.ACTION_FREE, "stride", false) suite.NoError(err) // Now, it is before starting air drop, so this value should return the empty coins suite.True(coins.Empty()) @@ -188,15 +188,15 @@ func (suite *KeeperTestSuite) TestAirdropFlow() { err := suite.app.ClaimKeeper.SetClaimRecordsWithWeights(suite.ctx, claimRecords) suite.Require().NoError(err) - coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride") + coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride", false) suite.Require().NoError(err) suite.Require().Equal(coins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 50_000_000)).String()) - coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr2, "stride") + coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr2, "stride", false) suite.Require().NoError(err) suite.Require().Equal(coins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 50_000_000)).String()) - coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr3, "stride") + coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr3, "stride", false) suite.Require().NoError(err) suite.Require().Equal(coins, sdk.Coins{}) @@ -288,11 +288,11 @@ func (suite *KeeperTestSuite) TestMultiChainAirdropFlow() { err := suite.app.ClaimKeeper.SetClaimRecordsWithWeights(suite.ctx, claimRecords) suite.Require().NoError(err) - coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride") + coins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride", false) suite.Require().NoError(err) suite.Require().Equal(coins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100_000_000)).String()) - coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr2, "juno") + coins, err = suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr2, "juno", false) suite.Require().NoError(err) suite.Require().Equal(coins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)).String()) diff --git a/x/claim/keeper/grpc_query.go b/x/claim/keeper/grpc_query.go index e16b53aca7..56c1d3c74b 100644 --- a/x/claim/keeper/grpc_query.go +++ b/x/claim/keeper/grpc_query.go @@ -68,7 +68,7 @@ func (k Keeper) ClaimableForAction( return nil, err } - coins, err := k.GetClaimableAmountForAction(ctx, addr, req.Action, req.AirdropIdentifier) + coins, err := k.GetClaimableAmountForAction(ctx, addr, req.Action, req.AirdropIdentifier, false) return &types.QueryClaimableForActionResponse{ Coins: coins, @@ -90,7 +90,7 @@ func (k Keeper) TotalClaimable( return nil, err } - coins, err := k.GetUserTotalClaimable(ctx, addr, req.AirdropIdentifier) + coins, err := k.GetUserTotalClaimable(ctx, addr, req.AirdropIdentifier, req.IncludeClaimed) return &types.QueryTotalClaimableResponse{ Coins: coins, diff --git a/x/claim/spec/04_keeper.md b/x/claim/spec/04_keeper.md index d347fe3e7f..5ae284f623 100644 --- a/x/claim/spec/04_keeper.md +++ b/x/claim/spec/04_keeper.md @@ -16,7 +16,7 @@ Claim keeper module provides utility functions to manage epochs. GetClaimRecords(ctx sdk.Context) []types.ClaimRecord SetClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord) error SetClaimRecords(ctx sdk.Context, claimRecords []types.ClaimRecord) error - GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action) (sdk.Coins, error) + GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, includeClaimed bool) (sdk.Coins, error) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coins, error) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action) (sdk.Coins, error) clearInitialClaimables(ctx sdk.Context) diff --git a/x/claim/types/query.pb.go b/x/claim/types/query.pb.go index 6e9045c15c..3108d5e273 100644 --- a/x/claim/types/query.pb.go +++ b/x/claim/types/query.pb.go @@ -411,6 +411,7 @@ func (m *QueryClaimableForActionResponse) GetCoins() github_com_cosmos_cosmos_sd type QueryTotalClaimableRequest struct { AirdropIdentifier string `protobuf:"bytes,1,opt,name=airdrop_identifier,json=airdropIdentifier,proto3" json:"airdrop_identifier,omitempty" yaml:"airdrop_identifier"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + IncludeClaimed bool `protobuf:"varint,3,opt,name=include_claimed,json=includeClaimed,proto3" json:"include_claimed,omitempty"` } func (m *QueryTotalClaimableRequest) Reset() { *m = QueryTotalClaimableRequest{} } @@ -460,6 +461,13 @@ func (m *QueryTotalClaimableRequest) GetAddress() string { return "" } +func (m *QueryTotalClaimableRequest) GetIncludeClaimed() bool { + if m != nil { + return m.IncludeClaimed + } + return false +} + type QueryTotalClaimableResponse struct { Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins" yaml:"coins"` } @@ -618,65 +626,67 @@ func init() { func init() { proto.RegisterFile("stride/claim/query.proto", fileDescriptor_baa87682a02846df) } var fileDescriptor_baa87682a02846df = []byte{ - // 924 bytes of a gzipped FileDescriptorProto + // 947 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0xce, 0x34, 0x74, 0x2b, 0x26, 0x69, 0xaa, 0x4e, 0x43, 0xd8, 0x75, 0x5a, 0x7b, 0x19, 0x29, - 0x61, 0x91, 0x1a, 0x9b, 0x26, 0x88, 0x03, 0x17, 0xc0, 0x45, 0x28, 0x45, 0x3d, 0x14, 0x03, 0x95, - 0xe0, 0xb2, 0x1a, 0xdb, 0xd3, 0xc5, 0x62, 0xd7, 0xe3, 0x78, 0xec, 0x8a, 0xa8, 0xea, 0x05, 0x0e, - 0xdc, 0xa0, 0x12, 0x20, 0xf1, 0x17, 0x40, 0xe2, 0xc0, 0xbf, 0xe8, 0xb1, 0x12, 0x17, 0x0e, 0xb0, - 0xa0, 0x84, 0x1b, 0xb7, 0x1c, 0x38, 0x23, 0xcf, 0x3c, 0x67, 0xed, 0xc4, 0xdb, 0x4d, 0x0e, 0xa8, - 0xb9, 0x64, 0xb3, 0xf3,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b, 0xde, 0x7b, 0xdf, 0xf7, 0x8d, 0xe7, 0x8d, 0x71, 0x4b, 0xa6, 0x49, + 0xe0, 0x73, 0xdb, 0x0b, 0x59, 0x30, 0xb2, 0x77, 0x33, 0x9e, 0xec, 0x59, 0x71, 0x22, 0x52, 0x41, + 0x16, 0x75, 0xc4, 0x52, 0x11, 0x63, 0x79, 0x28, 0x86, 0x42, 0x05, 0xec, 0xfc, 0x3f, 0x8d, 0x31, + 0xae, 0x0c, 0x85, 0x18, 0x86, 0xdc, 0x66, 0x71, 0x60, 0xb3, 0x28, 0x12, 0x29, 0x4b, 0x03, 0x11, + 0x49, 0x88, 0x9a, 0x9e, 0x90, 0x23, 0x21, 0x6d, 0x97, 0x49, 0x6e, 0xdf, 0xbb, 0xe1, 0xf2, 0x94, + 0xdd, 0xb0, 0x3d, 0x11, 0x44, 0x10, 0xaf, 0xf6, 0x56, 0x7f, 0x21, 0xd2, 0xae, 0x44, 0x62, 0x96, + 0xb0, 0x51, 0x51, 0xf4, 0x0a, 0x84, 0xee, 0x71, 0x99, 0x06, 0xd1, 0xb0, 0x78, 0xea, 0x28, 0xcd, + 0xf0, 0xda, 0xfb, 0xb9, 0x86, 0x77, 0x82, 0x1c, 0xe6, 0x66, 0xa9, 0x48, 0xde, 0xf6, 0x3c, 0x91, + 0x45, 0x69, 0x9f, 0x85, 0x2c, 0xf2, 0xb8, 0xc3, 0x77, 0x33, 0x2e, 0x53, 0x72, 0x0b, 0x13, 0x16, + 0x24, 0x7e, 0x22, 0xe2, 0x41, 0xe0, 0xf3, 0x28, 0x0d, 0xee, 0x06, 0x3c, 0x69, 0xa1, 0x2e, 0xea, + 0xbd, 0xd0, 0xbf, 0x7a, 0x38, 0xee, 0xb4, 0xf7, 0xd8, 0x28, 0x7c, 0x83, 0x9e, 0xc4, 0x50, 0xe7, + 0x12, 0x2c, 0xde, 0x9c, 0xac, 0xfd, 0x8e, 0xf0, 0xfa, 0xac, 0xbe, 0x32, 0x16, 0x91, 0x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a, 0xaf, 0x9c, + 0x02, 0x09, 0xfc, 0x7a, 0x8a, 0x1f, 0x25, 0x5d, 0xe0, 0x97, 0xe6, 0xb0, 0xc1, 0x11, 0xcb, 0x92, + 0x7b, 0x5f, 0x21, 0xbc, 0x58, 0x3e, 0xd7, 0xa4, 0x6e, 0x77, 0x6a, 0x66, 0x88, 0x71, 0x6d, 0x26, + 0x0e, 0xb8, 0xac, 0x2b, 0x2e, 0x5d, 0x62, 0x02, 0x97, 0x4c, 0xf2, 0x64, 0x00, 0x47, 0x51, 0x4e, + 0x98, 0xf4, 0x77, 0x1e, 0xed, 0x9b, 0xe8, 0xf1, 0xbe, 0x89, 0xfe, 0xda, 0x37, 0xd1, 0xc3, 0x03, + 0x73, 0xee, 0xf1, 0x81, 0x39, 0xf7, 0xdb, 0x81, 0x39, 0xf7, 0x89, 0x55, 0x9a, 0x05, 0x1f, 0xa8, + 0xa6, 0x1b, 0xb7, 0x98, 0x2b, 0xed, 0xe2, 0x9b, 0x74, 0xcb, 0xfe, 0xbc, 0xd0, 0x99, 0xcf, 0x05, + 0xb7, 0xa1, 0xbe, 0x4a, 0xb7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x32, 0x18, 0x46, 0x52, 0x66, + 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1231,6 +1241,16 @@ func (m *QueryTotalClaimableRequest) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if m.IncludeClaimed { + i-- + if m.IncludeClaimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -1502,6 +1522,9 @@ func (m *QueryTotalClaimableRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.IncludeClaimed { + n += 2 + } return n } @@ -2366,6 +2389,26 @@ func (m *QueryTotalClaimableRequest) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeClaimed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeClaimed = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From 35c337c1cfdbad1d0c425f9825d3d00895daa277 Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Sun, 20 Nov 2022 14:04:08 -0500 Subject: [PATCH 3/7] deps --- go.mod | 4 ++-- go.sum | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index daceb6dbb1..b5f99788ff 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.19 require ( github.com/cosmos/cosmos-proto v1.0.0-alpha8 - github.com/cosmos/cosmos-sdk v0.45.9 + github.com/cosmos/cosmos-sdk v0.45.11 github.com/cosmos/gogoproto v1.4.3 - github.com/cosmos/ibc-go/v3 v3.0.0-rc2 + github.com/cosmos/ibc-go/v3 v3.4.0 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index fd2c1790c9..376eaa3e13 100644 --- a/go.sum +++ b/go.sum @@ -159,8 +159,8 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= -github.com/cosmos/cosmos-sdk v0.45.9 h1:Z4s1EZL/mfM8uSSZr8WmyEbWp4hqbWVI5sAIFR432KY= -github.com/cosmos/cosmos-sdk v0.45.9/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= +github.com/cosmos/cosmos-sdk v0.45.11 h1:Pc44fFEkai0KXFND5Ys/2ZJkfVdstMIBzKBN8MY7Ll0= +github.com/cosmos/cosmos-sdk v0.45.11/go.mod h1:45z8Q1Ah4iypFycu2Kl4kBPIsQKUiND8G2CUX+HTtPM= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -172,8 +172,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v3 v3.0.0-rc2 h1:ttolImqsdf/KOGUSU3ok5yaf9rIMdTaaNNCwuBnHfNQ= -github.com/cosmos/ibc-go/v3 v3.0.0-rc2/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= +github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro= +github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220811092532-036a277666f3 h1:BhuqnpAyHPHaVvcQ+Da9wiKvDLODugAsVUdUItMatLQ= @@ -246,8 +246,8 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -271,8 +271,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= From 64cfe61974e87aa369870f547974b135c881c44f Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Sun, 20 Nov 2022 18:16:47 -0500 Subject: [PATCH 4/7] add test --- x/claim/keeper/claim_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/claim/keeper/claim_test.go b/x/claim/keeper/claim_test.go index 8435eb0610..5b2868391b 100644 --- a/x/claim/keeper/claim_test.go +++ b/x/claim/keeper/claim_test.go @@ -343,6 +343,14 @@ func (suite *KeeperTestSuite) TestMultiChainAirdropFlow() { coins = suite.app.BankKeeper.GetAllBalances(suite.ctx, addr1) suite.Require().Equal(coins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, (claimableAmountForFree+claimableAmountForStake+claimableAmountForLiquidStake)*2)).String()) + // Verify that the max claimable amount is unchanged, even after claims + maxCoins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride", true) + suite.Require().NoError(err) + suite.Require().Equal(maxCoins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100_000_000)).String()) + claimableCoins, err := suite.app.ClaimKeeper.GetUserTotalClaimable(suite.ctx, addr1, "stride", false) + suite.Require().NoError(err) + suite.Require().Equal(claimableCoins.String(), sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)).String()) + // check if stride and osmosis airdrops ended properly suite.ctx = suite.ctx.WithBlockHeight(1000) suite.app.ClaimKeeper.EndBlocker(suite.ctx.WithBlockTime(time.Now().Add(types.DefaultAirdropDuration))) From d5b741a0e96b7ed27a5019377935192ac1b70b3e Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Mon, 21 Nov 2022 18:15:50 -0500 Subject: [PATCH 5/7] Update scripts/airdrop.sh Co-authored-by: sampocs --- scripts/airdrop.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/airdrop.sh b/scripts/airdrop.sh index 35adbf6326..de92513c65 100644 --- a/scripts/airdrop.sh +++ b/scripts/airdrop.sh @@ -8,7 +8,8 @@ source ${SCRIPT_DIR}/vars.sh # NOTE: First, store the keys using the following mnemonics # distributor address: stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl # distributor mnemonic: barrel salmon half click confirm crunch sense defy salute process cart fiscal sport clump weasel render private manage picture spell wreck hill frozen before -$STRIDE_MAIN_CMD keys add distributor-test --recover +echo "barrel salmon half click confirm crunch sense defy salute process cart fiscal sport clump weasel render private manage picture spell wreck hill frozen before" | \ + $STRIDE_MAIN_CMD keys add distributor-test --recover # airdrop-test address: stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr # airdrop claimer mnemonic: royal auction state december october hip monster hotel south help bulk supreme history give deliver pigeon license gold carpet rabbit raw wool fatigue donate From 1dd50e7c5e95e1569618d7bf6c714ec9b3760b20 Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Mon, 21 Nov 2022 18:15:55 -0500 Subject: [PATCH 6/7] Update scripts/airdrop.sh Co-authored-by: sampocs --- scripts/airdrop.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/airdrop.sh b/scripts/airdrop.sh index de92513c65..150225c4ca 100644 --- a/scripts/airdrop.sh +++ b/scripts/airdrop.sh @@ -13,7 +13,8 @@ echo "barrel salmon half click confirm crunch sense defy salute process cart fis # airdrop-test address: stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr # airdrop claimer mnemonic: royal auction state december october hip monster hotel south help bulk supreme history give deliver pigeon license gold carpet rabbit raw wool fatigue donate -$STRIDE_MAIN_CMD keys add airdrop-test --recover +echo "royal auction state december october hip monster hotel south help bulk supreme history give deliver pigeon license gold carpet rabbit raw wool fatigue donate" | \ + $STRIDE_MAIN_CMD keys add airdrop-test --recover ## AIRDROP SETUP From a83bd9dbda4e1bcb01e63aea8fe33814e215aa64 Mon Sep 17 00:00:00 2001 From: Aidan Salzmann Date: Mon, 21 Nov 2022 18:18:36 -0500 Subject: [PATCH 7/7] updates per sam --- scripts/airdrop.sh | 26 ++++++++++++++++---------- x/claim/client/cli/query.go | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/airdrop.sh b/scripts/airdrop.sh index 150225c4ca..ebba867184 100644 --- a/scripts/airdrop.sh +++ b/scripts/airdrop.sh @@ -16,38 +16,44 @@ echo "barrel salmon half click confirm crunch sense defy salute process cart fis echo "royal auction state december october hip monster hotel south help bulk supreme history give deliver pigeon license gold carpet rabbit raw wool fatigue donate" | \ $STRIDE_MAIN_CMD keys add airdrop-test --recover - ## AIRDROP SETUP +echo "Funding accounts..." # Transfer uatom from gaia to stride, so that we can liquid stake later $GAIA_MAIN_CMD tx ibc-transfer transfer transfer channel-0 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000uatom --from ${GAIA_VAL_PREFIX}1 -y sleep 5 - - # Fund the distributor account -$STRIDE_MAIN_CMD tx bank send val1 stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl 600000ustrd --from val1 +$STRIDE_MAIN_CMD tx bank send val1 stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl 600000ustrd --from val1 -y sleep 5 # Fund the airdrop account -$STRIDE_MAIN_CMD tx bank send val1 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000000ustrd --from val1 +$STRIDE_MAIN_CMD tx bank send val1 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000000ustrd --from val1 -y sleep 5 - # Create the airdrop, so that the airdrop account can claim tokens -$STRIDE_MAIN_CMD tx claim create-airdrop stride 1666792900 40000000 ustrd --from distributor-test +$STRIDE_MAIN_CMD tx claim create-airdrop stride 1666792900 40000000 ustrd --from distributor-test -y sleep 5 # Set airdrop allocations -$STRIDE_MAIN_CMD tx claim set-airdrop-allocations stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1 --from distributor-test +$STRIDE_MAIN_CMD tx claim set-airdrop-allocations stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1 --from distributor-test -y sleep 5 - # AIRDROP CLAIMS # Check balances before claims +echo "Initial balance before claim:" $STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr # NOTE: You can claim here using the CLI, or from the frontend! # Claim 20% of the free tokens +echo "Claiming fee amount..." $STRIDE_MAIN_CMD tx claim claim-free-amount --from airdrop-test --gas 400000 sleep 5 +echo "Balance after claim:" +$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr # Stake, to claim another 20% +echo "Staking..." $STRIDE_MAIN_CMD tx staking delegate stridevaloper1nnurja9zt97huqvsfuartetyjx63tc5zrj5x9f 100ustrd --from airdrop-test --gas 400000 sleep 5 -# Liquid stake, to claim the final 20% of tokens +echo "Balance after stake:" +$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr +# Liquid stake, to claim the final 60% of tokens +echo "Liquid staking..." $STRIDE_MAIN_CMD tx stakeibc liquid-stake 1000 uatom --from airdrop-test --gas 400000 sleep 5 +echo "Balance after liquid stake:" +$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr \ No newline at end of file diff --git a/x/claim/client/cli/query.go b/x/claim/client/cli/query.go index 647c8b19b5..a11262c8b9 100644 --- a/x/claim/client/cli/query.go +++ b/x/claim/client/cli/query.go @@ -186,7 +186,7 @@ func GetCmdQueryTotalClaimable() *cobra.Command { Long: strings.TrimSpace( fmt.Sprintf(`Query the total claimable amount remaining for an account. Example: -$ %s query claim total-claimable stride stride1h4astdfzjhcwahtfrh24qtvndzzh49xvqtfftk +$ %s query claim total-claimable stride stride1h4astdfzjhcwahtfrh24qtvndzzh49xvqtfftk true `, version.AppName, ),