diff --git a/go.mod b/go.mod index 289adccd6..dc3adf36b 100644 --- a/go.mod +++ b/go.mod @@ -238,7 +238,7 @@ replace ( // for collections cosmossdk.io/api => cosmossdk.io/api v0.3.1 // use dymension forks - github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20240625101522-b1506ae83050 + github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20241013112411-5ef491708a2d github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/osmosis-labs/osmosis/osmomath => github.com/dymensionxyz/osmosis/osmomath v0.0.6-dymension-v0.1.0.20240820121212-c0e21fa21e43 github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.1-0.20240820121212-c0e21fa21e43 diff --git a/go.sum b/go.sum index 2a19763e3..a67018703 100644 --- a/go.sum +++ b/go.sum @@ -500,8 +500,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20240625101522-b1506ae83050 h1:1mtlo6bDOdBihHWbDpOaai0NMC/4xHCkCHGCqdLT8WM= -github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20240625101522-b1506ae83050/go.mod h1:aokD0im7cUMMtR/khzNsmcGtINtxCpBfcgRvJdmLymA= +github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20241013112411-5ef491708a2d h1:UiPbek/78Cr0hUKJmCCtVt0VkfGop5zV39tnF08I6Qk= +github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20241013112411-5ef491708a2d/go.mod h1:aokD0im7cUMMtR/khzNsmcGtINtxCpBfcgRvJdmLymA= github.com/dymensionxyz/gerr-cosmos v1.1.0 h1:IW/P7HCB/iP9kgk3VXaWUoMoyx3vD76YO6p1fnubHVc= github.com/dymensionxyz/gerr-cosmos v1.1.0/go.mod h1:n+0olxPogzWqFKba45mCpvrHLGmeS8W9UZjggHnWk6c= github.com/dymensionxyz/osmosis/osmomath v0.0.6-dymension-v0.1.0.20240820121212-c0e21fa21e43 h1:EskhZ6ILN3vwJ6l8gPWPZ49RFSB52WghT5v+pmzrNCI= diff --git a/proto/dymensionxyz/dymension/iro/events.proto b/proto/dymensionxyz/dymension/iro/events.proto index 4095e40e2..b57f09b27 100644 --- a/proto/dymensionxyz/dymension/iro/events.proto +++ b/proto/dymensionxyz/dymension/iro/events.proto @@ -14,23 +14,25 @@ message EventUpdateParams { Params old_params = 3 [ (gogoproto.nullable) = false ]; } - message EventNewIROPlan { string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; string plan_id = 2; - Plan plan = 3; + string rollapp_id = 3; } - message EventBuy { string buyer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; string plan_id = 2; string rollapp_id = 3; - string amount = 4[ + string amount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string cost = 5 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - string cost = 5[ + string taker_fee = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -40,13 +42,17 @@ message EventSell { string seller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; string plan_id = 2; string rollapp_id = 3; + string amount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; - string amount = 4[ + string revenue = 5 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - string revenue = 5[ + string taker_fee = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -56,16 +62,16 @@ message EventClaim { string claimer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; string plan_id = 2; string rollapp_id = 3; - string amount = 4[ + string amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; } - - message EventSettle { string plan_id = 1; string rollapp_id = 2; - //FIXME: Add more fields, probably liquidity related + string IBC_denom = 3; + uint64 pool_id = 4; + uint64 gauge_id = 5; } \ No newline at end of file diff --git a/x/iro/keeper/create_plan.go b/x/iro/keeper/create_plan.go index 4ae5a6c16..7b5bd8ee8 100644 --- a/x/iro/keeper/create_plan.go +++ b/x/iro/keeper/create_plan.go @@ -132,6 +132,16 @@ func (k Keeper) CreatePlan(ctx sdk.Context, allocatedAmount math.Int, start, pre // Set the plan in the store k.SetPlan(ctx, plan) + // Emit event + err = ctx.EventManager().EmitTypedEvent(&types.EventNewIROPlan{ + Creator: rollapp.Owner, + PlanId: fmt.Sprintf("%d", plan.Id), + RollappId: rollapp.RollappId, + }) + if err != nil { + return "", err + } + return fmt.Sprintf("%d", plan.Id), nil } diff --git a/x/iro/keeper/settle.go b/x/iro/keeper/settle.go index 18ff5a608..7cb46e873 100644 --- a/x/iro/keeper/settle.go +++ b/x/iro/keeper/settle.go @@ -58,15 +58,18 @@ func (k Keeper) Settle(ctx sdk.Context, rollappId, rollappIBCDenom string) error k.SetPlan(ctx, plan) // uses the raised DYM and unsold tokens to bootstrap the rollapp's liquidity pool - err = k.bootstrapLiquidityPool(ctx, plan) + poolID, gaugeID, err := k.bootstrapLiquidityPool(ctx, plan) if err != nil { return errors.Join(types.ErrFailedBootstrapLiquidityPool, err) } // Emit event err = ctx.EventManager().EmitTypedEvent(&types.EventSettle{ - RollappId: rollappId, PlanId: fmt.Sprintf("%d", plan.Id), + RollappId: rollappId, + IBCDenom: rollappIBCDenom, + PoolId: poolID, + GaugeId: gaugeID, }) if err != nil { return err @@ -82,14 +85,14 @@ func (k Keeper) Settle(ctx sdk.Context, rollappId, rollappIBCDenom string) error // - Determines the required pool liquidity amounts to fulfill the last price. // - Creates a balancer pool with the determined tokens and DYM. // - Uses leftover tokens as incentives to the pool LP token holders. -func (k Keeper) bootstrapLiquidityPool(ctx sdk.Context, plan types.Plan) error { +func (k Keeper) bootstrapLiquidityPool(ctx sdk.Context, plan types.Plan) (poolID, gaugeID uint64, err error) { unallocatedTokens := plan.TotalAllocation.Amount.Sub(plan.SoldAmt) // assumed > 0, as we enforce it in the Buy function raisedDYM := k.BK.GetBalance(ctx, plan.GetAddress(), appparams.BaseDenom) // assumed > 0, as we enforce it by IRO creation fee // send the raised DYM to the iro module as it will be used as the pool creator - err := k.BK.SendCoinsFromAccountToModule(ctx, plan.GetAddress(), types.ModuleName, sdk.NewCoins(raisedDYM)) + err = k.BK.SendCoinsFromAccountToModule(ctx, plan.GetAddress(), types.ModuleName, sdk.NewCoins(raisedDYM)) if err != nil { - return err + return 0, 0, err } // find the tokens needed to bootstrap the pool, to fulfill last price @@ -114,7 +117,7 @@ func (k Keeper) bootstrapLiquidityPool(ctx sdk.Context, plan types.Plan) error { // we call the pool manager directly, instead of the gamm keeper, to avoid the pool creation fee poolId, err := k.pm.CreatePool(ctx, balancerPool) if err != nil { - return err + return 0, 0, err } // Add incentives @@ -128,12 +131,12 @@ func (k Keeper) bootstrapLiquidityPool(ctx sdk.Context, plan types.Plan) error { Denom: poolDenom, Duration: k.ik.GetLockableDurations(ctx)[0], } - _, err = k.ik.CreateGauge(ctx, false, k.AK.GetModuleAddress(types.ModuleName), incentives, distrTo, ctx.BlockTime().Add(plan.IncentivePlanParams.StartTimeAfterSettlement), plan.IncentivePlanParams.NumEpochsPaidOver) + gaugeID, err = k.ik.CreateGauge(ctx, false, k.AK.GetModuleAddress(types.ModuleName), incentives, distrTo, ctx.BlockTime().Add(plan.IncentivePlanParams.StartTimeAfterSettlement), plan.IncentivePlanParams.NumEpochsPaidOver) if err != nil { - return err + return 0, 0, err } - return nil + return poolID, gaugeID, nil } // calcLiquidityPoolTokens determines the tokens and DYM to be used for bootstrapping the liquidity pool. diff --git a/x/iro/keeper/trade.go b/x/iro/keeper/trade.go index 4c0363cf7..7b414359d 100644 --- a/x/iro/keeper/trade.go +++ b/x/iro/keeper/trade.go @@ -99,6 +99,8 @@ func (k Keeper) Buy(ctx sdk.Context, planId string, buyer sdk.AccAddress, amount PlanId: planId, RollappId: plan.RollappId, Amount: amountTokensToBuy, + Cost: cost.Amount, + TakerFee: takerFee.Amount, }) if err != nil { return err @@ -154,6 +156,8 @@ func (k Keeper) Sell(ctx sdk.Context, planId string, seller sdk.AccAddress, amou PlanId: planId, RollappId: plan.RollappId, Amount: amountTokensToSell, + Revenue: cost.Amount, + TakerFee: takerFee.Amount, }) if err != nil { return err diff --git a/x/iro/types/events.pb.go b/x/iro/types/events.pb.go index e8c5c4ed1..dda3deeb3 100644 --- a/x/iro/types/events.pb.go +++ b/x/iro/types/events.pb.go @@ -87,9 +87,9 @@ func (m *EventUpdateParams) GetOldParams() Params { } type EventNewIROPlan struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - PlanId string `protobuf:"bytes,2,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` - Plan *Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,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"` } func (m *EventNewIROPlan) Reset() { *m = EventNewIROPlan{} } @@ -139,11 +139,11 @@ func (m *EventNewIROPlan) GetPlanId() string { return "" } -func (m *EventNewIROPlan) GetPlan() *Plan { +func (m *EventNewIROPlan) GetRollappId() string { if m != nil { - return m.Plan + return m.RollappId } - return nil + return "" } type EventBuy struct { @@ -152,6 +152,7 @@ type EventBuy struct { 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"` 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"` } func (m *EventBuy) Reset() { *m = EventBuy{} } @@ -214,6 +215,7 @@ type EventSell struct { 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"` 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"` } func (m *EventSell) Reset() { *m = EventSell{} } @@ -334,6 +336,9 @@ func (m *EventClaim) GetRollappId() string { 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"` + IBCDenom string `protobuf:"bytes,3,opt,name=IBC_denom,json=IBCDenom,proto3" json:"IBC_denom,omitempty"` + PoolId uint64 `protobuf:"varint,4,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` + GaugeId uint64 `protobuf:"varint,5,opt,name=gauge_id,json=gaugeId,proto3" json:"gauge_id,omitempty"` } func (m *EventSettle) Reset() { *m = EventSettle{} } @@ -383,6 +388,27 @@ func (m *EventSettle) GetRollappId() string { return "" } +func (m *EventSettle) GetIBCDenom() string { + if m != nil { + return m.IBCDenom + } + return "" +} + +func (m *EventSettle) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *EventSettle) GetGaugeId() uint64 { + if m != nil { + return m.GaugeId + } + return 0 +} + func init() { proto.RegisterType((*EventUpdateParams)(nil), "dymensionxyz.dymension.iro.EventUpdateParams") proto.RegisterType((*EventNewIROPlan)(nil), "dymensionxyz.dymension.iro.EventNewIROPlan") @@ -397,41 +423,45 @@ func init() { } var fileDescriptor_9d7833031285167c = []byte{ - // 537 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x94, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0xeb, 0xad, 0x6b, 0xc9, 0xdb, 0x01, 0x11, 0x4d, 0xa2, 0x54, 0x22, 0xad, 0x22, 0x04, - 0xbb, 0x2c, 0x99, 0x36, 0xc4, 0x9d, 0xa2, 0x31, 0xca, 0x01, 0xa6, 0x4c, 0x5c, 0xb8, 0x54, 0x6e, - 0x63, 0x32, 0x0b, 0xc7, 0x8e, 0x6c, 0x67, 0x5d, 0xf8, 0x02, 0x5c, 0x39, 0xf0, 0x51, 0xf8, 0x00, - 0x1c, 0x77, 0x9c, 0x38, 0x21, 0x24, 0x26, 0xd4, 0x7e, 0x0f, 0x84, 0xe2, 0xb8, 0xa3, 0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xff, 0x15, 0x01, 0x18, - 0x27, 0x9e, 0x31, 0x4c, 0x53, 0x73, 0x39, 0xcb, 0x05, 0xb9, 0xca, 0xe5, 0xac, 0x84, 0x37, 0x6d, - 0x86, 0xbf, 0x07, 0xeb, 0xf6, 0xbf, 0xd4, 0x9a, 0x91, 0x79, 0x1c, 0xb4, 0x04, 0x67, 0xe5, 0x1f, - 0x9c, 0xde, 0xcb, 0xd3, 0x89, 0x87, 0xce, 0x26, 0x1e, 0xfa, 0x35, 0xf1, 0xd0, 0xa7, 0xa9, 0x57, - 0x3b, 0x9b, 0x7a, 0xb5, 0xef, 0x53, 0xaf, 0xf6, 0x76, 0x7b, 0x0e, 0x68, 0xc1, 0xb3, 0x76, 0xbc, - 0x1b, 0x9e, 0x98, 0xb7, 0xcd, 0xe0, 0x0d, 0x1b, 0xe6, 0x79, 0xdb, 0xfd, 0x13, 0x00, 0x00, 0xff, - 0xff, 0x56, 0x7e, 0xfa, 0xf0, 0x9d, 0x05, 0x00, 0x00, + // 593 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcf, 0x6a, 0x14, 0x4f, + 0x10, 0xde, 0xd9, 0x6c, 0x76, 0x77, 0x2a, 0x87, 0x1f, 0xbf, 0x21, 0xe0, 0x26, 0xe2, 0x26, 0x2c, + 0xa2, 0xb9, 0x64, 0x26, 0x24, 0xe0, 0xdd, 0x89, 0x26, 0x8e, 0x82, 0x86, 0x0d, 0x5e, 0xbc, 0x2c, + 0xbd, 0xdb, 0x95, 0xc9, 0x90, 0x9e, 0xe9, 0xa1, 0xbb, 0x27, 0xc9, 0x08, 0xbe, 0x83, 0x27, 0x9f, + 0xc4, 0x07, 0xf0, 0x18, 0xf0, 0x12, 0xc4, 0x83, 0x08, 0x06, 0x49, 0x5e, 0x44, 0xba, 0xa7, 0x13, + 0x17, 0x21, 0x7f, 0x5c, 0x84, 0x9c, 0x66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, 0xa7, 0xff, 0x5b, 0x5b, 0x3f, 0x39, 0x00, 0xc6, 0xd6, 0x75, 0x46, 0x92, 0xd4, 0xbc, + 0x0f, 0xfd, 0x83, 0x37, 0x79, 0x1f, 0x15, 0xf1, 0xb6, 0x9d, 0xed, 0x7d, 0x70, 0x60, 0xc6, 0xde, + 0x0c, 0xa5, 0x18, 0x8e, 0xeb, 0x71, 0xae, 0xd0, 0x53, 0xff, 0x53, 0xcf, 0x5d, 0x70, 0xa3, 0x70, + 0x7d, 0x40, 0x31, 0xe3, 0xa9, 0x55, 0xdb, 0x8e, 0xc2, 0xf5, 0x27, 0x1a, 0x9b, 0xa2, 0x9c, 0x33, + 0x9d, 0xa8, 0xd5, 0x36, 0xfa, 0x4d, 0x0d, 0x23, 0xea, 0xcd, 0x41, 0x3b, 0x26, 0x45, 0x8c, 0x3a, + 0x32, 0x6d, 0x22, 0x2d, 0x83, 0x23, 0x1a, 0x3e, 0x3f, 0x3a, 0xed, 0x3a, 0xc7, 0xa7, 0x5d, 0xe7, + 0xe7, 0x69, 0xd7, 0x79, 0x7f, 0xd6, 0xad, 0x1d, 0x9f, 0x75, 0x6b, 0xdf, 0xce, 0xba, 0xb5, 0x37, + 0x2b, 0x63, 0x23, 0x5e, 0xb2, 0xaa, 0xf7, 0xd7, 0x82, 0x43, 0xb3, 0xaf, 0xcd, 0xc0, 0xc3, 0xa6, + 0x59, 0xd9, 0x6b, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x18, 0xc4, 0x05, 0x9b, 0x71, 0x06, 0x00, + 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -504,15 +534,10 @@ func (m *EventNewIROPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Plan != nil { - { - size, err := m.Plan.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RollappId))) i-- dAtA[i] = 0x1a } @@ -553,6 +578,16 @@ func (m *EventBuy) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.TakerFee.Size() + i -= size + if _, err := m.TakerFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 { size := m.Cost.Size() i -= size @@ -617,6 +652,16 @@ func (m *EventSell) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.TakerFee.Size() + i -= size + if _, err := m.TakerFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 { size := m.Revenue.Size() i -= size @@ -735,6 +780,23 @@ func (m *EventSettle) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GaugeId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.GaugeId)) + i-- + dAtA[i] = 0x28 + } + if m.PoolId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x20 + } + if len(m.IBCDenom) > 0 { + i -= len(m.IBCDenom) + copy(dAtA[i:], m.IBCDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.IBCDenom))) + i-- + dAtA[i] = 0x1a + } if len(m.RollappId) > 0 { i -= len(m.RollappId) copy(dAtA[i:], m.RollappId) @@ -794,8 +856,8 @@ func (m *EventNewIROPlan) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if m.Plan != nil { - l = m.Plan.Size() + l = len(m.RollappId) + if l > 0 { n += 1 + l + sovEvents(uint64(l)) } return n @@ -823,6 +885,8 @@ func (m *EventBuy) Size() (n int) { n += 1 + l + sovEvents(uint64(l)) l = m.Cost.Size() n += 1 + l + sovEvents(uint64(l)) + l = m.TakerFee.Size() + n += 1 + l + sovEvents(uint64(l)) return n } @@ -848,6 +912,8 @@ func (m *EventSell) Size() (n int) { n += 1 + l + sovEvents(uint64(l)) l = m.Revenue.Size() n += 1 + l + sovEvents(uint64(l)) + l = m.TakerFee.Size() + n += 1 + l + sovEvents(uint64(l)) return n } @@ -888,6 +954,16 @@ func (m *EventSettle) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } + l = len(m.IBCDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.PoolId != 0 { + n += 1 + sovEvents(uint64(m.PoolId)) + } + if m.GaugeId != 0 { + n += 1 + sovEvents(uint64(m.GaugeId)) + } return n } @@ -1140,9 +1216,9 @@ func (m *EventNewIROPlan) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvents @@ -1152,27 +1228,23 @@ func (m *EventNewIROPlan) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvents } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvents } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Plan == nil { - m.Plan = &Plan{} - } - if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RollappId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1388,6 +1460,40 @@ func (m *EventBuy) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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 + } + if err := m.TakerFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -1602,6 +1708,40 @@ func (m *EventSell) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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 + } + if err := m.TakerFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -1896,6 +2036,76 @@ func (m *EventSettle) Unmarshal(dAtA []byte) error { } m.RollappId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IBCDenom", 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.IBCDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GaugeId", wireType) + } + m.GaugeId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GaugeId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:])