Skip to content

Commit

Permalink
prep v4.1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
hard-nett committed Nov 18, 2023
1 parent 0a94d73 commit c301a51
Show file tree
Hide file tree
Showing 79 changed files with 8,035 additions and 165 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ This framework is like a craft genetics lineage, one that has been fine tuned wi
If we forgot you in this list, let us know or open a PR ::)


## DISCLAIMER
# Disclaimer
TERP-CORE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. No developer or entity involved in running terp-core software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of Stargaze, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. Although Discover Decentralization, LLC and it's affiliates developed the initial code for Terp-Core, it does not own or control the Terp Network, which is run by a decentralized validator set.
50 changes: 50 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Terp-Core Security Policy

This document describes the Terp Network Security team's process for handling security issues.

## Reporting Security Issues

__IMPORTANT:__ _Please DO NOT open public issues for security related matters, or discuss it in public forum or on social media._

### Email

All security issues should be reported via email to [terp.network@skiff.com](mailto:terp.network@skiff.com). Email is delivered to the Terp Network Foundation DAO.

Include the following details in the report:

- Your name;
- Your affiliation (if applicable);
- Technical description of the issue, including steps to reproduce;
- Explanation of who may be able to exploit this vulnerability and what the impact or implications may be;
- Whether this vulnerability is public or known to third parties. Please provide details where applicable;

_Please notify the Terp Network Security team at the email above of existing public issues that may be of critical security importance._ Please ensure to include the issue ID along with a short description / explanation of the security relevance.

### GitHub Private Vulnerability Reporting

Under the repository "Security" tab / Security Advisories you will find "Report a vulnerability". Please complete the provided form with as much details as possible.

For more information on GitHub private vulnerability reporting [see this](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).

_Best practices for writing repository security advisories_ can be found [here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/best-practices-for-writing-repository-security-advisories).

Security researchers can also use the REST API to privately report security vulnerabilities. For more information, see "[Privately report a security vulnerability](https://docs.github.com/en/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability)" in the REST API documentation.

## Handling Security Issues

The Terp Network Security team will:

1. Verify and confirm the issue;
2. Determine affected versions and scope of impact;
3. Conduct audits to find any potential similar and related issues;
4. Prepare fixes for relevant in-production releases;
5. Endeavor to communicate and coordinate with relevant ecosystem stakeholders, including the Terp Network communities, at the appropriate times;

Please assist the Terp Network Security team by following these guidelines:

- Allow a reasonable amount of time for the team to respond to and address the issue;
- Avoid exploiting any issues or vulnerabilities that you may become aware of;
- Demonstrate good faith by not disrupting the Terp Network's networks, data, services or communities;

_Every effort will be made to handle and address security issues as quickly and efficiently as possible._

5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import (
"github.com/terpnetwork/terp-core/v4/app/openapiconsole"
v2 "github.com/terpnetwork/terp-core/v4/app/upgrades/v2"
v3 "github.com/terpnetwork/terp-core/v4/app/upgrades/v3"
v4 "github.com/terpnetwork/terp-core/v4/app/upgrades/v4"
"github.com/terpnetwork/terp-core/v4/app/upgrades/v4_1"
"github.com/terpnetwork/terp-core/v4/docs"

"github.com/CosmWasm/wasmd/x/wasm"
Expand Down Expand Up @@ -100,7 +100,8 @@ var (
Upgrades = []upgrades.Upgrade{
v2.Upgrade,
v3.Upgrade,
v4.Upgrade,
// v4.Upgrade, patched for v4_1
v4_1.Upgrade,
}
)

Expand Down
48 changes: 38 additions & 10 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,19 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

denomburn "github.com/terpnetwork/terp-core/v4/x/burn"
// clockkeeper "github.com/terpnetwork/terp-core/v4/x/clock/keeper"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
clockkeeper "github.com/terpnetwork/terp-core/v4/x/clock/keeper"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
dripkeeper "github.com/terpnetwork/terp-core/v4/x/drip/keeper"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"
feesharekeeper "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper"
feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types"

"github.com/terpnetwork/terp-core/v4/x/globalfee"
globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper"
globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types"

// token factory
// cwhookskeeper "github.com/terpnetwork/terp-core/v4/x/cw-hooks/keeper"
// cwhookstypes "github.com/terpnetwork/terp-core/v4/x/cw-hooks/types"

"github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings"
tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper"
Expand Down Expand Up @@ -175,9 +178,10 @@ type AppKeepers struct {
PacketForwardKeeper *packetforwardkeeper.Keeper
ICQKeeper icqkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
// ClockKeeper clockkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
ClockKeeper clockkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
// CWHooksKeeper cwhookskeeper.Keeper
WasmKeeper wasmkeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
Expand All @@ -187,6 +191,8 @@ type AppKeepers struct {
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
ScopedICQKeeper capabilitykeeper.ScopedKeeper

DripKeeper dripkeeper.Keeper

// Middleware wrapper
Ics20WasmHooks *ibchooks.WasmHooks
HooksICS4Wrapper ibchooks.ICS4Middleware
Expand Down Expand Up @@ -324,7 +330,10 @@ func NewAppKeepers(
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
stakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks()),
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(),
appKeepers.SlashingKeeper.Hooks(),
// appKeepers.CWHooksKeeper.StakingHooks(),
),
)
appKeepers.StakingKeeper = stakingKeeper

Expand Down Expand Up @@ -364,7 +373,7 @@ func NewAppKeepers(
)
appKeepers.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// appKeepers.CWHooksKeeper.GovHooks(),
),
)

Expand Down Expand Up @@ -574,9 +583,28 @@ func NewAppKeepers(
appKeepers.keys[globalfeetypes.StoreKey],
govModAddress,
)
// appKeepers.ClockKeeper = clockkeeper.NewKeeper(
// appKeepers.keys[clocktypes.StoreKey],

appKeepers.DripKeeper = dripkeeper.NewKeeper(
appKeepers.keys[driptypes.StoreKey],
appCodec,
appKeepers.BankKeeper,
authtypes.FeeCollectorName,
govModAddress,
)

appKeepers.ClockKeeper = clockkeeper.NewKeeper(
appKeepers.keys[clocktypes.StoreKey],
appCodec,
*appKeepers.ContractKeeper,
govModAddress,
)

// appKeepers.CWHooksKeeper = cwhookskeeper.NewKeeper(
// appKeepers.keys[cwhookstypes.StoreKey],
// appCodec,
// stakingKeeper,
// *govKeeper,
// appKeepers.WasmKeeper,
// *appKeepers.ContractKeeper,
// govModAddress,
// )
Expand Down
9 changes: 7 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ import (
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"

// cwhookstypes "github.com/terpnetwork/terp-core/v4/x/cw-hooks/types"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down Expand Up @@ -68,7 +71,9 @@ func (appKeepers *AppKeepers) GenerateKeys() {
ibchookstypes.StoreKey,
feesharetypes.StoreKey,
globalfeetypes.StoreKey,
// clocktypes.StoreKey,
clocktypes.StoreKey,
driptypes.StoreKey,
// cwhookstypes.StoreKey,
tokenfactorytypes.StoreKey,
)

Expand Down
29 changes: 22 additions & 7 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"

// "github.com/terpnetwork/terp-core/v4/x/clock"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
"github.com/terpnetwork/terp-core/v4/x/clock"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -66,10 +66,15 @@ import (
"github.com/terpnetwork/terp-core/v4/x/globalfee"
"github.com/terpnetwork/terp-core/v4/x/tokenfactory"

"github.com/terpnetwork/terp-core/v4/x/drip"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"

"github.com/cosmos/cosmos-sdk/x/group"
ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"

// cwhooks "github.com/terpnetwork/terp-core/v4/x/cw-hooks"

tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"

groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
Expand Down Expand Up @@ -110,8 +115,10 @@ var ModuleBasics = module.NewBasicManager(
packetforward.AppModuleBasic{},
feeshare.AppModuleBasic{},
globalfee.AppModuleBasic{},
// clock.AppModuleBasic{},
clock.AppModuleBasic{},
drip.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
// cwhooks.AppModuleBasic{},
)

func appModules(
Expand Down Expand Up @@ -157,7 +164,8 @@ func appModules(
ica.NewAppModule(&app.AppKeepers.ICAControllerKeeper, &app.AppKeepers.ICAHostKeeper),
icq.NewAppModule(app.AppKeepers.ICQKeeper),
packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper),
// clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper),
clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper),
// cwhooks.NewAppModule(appCodec, app.AppKeepers.CWHooksKeeper),
ibchooks.NewAppModule(app.AppKeepers.AccountKeeper),
crisis.NewAppModule(app.AppKeepers.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
}
Expand Down Expand Up @@ -189,6 +197,7 @@ func simulationModules(
ibc.NewAppModule(app.AppKeepers.IBCKeeper),
transfer.NewAppModule(app.AppKeepers.TransferKeeper),
feeshare.NewAppModule(app.AppKeepers.FeeShareKeeper, app.AppKeepers.AccountKeeper, app.GetSubspace(feesharetypes.ModuleName)),
drip.NewAppModule(app.AppKeepers.DripKeeper, app.AppKeepers.AccountKeeper),
ibcfee.NewAppModule(app.AppKeepers.IBCFeeKeeper),
}
}
Expand Down Expand Up @@ -221,11 +230,13 @@ func orderBeginBlockers() []string {
ibcfeetypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Expand Down Expand Up @@ -258,11 +269,13 @@ func orderEndBlockers() []string {
ibcfeetypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Expand All @@ -280,13 +293,15 @@ func orderInitBlockers() []string {
icatypes.ModuleName,
ibcfeetypes.ModuleName,
// wasm after ibc transfer
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Loading

0 comments on commit c301a51

Please sign in to comment.