diff --git a/dockernet/config.sh b/dockernet/config.sh index 1d9cbe80cf..bf52f7c7a2 100755 --- a/dockernet/config.sh +++ b/dockernet/config.sh @@ -128,6 +128,7 @@ HOST_DAY_EPOCH_DURATION="60s" HOST_HOUR_EPOCH_DURATION="60s" HOST_WEEK_EPOCH_DURATION="60s" HOST_MINT_EPOCH_DURATION="60s" +AIRDROP_PERIOD_LENGTH="86400" UNBONDING_TIME="240s" MAX_DEPOSIT_PERIOD="30s" VOTING_PERIOD="30s" diff --git a/dockernet/scripts/airdrop/allocations_prod.csv b/dockernet/scripts/airdrop/allocations_prod.csv new file mode 100644 index 0000000000..e7e5ea091d --- /dev/null +++ b/dockernet/scripts/airdrop/allocations_prod.csv @@ -0,0 +1,4 @@ +stride1qtzlx93h8xlmej42pjqyez6yp9nscfgxsmtt59,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000 +stride183g7tx3u4lmtwv7ph9fpq862e6dyapamexywru,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000 +stride13k0vj64yr3dxq4e24v5s2ptqmnxmyl7xn5pz7q,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000 +dym1np5x8s6lufkv8ghu8lzj5xtlgae5pwl8y8ne6x,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000 \ No newline at end of file diff --git a/dockernet/scripts/airdrop/setup_prod.sh b/dockernet/scripts/airdrop/setup_prod.sh new file mode 100644 index 0000000000..6f63bcf974 --- /dev/null +++ b/dockernet/scripts/airdrop/setup_prod.sh @@ -0,0 +1,132 @@ +#!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source ${SCRIPT_DIR}/../../config.sh + +# NOTE: Before running this script, you must change AIRDROP_PERIOD_LENGTH to "86400" in config.sh + +# Options: fresh-start, midway-before-deadline, midway-after-deadline, distribution-ended +STAGE="fresh-start" + +AIRDROP_NAME="sttia" +OS=$(uname) + +# stride1wxv8jnusl5s2che9kp33jrsxz3kxcwm6fgfs0z +DISTRIBUTOR_MNEMONIC="wire elephant soldier improve million minor image identify analyst black kangaroo word dose run olive heavy usual sound copy diamond market accident other clean" +# stride1v0t265yce4pwdvmzs4ew0ll4fnk2t6updfg6hf +ALLOCATOR_MNEMONIC="board stamp journey usage pen warfare burst that detect rain solid skill affair cactus forward insect video bitter goddess tank syrup hunt pond flat" +# stride1krn5q0s83qfx9v67awsj7leaql99tmyydcukhl +LINKER_MNEMONIC="add special provide zebra gasp above tube shield judge vapor tortoise snow receive vibrant couch true tide snack goat fee risk viable coil mutual" + +# stride1qtzlx93h8xlmej42pjqyez6yp9nscfgxsmtt59 +CLAIMER_1_MNEMONIC="breeze reason effort latin mask orbit ball raw security gown category royal copper scheme fiction flame few wise siege car text snake famous render" +# stride183g7tx3u4lmtwv7ph9fpq862e6dyapamexywru +CLAIMER_2_MNEMONIC="glance trigger upgrade keep nature glad wreck snake grief trap utility curtain bracket large drama ridge loud token service idea smart crisp flavor carpet" +# stride13k0vj64yr3dxq4e24v5s2ptqmnxmyl7xn5pz7q +CLAIMER_3_MNEMONIC="pet garlic cram security clock element truth soda stomach ugly you dress narrow black space grab concert cancel depend crawl corn worry miss submit" + +# Same mnemonic as claimer 3 +LINKED_CLAIMER_ADDRESS="dym1np5x8s6lufkv8ghu8lzj5xtlgae5pwl8y8ne6x" + +current_time_minus_day_offset() { + days=$1 + if [[ "$OS" == "Darwin" ]]; then + date -u -v-"${days}d" +"%Y-%m-%dT00:00:00" + else + date -u +"%Y-%m-%dT00:00:00" -d "$days days ago" + fi +} +current_time_plus_day_offset() { + days=$1 + if [[ "$OS" == "Darwin" ]]; then + date -u -v+"${days}d" +"%Y-%m-%dT00:00:00" + else + date -u +"%Y-%m-%dT00:00:00" -d "$days days" + fi +} + +echo ">>> Creating admin accounts..." +echo $DISTRIBUTOR_MNEMONIC | $STRIDE_MAIN_CMD keys add distributor --recover -- | grep -E "address|name" +echo $ALLOCATOR_MNEMONIC | $STRIDE_MAIN_CMD keys add allocator --recover | grep -E "address|name" +echo $LINKER_MNEMONIC | $STRIDE_MAIN_CMD keys add linker --recover | grep -E "address|name" + +echo -e "\n>>> Creating claimer accounts..." +echo $CLAIMER_1_MNEMONIC | $STRIDE_MAIN_CMD keys add claimer1 --recover | grep -E "address|name" +echo $CLAIMER_2_MNEMONIC | $STRIDE_MAIN_CMD keys add claimer2 --recover | grep -E "address|name" +echo $CLAIMER_3_MNEMONIC | $STRIDE_MAIN_CMD keys add claimer3 --recover | grep -E "address|name" + +distributor_address=$($STRIDE_MAIN_CMD keys show distributor -a) +allocator_address=$($STRIDE_MAIN_CMD keys show allocator -a) +linker_address=$($STRIDE_MAIN_CMD keys show linker -a) + +claimer_1_address=$($STRIDE_MAIN_CMD keys show claimer1 -a) +claimer_2_address=$($STRIDE_MAIN_CMD keys show claimer2 -a) +claimer_3_address=$($STRIDE_MAIN_CMD keys show claimer3 -a) + +echo -e "\n>>> Funding admin accounts..." +$STRIDE_MAIN_CMD tx bank send val1 $distributor_address 5000000000ustrd --from val1 -y | TRIM_TX +sleep 3 +$STRIDE_MAIN_CMD tx bank send val1 $allocator_address 1ustrd --from val1 -y | TRIM_TX +sleep 3 +$STRIDE_MAIN_CMD tx bank send val1 $linker_address 1ustrd --from val1 -y | TRIM_TX +sleep 3 + +echo -e "\n>>> Funding claimer accounts..." +$STRIDE_MAIN_CMD tx bank send val1 $claimer_1_address 10000000ustrd --from val1 -y | TRIM_TX +sleep 3 +$STRIDE_MAIN_CMD tx bank send val1 $claimer_2_address 10000000ustrd --from val1 -y | TRIM_TX +sleep 3 +$STRIDE_MAIN_CMD tx bank send val1 $claimer_3_address 10000000ustrd --from val1 -y | TRIM_TX +sleep 3 + +if [[ "$STAGE" == "fresh-start" ]]; then + start_date=$(current_time_plus_day_offset 0) + end_date=$(current_time_plus_day_offset 149) + clawback_date=$(current_time_plus_day_offset 160) + deadline_date=$(current_time_plus_day_offset 30) +fi + +if [[ "$STAGE" == "midway-before-deadline" ]]; then + start_date=$(current_time_minus_day_offset 10) + end_date=$(current_time_plus_day_offset 139) + clawback_date=$(current_time_plus_day_offset 150) + deadline_date=$(current_time_plus_day_offset 20) +fi + +if [[ "$STAGE" == "midway-after-deadline" ]]; then + start_date=$(current_time_minus_day_offset 40) + end_date=$(current_time_plus_day_offset 109) + clawback_date=$(current_time_plus_day_offset 120) + deadline_date=$(current_time_minus_day_offset 10) +fi + +if [[ "$STAGE" == "distribution-ended" ]]; then + start_date=$(current_time_minus_day_offset 155) + end_date=$(current_time_minus_day_offset 6) + clawback_date=$(current_time_plus_day_offset 25) + deadline_date=$(current_time_minus_day_offset 125) +fi + +echo -e "\n>>> Creating airdrop..." +$STRIDE_MAIN_CMD tx airdrop create-airdrop $AIRDROP_NAME \ + --distribution-start-date $start_date \ + --distribution-end-date $end_date \ + --clawback-date $clawback_date \ + --claim-type-deadline-date $deadline_date \ + --early-claim-penalty 0.5 \ + --distributor-address $distributor_address \ + --allocator-address $allocator_address \ + --linker-address $linker_address \ + --from admin -y | TRIM_TX +sleep 3 + +echo -e "\n>>> Adding allocations..." +$STRIDE_MAIN_CMD tx airdrop add-allocations $AIRDROP_NAME ${SCRIPT_DIR}/allocations_prod.csv \ + --from allocator -y --gas 1000000 | TRIM_TX +sleep 3 + +echo -e "\n>>> Airdrops:" +$STRIDE_MAIN_CMD q airdrop airdrops + +echo -e "\n>>> Allocations:" +$STRIDE_MAIN_CMD q airdrop all-allocations $AIRDROP_NAME | head -n 10 +echo "..." \ No newline at end of file diff --git a/dockernet/src/init_chain.sh b/dockernet/src/init_chain.sh index ae8f4890cf..104f52745a 100644 --- a/dockernet/src/init_chain.sh +++ b/dockernet/src/init_chain.sh @@ -89,7 +89,7 @@ set_stride_genesis() { jq '.app_state.staketia.host_zone.native_token_ibc_denom = $newVal' --arg newVal "${host_ibc_denom}" $genesis_config > json.tmp && mv json.tmp $genesis_config fi - jq '.app_state.airdrop.params.period_length_seconds = $newVal' --arg newVal "60" $genesis_config > json.tmp && mv json.tmp $genesis_config + jq '.app_state.airdrop.params.period_length_seconds = $newVal' --arg newVal "${AIRDROP_PERIOD_LENGTH}" $genesis_config > json.tmp && mv json.tmp $genesis_config } set_host_genesis() { diff --git a/proto/stride/airdrop/query.proto b/proto/stride/airdrop/query.proto index 5d784e41f4..eb60032c28 100644 --- a/proto/stride/airdrop/query.proto +++ b/proto/stride/airdrop/query.proto @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/Stride-Labs/stride/v23/x/airdrop/types"; @@ -53,7 +54,55 @@ service Query { // Airdrop message QueryAirdropRequest { string id = 1; }; -message QueryAirdropResponse { Airdrop airdrop = 1; } +message QueryAirdropResponse { + // Airdrop ID + string id = 1; + + // Denom used when distributing rewards + string reward_denom = 2; + + // The first date that claiming begins and rewards are distributed + google.protobuf.Timestamp distribution_start_date = 3 + [ (gogoproto.stdtime) = true ]; + + // The last date for rewards to be distributed. Immediately after this date + // the rewards can no longer be claimed, but rewards have not been clawed back + // yet + google.protobuf.Timestamp distribution_end_date = 4 + [ (gogoproto.stdtime) = true ]; + + // Date with which the rewards are clawed back (occurs after the distribution + // end date) + google.protobuf.Timestamp clawback_date = 5 [ (gogoproto.stdtime) = true ]; + + // Deadline for the user to make a decision on their claim type + google.protobuf.Timestamp claim_type_deadline_date = 6 + [ (gogoproto.stdtime) = true ]; + + // Penalty for claiming rewards early - e.g. 0.5 means claiming early will + // result in losing 50% of rewards + string early_claim_penalty = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Account that holds the total reward balance and distributes to users + string distributor_address = 8 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Admin account with permissions to add or update allocations + string allocator_address = 9 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Admin account with permissions to link addresseses + string linker_address = 10 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The current date index into the airdrop array + int64 current_date_index = 11; + + // The length of the airdrop (i.e. number of periods in the airdrop array) + int64 airdrop_length = 12; +} // Airdrops message QueryAllAirdropsRequest {}; @@ -118,7 +167,4 @@ message QueryUserSummaryResponse { (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; - - // The current date index into the airdrop array - int64 current_date_index = 6; } diff --git a/x/airdrop/keeper/query.go b/x/airdrop/keeper/query.go index 1563d927cd..02c4c21a2c 100644 --- a/x/airdrop/keeper/query.go +++ b/x/airdrop/keeper/query.go @@ -27,7 +27,30 @@ func (k Keeper) Airdrop(goCtx context.Context, req *types.QueryAirdropRequest) ( return nil, status.Errorf(codes.NotFound, "airdrop %s not found", req.Id) } - return &types.QueryAirdropResponse{Airdrop: &airdrop}, nil + periodLengthSeconds := k.GetParams(ctx).PeriodLengthSeconds + currentDateIndex, err := airdrop.GetCurrentDateIndex(ctx, periodLengthSeconds) + if err == types.ErrAirdropNotStarted || err == types.ErrAirdropEnded { + currentDateIndex = -1 + } else if err != nil { + return nil, status.Errorf(codes.FailedPrecondition, err.Error()) + } + + airdropResponse := types.QueryAirdropResponse{ + Id: airdrop.Id, + RewardDenom: airdrop.RewardDenom, + DistributionStartDate: airdrop.DistributionStartDate, + DistributionEndDate: airdrop.DistributionEndDate, + ClawbackDate: airdrop.ClawbackDate, + ClaimTypeDeadlineDate: airdrop.ClaimTypeDeadlineDate, + EarlyClaimPenalty: airdrop.EarlyClaimPenalty, + DistributorAddress: airdrop.DistributorAddress, + AllocatorAddress: airdrop.AllocatorAddress, + LinkerAddress: airdrop.LinkerAddress, + CurrentDateIndex: int64(currentDateIndex), + AirdropLength: airdrop.GetAirdropPeriods(periodLengthSeconds), + } + + return &airdropResponse, nil } // Queries all airdrop configurations @@ -117,13 +140,13 @@ func (k Keeper) UserSummary(goCtx context.Context, req *types.QueryUserSummaryRe } // If the airdrop hasn't started yet or has ended, return date index -1 and claimable 0 - claimable := sdkmath.ZeroInt() + var claimable sdkmath.Int periodLengthSeconds := k.GetParams(ctx).PeriodLengthSeconds currentDateIndex, err := airdrop.GetCurrentDateIndex(ctx, periodLengthSeconds) if err == nil { claimable = allocation.GetClaimableAllocation(currentDateIndex) } else if err == types.ErrAirdropNotStarted || err == types.ErrAirdropEnded { - currentDateIndex = -1 + claimable = sdkmath.ZeroInt() } else { return nil, status.Errorf(codes.FailedPrecondition, err.Error()) } @@ -134,12 +157,11 @@ func (k Keeper) UserSummary(goCtx context.Context, req *types.QueryUserSummaryRe } summary := &types.QueryUserSummaryResponse{ - ClaimType: claimType.String(), - Claimed: allocation.Claimed, - Claimable: claimable, - Forfeited: allocation.Forfeited, - Remaining: allocation.GetRemainingAllocations(), - CurrentDateIndex: int64(currentDateIndex), + ClaimType: claimType.String(), + Claimed: allocation.Claimed, + Claimable: claimable, + Forfeited: allocation.Forfeited, + Remaining: allocation.GetRemainingAllocations(), } return summary, nil diff --git a/x/airdrop/keeper/query_test.go b/x/airdrop/keeper/query_test.go index 3c06caa31d..005aa90c8f 100644 --- a/x/airdrop/keeper/query_test.go +++ b/x/airdrop/keeper/query_test.go @@ -16,12 +16,66 @@ func (s *KeeperTestSuite) TestQueryAirdrop() { airdrops := s.addAirdrops() expectedAirdrop := airdrops[1] + // Update the date boundaries + startTime := time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC) + endTime := time.Date(2024, 1, 10, 0, 0, 0, 0, time.UTC) // 10 days later + clawbackDate := time.Date(2024, 1, 20, 0, 0, 0, 0, time.UTC) // 10 more days later + + expectedAirdropLength := int64(10) + expectedAirdrop.DistributionStartDate = &startTime + expectedAirdrop.DistributionEndDate = &endTime + expectedAirdrop.ClawbackDate = &clawbackDate + s.App.AirdropKeeper.SetAirdrop(s.Ctx, expectedAirdrop) + + // Set the block time so that we're on the third day + blockTime := time.Date(2024, 1, 3, 0, 0, 0, 0, time.UTC) + expectedDateIndex := int64(2) // third day is index 2 + s.Ctx = s.Ctx.WithBlockTime(blockTime) + + // Query for the airdrop req := &types.QueryAirdropRequest{ Id: expectedAirdrop.Id, } - resp, err := s.App.AirdropKeeper.Airdrop(sdk.WrapSDKContext(s.Ctx), req) + respAirdrop, err := s.App.AirdropKeeper.Airdrop(sdk.WrapSDKContext(s.Ctx), req) s.Require().NoError(err, "no error expected when querying an airdrop") - s.Require().Equal(expectedAirdrop, *resp.Airdrop, "airdrop") + + // Confirm all the airdrop fields + s.Require().Equal(expectedAirdrop.Id, respAirdrop.Id, "airdrop id") + s.Require().Equal(expectedAirdrop.RewardDenom, respAirdrop.RewardDenom, "airdrop reward denom") + + s.Require().Equal(expectedAirdrop.DistributionStartDate, respAirdrop.DistributionStartDate, "airdrop start") + s.Require().Equal(expectedAirdrop.DistributionEndDate, respAirdrop.DistributionEndDate, "airdrop end") + s.Require().Equal(expectedAirdrop.ClawbackDate, respAirdrop.ClawbackDate, "airdrop clawback") + s.Require().Equal(expectedAirdrop.ClaimTypeDeadlineDate, respAirdrop.ClaimTypeDeadlineDate, "airdrop deadline") + + s.Require().Equal(expectedAirdrop.EarlyClaimPenalty, respAirdrop.EarlyClaimPenalty, "airdrop penalty") + s.Require().Equal(expectedAirdrop.DistributorAddress, respAirdrop.DistributorAddress, "airdrop distributor") + s.Require().Equal(expectedAirdrop.AllocatorAddress, respAirdrop.AllocatorAddress, "airdrop allocator") + s.Require().Equal(expectedAirdrop.LinkerAddress, respAirdrop.LinkerAddress, "airdrop linker") + + s.Require().Equal(expectedDateIndex, respAirdrop.CurrentDateIndex, "airdrop date index") + s.Require().Equal(expectedAirdropLength, respAirdrop.AirdropLength, "airdrop length") + + // Update the block time so the airdrop hasn't started yet + // Confirm the current date index is -1 + s.Ctx = s.Ctx.WithBlockTime(startTime.Add(-1 * time.Hour)) + respAirdrop, err = s.App.AirdropKeeper.Airdrop(sdk.WrapSDKContext(s.Ctx), req) + s.Require().NoError(err, "no error expected when querying an airdrop before it has started") + s.Require().Equal(int64(-1), respAirdrop.CurrentDateIndex, "date index before airdrop") + + // Update the block time so the airdrop distribution has ended, but the clawback data hasn't hit + // Confirm the current date index is 9 (last index of the 10 day array) + s.Ctx = s.Ctx.WithBlockTime(clawbackDate.Add(-1 * time.Hour)) + respAirdrop, err = s.App.AirdropKeeper.Airdrop(sdk.WrapSDKContext(s.Ctx), req) + s.Require().NoError(err, "no error expected when querying an airdrop after distribution ended") + s.Require().Equal(int64(9), respAirdrop.CurrentDateIndex, "date index after distribution") + + // Update the block time so the clawback date has passed + // Confirm the current date index is -1 + s.Ctx = s.Ctx.WithBlockTime(clawbackDate.Add(time.Hour)) + respAirdrop, err = s.App.AirdropKeeper.Airdrop(sdk.WrapSDKContext(s.Ctx), req) + s.Require().NoError(err, "no error expected when querying an airdrop after the clawback date") + s.Require().Equal(int64(-1), respAirdrop.CurrentDateIndex, "date index after clawback") } func (s *KeeperTestSuite) TestQueryAllAirdrops() { @@ -127,7 +181,6 @@ func (s *KeeperTestSuite) TestQueryUserSummary() { forfeited := sdkmath.ZeroInt() remaining := sdkmath.NewInt(1 + 5 + 3) claimable := sdkmath.NewInt(1 + 5) - dateIndex := int64(2) userAllocation := types.UserAllocation{ AirdropId: AirdropId, @@ -163,7 +216,6 @@ func (s *KeeperTestSuite) TestQueryUserSummary() { s.Require().Equal(remaining, resp.Remaining, "amount remaining") s.Require().Equal(claimable, resp.Claimable, "amount claimable") s.Require().Equal(types.CLAIM_DAILY.String(), resp.ClaimType, "claim type") - s.Require().Equal(dateIndex, resp.CurrentDateIndex, "todays index") // Update the user so that it appears they claimed early and confirm the type change userAllocation.Forfeited = sdkmath.OneInt() @@ -174,30 +226,19 @@ func (s *KeeperTestSuite) TestQueryUserSummary() { s.Require().Equal(types.CLAIM_EARLY.String(), resp.ClaimType, "claim type") // Update the block time so it appears as if the airdrop has not started - // Then check that the date index is -1 and claimable is 0 - s.Ctx = s.Ctx.WithBlockTime(DistributionStartDate.Add(-1 * time.Hour)) - - resp, err = s.App.AirdropKeeper.UserSummary(sdk.WrapSDKContext(s.Ctx), req) - s.Require().NoError(err, "no error expected when querying user summary before airdrop") - s.Require().Equal(int64(-1), resp.CurrentDateIndex, "date index") - s.Require().Equal(remaining, resp.Remaining, "date index") - s.Require().Equal(int64(0), resp.Claimable.Int64(), "date index") - - // Update the block time so it appears as if the airdrop has not started - // Then check that the date index is -1 and claimable is 0 + // Then check that claimable is 0 s.Ctx = s.Ctx.WithBlockTime(DistributionStartDate.Add(-1 * time.Hour)) resp, err = s.App.AirdropKeeper.UserSummary(sdk.WrapSDKContext(s.Ctx), req) s.Require().NoError(err, "no error expected when querying user summary before airdrop") - s.Require().Equal(int64(-1), resp.CurrentDateIndex, "date index") - s.Require().Equal(int64(0), resp.Claimable.Int64(), "date index") + s.Require().Equal(remaining, resp.Remaining, "remaining") + s.Require().Equal(int64(0), resp.Claimable.Int64(), "claimable before airdrop") // Update the block time so it appears as if the airdrop has ended - // Then check that the date index is -1 and claimable is 0 + // Then check that claimable is 0 s.Ctx = s.Ctx.WithBlockTime(ClawbackDate.Add(time.Hour)) resp, err = s.App.AirdropKeeper.UserSummary(sdk.WrapSDKContext(s.Ctx), req) - s.Require().NoError(err, "no error expected when querying user summary before airdrop") - s.Require().Equal(int64(-1), resp.CurrentDateIndex, "date index") - s.Require().Equal(int64(0), resp.Claimable.Int64(), "date index") + s.Require().NoError(err, "no error expected when querying user summary after airdrop") + s.Require().Equal(int64(0), resp.Claimable.Int64(), "claimable after airdrop") } diff --git a/x/airdrop/types/airdrop.go b/x/airdrop/types/airdrop.go index c673ba6cbf..840ede34b3 100644 --- a/x/airdrop/types/airdrop.go +++ b/x/airdrop/types/airdrop.go @@ -7,8 +7,8 @@ import ( ) // Returns the date index in the allocations array using the current block time -// windowLengthSeconds is the time between each element in the allocations array -func (a *Airdrop) GetCurrentDateIndex(ctx sdk.Context, windowLengthSeconds int64) (dateIndex int, err error) { +// periodLengthSeconds is the time between each element in the allocations array +func (a *Airdrop) GetCurrentDateIndex(ctx sdk.Context, periodLengthSeconds int64) (dateIndex int, err error) { if a.DistributionStartDate == nil { return 0, errors.New("distribution start date not set") } @@ -25,20 +25,20 @@ func (a *Airdrop) GetCurrentDateIndex(ctx sdk.Context, windowLengthSeconds int64 } elapsedTimeSeconds := blockTime - startTime - elapsedDays := elapsedTimeSeconds / windowLengthSeconds + elapsedDays := elapsedTimeSeconds / periodLengthSeconds // Cap the airdrop index at the last day - if elapsedDays >= a.GetAirdropPeriods(windowLengthSeconds) { - elapsedDays = a.GetAirdropPeriods(windowLengthSeconds) - 1 + if elapsedDays >= a.GetAirdropPeriods(periodLengthSeconds) { + elapsedDays = a.GetAirdropPeriods(periodLengthSeconds) - 1 } return int(elapsedDays), nil } // Returns number of periods in the airdrop -// windowLengthSeconds is the time between each element in the allocations array -func (a *Airdrop) GetAirdropPeriods(windowLengthSeconds int64) int64 { +// periodLengthSeconds is the time between each element in the allocations array +func (a *Airdrop) GetAirdropPeriods(periodLengthSeconds int64) int64 { airdropLengthSeconds := int64(a.DistributionEndDate.Unix() - a.DistributionStartDate.Unix()) - numberOfDays := (airdropLengthSeconds / (windowLengthSeconds)) + 1 + numberOfDays := (airdropLengthSeconds / (periodLengthSeconds)) + 1 return numberOfDays } diff --git a/x/airdrop/types/query.pb.go b/x/airdrop/types/query.pb.go index dfc6ca3286..69da18c045 100644 --- a/x/airdrop/types/query.pb.go +++ b/x/airdrop/types/query.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -12,6 +13,8 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + _ "github.com/cosmos/gogoproto/types" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -19,12 +22,14 @@ import ( io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -78,7 +83,34 @@ func (m *QueryAirdropRequest) GetId() string { } type QueryAirdropResponse struct { - Airdrop *Airdrop `protobuf:"bytes,1,opt,name=airdrop,proto3" json:"airdrop,omitempty"` + // Airdrop ID + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Denom used when distributing rewards + RewardDenom string `protobuf:"bytes,2,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` + // The first date that claiming begins and rewards are distributed + DistributionStartDate *time.Time `protobuf:"bytes,3,opt,name=distribution_start_date,json=distributionStartDate,proto3,stdtime" json:"distribution_start_date,omitempty"` + // The last date for rewards to be distributed. Immediately after this date + // the rewards can no longer be claimed, but rewards have not been clawed back + // yet + DistributionEndDate *time.Time `protobuf:"bytes,4,opt,name=distribution_end_date,json=distributionEndDate,proto3,stdtime" json:"distribution_end_date,omitempty"` + // Date with which the rewards are clawed back (occurs after the distribution + // end date) + ClawbackDate *time.Time `protobuf:"bytes,5,opt,name=clawback_date,json=clawbackDate,proto3,stdtime" json:"clawback_date,omitempty"` + // Deadline for the user to make a decision on their claim type + ClaimTypeDeadlineDate *time.Time `protobuf:"bytes,6,opt,name=claim_type_deadline_date,json=claimTypeDeadlineDate,proto3,stdtime" json:"claim_type_deadline_date,omitempty"` + // Penalty for claiming rewards early - e.g. 0.5 means claiming early will + // result in losing 50% of rewards + EarlyClaimPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=early_claim_penalty,json=earlyClaimPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"early_claim_penalty"` + // Account that holds the total reward balance and distributes to users + DistributorAddress string `protobuf:"bytes,8,opt,name=distributor_address,json=distributorAddress,proto3" json:"distributor_address,omitempty"` + // Admin account with permissions to add or update allocations + AllocatorAddress string `protobuf:"bytes,9,opt,name=allocator_address,json=allocatorAddress,proto3" json:"allocator_address,omitempty"` + // Admin account with permissions to link addresseses + LinkerAddress string `protobuf:"bytes,10,opt,name=linker_address,json=linkerAddress,proto3" json:"linker_address,omitempty"` + // The current date index into the airdrop array + CurrentDateIndex int64 `protobuf:"varint,11,opt,name=current_date_index,json=currentDateIndex,proto3" json:"current_date_index,omitempty"` + // The length of the airdrop (i.e. number of periods in the airdrop array) + AirdropLength int64 `protobuf:"varint,12,opt,name=airdrop_length,json=airdropLength,proto3" json:"airdrop_length,omitempty"` } func (m *QueryAirdropResponse) Reset() { *m = QueryAirdropResponse{} } @@ -114,13 +146,83 @@ func (m *QueryAirdropResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAirdropResponse proto.InternalMessageInfo -func (m *QueryAirdropResponse) GetAirdrop() *Airdrop { +func (m *QueryAirdropResponse) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *QueryAirdropResponse) GetRewardDenom() string { + if m != nil { + return m.RewardDenom + } + return "" +} + +func (m *QueryAirdropResponse) GetDistributionStartDate() *time.Time { + if m != nil { + return m.DistributionStartDate + } + return nil +} + +func (m *QueryAirdropResponse) GetDistributionEndDate() *time.Time { + if m != nil { + return m.DistributionEndDate + } + return nil +} + +func (m *QueryAirdropResponse) GetClawbackDate() *time.Time { if m != nil { - return m.Airdrop + return m.ClawbackDate } return nil } +func (m *QueryAirdropResponse) GetClaimTypeDeadlineDate() *time.Time { + if m != nil { + return m.ClaimTypeDeadlineDate + } + return nil +} + +func (m *QueryAirdropResponse) GetDistributorAddress() string { + if m != nil { + return m.DistributorAddress + } + return "" +} + +func (m *QueryAirdropResponse) GetAllocatorAddress() string { + if m != nil { + return m.AllocatorAddress + } + return "" +} + +func (m *QueryAirdropResponse) GetLinkerAddress() string { + if m != nil { + return m.LinkerAddress + } + return "" +} + +func (m *QueryAirdropResponse) GetCurrentDateIndex() int64 { + if m != nil { + return m.CurrentDateIndex + } + return 0 +} + +func (m *QueryAirdropResponse) GetAirdropLength() int64 { + if m != nil { + return m.AirdropLength + } + return 0 +} + // Airdrops type QueryAllAirdropsRequest struct { } @@ -557,8 +659,6 @@ type QueryUserSummaryResponse struct { Remaining github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=remaining,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"remaining"` // The total rewards that can be claimed right now Claimable github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=claimable,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"claimable"` - // The current date index into the airdrop array - CurrentDateIndex int64 `protobuf:"varint,6,opt,name=current_date_index,json=currentDateIndex,proto3" json:"current_date_index,omitempty"` } func (m *QueryUserSummaryResponse) Reset() { *m = QueryUserSummaryResponse{} } @@ -601,13 +701,6 @@ func (m *QueryUserSummaryResponse) GetClaimType() string { return "" } -func (m *QueryUserSummaryResponse) GetCurrentDateIndex() int64 { - if m != nil { - return m.CurrentDateIndex - } - return 0 -} - func init() { proto.RegisterType((*QueryAirdropRequest)(nil), "stride.airdrop.QueryAirdropRequest") proto.RegisterType((*QueryAirdropResponse)(nil), "stride.airdrop.QueryAirdropResponse") @@ -626,63 +719,80 @@ func init() { func init() { proto.RegisterFile("stride/airdrop/query.proto", fileDescriptor_28cd033986bfea74) } var fileDescriptor_28cd033986bfea74 = []byte{ - // 887 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xce, 0x24, 0xbb, 0x1b, 0x3a, 0x91, 0xd2, 0xd5, 0x50, 0x69, 0xbd, 0xa1, 0x9b, 0xad, 0xcc, - 0xd2, 0x8d, 0x4a, 0x6b, 0x93, 0x54, 0x42, 0x85, 0x03, 0x90, 0xa8, 0x6a, 0x09, 0x54, 0x82, 0xa6, - 0xf4, 0xc2, 0x25, 0x9a, 0xc4, 0x53, 0x63, 0xe1, 0x78, 0x52, 0x8f, 0x53, 0x35, 0xaa, 0x7a, 0x01, - 0x89, 0x23, 0x42, 0xe2, 0xc8, 0x5f, 0x80, 0x40, 0x9c, 0xe0, 0x7f, 0xe8, 0xb1, 0x82, 0x0b, 0xe2, - 0x50, 0xa1, 0x94, 0x3f, 0x04, 0x79, 0xfc, 0x9c, 0xc4, 0x8e, 0xf3, 0x83, 0x48, 0x9c, 0x62, 0xcf, - 0xfb, 0xe6, 0xfb, 0xbe, 0xf7, 0x66, 0xde, 0x73, 0x70, 0x41, 0x78, 0xae, 0x65, 0x30, 0x9d, 0x5a, - 0xae, 0xe1, 0xf2, 0xae, 0x7e, 0xde, 0x63, 0x6e, 0x5f, 0xeb, 0xba, 0xdc, 0xe3, 0x24, 0x1f, 0xc4, - 0x34, 0x88, 0x15, 0xd6, 0x63, 0x58, 0xf8, 0x0d, 0xd0, 0x85, 0x35, 0x93, 0x9b, 0x5c, 0x3e, 0xea, - 0xfe, 0x13, 0xac, 0xae, 0x9b, 0x9c, 0x9b, 0x36, 0xd3, 0x69, 0xd7, 0xd2, 0xa9, 0xe3, 0x70, 0x8f, - 0x7a, 0x16, 0x77, 0x04, 0x44, 0xb7, 0xda, 0x5c, 0x74, 0xb8, 0xd0, 0x5b, 0x54, 0xb0, 0x40, 0x5a, - 0xbf, 0x28, 0xb7, 0x98, 0x47, 0xcb,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0x8d, 0x7a, 0xf6, 0x5a, 0xbf, 0x82, 0xc6, 0xbb, - 0x26, 0x3f, 0x23, 0xbc, 0x1a, 0x9b, 0xc5, 0x64, 0x11, 0x33, 0xc3, 0x82, 0x6e, 0x2f, 0x06, 0x06, - 0xeb, 0xef, 0x49, 0xeb, 0x7b, 0xe4, 0xed, 0xff, 0x60, 0x5d, 0x8c, 0xd9, 0xfd, 0x09, 0xe1, 0x7c, - 0x74, 0x84, 0x4e, 0x29, 0x73, 0xe2, 0xb4, 0x9f, 0x52, 0xe6, 0xe4, 0x99, 0xac, 0x7e, 0x20, 0xbd, - 0xbe, 0x4b, 0xf6, 0x66, 0x5e, 0x00, 0xdb, 0x8e, 0x59, 0x1d, 0x95, 0x99, 0xfc, 0x88, 0x70, 0x6e, - 0x6c, 0xa2, 0x4d, 0xb9, 0xa5, 0x93, 0x23, 0x76, 0xca, 0x2d, 0x4d, 0x18, 0x8e, 0xea, 0xa1, 0x34, - 0x59, 0x25, 0xef, 0xcf, 0x2d, 0xa8, 0x08, 0x76, 0x4e, 0xb9, 0x08, 0xb5, 0x8f, 0x6f, 0x06, 0x45, - 0x74, 0x3b, 0x28, 0xa2, 0xbf, 0x07, 0x45, 0xf4, 0xdd, 0x7d, 0x31, 0x75, 0x7b, 0x5f, 0x4c, 0xfd, - 0x79, 0x5f, 0x4c, 0x7d, 0x5e, 0x1e, 0x9b, 0x2f, 0x09, 0x22, 0x17, 0x95, 0x5d, 0xfd, 0x72, 0x28, - 0x25, 0xc7, 0x4d, 0xeb, 0x91, 0xfc, 0xf3, 0xb7, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, - 0xe1, 0x6a, 0xda, 0xc3, 0x0a, 0x00, 0x00, + // 1154 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x4f, 0x1b, 0x47, + 0x14, 0x66, 0x0d, 0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06, 0x5e, 0x9e, 0x14, 0x06, 0xfe, 0x3c, 0x29, 0x0c, 0x7c, 0xb5, + 0x92, 0x50, 0x8c, 0x94, 0x24, 0x4f, 0x4a, 0x77, 0xac, 0x67, 0xad, 0x54, 0x52, 0x40, 0x2a, 0xc3, + 0xf2, 0x1b, 0xf8, 0xce, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x65, 0x19, 0x23, 0x4f, 0x86, 0x0d, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1009,15 +1119,98 @@ func (m *QueryAirdropResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Airdrop != nil { - { - size, err := m.Airdrop.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.AirdropLength != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AirdropLength)) + i-- + dAtA[i] = 0x60 + } + if m.CurrentDateIndex != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CurrentDateIndex)) + i-- + dAtA[i] = 0x58 + } + if len(m.LinkerAddress) > 0 { + i -= len(m.LinkerAddress) + copy(dAtA[i:], m.LinkerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.LinkerAddress))) + i-- + dAtA[i] = 0x52 + } + if len(m.AllocatorAddress) > 0 { + i -= len(m.AllocatorAddress) + copy(dAtA[i:], m.AllocatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AllocatorAddress))) + i-- + dAtA[i] = 0x4a + } + if len(m.DistributorAddress) > 0 { + i -= len(m.DistributorAddress) + copy(dAtA[i:], m.DistributorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DistributorAddress))) + i-- + dAtA[i] = 0x42 + } + { + size := m.EarlyClaimPenalty.Size() + i -= size + if _, err := m.EarlyClaimPenalty.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if m.ClaimTypeDeadlineDate != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ClaimTypeDeadlineDate, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ClaimTypeDeadlineDate):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + } + if m.ClawbackDate != nil { + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ClawbackDate, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ClawbackDate):]) + if err2 != nil { + return 0, err2 } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + } + if m.DistributionEndDate != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.DistributionEndDate, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DistributionEndDate):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintQuery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x22 + } + if m.DistributionStartDate != nil { + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.DistributionStartDate, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DistributionStartDate):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x1a + } + if len(m.RewardDenom) > 0 { + i -= len(m.RewardDenom) + copy(dAtA[i:], m.RewardDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RewardDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -1371,11 +1564,6 @@ func (m *QueryUserSummaryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - if m.CurrentDateIndex != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CurrentDateIndex)) - i-- - dAtA[i] = 0x30 - } { size := m.Claimable.Size() i -= size @@ -1456,10 +1644,50 @@ func (m *QueryAirdropResponse) Size() (n int) { } var l int _ = l - if m.Airdrop != nil { - l = m.Airdrop.Size() + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.RewardDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.DistributionStartDate != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DistributionStartDate) n += 1 + l + sovQuery(uint64(l)) } + if m.DistributionEndDate != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DistributionEndDate) + n += 1 + l + sovQuery(uint64(l)) + } + if m.ClawbackDate != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ClawbackDate) + n += 1 + l + sovQuery(uint64(l)) + } + if m.ClaimTypeDeadlineDate != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ClaimTypeDeadlineDate) + n += 1 + l + sovQuery(uint64(l)) + } + l = m.EarlyClaimPenalty.Size() + n += 1 + l + sovQuery(uint64(l)) + l = len(m.DistributorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AllocatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.LinkerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.CurrentDateIndex != 0 { + n += 1 + sovQuery(uint64(m.CurrentDateIndex)) + } + if m.AirdropLength != 0 { + n += 1 + sovQuery(uint64(m.AirdropLength)) + } return n } @@ -1616,9 +1844,6 @@ func (m *QueryUserSummaryResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.Claimable.Size() n += 1 + l + sovQuery(uint64(l)) - if m.CurrentDateIndex != 0 { - n += 1 + sovQuery(uint64(m.CurrentDateIndex)) - } return n } @@ -1741,7 +1966,107 @@ func (m *QueryAirdropResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Airdrop", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionStartDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DistributionStartDate == nil { + m.DistributionStartDate = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.DistributionStartDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionEndDate", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1768,13 +2093,253 @@ func (m *QueryAirdropResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Airdrop == nil { - m.Airdrop = &Airdrop{} + if m.DistributionEndDate == nil { + m.DistributionEndDate = new(time.Time) } - if err := m.Airdrop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.DistributionEndDate, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClawbackDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClawbackDate == nil { + m.ClawbackDate = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.ClawbackDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimTypeDeadlineDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimTypeDeadlineDate == nil { + m.ClaimTypeDeadlineDate = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.ClaimTypeDeadlineDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EarlyClaimPenalty", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.EarlyClaimPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DistributorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllocatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllocatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LinkerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LinkerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentDateIndex", wireType) + } + m.CurrentDateIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentDateIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AirdropLength", wireType) + } + m.AirdropLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AirdropLength |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2845,25 +3410,6 @@ func (m *QueryUserSummaryResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentDateIndex", wireType) - } - m.CurrentDateIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentDateIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:])