-
Notifications
You must be signed in to change notification settings - Fork 14
feat: liquid staking module integration #61
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
Merged
Merged
Changes from all commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
1dcb836
test: test deploy to server
nikita-misiura affd81c
fix: fix docker-compose path
nikita-misiura 3634b2b
fix: fix docker-compose path
nikita-misiura 6007a2d
fix: fix docker-compose path #1
nikita-misiura 998586a
fix: fix docker-compose path #2
nikita-misiura 6b2146d
fix(HOTFIX): add envs to compose
nikita-misiura 726b6d8
fix(HOTFIX): add envs to compose #1
nikita-misiura 29cbd0f
fix(HOTFIX): add envs to compose #2
nikita-misiura ec8844d
fix(HOTFIX): add envs to compose #3
nikita-misiura e57025a
feat(TAC-21): update node to main finally
nikita-misiura ee21872
draft: Register gTAC with x/erc20
a-romanenya-pixelplex 0e7e05b
draft(FIX): Removed gTAC registration in app constructor
a-romanenya-pixelplex cc06b25
draft(FEAT): Added set token pair function into InitChainer
a-romanenya-pixelplex c95288c
fix: fix docker-compose path
nikita-misiura 54e49a0
fix: fix docker-compose path #1
nikita-misiura 362853e
fix: fix docker-compose path #2
nikita-misiura 8cc4650
fix(HOTFIX): add envs to compose
nikita-misiura a2e369c
fix(HOTFIX): add envs to compose #1
nikita-misiura ae45d07
fix(HOTFIX): add envs to compose #2
nikita-misiura bf4ddcc
fix(HOTFIX): add envs to compose #3
nikita-misiura d19d79a
feat: Integrate “x/liquidstake” module
a-romanenya-pixelplex cb3a8d4
chore: Update Cosmos SDK
a-romanenya-pixelplex efb8cd7
refactor: Refactor x/liquidstake module
a-romanenya-pixelplex 9be14d3
try to emplement liquid staking
Alexey-Ostrovsky b472084
(draft) fixing compatibility issues
Alexey-Ostrovsky ba99838
dependency cherry-picking
Alexey-Ostrovsky a7a7db3
draft: Merged from TAC-12
a-romanenya-pixelplex ec3918a
Merge branch 'TAC-20' into TAC-13
a-romanenya-pixelplex d9949d9
remove redunant tests
Alexey-Ostrovsky 9dde47b
protogen fix
Alexey-Ostrovsky dbd83da
another fix on fix
Alexey-Ostrovsky c1ac062
error handling
Alexey-Ostrovsky 9849dde
draft: added init function for erc20, x/liauidstake modules and chang…
a-romanenya-pixelplex 529f949
fix docker build
Alexey-Ostrovsky 42d5b8f
chore: remove needless log and updated Cosmos SDK module location in …
a-romanenya-pixelplex e1e375e
[TAC-46]: deploy localnode
nikita-misiura 6a97f07
fix(HOTFIX): change deployed branch
nikita-misiura 05d805f
feat(UPDATE): change built image
nikita-misiura a42cc84
feat(UPDATE): add libc6
nikita-misiura af81de9
feat(UPDATE): change runner tag
nikita-misiura 70daa6e
feat(UPDATE): unchange runner tag
nikita-misiura 4b27ec5
feat(UPDATE): add image
nikita-misiura f40dc0d
feat(UPDATE): expose necessary ports
nikita-misiura 5ee0971
feat(UPDATE): expose necessary ports#!
nikita-misiura 0af94b5
draft: added tests
a-romanenya-pixelplex 7cc9f47
[TAC-46]: deploy second node
nikita-misiura a740b30
[TAC-46]: create initial genesis for both nodes
nikita-misiura 66f35f0
Revert "[TAC-46]: create initial genesis for both nodes"
nikita-misiura f84b816
[TAC-46]: change node_id
nikita-misiura 7f54ba8
[TAC-46]: deploy multi-node chain
nikita-misiura e5f912f
[TAC-46]: deploy multi-node chain #1
nikita-misiura f0d6362
[TAC-46]: deploy localchain with 4 node-validators
nikita-misiura e17bf39
feat: added web3Tx extension to implement eip-712 tx
a-romanenya-pixelplex 1074440
Merge branch 'TAC-60' into localnet
a-romanenya-pixelplex cd91ec4
testing migration
Alexey-Ostrovsky e2c2e1a
rstore vote
Alexey-Ostrovsky 4b395c5
few fixes
Alexey-Ostrovsky ef7b115
Merge branch 'migration_testing' into 'TAC-60'
Alexey-Ostrovsky 23f2de9
draft: updated script for init multinode
a-romanenya-pixelplex 21421b3
Merge branch 'localnet' into TAC-60
a-romanenya-pixelplex 8ebbe07
fix(HOTFIX): add liquiedstake script do docker
nikita-misiura 9681118
fix(HOTFIX): add liquiedstake script do docker #1
nikita-misiura 4df4a48
fix(HOTFIX): change init-multi-node.sh script
nikita-misiura a7bc306
feat: upgraded cosmos evm for eip712
a-romanenya-pixelplex 93b778d
chore: open grpc and rest ports
a-romanenya-pixelplex b84492a
chore: add ports to start script
a-romanenya-pixelplex 09b665d
fix: grpc address
a-romanenya-pixelplex a5b52fe
fix(TAC-70): fix REST API port
SergeyAndreevPixel dd39b3c
fix(TAC-70): allow cors
SergeyAndreevPixel 68af7d0
fix: update cosmos evm
a-romanenya-pixelplex 7cbb7cb
Merge branch 'TAC-66' into localnet
a-romanenya-pixelplex 79dfd14
chore: updated Dockerfile to download go modules before app building
a-romanenya-pixelplex a03c30c
Merge branch 'TAC-66' into localnet
a-romanenya-pixelplex 9a40cde
Correct Net amount calculation logick
Alexey-Ostrovsky 812b238
chore: reverted flags
a-romanenya-pixelplex 7e092ed
draft: added tests
a-romanenya-pixelplex 9bf0dd7
fix: added app helpers
a-romanenya-pixelplex 7a17e67
feat: added epochs module and upgraded cosmos sdk
a-romanenya-pixelplex 8ecad0f
draft: added tests
a-romanenya-pixelplex bfad412
fix: added app helpers
a-romanenya-pixelplex 5db0431
feat: added epochs module and upgraded cosmos sdk
a-romanenya-pixelplex d19f94f
Merge branch 'localnet' into LSM_fixes
a-romanenya-pixelplex 402b49c
Merge remote-tracking branch 'refs/remotes/origin/LSM_fixes' into LSM…
a-romanenya-pixelplex 81fba24
fix: localnet-start script
a-romanenya-pixelplex 92658f2
refactor: module variables renamed to TAC format
a-romanenya-pixelplex 42b610b
draft: changed unbonding time
a-romanenya-pixelplex 00fb48c
fix: changed unbonding time
a-romanenya-pixelplex 599efd4
fix: changed unbonding time 2
a-romanenya-pixelplex a815e3e
Merge branch 'localnet' into TAC-84
a-romanenya-pixelplex 15779f5
moving module to evm
Alexey-Ostrovsky 449b1be
fix_dependency
Alexey-Ostrovsky 9a8e6b9
change ci/cd
Alexey-Ostrovsky 1dcbf29
fix generate genesis scripts
Alexey-Ostrovsky d9cabaa
return EIP typed data changes
Alexey-Ostrovsky 11aee2d
Update Evm version to precompiles with events
Alexey-Ostrovsky 6c39215
chore: set non-zero inflation
a-romanenya-pixelplex f36169b
chore: update ci
a-romanenya-pixelplex d1e895e
Sync with admin transaction changes: bf42d5628eca
Alexey-Ostrovsky 9c47ab7
Revert EIP712 changes
Alexey-Ostrovsky 4264ab6
Halborn audit fixes sync
Alexey-Ostrovsky f464ded
Prepare for proposal: remove redunant code after migrating module
Alexey-Ostrovsky 5fa3780
Prepare for proposal: remove redunant scripts, move protocgen from se…
Alexey-Ostrovsky 8b123c8
Prepare for proposal: remove unnescesssary ci parts and redunant modi…
Alexey-Ostrovsky 8fe2f35
Prepare for proposal: reduce unnescescary changes in scripts
Alexey-Ostrovsky 5bced55
Prepare for proposal: restore original params: inflation, gov proposa…
Alexey-Ostrovsky 593e799
Prepare for proposal: fix, get back nescessary changes
Alexey-Ostrovsky e533c0d
Merge branch 'stage' into localnet
Alexey-Ostrovsky 97381b3
Merge pull request #1 from pixelplex/localnet
Alexey-Ostrovsky bddba59
Prepare proposal
Alexey-Ostrovsky 884c421
Sync with BeginBlock fix
Alexey-Ostrovsky d54cc64
Merge branch 'stage' into migration
Alexey-Ostrovsky 497417a
Prepare proposal: minimize Dockerfile
Alexey-Ostrovsky 4e774f8
sync with full wasm removal
Alexey-Ostrovsky e2943da
Prepare for proposal: Sync with test fixes in cosmos sdk
Alexey-Ostrovsky d0e679d
fix: go mod indirect ordering
Alexey-Ostrovsky 2b80502
fix: v101 upgrade handler restore
Alexey-Ostrovsky 5a48980
fix: go.mod ibc-go requrie section
Alexey-Ostrovsky a58ffda
fix: upgrade name to versioning convention
Alexey-Ostrovsky c891c6e
fix: remove redunant protobuf functionality
Alexey-Ostrovsky aabe557
fix: +x for script
Alexey-Ostrovsky 5cc538b
feat: generilize init scripts for onde and for multi nodes
Alexey-Ostrovsky 06623db
fix: remove redunant test utilities
Alexey-Ostrovsky cc95c36
feat: sync with dependency changes
Alexey-Ostrovsky 5000685
fix: test localnet params
Alexey-Ostrovsky 03aceb3
chore: add comments for replace in go mod
Alexey-Ostrovsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -79,3 +79,4 @@ func NewTacChainAppWithCustomOptions(t *testing.T, isCheckTx bool, invCheckPerio | |
|
|
||
| return app | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,32 @@ | ||
| package v102 | ||
|
|
||
| // Upgrade for implementing liquid stake module | ||
|
|
||
| import ( | ||
| banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" | ||
| ) | ||
|
|
||
| const ( | ||
| LsmBondDenom = "stk/utac" | ||
| DisplayDenom = "gTAC" | ||
| ) | ||
|
|
||
| var GTACMetadata = banktypes.Metadata{ | ||
| Description: "Liquid Staked TAC token", | ||
| DenomUnits: []*banktypes.DenomUnit{ | ||
| { | ||
| Denom: LsmBondDenom, | ||
| Exponent: 0, | ||
| }, | ||
| { | ||
| Denom: DisplayDenom, | ||
| Exponent: 18, | ||
| }, | ||
| }, | ||
| Base: LsmBondDenom, | ||
| Display: DisplayDenom, | ||
| Name: "Gravity TAC", | ||
| Symbol: "gTAC", | ||
| URI: "", | ||
| URIHash: "", | ||
| } |
This file contains hidden or 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,74 @@ | ||
| package v102 | ||
|
|
||
| // Upgrade for implementing liquid stake module | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| storetypes "cosmossdk.io/store/types" | ||
| upgradetypes "cosmossdk.io/x/upgrade/types" | ||
|
|
||
| "github.com/Asphere-xyz/tacchain/app/upgrades" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| "github.com/cosmos/cosmos-sdk/types/module" | ||
| evmerc20types "github.com/cosmos/evm/x/erc20/types" | ||
|
|
||
| "github.com/ethereum/go-ethereum/common" | ||
| "golang.org/x/crypto/sha3" | ||
|
|
||
| ) | ||
|
|
||
| // UpgradeName defines the on-chain upgrade name | ||
| const UpgradeName = "v1.0.2" | ||
|
|
||
| var Upgrade = upgrades.Upgrade{ | ||
| UpgradeName: UpgradeName, | ||
| CreateUpgradeHandler: CreateUpgradeHandler, | ||
| StoreUpgrades: storetypes.StoreUpgrades{ | ||
| Added: []string{"utacliquidstake", "epochs"}, | ||
| Deleted: []string{}, | ||
| }, | ||
| } | ||
|
|
||
| func generateAddressFromDenom(denom string) (common.Address, error) { | ||
| hash := sha3.NewLegacyKeccak256() | ||
| if _, err := hash.Write([]byte(denom)); err != nil { | ||
| return common.Address{}, err | ||
| } | ||
| return common.BytesToAddress(hash.Sum(nil)), nil | ||
| } | ||
|
|
||
| func CreateUpgradeHandler( | ||
| mm upgrades.ModuleManager, | ||
| configurator module.Configurator, | ||
| ak *upgrades.AppKeepers, | ||
| ) upgradetypes.UpgradeHandler { | ||
| return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
| newVM, err := mm.RunMigrations(ctx, configurator, fromVM) | ||
| if err != nil { | ||
| return newVM, err | ||
| } | ||
|
|
||
| sdkCtx := sdk.UnwrapSDKContext(ctx) | ||
|
|
||
| // Register gTAC token pair | ||
| lsmBondDenom := ak.LiquidStakeKeeper.LiquidBondDenom(sdkCtx) | ||
| lsmBondCommonAddress, err := generateAddressFromDenom(lsmBondDenom) | ||
| if err != nil { | ||
| return newVM, err | ||
| } | ||
| ak.BankKeeper.SetDenomMetaData(ctx, GTACMetadata) | ||
|
|
||
| erc20Params := ak.Erc20Keeper.GetParams(sdkCtx) | ||
| erc20Params.NativePrecompiles = append(erc20Params.NativePrecompiles, lsmBondCommonAddress.String()) | ||
| if err := ak.Erc20Keeper.SetParams(sdkCtx, erc20Params); err != nil { | ||
| return newVM, err | ||
| } | ||
|
|
||
| lsmTokenPair := evmerc20types.NewTokenPair(lsmBondCommonAddress, lsmBondDenom, evmerc20types.OWNER_MODULE) | ||
|
|
||
| ak.Erc20Keeper.SetToken(sdkCtx, lsmTokenPair) | ||
|
|
||
| return newVM, nil | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.