-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(upgrade): remove deprecated gov proposals (incentives) (#2196)
* wip - add remove proposal logic * add incentives code * keep only incentives types * update tests * update upgrade logic * remove unnecessary types * update upgrade logic * update comments * make format * fix lint issues * add changelog entry * update upgrade logic (cherry picked from commit 7dfc497) # Conflicts: # app/app.go # app/upgrades/v16/proposals.go # app/upgrades/v16/upgrades.go # app/upgrades/v16/upgrades_test.go
- Loading branch information
1 parent
5d51d37
commit b21ed82
Showing
13 changed files
with
2,737 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright Tharsis Labs Ltd.(Evmos) | ||
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) | ||
syntax = "proto3"; | ||
package evmos.incentives.v1; | ||
import "evmos/incentives/v1/incentives.proto"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/evmos/evmos/v16/x/incentives/types"; | ||
|
||
// GenesisState defines the module's genesis state. | ||
message GenesisState { | ||
// params are the incentives module parameters | ||
Params params = 1 [(gogoproto.nullable) = false]; | ||
// incentives is a slice of active incentives | ||
repeated Incentive incentives = 2 [(gogoproto.nullable) = false]; | ||
// gas_meters is a slice of active Gasmeters | ||
repeated GasMeter gas_meters = 3 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// Params defines the incentives module params | ||
message Params { | ||
// enable_incentives is the parameter to enable incentives | ||
bool enable_incentives = 1; | ||
// allocation_limit is the maximum percentage an incentive can allocate per denomination | ||
string allocation_limit = 2 | ||
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; | ||
// incentives_epoch_identifier for the epochs module hooks | ||
string incentives_epoch_identifier = 3; | ||
// reward_scaler is the scaling factor for capping rewards | ||
string reward_scaler = 4 | ||
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright Tharsis Labs Ltd.(Evmos) | ||
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) | ||
syntax = "proto3"; | ||
package evmos.incentives.v1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
option go_package = "github.com/evmos/evmos/v16/x/incentives/types"; | ||
|
||
// Incentive defines an instance that organizes distribution conditions for a | ||
// given smart contract | ||
message Incentive { | ||
// contract address of the smart contract to be incentivized | ||
string contract = 1; | ||
// allocations is a slice of denoms and percentages of rewards to be allocated | ||
repeated cosmos.base.v1beta1.DecCoin allocations = 2 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; | ||
// epochs defines the number of remaining epochs for the incentive | ||
uint32 epochs = 3; | ||
// start_time of the incentive distribution | ||
google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; | ||
// total_gas is the cumulative gas spent by all gas meters of the incentive during the epoch | ||
uint64 total_gas = 5; | ||
} | ||
// GasMeter tracks the cumulative gas spent per participant in one epoch | ||
message GasMeter { | ||
// contract is the hex address of the incentivized smart contract | ||
string contract = 1; | ||
// participant address that interacts with the incentive | ||
string participant = 2; | ||
// cumulative_gas spent during the epoch | ||
uint64 cumulative_gas = 3; | ||
} | ||
|
||
// RegisterIncentiveProposal is a gov Content type to register an incentive | ||
message RegisterIncentiveProposal { | ||
option (gogoproto.equal) = false; | ||
// title of the proposal | ||
string title = 1; | ||
// description of the proposal | ||
string description = 2; | ||
// contract address to be registered | ||
string contract = 3; | ||
// allocations defines the denoms and percentage of rewards to be allocated | ||
repeated cosmos.base.v1beta1.DecCoin allocations = 4 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; | ||
// epochs is the number of remaining epochs for the incentive | ||
uint32 epochs = 5; | ||
} | ||
|
||
// CancelIncentiveProposal is a gov Content type to cancel an incentive | ||
message CancelIncentiveProposal { | ||
option (gogoproto.equal) = false; | ||
// title of the proposal | ||
string title = 1; | ||
// description of the proposal | ||
string description = 2; | ||
// contract address of the incentivized smart contract | ||
string contract = 3; | ||
} |
Oops, something went wrong.