Skip to content

Commit

Permalink
refactor: remove token factory (#1490)
Browse files Browse the repository at this point in the history
* update to ibc v6

* fix test and bump pfm v6

* remove wasmd and cosmwasm and delete store key

* add deployment

* update to ibc v6

* update to ibc v6

* fix test and bump pfm v6

* remove wasmd and cosmwasm and delete store key

* add deployment

* linting

* refactor: remove token factory

* remove tokenfactory proto

* fix channel capability issue, and remove wasm from Dockerfile

* lint

---------

Co-authored-by: Jacob Gadikian <[email protected]>
Co-authored-by: Tuan Tran <[email protected]>
Co-authored-by: Joe Bowman <[email protected]>
  • Loading branch information
4 people authored Apr 25, 2024
1 parent 292f781 commit 736ecbc
Show file tree
Hide file tree
Showing 51 changed files with 14 additions and 9,573 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.2-alpine3.18 AS builder
FROM golang:1.22.2-alpine3.19 AS builder
RUN apk add --no-cache git musl-dev openssl-dev linux-headers ca-certificates build-base

WORKDIR /src/app/
Expand All @@ -9,20 +9,20 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
#RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
# wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
# -O /lib/libwasmvm_muslc.a && \
# # verify checksum
# wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
# sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
LINK_STATICALLY=true make build

# Add to a distroless container
FROM alpine:3.18
FROM alpine:3.19
COPY --from=builder /src/app/build/quicksilverd /usr/local/bin/quicksilverd
RUN adduser -S -h /quicksilver -D quicksilver -u 1000
USER quicksilver
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,10 @@ proto-breaking-check:
bufbuild/buf:$(BUF_VERSION) breaking --against '.git#branch=develop'
@echo "✅ Completed protobuf breaking check!"

proto-setup:
@echo "🤖 Setting up protobuf environment..."
@$(DOCKER) build --rm --tag quicksilver-proto:latest --file proto/Dockerfile .
@echo "✅ Setup protobuf environment!"
# proto-setup:
# @echo "🤖 Setting up protobuf environment..."
# @$(DOCKER) build --rm --tag quicksilver-proto:latest --file proto/Dockerfile .
# @echo "✅ Setup protobuf environment!"

### Other tools
.PHONY: hermes-build
Expand Down
12 changes: 0 additions & 12 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ import (
participationrewardskeeper "github.com/quicksilver-zone/quicksilver/x/participationrewards/keeper"
participationrewardstypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types"
supplykeeper "github.com/quicksilver-zone/quicksilver/x/supply/keeper"
tokenfactorykeeper "github.com/quicksilver-zone/quicksilver/x/tokenfactory/keeper"
tokenfactorytypes "github.com/quicksilver-zone/quicksilver/x/tokenfactory/types"
)

type AppKeepers struct {
Expand Down Expand Up @@ -114,7 +112,6 @@ type AppKeepers struct {
InterchainQueryKeeper interchainquerykeeper.Keeper
ParticipationRewardsKeeper *participationrewardskeeper.Keeper
AirdropKeeper *airdropkeeper.Keeper
TokenFactoryKeeper tokenfactorykeeper.Keeper
SupplyKeeper supplykeeper.Keeper

// IBC keepers
Expand Down Expand Up @@ -426,14 +423,6 @@ func (appKeepers *AppKeepers) InitKeepers(
panic(err)
}

appKeepers.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
appKeepers.keys[tokenfactorytypes.StoreKey],
appKeepers.GetSubspace(tokenfactorytypes.ModuleName),
appKeepers.AccountKeeper,
appKeepers.BankKeeper.WithMintCoinsRestriction(tokenfactorytypes.NewTokenFactoryDenomMintCoinsRestriction()),
appKeepers.DistrKeeper,
)

// Quicksilver Keepers
appKeepers.EpochsKeeper = epochskeeper.NewKeeper(appCodec, appKeepers.keys[epochstypes.StoreKey])
appKeepers.ParticipationRewardsKeeper.SetEpochsKeeper(appKeepers.EpochsKeeper)
Expand Down Expand Up @@ -547,7 +536,6 @@ func (*AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *cod
paramsKeeper.Subspace(interchainquerytypes.ModuleName)
paramsKeeper.Subspace(participationrewardstypes.ModuleName)
paramsKeeper.Subspace(airdroptypes.ModuleName)
paramsKeeper.Subspace(tokenfactorytypes.ModuleName)

return paramsKeeper
}
Expand Down
2 changes: 0 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
minttypes "github.com/quicksilver-zone/quicksilver/x/mint/types"
participationrewardstypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types"
supplytypes "github.com/quicksilver-zone/quicksilver/x/supply/types"
tokenfactorytypes "github.com/quicksilver-zone/quicksilver/x/tokenfactory/types"
)

// TODO: We need to automate this, by bundling with a module struct...
Expand Down Expand Up @@ -64,7 +63,6 @@ func KVStoreKeys() []string {
interchainquerytypes.StoreKey,
participationrewardstypes.StoreKey,
airdroptypes.StoreKey,
tokenfactorytypes.StoreKey,
supplytypes.StoreKey,
}
}
Expand Down
9 changes: 0 additions & 9 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ import (
participationrewardstypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types"
"github.com/quicksilver-zone/quicksilver/x/supply"
supplytypes "github.com/quicksilver-zone/quicksilver/x/supply/types"
"github.com/quicksilver-zone/quicksilver/x/tokenfactory"
tokenfactorytypes "github.com/quicksilver-zone/quicksilver/x/tokenfactory/types"
)

var (
Expand Down Expand Up @@ -108,7 +106,6 @@ var (
interchainquery.AppModuleBasic{},
participationrewards.AppModuleBasic{},
airdrop.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
supply.AppModuleBasic{},
)

Expand All @@ -129,7 +126,6 @@ var (
participationrewardstypes.ModuleName: nil,
airdroptypes.ModuleName: nil,
packetforwardtypes.ModuleName: nil,
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}
)

Expand Down Expand Up @@ -175,7 +171,6 @@ func appModules(
interchainquery.NewAppModule(appCodec, app.InterchainQueryKeeper),
participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
supply.NewAppModule(appCodec, app.SupplyKeeper),
}
}
Expand Down Expand Up @@ -214,7 +209,6 @@ func simulationModules(
interchainquery.NewAppModule(appCodec, app.InterchainQueryKeeper),
participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
// supply.NewAppModule(appCodec, app.SupplyKeeper),
}
}
Expand Down Expand Up @@ -260,7 +254,6 @@ func orderBeginBlockers() []string {
feegrant.ModuleName,
paramstypes.ModuleName,
vestingtypes.ModuleName,
tokenfactorytypes.ModuleName,
supplytypes.ModuleName,
}
}
Expand Down Expand Up @@ -303,7 +296,6 @@ func orderEndBlockers() []string {
interchainstakingtypes.ModuleName,
participationrewardstypes.ModuleName,
airdroptypes.ModuleName,
tokenfactorytypes.ModuleName,
supplytypes.ModuleName,
// currently no-op.
}
Expand Down Expand Up @@ -346,7 +338,6 @@ func orderInitBlockers() []string {
interchainquerytypes.ModuleName,
participationrewardstypes.ModuleName,
airdroptypes.ModuleName,
tokenfactorytypes.ModuleName,
supplytypes.ModuleName,
// NOTE: crisis module must go at the end to check for invariants on each module
crisistypes.ModuleName,
Expand Down
16 changes: 0 additions & 16 deletions proto/quicksilver/tokenfactory/v1beta1/authorityMetadata.proto

This file was deleted.

32 changes: 0 additions & 32 deletions proto/quicksilver/tokenfactory/v1beta1/genesis.proto

This file was deleted.

16 changes: 0 additions & 16 deletions proto/quicksilver/tokenfactory/v1beta1/params.proto

This file was deleted.

66 changes: 0 additions & 66 deletions proto/quicksilver/tokenfactory/v1beta1/query.proto

This file was deleted.

Loading

0 comments on commit 736ecbc

Please sign in to comment.