From 098bdf92ab5fb29fbbbe6bcec2b149d32362a85b Mon Sep 17 00:00:00 2001 From: zale144 Date: Mon, 11 Nov 2024 15:12:35 +0100 Subject: [PATCH] Add denom to IRO buy, sell and claim events --- proto/dymensionxyz/dymension/iro/events.proto | 6 + x/iro/keeper/claim.go | 1 + x/iro/keeper/trade.go | 3 + x/iro/types/events.pb.go | 234 +++++++++++++++--- 4 files changed, 204 insertions(+), 40 deletions(-) diff --git a/proto/dymensionxyz/dymension/iro/events.proto b/proto/dymensionxyz/dymension/iro/events.proto index bbaad12d5..e87c345aa 100644 --- a/proto/dymensionxyz/dymension/iro/events.proto +++ b/proto/dymensionxyz/dymension/iro/events.proto @@ -41,6 +41,8 @@ message EventBuy { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + + string denom = 8; } message EventSell { @@ -66,6 +68,8 @@ message EventSell { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + + string denom = 8; } message EventClaim { @@ -76,6 +80,8 @@ message EventClaim { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + + string denom = 5; } message EventSettle { diff --git a/x/iro/keeper/claim.go b/x/iro/keeper/claim.go index 19bd2ee4a..ff8a64988 100644 --- a/x/iro/keeper/claim.go +++ b/x/iro/keeper/claim.go @@ -65,6 +65,7 @@ func (k Keeper) Claim(ctx sdk.Context, planId string, claimer sdk.AccAddress) er PlanId: planId, RollappId: plan.RollappId, Amount: availableTokens.Amount, + Denom: plan.SettledDenom, }) if err != nil { return err diff --git a/x/iro/keeper/trade.go b/x/iro/keeper/trade.go index 72eda72ce..b02636df0 100644 --- a/x/iro/keeper/trade.go +++ b/x/iro/keeper/trade.go @@ -115,6 +115,7 @@ func (k Keeper) Buy(ctx sdk.Context, planId string, buyer sdk.AccAddress, amount Cost: costAmt, TakerFee: takerFeeAmt, ClosingPrice: plan.SpotPrice(), + Denom: plan.SettledDenom, }) if err != nil { return err @@ -186,6 +187,7 @@ func (k Keeper) BuyExactSpend(ctx sdk.Context, planId string, buyer sdk.AccAddre Cost: toSpendMinusTakerFeeAmt, TakerFee: takerFeeAmt, ClosingPrice: plan.SpotPrice(), + Denom: plan.SettledDenom, }) if err != nil { return err @@ -247,6 +249,7 @@ func (k Keeper) Sell(ctx sdk.Context, planId string, seller sdk.AccAddress, amou Revenue: costAmt, TakerFee: takerFeeAmt, ClosingPrice: plan.SpotPrice(), + Denom: plan.SettledDenom, }) if err != nil { return err diff --git a/x/iro/types/events.pb.go b/x/iro/types/events.pb.go index b3f3a25d7..744ddb002 100644 --- a/x/iro/types/events.pb.go +++ b/x/iro/types/events.pb.go @@ -154,6 +154,7 @@ type EventBuy struct { Cost github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=cost,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cost"` TakerFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=taker_fee,json=takerFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"taker_fee"` ClosingPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=closing_price,json=closingPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_price"` + Denom string `protobuf:"bytes,8,opt,name=denom,proto3" json:"denom,omitempty"` } func (m *EventBuy) Reset() { *m = EventBuy{} } @@ -210,6 +211,13 @@ func (m *EventBuy) GetRollappId() string { return "" } +func (m *EventBuy) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type EventSell struct { Seller string `protobuf:"bytes,1,opt,name=seller,proto3" json:"seller,omitempty"` PlanId string `protobuf:"bytes,2,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` @@ -218,6 +226,7 @@ type EventSell struct { Revenue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=revenue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"revenue"` TakerFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=taker_fee,json=takerFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"taker_fee"` ClosingPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=closing_price,json=closingPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_price"` + Denom string `protobuf:"bytes,8,opt,name=denom,proto3" json:"denom,omitempty"` } func (m *EventSell) Reset() { *m = EventSell{} } @@ -274,11 +283,19 @@ func (m *EventSell) GetRollappId() string { return "" } +func (m *EventSell) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type EventClaim struct { Claimer string `protobuf:"bytes,1,opt,name=claimer,proto3" json:"claimer,omitempty"` PlanId string `protobuf:"bytes,2,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` RollappId string `protobuf:"bytes,3,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Denom string `protobuf:"bytes,5,opt,name=denom,proto3" json:"denom,omitempty"` } func (m *EventClaim) Reset() { *m = EventClaim{} } @@ -335,6 +352,13 @@ func (m *EventClaim) GetRollappId() string { return "" } +func (m *EventClaim) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type EventSettle struct { PlanId string `protobuf:"bytes,1,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` RollappId string `protobuf:"bytes,2,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` @@ -425,46 +449,47 @@ func init() { } var fileDescriptor_9d7833031285167c = []byte{ - // 622 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x49, 0x48, 0xe2, 0xcb, 0x7b, 0x7a, 0x7a, 0x16, 0xd2, 0x33, 0x3c, 0x35, 0xa0, 0xa8, - 0x6a, 0xd9, 0x60, 0x23, 0x90, 0xba, 0xaf, 0xa1, 0x50, 0xb7, 0x52, 0x8b, 0x8c, 0xba, 0xe9, 0x26, - 0x72, 0x3c, 0x17, 0x63, 0x31, 0xf6, 0x58, 0x33, 0x63, 0x20, 0x95, 0xfa, 0x1f, 0xba, 0xea, 0xba, - 0xdb, 0xee, 0xfb, 0x03, 0xba, 0x64, 0x89, 0xba, 0xaa, 0x2a, 0x15, 0x55, 0xf0, 0x47, 0xaa, 0x19, - 0x0f, 0x14, 0x55, 0xe2, 0x2b, 0x1b, 0xd4, 0x55, 0xe6, 0xcc, 0x3d, 0xf7, 0xdc, 0x73, 0x73, 0x67, - 0x3c, 0xf0, 0x90, 0x8c, 0x72, 0x2c, 0x44, 0xc6, 0x8a, 0x83, 0xd1, 0x1b, 0xff, 0x1c, 0xf8, 0x19, - 0x67, 0x3e, 0xee, 0x61, 0x21, 0x85, 0x57, 0x72, 0x26, 0x99, 0x33, 0x7b, 0x91, 0xe8, 0x9d, 0x03, - 0x2f, 0xe3, 0x6c, 0x76, 0x3a, 0x65, 0x29, 0xd3, 0x34, 0x5f, 0xad, 0xea, 0x8c, 0xd9, 0x99, 0x84, - 0x89, 0x9c, 0x89, 0x41, 0x1d, 0xa8, 0x81, 0x09, 0xcd, 0xa5, 0x8c, 0xa5, 0x14, 0x7d, 0x8d, 0x86, - 0xd5, 0xb6, 0x2f, 0xb3, 0x1c, 0x85, 0x8c, 0xf3, 0xd2, 0x10, 0xee, 0x5f, 0x61, 0x2b, 0xe3, 0xa6, - 0x42, 0xff, 0xbb, 0x05, 0xff, 0x3e, 0x51, 0x26, 0x5f, 0x95, 0x24, 0x96, 0xb8, 0x19, 0xf3, 0x38, - 0x17, 0xce, 0x23, 0xb0, 0xe3, 0x4a, 0xee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a3, 0x71, 0x48, 0x82, 0x67, 0x87, 0x27, 0x3d, 0xeb, 0xe8, 0xa4, 0x67, 0xfd, 0x38, 0xe9, 0x59, - 0xef, 0x4e, 0x7b, 0x8d, 0xa3, 0xd3, 0x5e, 0xe3, 0xeb, 0x69, 0xaf, 0xf1, 0x7a, 0xe9, 0x42, 0x8b, - 0x97, 0x3c, 0x2a, 0x7b, 0x2b, 0xfe, 0x81, 0x7e, 0x59, 0x74, 0xc3, 0xc3, 0xb6, 0x7e, 0x5c, 0x56, - 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x24, 0xc5, 0xf8, 0x77, 0x1b, 0x07, 0x00, 0x00, + // 633 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcf, 0x6b, 0xd4, 0x4e, + 0x14, 0xdf, 0x74, 0x7f, 0xe6, 0xf5, 0xfb, 0x45, 0x1c, 0x0a, 0xa6, 0x15, 0xb7, 0x65, 0x11, 0xed, + 0xa5, 0x49, 0x69, 0xc1, 0xbb, 0x69, 0x6d, 0x8d, 0x82, 0x96, 0x14, 0x2f, 0x5e, 0x96, 0x6c, 0xf2, + 0x9a, 0x86, 0x4e, 0x32, 0x61, 0x66, 0xd2, 0x76, 0x05, 0xff, 0x07, 0x4f, 0xfe, 0x25, 0xe2, 0xd5, + 0x6b, 0x8f, 0xc5, 0x83, 0x88, 0x60, 0x91, 0xf6, 0x1f, 0x91, 0x99, 0xa4, 0xeb, 0x22, 0xf4, 0xd7, + 0x5e, 0x8a, 0xa7, 0xcd, 0x67, 0xde, 0xe7, 0x7d, 0xde, 0xfb, 0xcc, 0x9b, 0xd9, 0x81, 0xc7, 0xd1, + 0x30, 0xc5, 0x4c, 0x24, 0x2c, 0x3b, 0x1c, 0xbe, 0x73, 0x46, 0xc0, 0x49, 0x38, 0x73, 0x70, 0x1f, + 0x33, 0x29, 0xec, 0x9c, 0x33, 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, 0xeb, 0x27, 0x91, + 0x76, 0x65, 0xfa, 0x2d, 0x05, 0xbd, 0x88, 0x3c, 0x00, 0xe0, 0x8c, 0xd2, 0x20, 0xcf, 0x55, 0xac, + 0xae, 0x63, 0x66, 0xb5, 0xe2, 0x45, 0xbd, 0xcf, 0x75, 0xe8, 0xe8, 0xfa, 0x6e, 0x31, 0x24, 0x36, + 0x34, 0x07, 0xc5, 0x10, 0xaf, 0x2e, 0x5b, 0xd2, 0x26, 0x2d, 0x4a, 0x36, 0xa0, 0x15, 0xa4, 0xac, + 0xc8, 0xa4, 0xd5, 0xd0, 0x85, 0x6c, 0xb5, 0x29, 0x3f, 0x4e, 0xe6, 0x1f, 0xc5, 0x89, 0xdc, 0x2d, + 0x06, 0x76, 0xc8, 0xd2, 0xea, 0x2c, 0x55, 0x3f, 0x4b, 0x22, 0xda, 0x73, 0xe4, 0x30, 0x47, 0x61, + 0x7b, 0x99, 0xf4, 0xab, 0x6c, 0xe2, 0x42, 0x23, 0x64, 0x42, 0x5a, 0xcd, 0x89, 0x54, 0x74, 0x2e, + 0x79, 0x09, 0xa6, 0x0c, 0xf6, 0x90, 0xf7, 0x77, 0x10, 0xad, 0xd6, 0x44, 0x42, 0x1d, 0x2d, 0xb0, + 0x81, 0x48, 0xb6, 0xe1, 0xff, 0x90, 0x32, 0x91, 0x64, 0x71, 0x3f, 0xe7, 0x49, 0x88, 0x56, 0xfb, + 0xc6, 0x82, 0xeb, 0x18, 0xfa, 0xff, 0x55, 0x22, 0x5b, 0x4a, 0x83, 0xcc, 0x40, 0x33, 0xc2, 0x8c, + 0xa5, 0x56, 0x47, 0xef, 0x63, 0x09, 0x7a, 0x5f, 0xea, 0x60, 0xea, 0xc1, 0x6d, 0x23, 0xa5, 0x64, + 0x19, 0x5a, 0x02, 0x29, 0xbd, 0xc6, 0xe8, 0x2a, 0xde, 0xad, 0xcf, 0xee, 0x39, 0xb4, 0xb9, 0xfa, + 0xf3, 0x29, 0x70, 0xc2, 0xf1, 0x9d, 0xa7, 0xff, 0xb3, 0x13, 0xfc, 0x66, 0x00, 0xe8, 0x09, 0xae, + 0xd1, 0x20, 0x49, 0xf5, 0xad, 0x57, 0x1f, 0x78, 0x9d, 0x5b, 0x5f, 0x12, 0x6f, 0x7d, 0x88, 0x23, + 0x63, 0xcd, 0x71, 0x63, 0x1f, 0x0d, 0x98, 0xae, 0x8e, 0xa6, 0x94, 0x14, 0xc7, 0xbb, 0x34, 0x2e, + 0xe9, 0x72, 0xea, 0xef, 0x2e, 0xef, 0x83, 0xe9, 0xb9, 0x6b, 0xfd, 0xb2, 0x42, 0xe9, 0xa1, 0xe3, + 0xb9, 0x6b, 0xeb, 0x0a, 0x6b, 0x51, 0xc6, 0xa8, 0x4a, 0x54, 0x1e, 0x1a, 0x7e, 0x4b, 0x41, 0x2f, + 0x22, 0xb3, 0xd0, 0x89, 0x83, 0x22, 0x46, 0x15, 0x69, 0xea, 0x48, 0x5b, 0x63, 0x2f, 0x72, 0x5f, + 0x1c, 0x9d, 0x76, 0x8d, 0xe3, 0xd3, 0xae, 0xf1, 0xeb, 0xb4, 0x6b, 0x7c, 0x38, 0xeb, 0xd6, 0x8e, + 0xcf, 0xba, 0xb5, 0xef, 0x67, 0xdd, 0xda, 0xdb, 0xe5, 0x31, 0xe3, 0x17, 0x3c, 0x4b, 0xfb, 0xab, + 0xce, 0xa1, 0x7e, 0x9b, 0xf4, 0x36, 0x0c, 0x5a, 0xfa, 0x79, 0x5a, 0xfd, 0x1d, 0x00, 0x00, 0xff, + 0xff, 0x62, 0xf3, 0xd3, 0x6a, 0x5d, 0x07, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -581,6 +606,13 @@ func (m *EventBuy) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x42 + } { size := m.ClosingPrice.Size() i -= size @@ -665,6 +697,13 @@ func (m *EventSell) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x42 + } { size := m.ClosingPrice.Size() i -= size @@ -749,6 +788,13 @@ func (m *EventClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x2a + } { size := m.Amount.Size() i -= size @@ -912,6 +958,10 @@ func (m *EventBuy) Size() (n int) { n += 1 + l + sovEvents(uint64(l)) l = m.ClosingPrice.Size() n += 1 + l + sovEvents(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -941,6 +991,10 @@ func (m *EventSell) Size() (n int) { n += 1 + l + sovEvents(uint64(l)) l = m.ClosingPrice.Size() n += 1 + l + sovEvents(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -964,6 +1018,10 @@ func (m *EventClaim) Size() (n int) { } l = m.Amount.Size() n += 1 + l + sovEvents(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -1555,6 +1613,38 @@ func (m *EventBuy) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -1837,6 +1927,38 @@ func (m *EventSell) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -2017,6 +2139,38 @@ func (m *EventClaim) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:])