diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 342e1480d202..94496bbdda8b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -575,20 +575,25 @@ - [Query](#cosmos.upgrade.v1beta1.Query) -- [cosmos/vesting/v1beta1/tx.proto](#cosmos/vesting/v1beta1/tx.proto) - - [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) - - [MsgCreateVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) - - - [Msg](#cosmos.vesting.v1beta1.Msg) - - [cosmos/vesting/v1beta1/vesting.proto](#cosmos/vesting/v1beta1/vesting.proto) - [BaseVestingAccount](#cosmos.vesting.v1beta1.BaseVestingAccount) + - [ClawbackVestingAccount](#cosmos.vesting.v1beta1.ClawbackVestingAccount) - [ContinuousVestingAccount](#cosmos.vesting.v1beta1.ContinuousVestingAccount) - [DelayedVestingAccount](#cosmos.vesting.v1beta1.DelayedVestingAccount) - [Period](#cosmos.vesting.v1beta1.Period) - [PeriodicVestingAccount](#cosmos.vesting.v1beta1.PeriodicVestingAccount) - [PermanentLockedAccount](#cosmos.vesting.v1beta1.PermanentLockedAccount) +- [cosmos/vesting/v1beta1/tx.proto](#cosmos/vesting/v1beta1/tx.proto) + - [MsgClawback](#cosmos.vesting.v1beta1.MsgClawback) + - [MsgClawbackResponse](#cosmos.vesting.v1beta1.MsgClawbackResponse) + - [MsgCreateClawbackVestingAccount](#cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount) + - [MsgCreateClawbackVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse) + - [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) + - [MsgCreateVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) + + - [Msg](#cosmos.vesting.v1beta1.Msg) + - [Scalar Value Types](#scalar-value-types) @@ -8182,83 +8187,49 @@ Since: cosmos-sdk 0.43 | GET|/cosmos/upgrade/v1beta1/module_versions| - +

Top

-## cosmos/vesting/v1beta1/tx.proto +## cosmos/vesting/v1beta1/vesting.proto - + -### MsgCreateVestingAccount -MsgCreateVestingAccount defines a message that enables creating a vesting -account. +### BaseVestingAccount +BaseVestingAccount implements the VestingAccount interface. It contains all +the necessary fields needed for any vesting account implementation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `from_address` | [string](#string) | | | -| `to_address` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `original_vesting` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `delegated_free` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `delegated_vesting` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | | `end_time` | [int64](#int64) | | | -| `delayed` | [bool](#bool) | | | - - - - - - - - -### MsgCreateVestingAccountResponse -MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. - - - - - - - - - - -### Msg -Msg defines the bank Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `CreateVestingAccount` | [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) | [MsgCreateVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) | CreateVestingAccount defines a method that enables creating a vesting account. | | - - + - -

Top

- -## cosmos/vesting/v1beta1/vesting.proto - - - - - -### BaseVestingAccount -BaseVestingAccount implements the VestingAccount interface. It contains all -the necessary fields needed for any vesting account implementation. +### ClawbackVestingAccount +ClawbackVestingAccount implements the VestingAccount interface. It provides +an account that can hold contributions subject to "lockup" (like a +PeriodicVestingAccount), or vesting which is subject to clawback +of unvested tokens, or a combination (tokens vest, but are still locked). | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `original_vesting` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `delegated_free` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `delegated_vesting` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `end_time` | [int64](#int64) | | | +| `base_vesting_account` | [BaseVestingAccount](#cosmos.vesting.v1beta1.BaseVestingAccount) | | | +| `funder_address` | [string](#string) | | funder_address specifies the account which can perform clawback. | +| `start_time` | [int64](#int64) | | | +| `lockup_periods` | [Period](#cosmos.vesting.v1beta1.Period) | repeated | unlocking schedule relative to the BaseVestingAccount start_time. | +| `vesting_periods` | [Period](#cosmos.vesting.v1beta1.Period) | repeated | vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. | @@ -8361,6 +8332,123 @@ Since: cosmos-sdk 0.43 + +

Top

+ +## cosmos/vesting/v1beta1/tx.proto + + + + + +### MsgClawback +MsgClawback defines a message that removes unvested tokens from a +ClawbackVestingAccount. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `funder_address` | [string](#string) | | funder_address is the address which funded the account | +| `address` | [string](#string) | | address is the address of the ClawbackVestingAccount to claw back from. | +| `dest_address` | [string](#string) | | dest_address specifies where the clawed-back tokens should be transferred to. If empty, the tokens will be transferred back to the original funder of the account. | + + + + + + + + +### MsgClawbackResponse +MsgClawbackResponse defines the MsgClawback response type. + + + + + + + + +### MsgCreateClawbackVestingAccount +MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `from_address` | [string](#string) | | from_address specifies the account to provide the funds and sign the clawback request | +| `to_address` | [string](#string) | | to_address specifies the account to receive the funds | +| `start_time` | [int64](#int64) | | start_time defines the time at which the vesting period begins | +| `lockup_periods` | [Period](#cosmos.vesting.v1beta1.Period) | repeated | lockup_periods defines the unlocking schedule relative to the start_time | +| `vesting_periods` | [Period](#cosmos.vesting.v1beta1.Period) | repeated | vesting_periods defines the vesting schedule relative to the start_time | +| `merge` | [bool](#bool) | | merge specifies a creation mechanism for existing ClawbackVestingAccounts. If true, merge this new grant into an existing ClawbackVestingAccount, or create it if it does not exist. If false, creates a new account. New grants to an existing account must be from the same from_address. | + + + + + + + + +### MsgCreateClawbackVestingAccountResponse +MsgCreateClawbackVestingAccountResponse defines the +MsgCreateClawbackVestingAccount response type. + + + + + + + + +### MsgCreateVestingAccount +MsgCreateVestingAccount defines a message that enables creating a vesting +account. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `from_address` | [string](#string) | | | +| `to_address` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `end_time` | [int64](#int64) | | | +| `delayed` | [bool](#bool) | | | + + + + + + + + +### MsgCreateVestingAccountResponse +MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. + + + + + + + + + + + + + + +### Msg +Msg defines the bank Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CreateVestingAccount` | [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) | [MsgCreateVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse) | CreateVestingAccount defines a method that enables creating a vesting account. | | +| `CreateClawbackVestingAccount` | [MsgCreateClawbackVestingAccount](#cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount) | [MsgCreateClawbackVestingAccountResponse](#cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse) | CreateClawbackVestingAccount creats a vesting account that is subject to clawback and the configuration of vesting and lockup schedules. | | +| `Clawback` | [MsgClawback](#cosmos.vesting.v1beta1.MsgClawback) | [MsgClawbackResponse](#cosmos.vesting.v1beta1.MsgClawbackResponse) | Clawback removes the unvested tokens from a ClawbackVestingAccount. | | + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index c49be802a76e..78f15582d2ce 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -3,6 +3,8 @@ package cosmos.vesting.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/vesting/v1beta1/vesting.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; @@ -11,6 +13,11 @@ service Msg { // CreateVestingAccount defines a method that enables creating a vesting // account. rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + rpc CreateClawbackVestingAccount(MsgCreateClawbackVestingAccount) returns (MsgCreateClawbackVestingAccountResponse); + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + rpc Clawback(MsgClawback) returns (MsgClawbackResponse); } // MsgCreateVestingAccount defines a message that enables creating a vesting @@ -28,4 +35,47 @@ message MsgCreateVestingAccount { } // MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -message MsgCreateVestingAccountResponse {} \ No newline at end of file +message MsgCreateVestingAccountResponse {} + +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +message MsgCreateClawbackVestingAccount { + option (gogoproto.equal) = false; + + // from_address specifies the account to provide the funds and sign the + // clawback request + string from_address = 1; + // to_address specifies the account to receive the funds + string to_address = 2; + // start_time defines the time at which the vesting period begins + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // lockup_periods defines the unlocking schedule relative to the start_time + repeated cosmos.vesting.v1beta1.Period lockup_periods = 4 [(gogoproto.nullable) = false]; + // vesting_periods defines the vesting schedule relative to the start_time + repeated cosmos.vesting.v1beta1.Period vesting_periods = 5 [(gogoproto.nullable) = false]; + // merge specifies a creation mechanism for existing + // ClawbackVestingAccounts. If true, merge this new grant into an existing + // ClawbackVestingAccount, or create it if it does not exist. If false, + // creates a new account. New grants to an existing account must be from the + // same from_address. + bool merge = 6; +} + +// MsgCreateClawbackVestingAccountResponse defines the +// MsgCreateClawbackVestingAccount response type. +message MsgCreateClawbackVestingAccountResponse {} + +// MsgClawback defines a message that removes unvested tokens from a +// ClawbackVestingAccount. +message MsgClawback { + // funder_address is the address which funded the account + string funder_address = 1; + // address is the address of the ClawbackVestingAccount to claw back from. + string address = 2; + // dest_address specifies where the clawed-back tokens should be transferred + // to. If empty, the tokens will be transferred back to the original funder of + // the account. + string dest_address = 3; +} + +// MsgClawbackResponse defines the MsgClawback response type. +message MsgClawbackResponse {} diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index e9f661f93c71..bf5efdcf47a7 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.vesting.v1beta1; import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/auth/v1beta1/auth.proto"; @@ -83,3 +84,22 @@ message PermanentLockedAccount { BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; } + +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +message ClawbackVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + + // funder_address specifies the account which can perform clawback. + string funder_address = 2 [(gogoproto.moretags) = "yaml:\"funder_address\""]; + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // unlocking schedule relative to the BaseVestingAccount start_time. + repeated Period lockup_periods = 4 [(gogoproto.moretags) = "yaml:\"lockup_periods\"", (gogoproto.nullable) = false]; + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + repeated Period vesting_periods = 5 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; +} diff --git a/x/auth/vesting/handler.go b/x/auth/vesting/handler.go index 1d32e9969bb5..ada0435761c0 100644 --- a/x/auth/vesting/handler.go +++ b/x/auth/vesting/handler.go @@ -18,6 +18,12 @@ func NewHandler(ak keeper.AccountKeeper, bk types.BankKeeper) sdk.Handler { case *types.MsgCreateVestingAccount: res, err := msgServer.CreateVestingAccount(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgCreateClawbackVestingAccount: + res, err := msgServer.CreateClawbackVestingAccount(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgClawback: + res, err := msgServer.Clawback(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go index 795fc2c60581..2b1c46dc8e9a 100644 --- a/x/auth/vesting/msg_server.go +++ b/x/auth/vesting/msg_server.go @@ -98,3 +98,11 @@ func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCre return &types.MsgCreateVestingAccountResponse{}, nil } + +func (s msgServer) CreateClawbackVestingAccount(goCtx context.Context, msg *types.MsgCreateClawbackVestingAccount) (*types.MsgCreateClawbackVestingAccountResponse, error) { + return &types.MsgCreateClawbackVestingAccountResponse{}, nil +} + +func (s msgServer) Clawback(goCtx context.Context, msg *types.MsgClawback) (*types.MsgClawbackResponse, error) { + return &types.MsgClawbackResponse{}, nil +} diff --git a/x/auth/vesting/types/msgs.go b/x/auth/vesting/types/msgs.go index 3308e0304881..82b038d600ca 100644 --- a/x/auth/vesting/types/msgs.go +++ b/x/auth/vesting/types/msgs.go @@ -5,10 +5,15 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +// Vetsing message types and routes // TypeMsgCreateVestingAccount defines the type value for a MsgCreateVestingAccount. -const TypeMsgCreateVestingAccount = "msg_create_vesting_account" +const ( + TypeMsgCreateVestingAccount = "msg_create_vesting_account" + TypeMsgCreateClawbackVestingAccount = "msg_create_clawback_vesting_account" + TypeMsgClawback = "msg_clawback" +) -var _ sdk.Msg = &MsgCreateVestingAccount{} +var _, _, _ sdk.Msg = &MsgCreateVestingAccount{}, &MsgCreateVestingAccount{}, &MsgClawback{} // NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount. //nolint:interfacer @@ -75,3 +80,148 @@ func (msg MsgCreateVestingAccount) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{from} } + +// NewMsgCreateClawbackVestingAccount returns a reference to a new MsgCreateClawbackVestingAccount. +//nolint:interfacer +func NewMsgCreateClawbackVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, lockupPeriods, vestingPeriods []Period, merge bool) *MsgCreateClawbackVestingAccount { + return &MsgCreateClawbackVestingAccount{ + FromAddress: fromAddr.String(), + ToAddress: toAddr.String(), + StartTime: startTime, + LockupPeriods: lockupPeriods, + VestingPeriods: vestingPeriods, + Merge: merge, + } +} + +// Route returns the message route for a MsgCreateClawbackVestingAccount. +func (msg MsgCreateClawbackVestingAccount) Route() string { return RouterKey } + +// Type returns the message type for a MsgCreateClawbackVestingAccount. +func (msg MsgCreateClawbackVestingAccount) Type() string { return TypeMsgCreateClawbackVestingAccount } + +// GetSigners returns the expected signers for a MsgCreateClawbackVestingAccount. +func (msg MsgCreateClawbackVestingAccount) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +// GetSignBytes returns the bytes all expected signers must sign over for a +// MsgCreateClawbackVestingAccount. +func (msg MsgCreateClawbackVestingAccount) GetSignBytes() []byte { + return sdk.MustSortJSON(amino.MustMarshalJSON(&msg)) +} + +// ValidateBasic Implements Msg. +func (msg MsgCreateClawbackVestingAccount) ValidateBasic() error { + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return err + } + to, err := sdk.AccAddressFromBech32(msg.ToAddress) + if err != nil { + return err + } + if err := sdk.VerifyAddressFormat(from); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err) + } + + if err := sdk.VerifyAddressFormat(to); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err) + } + + lockupCoins := sdk.NewCoins() + for i, period := range msg.LockupPeriods { + if period.Length < 1 { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid period length of %d in period %d, length must be greater than 0", period.Length, i) + } + lockupCoins = lockupCoins.Add(period.Amount...) + } + + vestingCoins := sdk.NewCoins() + for i, period := range msg.VestingPeriods { + if period.Length < 1 { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid period length of %d in period %d, length must be greater than 0", period.Length, i) + } + vestingCoins = vestingCoins.Add(period.Amount...) + } + + // If both schedules are present, the must describe the same total amount. + // IsEqual can panic, so use (a == b) <=> (a <= b && b <= a). + if len(msg.LockupPeriods) > 0 && len(msg.VestingPeriods) > 0 && + !(lockupCoins.IsAllLTE(vestingCoins) && vestingCoins.IsAllLTE(lockupCoins)) { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "vesting and lockup schedules must have same total coins") + } + + return nil +} + +// NewMsgClawback returns a reference to a new MsgClawback. +// The dest address may be nil - defaulting to the funder. +//nolint:interfacer +func NewMsgClawback(funder, addr, dest sdk.AccAddress) *MsgClawback { + var destString string + if dest != nil { + destString = dest.String() + } + return &MsgClawback{ + FunderAddress: funder.String(), + Address: addr.String(), + DestAddress: destString, + } +} + +// Route returns the message route for a MsgClawback. +func (msg MsgClawback) Route() string { return RouterKey } + +// Type returns the message type for a MsgClawback. +func (msg MsgClawback) Type() string { return TypeMsgClawback } + +// GetSigners returns the expected signers for a MsgClawback. +func (msg MsgClawback) GetSigners() []sdk.AccAddress { + funder, err := sdk.AccAddressFromBech32(msg.FunderAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{funder} +} + +// GetSignBytes returns the bytes all expected signers must sign over for a +// MsgClawback. +func (msg MsgClawback) GetSignBytes() []byte { + return sdk.MustSortJSON(amino.MustMarshalJSON(&msg)) +} + +// ValidateBasic Implements Msg. +func (msg MsgClawback) ValidateBasic() error { + funder, err := sdk.AccAddressFromBech32(msg.GetFunderAddress()) + if err != nil { + return err + } + if err := sdk.VerifyAddressFormat(funder); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid funder address: %s", err) + } + + addr, err := sdk.AccAddressFromBech32(msg.GetAddress()) + if err != nil { + return err + } + if err := sdk.VerifyAddressFormat(addr); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid account address: %s", err) + } + + if msg.GetDestAddress() != "" { + dest, err := sdk.AccAddressFromBech32(msg.GetDestAddress()) + if err != nil { + return err + } + if err := sdk.VerifyAddressFormat(dest); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid destination address: %s", err) + } + } + + return nil +} diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index d07a154dd326..fcb456654545 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -14,6 +14,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -145,41 +146,300 @@ func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateVestingAccountResponse proto.InternalMessageInfo +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +type MsgCreateClawbackVestingAccount struct { + // from_address specifies the account to provide the funds and sign the + // clawback request + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // to_address specifies the account to receive the funds + ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + // start_time defines the time at which the vesting period begins + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` + // lockup_periods defines the unlocking schedule relative to the start_time + LockupPeriods []Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods"` + // vesting_periods defines the vesting schedule relative to the start_time + VestingPeriods []Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods"` + // merge specifies a creation mechanism for existing + // ClawbackVestingAccounts. If true, merge this new grant into an existing + // ClawbackVestingAccount, or create it if it does not exist. If false, + // creates a new account. New grants to an existing account must be from the + // same from_address. + Merge bool `protobuf:"varint,6,opt,name=merge,proto3" json:"merge,omitempty"` +} + +func (m *MsgCreateClawbackVestingAccount) Reset() { *m = MsgCreateClawbackVestingAccount{} } +func (m *MsgCreateClawbackVestingAccount) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClawbackVestingAccount) ProtoMessage() {} +func (*MsgCreateClawbackVestingAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{2} +} +func (m *MsgCreateClawbackVestingAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClawbackVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClawbackVestingAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateClawbackVestingAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClawbackVestingAccount.Merge(m, src) +} +func (m *MsgCreateClawbackVestingAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClawbackVestingAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClawbackVestingAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClawbackVestingAccount proto.InternalMessageInfo + +func (m *MsgCreateClawbackVestingAccount) GetFromAddress() string { + if m != nil { + return m.FromAddress + } + return "" +} + +func (m *MsgCreateClawbackVestingAccount) GetToAddress() string { + if m != nil { + return m.ToAddress + } + return "" +} + +func (m *MsgCreateClawbackVestingAccount) GetStartTime() int64 { + if m != nil { + return m.StartTime + } + return 0 +} + +func (m *MsgCreateClawbackVestingAccount) GetLockupPeriods() []Period { + if m != nil { + return m.LockupPeriods + } + return nil +} + +func (m *MsgCreateClawbackVestingAccount) GetVestingPeriods() []Period { + if m != nil { + return m.VestingPeriods + } + return nil +} + +func (m *MsgCreateClawbackVestingAccount) GetMerge() bool { + if m != nil { + return m.Merge + } + return false +} + +// MsgCreateClawbackVestingAccountResponse defines the +// MsgCreateClawbackVestingAccount response type. +type MsgCreateClawbackVestingAccountResponse struct { +} + +func (m *MsgCreateClawbackVestingAccountResponse) Reset() { + *m = MsgCreateClawbackVestingAccountResponse{} +} +func (m *MsgCreateClawbackVestingAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClawbackVestingAccountResponse) ProtoMessage() {} +func (*MsgCreateClawbackVestingAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{3} +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.Merge(m, src) +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClawbackVestingAccountResponse proto.InternalMessageInfo + +// MsgClawback defines a message that removes unvested tokens from a +// ClawbackVestingAccount. +type MsgClawback struct { + // funder_address is the address which funded the account + FunderAddress string `protobuf:"bytes,1,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty"` + // address is the address of the ClawbackVestingAccount to claw back from. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // dest_address specifies where the clawed-back tokens should be transferred + // to. If empty, the tokens will be transferred back to the original funder of + // the account. + DestAddress string `protobuf:"bytes,3,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` +} + +func (m *MsgClawback) Reset() { *m = MsgClawback{} } +func (m *MsgClawback) String() string { return proto.CompactTextString(m) } +func (*MsgClawback) ProtoMessage() {} +func (*MsgClawback) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{4} +} +func (m *MsgClawback) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClawback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClawback.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClawback) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClawback.Merge(m, src) +} +func (m *MsgClawback) XXX_Size() int { + return m.Size() +} +func (m *MsgClawback) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClawback.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClawback proto.InternalMessageInfo + +func (m *MsgClawback) GetFunderAddress() string { + if m != nil { + return m.FunderAddress + } + return "" +} + +func (m *MsgClawback) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgClawback) GetDestAddress() string { + if m != nil { + return m.DestAddress + } + return "" +} + +// MsgClawbackResponse defines the MsgClawback response type. +type MsgClawbackResponse struct { +} + +func (m *MsgClawbackResponse) Reset() { *m = MsgClawbackResponse{} } +func (m *MsgClawbackResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClawbackResponse) ProtoMessage() {} +func (*MsgClawbackResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{5} +} +func (m *MsgClawbackResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClawbackResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClawbackResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgClawbackResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClawbackResponse.Merge(m, src) +} +func (m *MsgClawbackResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClawbackResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClawbackResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClawbackResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccount") proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") + proto.RegisterType((*MsgCreateClawbackVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount") + proto.RegisterType((*MsgCreateClawbackVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse") + proto.RegisterType((*MsgClawback)(nil), "cosmos.vesting.v1beta1.MsgClawback") + proto.RegisterType((*MsgClawbackResponse)(nil), "cosmos.vesting.v1beta1.MsgClawbackResponse") } func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) } var fileDescriptor_5338ca97811f9792 = []byte{ - // 410 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbd, 0xae, 0xd3, 0x30, - 0x14, 0x8e, 0x6f, 0x2e, 0xf7, 0xc7, 0x17, 0x09, 0x91, 0x16, 0x1a, 0x3a, 0xc4, 0x21, 0x53, 0x16, - 0x6c, 0x5a, 0x90, 0x90, 0xba, 0x35, 0x1d, 0x51, 0x97, 0x08, 0x31, 0xb0, 0x54, 0x4e, 0x62, 0xd2, - 0x88, 0x26, 0xae, 0x62, 0xb7, 0x6a, 0x37, 0x46, 0x46, 0x1e, 0x81, 0x99, 0xa7, 0x60, 0xec, 0xd8, - 0x91, 0x29, 0xa0, 0x76, 0x61, 0xee, 0x13, 0xa0, 0xc4, 0x49, 0x61, 0x68, 0x91, 0x98, 0xec, 0xa3, - 0xef, 0xc7, 0xe7, 0x7c, 0x3e, 0x10, 0x85, 0x5c, 0xa4, 0x5c, 0x90, 0x25, 0x13, 0x32, 0xc9, 0x62, - 0xb2, 0xec, 0x05, 0x4c, 0xd2, 0x1e, 0x91, 0x2b, 0x3c, 0xcf, 0xb9, 0xe4, 0xc6, 0x63, 0x45, 0xc0, - 0x35, 0x01, 0xd7, 0x84, 0x6e, 0x3b, 0xe6, 0x31, 0xaf, 0x28, 0xa4, 0xbc, 0x29, 0x76, 0xd7, 0xaa, - 0xed, 0x02, 0x2a, 0xd8, 0xd1, 0x2b, 0xe4, 0x49, 0xa6, 0x70, 0xe7, 0xdb, 0x05, 0xec, 0x8c, 0x45, - 0x3c, 0xca, 0x19, 0x95, 0xec, 0xad, 0xb2, 0x1c, 0x86, 0x21, 0x5f, 0x64, 0xd2, 0x18, 0xc0, 0xfb, - 0xef, 0x73, 0x9e, 0x4e, 0x68, 0x14, 0xe5, 0x4c, 0x08, 0x13, 0xd8, 0xc0, 0xbd, 0xf5, 0x3a, 0x87, - 0x02, 0xb5, 0xd6, 0x34, 0x9d, 0x0d, 0x9c, 0xbf, 0x51, 0xc7, 0xbf, 0x2b, 0xcb, 0xa1, 0xaa, 0x8c, - 0x97, 0x10, 0x4a, 0x7e, 0x54, 0x5e, 0x54, 0xca, 0x47, 0x87, 0x02, 0x3d, 0x54, 0xca, 0x3f, 0x98, - 0xe3, 0xdf, 0x4a, 0xde, 0xa8, 0x42, 0x78, 0x45, 0xd3, 0xf2, 0x6d, 0x53, 0xb7, 0x75, 0xf7, 0xae, - 0xff, 0x04, 0xd7, 0xc3, 0x96, 0xed, 0x37, 0x93, 0xe2, 0x11, 0x4f, 0x32, 0xef, 0xf9, 0xa6, 0x40, - 0xda, 0xd7, 0x1f, 0xc8, 0x8d, 0x13, 0x39, 0x5d, 0x04, 0x38, 0xe4, 0x29, 0xa9, 0x67, 0x55, 0xc7, - 0x33, 0x11, 0x7d, 0x20, 0x72, 0x3d, 0x67, 0xa2, 0x12, 0x08, 0xbf, 0xb6, 0x36, 0x30, 0xbc, 0x61, - 0x59, 0x34, 0x91, 0x49, 0xca, 0xcc, 0x4b, 0x1b, 0xb8, 0xba, 0xd7, 0x3a, 0x14, 0xe8, 0x81, 0x6a, - 0xac, 0x41, 0x1c, 0xff, 0x9a, 0x65, 0xd1, 0x9b, 0x24, 0x65, 0x86, 0x09, 0xaf, 0x23, 0x36, 0xa3, - 0x6b, 0x16, 0x99, 0xf7, 0x6c, 0xe0, 0xde, 0xf8, 0x4d, 0x39, 0xb8, 0xfc, 0xf5, 0x05, 0x01, 0xe7, - 0x29, 0x44, 0x67, 0x12, 0xf4, 0x99, 0x98, 0xf3, 0x4c, 0xb0, 0xfe, 0x27, 0x00, 0xf5, 0xb1, 0x88, - 0x8d, 0x8f, 0x00, 0xb6, 0x4f, 0x46, 0x4d, 0xf0, 0xe9, 0x5f, 0xc5, 0x67, 0x9c, 0xbb, 0xaf, 0xfe, - 0x53, 0xd0, 0xb4, 0xe2, 0xbd, 0xde, 0xec, 0x2c, 0xb0, 0xdd, 0x59, 0xe0, 0xe7, 0xce, 0x02, 0x9f, - 0xf7, 0x96, 0xb6, 0xdd, 0x5b, 0xda, 0xf7, 0xbd, 0xa5, 0xbd, 0xeb, 0xfd, 0x33, 0xc9, 0x15, 0xa1, - 0x0b, 0x39, 0x3d, 0xae, 0x65, 0x15, 0x6c, 0x70, 0x55, 0x2d, 0xd1, 0x8b, 0xdf, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xe7, 0x28, 0xaf, 0xe5, 0xb5, 0x02, 0x00, 0x00, + // 644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0xa5, 0xfb, 0xe7, 0xb1, 0x4d, 0x64, 0x1b, 0x0b, 0x15, 0x24, 0x5d, 0x00, 0x51, + 0x84, 0x48, 0xd8, 0x98, 0x84, 0xb4, 0x0b, 0x5a, 0x77, 0x9c, 0x2a, 0xa1, 0x08, 0x71, 0x40, 0x48, + 0x95, 0x93, 0xb8, 0x59, 0xd4, 0x26, 0x0e, 0xb1, 0x33, 0xd6, 0x1b, 0x7c, 0x03, 0x8e, 0x1c, 0x39, + 0xf3, 0x29, 0x38, 0xee, 0x38, 0x6e, 0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x82, 0x29, 0x3d, 0x2a, 0xde, 0x53, 0xf6, + 0xb4, 0x38, 0x73, 0xec, 0x19, 0x7d, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0x09, 0x7f, 0x5e, 0xa8, + 0xfe, 0x05, 0x00, 0x00, } func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { @@ -239,6 +499,11 @@ type MsgClient interface { // CreateVestingAccount defines a method that enables creating a vesting // account. CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) } type msgClient struct { @@ -258,11 +523,34 @@ func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVesti return out, nil } +func (c *msgClient) CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) { + out := new(MsgCreateClawbackVestingAccountResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreateClawbackVestingAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + out := new(MsgClawbackResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/Clawback", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // CreateVestingAccount defines a method that enables creating a vesting // account. CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(context.Context, *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(context.Context, *MsgClawback) (*MsgClawbackResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -272,6 +560,12 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") } +func (*UnimplementedMsgServer) CreateClawbackVestingAccount(ctx context.Context, req *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClawbackVestingAccount not implemented") +} +func (*UnimplementedMsgServer) Clawback(ctx context.Context, req *MsgClawback) (*MsgClawbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -295,6 +589,42 @@ func _Msg_CreateVestingAccount_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_CreateClawbackVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClawbackVestingAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/CreateClawbackVestingAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, req.(*MsgCreateClawbackVestingAccount)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClawback) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Clawback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/Clawback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Clawback(ctx, req.(*MsgClawback)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.vesting.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -303,6 +633,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CreateVestingAccount", Handler: _Msg_CreateVestingAccount_Handler, }, + { + MethodName: "CreateClawbackVestingAccount", + Handler: _Msg_CreateClawbackVestingAccount_Handler, + }, + { + MethodName: "Clawback", + Handler: _Msg_Clawback_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/vesting/v1beta1/tx.proto", @@ -397,47 +735,291 @@ func (m *MsgCreateVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgCreateClawbackVestingAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCreateVestingAccount) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgCreateClawbackVestingAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClawbackVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Merge { + i-- + if m.Merge { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.VestingPeriods) > 0 { + for iNdEx := len(m.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.LockupPeriods) > 0 { + for iNdEx := len(m.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockupPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } - if m.EndTime != 0 { - n += 1 + sovTx(uint64(m.EndTime)) + if m.StartTime != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x18 } - if m.Delayed { - n += 2 + if len(m.ToAddress) > 0 { + i -= len(m.ToAddress) + copy(dAtA[i:], m.ToAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) + i-- + dAtA[i] = 0x12 } - return n + if len(m.FromAddress) > 0 { + i -= len(m.FromAddress) + copy(dAtA[i:], m.FromAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgCreateVestingAccountResponse) Size() (n int) { +func (m *MsgCreateClawbackVestingAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateClawbackVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClawbackVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgClawback) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClawback) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClawback) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DestAddress) > 0 { + i -= len(m.DestAddress) + copy(dAtA[i:], m.DestAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DestAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.FunderAddress) > 0 { + i -= len(m.FunderAddress) + copy(dAtA[i:], m.FunderAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FunderAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClawbackResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgClawbackResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClawbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ToAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.EndTime != 0 { + n += 1 + sovTx(uint64(m.EndTime)) + } + if m.Delayed { + n += 2 + } + return n +} + +func (m *MsgCreateVestingAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateClawbackVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ToAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.StartTime != 0 { + n += 1 + sovTx(uint64(m.StartTime)) + } + if len(m.LockupPeriods) > 0 { + for _, e := range m.LockupPeriods { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.VestingPeriods) > 0 { + for _, e := range m.VestingPeriods { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Merge { + n += 2 + } + return n +} + +func (m *MsgCreateClawbackVestingAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgClawback) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FunderAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DestAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClawbackResponse) Size() (n int) { if m == nil { return 0 } @@ -689,6 +1271,473 @@ func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateClawbackVestingAccount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateClawbackVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClawbackVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ToAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockupPeriods = append(m.LockupPeriods, Period{}) + if err := m.LockupPeriods[len(m.LockupPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingPeriods = append(m.VestingPeriods, Period{}) + if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Merge", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Merge = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClawbackVestingAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateClawbackVestingAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClawbackVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClawback) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgClawback: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClawback: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClawbackResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgClawbackResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClawbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/vesting/types/vesting.pb.go b/x/auth/vesting/types/vesting.pb.go index ef6c8d01e425..a16ed08fa351 100644 --- a/x/auth/vesting/types/vesting.pb.go +++ b/x/auth/vesting/types/vesting.pb.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -279,6 +280,53 @@ func (m *PermanentLockedAccount) XXX_DiscardUnknown() { var xxx_messageInfo_PermanentLockedAccount proto.InternalMessageInfo +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +type ClawbackVestingAccount struct { + *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` + // funder_address specifies the account which can perform clawback. + FunderAddress string `protobuf:"bytes,2,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty" yaml:"funder_address"` + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` + // unlocking schedule relative to the BaseVestingAccount start_time. + LockupPeriods []Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods" yaml:"lockup_periods"` + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + VestingPeriods []Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods" yaml:"vesting_periods"` +} + +func (m *ClawbackVestingAccount) Reset() { *m = ClawbackVestingAccount{} } +func (*ClawbackVestingAccount) ProtoMessage() {} +func (*ClawbackVestingAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_89e80273ca606d6e, []int{6} +} +func (m *ClawbackVestingAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClawbackVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClawbackVestingAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClawbackVestingAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClawbackVestingAccount.Merge(m, src) +} +func (m *ClawbackVestingAccount) XXX_Size() int { + return m.Size() +} +func (m *ClawbackVestingAccount) XXX_DiscardUnknown() { + xxx_messageInfo_ClawbackVestingAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_ClawbackVestingAccount proto.InternalMessageInfo + func init() { proto.RegisterType((*BaseVestingAccount)(nil), "cosmos.vesting.v1beta1.BaseVestingAccount") proto.RegisterType((*ContinuousVestingAccount)(nil), "cosmos.vesting.v1beta1.ContinuousVestingAccount") @@ -286,6 +334,7 @@ func init() { proto.RegisterType((*Period)(nil), "cosmos.vesting.v1beta1.Period") proto.RegisterType((*PeriodicVestingAccount)(nil), "cosmos.vesting.v1beta1.PeriodicVestingAccount") proto.RegisterType((*PermanentLockedAccount)(nil), "cosmos.vesting.v1beta1.PermanentLockedAccount") + proto.RegisterType((*ClawbackVestingAccount)(nil), "cosmos.vesting.v1beta1.ClawbackVestingAccount") } func init() { @@ -293,46 +342,52 @@ func init() { } var fileDescriptor_89e80273ca606d6e = []byte{ - // 609 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x7d, 0x4d, 0x08, 0xe5, 0x0a, 0xfd, 0x63, 0xda, 0x60, 0x3a, 0xd8, 0x91, 0xc5, 0x10, - 0x21, 0xe1, 0xd0, 0xc2, 0xd4, 0x0d, 0x17, 0x21, 0x55, 0xed, 0x80, 0x2c, 0xc4, 0xc0, 0x12, 0x9d, - 0xed, 0xc3, 0xb1, 0x1a, 0xdf, 0x45, 0xbe, 0x4b, 0x45, 0x3e, 0x00, 0x08, 0xa9, 0x0b, 0x48, 0x0c, - 0x8c, 0x5d, 0x58, 0xf8, 0x10, 0xcc, 0x1d, 0x23, 0x26, 0xa6, 0x80, 0x92, 0x6f, 0x90, 0x4f, 0x80, - 0x7c, 0x77, 0x76, 0x8a, 0x0b, 0x44, 0x65, 0x00, 0x31, 0x25, 0x77, 0xef, 0xfb, 0x3e, 0xf7, 0x7b, - 0x5f, 0x3f, 0xa7, 0x83, 0xb7, 0x02, 0xca, 0x12, 0xca, 0x5a, 0x47, 0x98, 0xf1, 0x98, 0x44, 0xad, - 0xa3, 0x2d, 0x1f, 0x73, 0xb4, 0x95, 0xaf, 0x9d, 0x5e, 0x4a, 0x39, 0xd5, 0xeb, 0x32, 0xcb, 0xc9, - 0x77, 0x55, 0xd6, 0xe6, 0x7a, 0x44, 0x23, 0x2a, 0x52, 0x5a, 0xd9, 0x3f, 0x99, 0xbd, 0x69, 0x2a, - 0x4d, 0x1f, 0x31, 0x5c, 0x08, 0x06, 0x34, 0x26, 0xa5, 0x38, 0xea, 0xf3, 0x4e, 0x11, 0xcf, 0x16, - 0x32, 0x6e, 0x7f, 0xae, 0x42, 0xdd, 0x45, 0x0c, 0x3f, 0x95, 0xa7, 0x3d, 0x08, 0x02, 0xda, 0x27, - 0x5c, 0xdf, 0x83, 0x57, 0x33, 0xc5, 0x36, 0x92, 0x6b, 0x03, 0x34, 0x40, 0x73, 0x69, 0xbb, 0xe1, - 0x28, 0x36, 0x21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 0x9f, 0x8e, 0x4d, - 0x30, 0x1c, 0x9b, 0xe0, 0xdb, 0xd8, 0x04, 0x6f, 0x26, 0xa6, 0x36, 0x9c, 0x98, 0xda, 0x97, 0x89, - 0xa9, 0x3d, 0xdb, 0xfa, 0xad, 0x05, 0x5e, 0xa8, 0xe7, 0x42, 0xbd, 0x53, 0xc2, 0x11, 0x7e, 0x4d, - 0x3c, 0x18, 0xf7, 0xbe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0xd5, 0x07, 0xc6, 0x06, 0x00, - 0x00, + // 712 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x4f, 0xd4, 0x40, + 0x14, 0xde, 0x61, 0x97, 0x15, 0x06, 0x59, 0xa0, 0xc2, 0xba, 0x90, 0xd8, 0x6e, 0x1a, 0x0f, 0x1b, + 0x13, 0xbb, 0x82, 0x9e, 0x38, 0x49, 0x31, 0x26, 0x04, 0x0e, 0xa6, 0x31, 0x1e, 0xbc, 0x6c, 0xa6, + 0xed, 0x50, 0x9a, 0x6d, 0x3b, 0x9b, 0xce, 0x14, 0xe5, 0x07, 0x68, 0x4c, 0xb8, 0x68, 0xe2, 0xc1, + 0x23, 0x17, 0x2f, 0xfe, 0x08, 0xcf, 0x5c, 0x4c, 0x88, 0x27, 0x4f, 0xab, 0x81, 0x7f, 0xc0, 0x2f, + 0x30, 0x9d, 0x99, 0x76, 0xd9, 0x82, 0x02, 0x26, 0x4a, 0x3c, 0xed, 0xbe, 0x79, 0xef, 0x7d, 0xf3, + 0xbd, 0xf7, 0xbe, 0xd7, 0x16, 0xde, 0x76, 0x08, 0x0d, 0x09, 0x6d, 0x6f, 0x63, 0xca, 0xfc, 0xc8, + 0x6b, 0x6f, 0x2f, 0xda, 0x98, 0xa1, 0xc5, 0xcc, 0x36, 0x7a, 0x31, 0x61, 0x44, 0xa9, 0x8b, 0x28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 0xf4, 0xed, 0x48, 0x2d, 0x3d, 0x5f, 0xfc, 0xed, 0x4a, 0xbf, 0x94, 0xaf, 0x7f, + 0xf9, 0x61, 0xc2, 0x37, 0xdc, 0xae, 0xf2, 0x0f, 0x80, 0xfb, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x5d, 0x4a, 0x8e, 0x05, 0xb7, 0x08, 0x00, 0x00, } func (m *BaseVestingAccount) Marshal() (dAtA []byte, err error) { @@ -623,6 +678,81 @@ func (m *PermanentLockedAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *ClawbackVestingAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClawbackVestingAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClawbackVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VestingPeriods) > 0 { + for iNdEx := len(m.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.LockupPeriods) > 0 { + for iNdEx := len(m.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockupPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.StartTime != 0 { + i = encodeVarintVesting(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x18 + } + if len(m.FunderAddress) > 0 { + i -= len(m.FunderAddress) + copy(dAtA[i:], m.FunderAddress) + i = encodeVarintVesting(dAtA, i, uint64(len(m.FunderAddress))) + i-- + dAtA[i] = 0x12 + } + if m.BaseVestingAccount != nil { + { + size, err := m.BaseVestingAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintVesting(dAtA []byte, offset int, v uint64) int { offset -= sovVesting(v) base := offset @@ -750,6 +880,38 @@ func (m *PermanentLockedAccount) Size() (n int) { return n } +func (m *ClawbackVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseVestingAccount != nil { + l = m.BaseVestingAccount.Size() + n += 1 + l + sovVesting(uint64(l)) + } + l = len(m.FunderAddress) + if l > 0 { + n += 1 + l + sovVesting(uint64(l)) + } + if m.StartTime != 0 { + n += 1 + sovVesting(uint64(m.StartTime)) + } + if len(m.LockupPeriods) > 0 { + for _, e := range m.LockupPeriods { + l = e.Size() + n += 1 + l + sovVesting(uint64(l)) + } + } + if len(m.VestingPeriods) > 0 { + for _, e := range m.VestingPeriods { + l = e.Size() + n += 1 + l + sovVesting(uint64(l)) + } + } + return n +} + func sovVesting(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1482,6 +1644,211 @@ func (m *PermanentLockedAccount) Unmarshal(dAtA []byte) error { } return nil } +func (m *ClawbackVestingAccount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClawbackVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClawbackVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseVestingAccount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseVestingAccount == nil { + m.BaseVestingAccount = &BaseVestingAccount{} + } + if err := m.BaseVestingAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + 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 ErrInvalidLengthVesting + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockupPeriods = append(m.LockupPeriods, Period{}) + if err := m.LockupPeriods[len(m.LockupPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingPeriods = append(m.VestingPeriods, Period{}) + if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVesting(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVesting + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipVesting(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0