* add new field upgrade_time_set_staking_rewards_per_second with intention
of integrating into the disable inflation logic to set an initial
staking reward time
* when the disable inflation upgrade time occurs, set the staking rewards
per second to the value specified by the new
upgrade_time_set_staking_rewards_per_second. This will allow a decoupled
implementation between the ugprade switching logic, and the core
functionality of paying staking rewards from the pool
* add staking rewards state to community keeper and community module
genesis that is required to calculate and track staking reward payouts
accross blocks
* add implementation of staking reward payouts
* remove unused error
* touch up tests and add a test case that fully tests behavior when pool
is drained
* add function comments
* refactor and pull out main calculation to private pure function with
no dependence on keeper
* zero out default parameters -- these are too chain specific to have
useful defaults
* small touch ups on comments, test cases
* use correct Int from sdkmath, not old sdk types; update protonet genesis
for new parmater
* fix copy pasta comment
* use bond denom from staking keeper instead of referncing ukava directly
* add staking reward state for valid genesis
* update kvtool genesis for new params and rewards state
* refactor param validation test cases to be shared by genesis and params
tests
* add additional test case for zero staking rewards in order to ensure
no regressions in support for turning off rewards
* add test case to ensure default params are valid -- prevent regression
if defaults change to an invalid state during updates of validation or
defaults
* zero out parameters in migration -- this module will be used with
existing chains and parameters should be set after migrations in
each upgrade handler
* update StakingRewardsPerSecond to an 18 decimal type in order to
reduce error
* add community grpc rest endpoints to swagger
* Fix copy pasta query name to refer to correct Community module
Co-authored-by: drklee3 <derrick@dlee.dev>
* generate swagger changes from previous commit
---------
Co-authored-by: drklee3 <derrick@dlee.dev>
* add community params type
* add get/set params methods
* add community genesis state type
* add community init/export genesis
* add querier methods for params
* add query cli cmd
* update changelog
* update protonet genesis
* Add `RewardsPerSecond` param to `x/community` module (#1707)
* Add RewardsPerSecond param to community
* Update rewards per second param to int
* Add rewards_per_second to protonet genesis
* Use default rewards per second of 744191
* Include value if negative in Validate error
* Rename RewardsPerSecond param to StakingRewardsPerSecond
* Add changelog entry
* Add param migration, update consensus version to 2
* Update proto docs
* Update staking_rewards_per_second param name in protonet genesis (#1730)
* Update godoc
Co-authored-by: Robert Pirtle <Astropirtle@gmail.com>
* add genesis state tests
* document what 0 upgrade time means
* update kvtool to include new params
---------
Co-authored-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Robert Pirtle <Astropirtle@gmail.com>
* first pass at convert cosmos coin -> evm msg
* test ConvertCosmosCoinFromERC20 method
* test message server for MsgConvertCosmosCoinFromERC20
* update spec to include MsgConvertCosmosCoinFromERC20
* update changelog
* add CLI command for convert-cosmos-coin-from-erc20
* add test of removed/re-enable denom for convert
* add proto for allowed sdk denoms -> evm conversion
* add validation for AllowedNativeCoinERC20Token
* add validation for AllowedNativeCoinERC20Tokens
* add AllowedNativeDenoms into params & genesis
* add evmutil Params.Validate() test
* fix eip712 ante test
* update changelog
* update internal testnet genesis.json
* update state & param specs
updates to the sections describing functionality will be updated once
that functionality actually exists... :)
* update field decimal -> decimals
field now matches erc20 spec
* add validation decimals will cast to uint8
* add v2 store migration for evmutil
* create & register evmutil migrations
* adds migrator to evmutil's keeper
* sets up Migrate1To2 migration
* registers migration in module
* updates GetParams to properly handle historic block queries
* add unit test for GetParams with historic store
* feat: add CommunityCDPRepayDebtPermission
When granted, the new permission allows a committee to submit a
CommunityCDPRepayDebtProposal to lower principal owed on a cdp
owned by the x/community module.
* update changelog
* update protonet genesis.json
* add CommunityPoolCDPRepayDebtProposal proto & type
* add cdpKeeper to x/community's keeper
* add handler for CommunityPoolCDPRepayDebtProposal
* more test cases
* rename CommunityPoolCDP -> CommunityCDP
the proposal does not interact with the vanilla community pool
* fix & test stringer
* update changelog
* Add incentive grpc query service
* Register query server
* Add grpc query test
* Add grpc query test
* Fix proto lints
* Fix missing savings field, update tests
* Update proto docs
* Use consts for query reward types
* Add owner to queryRewards err
* Add empty reward type to be valid
* add proto for LegacyCommunityPool query
* add distribution keeper to community keeper
* implement LegacyCommunityPool query
* add cli cmd for legacy-community-pool
* add `x/kavamint` module (#1376)
* stub out the x/kavamint module
* mint staking rewards in x/kavamint BeginBlocker
* calculate cumulative inflation from x/kavamint
* cleanup, abstract bond denom, grpc query tests
* store & use previous block time to calculate mints
* move test suite to testutil
* add test of x/kavamint BeginBlocker
* cleanup & comments from @DracoLi review
* fix x/incentive integration test
* remove rest client grpc test
* add x/kavamint module spec
* track previous block time in genesis
* suggested cleanup from PR review
* bugfix incorrect module account check
* add x/community module (#1388)
* add x/community module
* refactor and setup fund-community-pool tx
* remove unused features (params, genesis state)
* test x/community query and message
* update with master branch deps
* updates from review
* indicate deprecated methods on module (still needed to fulfill interface)
* remove legacy querier
* derive msg Route() and Type() from sdk.MsgTypeURL(&msg)
* use module name for message Route()
* mint community pool inflation in x/kavamint (#1389)
* mint community pool inflation in x/kavamint
* refactor x/kavamint abci inflation test
* test inflation from x/kavamint
* default kavamint rates to 0%
* rename kavamint account name variables
* panic if genesis kavamint previous block time not set
* emit event on kavamint begin blocker
* add kavamint year of inflation sanity check test
* update fund_community_pool message event
* add x/community spec
* refactor inflation accumulation into single func
* use new comm pool in kavadist multispend proposal (#1403)
the x/community module houses the new community pool. this commit
points the CommunityPoolMultiSpendProposal at the new community pool
so that multispend proposals can continue to be processed once original
fee pool funds are move to x/community
* updates from proto lint changes
* update earn proposals to use new community pool
originally the CommunityPoolDepositProposal & CommunityPoolWithdrawProposal
used the vanilla community pool fee pool. this commit updates them both
to use the new x/community module account.
* spec formatting update
* add x/community & x/kavamint to internal testnet genesis
* increase test coverage of x/kavamint
* increase test coverage of x/community
* use string type for sdk.Dec proto fields; disable generation of getters
for genesis and params (and other store objects)
* follow sdk conventions for params endpoint naming
* add kavamint to swagger; update swagger & proto docs
* remove legacy querier; touch up module to match others
* reduce max minting rate; refactor genesis to allow nil/zero block time;
repace proto stringers and remove getters; keep sdk.Dec values strings
in protos; increase validation of sdk.Dec values in params; increase
coverage; add module account permission checks; ensure import and export
of genesis does not change state
* fix scaling of rate values -- should be yearly rates
* revert key change
* fix typo in test name
* fix regression in running tests -- rename method
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
* Add generic accumulator
* Add MultiRewardPeriodOfClaimType type to params
* Add adapters wrapper
* Add MultiRewardPeriodsOfClaimType to params
* Add multireward period to genesis test
* Rename MultiRewardPeriodOfClaimType to TypedMultiRewardPeriod
* Use source adapters wrapper
* start makefile refactor to smaller units; break out proto-dep updating;
add check-proto-deps target for use in CI in order to determine if
depdencies have diverged
* add proto check workflow
* download go modules before checking proto deps
* clean up -- hide output and add error message for check target
* add error message for check-rsync
* update any type, and ibc-go protos for v3.4.0
* add buf generate files for gogo, docs, and swagger
* update swagger dirs and run with latest swagger gen
* ignore new build directories
* refactor proto makefile logic -- use buf instead of scripts
* remove old protobuf scripts
* run all proto checks on push
* remove moved file
* set default value for protoc machine
* install build deps seperately
* fetch master for buf check breaking
* checkout from https url in CI for buf breaking
* fix rsync file permissions on darwin
* ignore build dirs
* fix issue with apple provided make; clean up build deps; switch to buf
format
* remove clang format file -- using buf format now
* run make proto-format (buf format changes)
* update generated files for proto format changes
* add total supply endpoint to x/liquid
* add test of x/liquid total supply query
* refactor x/savings test
* add total supply endpoint for x/savings (w/ test)
* add total supply endpoint for x/earn
* handle converting bkava to underlying staked amount
* aggregate bkava underlying values in x/earn
* aggregate underlying value of bkava in x/savings
* Add methods for reward accrual time
* Add accrual time methods
* Add claim type to IterateAllRewardAccrualTimes callback method
* Use new AccrualTime proto type for state methods, add to genesis
* Add GetAllRewardAccrualTimes doc
* Add accrual times to genesis methods
* Remove DecodeKeyPrefix
* Update acrual time iterate method naming
* Update Iterate claims naming
* Use method for sourceID key conversion
the yaml tags are not needed as they are generated automatically from the
json tags.
additionally fixed proto formatting error requiring doc comments on enum
values (for x/incentive claim type enum).
* add empty grpc endpoint
* add basic implementation
* remove unbonding from returned balance
* fix test typo
* resolve todo, use better method from staking mod
* Add earn deposits query param to return individual vaults value as ukava
* Add value_in_staked_tokens param handler to specific vault query
* Use separate ukava coins when querying deposits in ukava
Avoid usd of sdk.Coins.Add() as those will aggregate ukava amounts
* update params
* stub out methods
* delete legacy migration test
* feat: add infrastructure inflation and payouts
* fix: load same module account blocked addrs in kavadist as app
* fix: testing edge case where period starts and ends same block
* fix: add store key for infra params, update newparams function
* fix: testing edge case where period starts and ends in same block
* add test for basic infra minting
* add test for stand-alone core, partner rewards
* fix: set time elapsed in each case
* add e2e test for infra rewards
* fix: use standard method for naming infra params key
* feat: community pool deposit/withdraw proposals
* fix: check community pool balance in tests
* add new msg type definitions
* add msg methods and tests
* add module and keeper skeleton
* add deposit and withdraw methods (no delegation)
* untested depsit/withdraw with delegation methods
* add cli cmds
* fix cli argument parsing
* add tests for delegate/undelegate msgs
* emit un/delegate events
* add godoc comments
* tally handler with liquid staking support
* clean up
* update for liquid keeper changes
* Exclude non-bkava denoms from aggregate underlying ukava calculation
* wip Add claim
* Add distr keeper and claiming
* Add claim test
* Update claim test with failures
* wip Add staking rewards
* -S
Fix savings to earn incentive methods
* Use a single accural time for all earn incentives
* Add additional required liquid methods
* Update genesis to only include 1 accrual time for earn
* Revert "Update genesis to only include 1 accrual time for earn"
This reverts commit cc7e35347298681c0c8a4a0b9bf9b9b296c25531.
* Revert "Use a single accural time for all earn incentives"
This reverts commit aeb49c4622d4e3d99dc6421c8830932b1b546be9.
* Update tests with incentive distribution
* Add earn to incentive rewards query
* add earn cli tx
* Update claim example to use ukava large
* add proposal to gov router
* fix example tx formating
* add proposal handlers to gov app module
* fix: define gov router after earn keeper
* fix: correct proposal type
* remove outdated comment
* refactor withdraw so that fee pool is allows adjusted by the actual withdraw amount
* fix: lint proto file
* use non blocked module account instead of dist acc
* add fund mod account to app, enable receiving
* update to new withdraw interface
* add human readable apy test cases
* remove duplicate changes from previous merge
* remove deprecated io/ioutil package
* standardize proposal type as a pointer
(also matches sdk)
* minior comments and formatting
* use withdraw amount in router msgs
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
Co-authored-by: Draco <draco@dracoli.com>
Co-authored-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
* Add module name to multiplier
* Add claim test to use correct multiplier
* Add separate test for GetMultiplierByDenom
* Add 0 length lockup for earn to params test
* Add additional tests for genesis and params
* Add incentive types
* Add earn state methods
* Update earn incentives
* Update unit test NewKeeper to include earn keeper
* Fix sharesOwned typo
* Shares not used for AfterVaultDepositCreated
* Add earn to init genesis
* Pass earn keeper to incentive keeper
* Add sdk.Msg impl, disable legacy migrations
* Disable migrations
* Update incentive earn sync test
* Add earn to client and querier
* Add accum and init tests
* Add additional earn tests
* Fill in fakeEarnKeeper methods to fix tests
* Add earn reward periods to params, begin blocker earn reward
* Add earn to query
* Update genesis_test with missing DefaultMultiRewardPeriods parameter
* Remove disable of migration package
* Fix proto type comments
* Remove unused migration state
* Add legacytx.LegacyMsg compile time interface check
* add earn state validation to genesis validation
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
* proto types
* proto generated types
* liquidstaking top level files: module, genesis
* liquidstaking types
* liquidstaking keeper
* liquidstaking client/cli
* add liquidstaking to app, simapp
* implement mint derivative
* set up liquidstaking keeper test suite
* test mint derivative
* rename module to liquid
* rename proto types, app.go to liquid
* use sdk.Coin instead of shares
* mint liquid tokens to delegator
* burn derivative tokens to receive delegation
* use conversion method instead of type cast
* simplify delegation transfer logic
* broaden delegation transfer tests
* simplify transfer delegation method
This removes a source of rounding errors
* move derivative denom to keeper config
* check for invalid coins in msg validation
* block 0share transfers to avoid handling edge case
* refactor MintDerivative to test calculations
* simplify burn method so shares and tokens equal
* convert TransferShares back to old design
this makes handling vesting tokens easier
* fix missed merge conflict
* remove deprecated constants
* tidy up msg.go
* add msg tests
* remove unused store key
* fix msg event sender
* remove unused params
* tidy up documentation and errors
* remove unused mocks
* remove unused keepers from AppModule
* tidy up msg return values
keeper return values to be used in router msgs
* reinstate unintentionally removed interface check
* catch invalid input for MnitDerivative
clear up test TODOs
* clear up InitGenesis TODO
* Update x/liquid/client/cli/tx.go
Co-authored-by: Derrick Lee <derrick@dlee.dev>
* Update x/liquid/client/cli/tx.go
Co-authored-by: Derrick Lee <derrick@dlee.dev>
* show error logs in devnet
* unblock mod account so it can receive dist rewards
* catch zero amout msgs early
* minor cli fixes
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
Co-authored-by: Derrick Lee <derrick@dlee.dev>
* Add basic savings strategy
Supports ukava
* Use clearer error message for ErrInvalidVaultStrategy
* Add invariants
* Separate specific vault/all vaults query, update depositor inconsistencies
* Update swagger
* Use single bkava AllowedVault for all bkava variants
* Do not use allowedVault.Denom for value
* Fix vault balance query
* Update query to list bkava vaults
* Add vaults query doc
* Update grpc query test with no supply
* Add earn hooks
* Handle errors
* Update outdated doc comments, make getAllowedVault_Raw private
* Fix outdated comments, lints
* Fix comment maths
* Use AccAddressFromBech32 to validate message addresses
* Add multiple strategies to params, queries, txs
* Check deposit/withdraw strategy if supported by vault
* Add note for deposit strategy
* Add strategy type to messages
* Update swagger docs, ignore ethermint proto linting errors
* Update strategy test, move single strategy support to strategytype
* Simplify NewStrategyTypeFromString
* Change vault supply to shares
* Update deposit shares
* Use shares instead of supplied
* Update tests, fix share calculation
* Pass hard and savings keeper as pointer to earn keeper
* Update remaining failing test
* Add different share price test, fix comment for share price
* Add shares amount to events
* Additional share tests, use share to asset conversion for withdraw amount
* Update VaultTotalValue test
* Use sdk.Dec for vault shares instead of sdk.Int
* Add test for expensive 20:1 shares
* Update ConvertToShares comment for division, remove redundant test
* Add vault share tests
* Add query methods
* Add TotalDeposited rpc query
* All accounts and all denoms query wip
* Add query deposits
* Remove IsDenomSupported strategy method
This is not necessary and is already set in params allowed vaults
* Add Vaults, TotalDeposited queries
* Deposits query tests and fixes
* proto lints
* Add earn swagger docs
* Add cli query cmds
* Update init-new-chain.sh with usdx strategy and funds
* Add denom url query path for vaults
* Return a list of coins for each depositor instead of multiple deposit entries
* Simplify strategies to lend and savings
* Add hard and savings keepers
* Add ctx to strategy interface, fill in lend strategy
* Rename lend strategy to hard
* Fix hard deposit query, fix withdraw bank send
* Fix misleading borrow instead of withdraw for hard
* Remove liquidateall strategy method
* Withdraw tests
* Add hard gs to testutil suite
* Update withdraw tests with working hard strategy, clean strategy interface methods
* Check allowed denom for strategy
* Update GetVaultTotalValue doc note
* Update error wrap message for unsupported denom
* Remove unnecessary viewvault keeper
* Withdraw amount from account value, not supplied value
* Test value > supplied withdraw
* Use dec when dividing for withdrawAmountPercent
* Use the correct store prefix for vault shares
* Update swap references to earn
* Simplify vault shares, use a single share for all coins per address