Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dev #377

Merged
merged 127 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
415ae53
updating proto for cPoolName and liquidationBonus
Jul 21, 2022
eb104b6
minor refactoring id -> ID
Jul 21, 2022
94bea99
Merge branch 'feature/dev' of https://github.com/comdex-official/comd…
Jul 21, 2022
38bd331
price range condition check removed
vishnukumavat Jul 22, 2022
31fcb61
testcase fixed
vishnukumavat Jul 22, 2022
53bb115
Merge pull request #361 from comdex-official/rm_prange
dheerajkd30 Jul 22, 2022
db990cc
audit bug fixes
Jul 23, 2022
10818e1
changes reverted
vishnukumavat Jul 24, 2022
cbddc17
Merge pull request #363 from comdex-official/lrevert
dheerajkd30 Jul 24, 2022
cd71d4e
Merge branch 'feature/dev' of https://github.com/comdex-official/comd…
Jul 25, 2022
775793d
proposals modified to accept single valued input
Jul 25, 2022
99dcc12
lend testcases- WIP
Jul 26, 2022
7ffa976
Adding binding unit tests
karthik340 Jul 26, 2022
08fae97
Merge pull request #369 from comdex-official/locker_unit_tests
dheerajkd30 Jul 26, 2022
44a6caa
started fixing warnings in workflow checks
vishnukumavat Jul 27, 2022
a2c3e8f
map iteration fi in codeql fixes
vishnukumavat Jul 27, 2022
3dd2dbf
map iteration modified in app.go
vishnukumavat Jul 27, 2022
b565e75
refactor
vishnukumavat Jul 27, 2022
f0391b2
recovery function added on concensus methods
vishnukumavat Jul 28, 2022
fb483ec
comment updated comment
vishnukumavat Jul 28, 2022
8c6e1e0
comment update
vishnukumavat Jul 28, 2022
f208d59
testcases fixed
Jul 29, 2022
b944864
Merge pull request #370 from comdex-official/codeql-fixes
dheerajkd30 Jul 29, 2022
3766f87
fix minor bugs in deposit stats
Jul 29, 2022
11443d5
Merge branch 'feature/dev' of https://github.com/comdex-official/comd…
Jul 29, 2022
f7492ce
more test cases fixed
Jul 29, 2022
5fc670d
more test cases fixed
Jul 29, 2022
f711bcb
more test cases fixed
Jul 29, 2022
a9b38dd
more test cases fixed
Jul 29, 2022
64a9b65
Withdraw Amount Limit check added
Jul 30, 2022
1b8579c
genesis proto modified
Jul 30, 2022
099844f
BorrowForAddressByPair validation removed
Jul 30, 2022
a634177
minor refactor
Jul 30, 2022
8fb9d60
lend genesis proto modified
Jul 30, 2022
0bdf851
liquidity proto update, proto rebuild done
vishnukumavat Jul 31, 2022
b0bcc8e
app validation added and liquidate borrow refactored
Jul 31, 2022
6d94992
Deposit Borrow Txn refactored
Jul 31, 2022
80918ff
Reserve balance stats set fn updated
Jul 31, 2022
8b75ce6
Create New Borrow Updated
Jul 31, 2022
4997e93
removed map implementation of storing liquidity farmers in liquidity …
vishnukumavat Jul 31, 2022
24ab5a1
typo fixes
vishnukumavat Jul 31, 2022
fefc9fd
typos and refactor
vishnukumavat Jul 31, 2022
a665441
Merge pull request #371 from comdex-official/farming_redo
dheerajkd30 Jul 31, 2022
ad6448e
Asset Stats By PoolID And AssetID implemented in Borrow txns
Jul 31, 2022
c9254dc
auction param added in lend
Jul 31, 2022
f0e0432
update app.go for auction params
Jul 31, 2022
4d6f993
auction fixed
Jul 31, 2022
e40a73a
query corrected
Aug 1, 2022
fac99f5
assetStats refactoring
Aug 1, 2022
9891454
Merge branch 'lendauction' of https://github.com/comdex-official/comd…
Aug 1, 2022
447d581
minor refactor
Aug 1, 2022
094d7b9
updating cPool Name in iter fn
Aug 1, 2022
f4aba38
LendPos AmountIn Handling for withdrawl of asset
Aug 1, 2022
da856f3
export genesis added, pointers removed
Aug 1, 2022
5655fcb
liquidation refactor
Aug 2, 2022
1c5381d
pulled changes
Aug 2, 2022
9a744ad
pointer removed from alias etc
Aug 2, 2022
d1a6906
Merge pull request #362 from comdex-official/auditFixes
dheerajkd30 Aug 2, 2022
e0326f3
minor refactor and format
dheerajkd30 Aug 2, 2022
2515c7f
tx fixed
Aug 2, 2022
f2be02c
tx fixed
Aug 2, 2022
fa9bb28
oracle fix
Aug 2, 2022
62c542f
Merge pull request #372 from comdex-official/auditFixes
dheerajkd30 Aug 2, 2022
d77af9e
pullled changes, lend refactor
Aug 2, 2022
6e04623
minor refactor
Aug 2, 2022
2b22f07
refactoring keeper
Aug 2, 2022
4b6b243
proposals modified to accept single inputs
Aug 2, 2022
3efc223
spell check
Aug 2, 2022
e47c3b4
error handling added
Aug 2, 2022
1f3be81
lend export genesis added
Aug 2, 2022
358ac78
pointer removed
Aug 2, 2022
3189ab7
auction loop reduced, telemetry added in abci
Aug 2, 2022
abd794e
distributor field added, minor changes
Aug 3, 2022
4c14ea2
commented code removed
Aug 3, 2022
4312444
import, export handelling for genesis state of liquidity added
vishnukumavat Aug 3, 2022
6f98416
event emition and gas consumption added
vishnukumavat Aug 3, 2022
1f49005
esm query added
Aug 3, 2022
657b451
gas value changes
vishnukumavat Aug 3, 2022
5d36f87
Merge pull request #374 from comdex-official/genesis_handel
dheerajkd30 Aug 3, 2022
27ca065
pulled changes, gas meter added in vault, locker
Aug 3, 2022
00309f6
adding BorrowAlternate Txn fn
Aug 3, 2022
b7f604e
removing dummy prices
Aug 3, 2022
d8610d5
gas meter added in auction,lend
Aug 3, 2022
1eb257d
gas meter added in lend
Aug 3, 2022
400e57d
esm change
Aug 3, 2022
de5fceb
removing event types
Aug 4, 2022
a9b6096
debt,surplus removed from lend
Aug 4, 2022
5bdb05e
pulled changes
Aug 4, 2022
342cfbe
initialising Asset Stats by pooID & assetID
Aug 4, 2022
23df666
audit fixes for market module
Aug 4, 2022
10471e5
reverting protogen changes
Aug 4, 2022
6ff8cf4
audit fix
Aug 4, 2022
eccdc67
audit fixes rewards module
Aug 4, 2022
a48a997
max price check in lend auction added
Aug 4, 2022
25255b2
commented code removed
Aug 4, 2022
cc8de18
missed epoch calculation optimized
vishnukumavat Aug 4, 2022
5523d01
missed validated basic calls added
vishnukumavat Aug 4, 2022
0a5bb1d
Merge pull request #375 from comdex-official/epoch_fix
dheerajkd30 Aug 4, 2022
b77bc2a
Merge branch 'feature/dev' of github.com:comdex-official/comdex into …
vishnukumavat Aug 4, 2022
e893ea1
Merge pull request #376 from comdex-official/validate_calls
dheerajkd30 Aug 4, 2022
e642588
rewards,locker handler removed, collector modified, auction err handling
Aug 4, 2022
e616447
refactoring keepers
Aug 4, 2022
1767161
audit fixes magic numbers
Aug 4, 2022
2c746b6
kill switch modified, bank transfer check added in vault,locker,token…
Aug 4, 2022
0527ea9
pulled changes
Aug 4, 2022
18f1983
lend dutch auction refactoring
Aug 5, 2022
4bd6a27
removed prop
Aug 5, 2022
ac43b4b
gas meter in esm, tokenmint, collector changes
Aug 5, 2022
5fa45e3
minor change
Aug 5, 2022
e8d168a
params minor change
Aug 5, 2022
e310c34
lend refactoring for optimized fn calls
Aug 5, 2022
7bb3d13
coin validation for non negative values added
Aug 5, 2022
e20071c
validate basic checks added
Aug 5, 2022
f07914d
validate basic for lend commands
Aug 5, 2022
2b2c540
minor refactoring
Aug 5, 2022
6439774
collector reverted, test cases fixed
Aug 5, 2022
eb183f6
auction testcase fixed
Aug 5, 2022
54bf8b1
update lint , make file and go mod
dheerajkd30 Aug 5, 2022
35e380d
Merge pull request #378 from comdex-official/update-lint
dheerajkd30 Aug 5, 2022
a319ed5
function name changed
Aug 5, 2022
2992007
Merge pull request #373 from comdex-official/feature/lend_refactor
dheerajkd30 Aug 5, 2022
2d27c61
go fmt modules
dheerajkd30 Aug 5, 2022
03d4792
refactor vault
dheerajkd30 Aug 5, 2022
03c1295
removed unused code
dheerajkd30 Aug 5, 2022
87f52f7
Merge pull request #379 from comdex-official/refactor-5
dheerajkd30 Aug 5, 2022
39359c5
refactor and resolve issues
dheerajkd30 Aug 5, 2022
ce98d74
Merge pull request #380 from comdex-official/refactor-5
dheerajkd30 Aug 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ linters:
- bodyclose
- deadcode
- depguard
- dogsled
# - dogsled
#- dupl
- errcheck
- funlen
#- funlen
- forcetypeassert
#- gochecknoglobals
#- gochecknoinits
#- gocognit
Expand All @@ -58,7 +59,7 @@ linters:
- nakedret
#- nestif
#- nolintlint
- prealloc
#- prealloc
- rowserrcheck
- scopelint
- staticcheck
Expand All @@ -67,7 +68,7 @@ linters:
- testpackage
- typecheck
- unconvert
- unparam
#- unparam
- unused
- varcheck
- whitespace
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ endif

all: install test

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify

clean:
rm -rf $(CURDIR)/artifacts/

distclean: clean
rm -rf vendor/

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/comdex

Expand Down
26 changes: 17 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package app

import (
"fmt"
"net/http"
"sort"

icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"net/http"

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host"
Expand Down Expand Up @@ -192,10 +194,10 @@ func GetGovProposalHandlers() []govclient.ProposalHandler {
proposalHandlers := []govclient.ProposalHandler{
bandoraclemoduleclient.AddFetchPriceHandler,
lendclient.AddLendPairsHandler,
lendclient.UpdateLendPairsHandler,
lendclient.AddPoolHandler,
lendclient.AddAssetToPairHandler,
lendclient.AddAssetRatesStatsHandler,
lendclient.AddAuctionParamsHandler,
paramsclient.ProposalHandler,
distrclient.ProposalHandler,
upgradeclient.ProposalHandler,
Expand Down Expand Up @@ -551,7 +553,7 @@ func New(
&app.MarketKeeper,
)

app.LendKeeper = *lendkeeper.NewKeeper(
app.LendKeeper = lendkeeper.NewKeeper(
app.cdc,
app.keys[lendtypes.StoreKey],
app.keys[lendtypes.StoreKey],
Expand All @@ -562,7 +564,7 @@ func New(
&app.MarketKeeper,
)

app.EsmKeeper = *esmkeeper.NewKeeper(
app.EsmKeeper = esmkeeper.NewKeeper(
app.cdc,
app.keys[esmtypes.StoreKey],
app.keys[esmtypes.StoreKey],
Expand Down Expand Up @@ -613,7 +615,7 @@ func New(
app.IbcKeeper.ChannelKeeper,
)

app.MarketKeeper = *marketkeeper.NewKeeper(
app.MarketKeeper = marketkeeper.NewKeeper(
app.cdc,
app.keys[markettypes.StoreKey],
app.GetSubspace(markettypes.ModuleName),
Expand All @@ -622,7 +624,7 @@ func New(
&app.BandoracleKeeper,
)

app.LiquidationKeeper = *liquidationkeeper.NewKeeper(
app.LiquidationKeeper = liquidationkeeper.NewKeeper(
app.cdc,
keys[liquidationtypes.StoreKey],
keys[liquidationtypes.MemStoreKey],
Expand All @@ -637,7 +639,7 @@ func New(
&app.LendKeeper,
)

app.AuctionKeeper = *auctionkeeper.NewKeeper(
app.AuctionKeeper = auctionkeeper.NewKeeper(
app.cdc,
keys[auctiontypes.StoreKey],
keys[auctiontypes.MemStoreKey],
Expand All @@ -654,7 +656,7 @@ func New(
&app.LendKeeper,
)

app.CollectorKeeper = *collectorkeeper.NewKeeper(
app.CollectorKeeper = collectorkeeper.NewKeeper(
app.cdc,
app.keys[collectortypes.StoreKey],
app.keys[collectortypes.MemStoreKey],
Expand Down Expand Up @@ -699,7 +701,7 @@ func New(
&app.Rewardskeeper,
)

app.Rewardskeeper = *rewardskeeper.NewKeeper(
app.Rewardskeeper = rewardskeeper.NewKeeper(
app.cdc,
app.keys[rewardstypes.StoreKey],
app.keys[rewardstypes.MemStoreKey],
Expand Down Expand Up @@ -995,7 +997,13 @@ func (a *App) LoadHeight(height int64) error {
// ModuleAccountAddrs returns all the app's module account addresses.
func (a *App) ModuleAccountAddrs() map[string]bool {
accounts := make(map[string]bool)

names := make([]string, 0)
for name := range a.ModuleAccountsPermissions() {
names = append(names, name)
}
sort.Strings(names)
for _, name := range names {
accounts[authtypes.NewModuleAddress(name).String()] = true
}

Expand Down
1 change: 1 addition & 0 deletions app/wasm/bindings/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type MsgSetAuctionMappingForApp struct {
AssetIDs []uint64 `json:"asset_id"`
IsSurplusAuctions []bool `json:"is_surplus_auction"`
IsDebtAuctions []bool `json:"is_debt_auction"`
IsDistributor []bool `json:"is_distributor"`
AssetOutOraclePrices []bool `json:"asset_out_oracle_price"`
AssetOutPrices []uint64 `json:"asset_out_price"`
}
Expand Down
9 changes: 3 additions & 6 deletions app/wasm/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ func WhiteListAsset(lockerKeeper lockerkeeper.Keeper, ctx sdk.Context, contractA
AppId: whiteListAsset.AppID,
AssetId: whiteListAsset.AssetID,
}
msgServer := lockerkeeper.NewMsgServer(lockerKeeper)
_, err := msgServer.MsgAddWhiteListedAsset(sdk.WrapSDKContext(ctx), &msg)
_, err := lockerKeeper.AddWhiteListedAsset(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand All @@ -150,8 +149,7 @@ func WhitelistAppIDLockerRewards(rewardsKeeper rewardskeeper.Keeper, ctx sdk.Con
AppMappingId: whiteListAsset.AppID,
AssetId: whiteListAsset.AssetIDs,
}
msgServer := rewardskeeper.NewMsgServerImpl(rewardsKeeper)
_, err := msgServer.Whitelist(sdk.WrapSDKContext(ctx), &msg)
_, err := rewardsKeeper.Whitelist(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand All @@ -175,8 +173,7 @@ func WhitelistAppIDVaultInterest(rewardsKeeper rewardskeeper.Keeper, ctx sdk.Con
From: contractAddr,
AppMappingId: whiteListAsset.AppID,
}
msgServer := rewardskeeper.NewMsgServerImpl(rewardsKeeper)
_, err := msgServer.WhitelistAppVault(sdk.WrapSDKContext(ctx), &msg)
_, err := rewardsKeeper.WhitelistAppVault(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand Down
Loading