diff --git a/app/app.go b/app/app.go index b9486a130..2bb355dbb 100644 --- a/app/app.go +++ b/app/app.go @@ -81,6 +81,7 @@ import ( v17 "github.com/CosmosContracts/juno/v19/app/upgrades/v17" v18 "github.com/CosmosContracts/juno/v19/app/upgrades/v18" v19 "github.com/CosmosContracts/juno/v19/app/upgrades/v19" + v20 "github.com/CosmosContracts/juno/v19/app/upgrades/v20" "github.com/CosmosContracts/juno/v19/docs" ) @@ -119,6 +120,7 @@ var ( v17.Upgrade, v18.Upgrade, v19.Upgrade, + v20.Upgrade, } ) diff --git a/app/upgrades/v20/constants.go b/app/upgrades/v20/constants.go new file mode 100644 index 000000000..7ee4fa6be --- /dev/null +++ b/app/upgrades/v20/constants.go @@ -0,0 +1,22 @@ +package v20 + +import ( + wasmlctypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" + + store "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/CosmosContracts/juno/v19/app/upgrades" +) + +// UpgradeName defines the on-chain upgrade name for the upgrade. +const UpgradeName = "v20" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV20UpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + wasmlctypes.ModuleName, + }, + }, +} diff --git a/app/upgrades/v20/mainnet_accounts.go b/app/upgrades/v20/mainnet_accounts.go new file mode 100644 index 000000000..a39cbf28c --- /dev/null +++ b/app/upgrades/v20/mainnet_accounts.go @@ -0,0 +1,54 @@ +package v20 + +import ( + "encoding/json" + + sdk "github.com/cosmos/cosmos-sdk/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + + "github.com/CosmosContracts/juno/v19/app/keepers" +) + +func CreateMainnetVestingAccount(ctx sdk.Context, k keepers.AppKeepers) ([]*vestingtypes.PeriodicVestingAccount, error) { + jsonAccounts := []string{ + `{"@type":"/cosmos.vesting.v1beta1.PeriodicVestingAccount","base_vesting_account":{"base_account":{"address":"juno17py8gfneaam64vt9kaec0fseqwxvkq0flmsmhg","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Akr1IlYcH7p08W8pdYNkmAEvDRoPOXdOefg56cm3paKm"},"account_number":46158,"sequence":897},"original_vesting":[{"denom":"ujuno","amount":"431220000000"}],"delegated_free":[{"denom":"ujuno","amount":"417029796699"}],"delegated_vesting":[{"denom":"ujuno","amount":"430000000000"}],"end_time":2006348400},"start_time":1633100400,"vesting_periods":[{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]}]}`, + + `{"@type":"/cosmos.vesting.v1beta1.PeriodicVestingAccount","base_vesting_account":{"base_account":{"address":"juno1s33zct2zhhaf60x4a90cpe9yquw99jj0zen8pt","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"ApcEus7fRKwSRNNs4nlOy62fFH9Ep7lg9DQRsnx9Ht0H"},"account_number":14783,"sequence":991},"original_vesting":[{"denom":"ujuno","amount":"431230191000"}],"delegated_free":[{"denom":"ujuno","amount":"594329704467"}],"delegated_vesting":[{"denom":"ujuno","amount":"431220000000"}],"end_time":2006348400},"start_time":1633100400,"vesting_periods":[{"length":0,"amount":[{"denom":"ujuno","amount":"10191000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]}]}`, + + `{"@type":"/cosmos.vesting.v1beta1.PeriodicVestingAccount","base_vesting_account":{"base_account":{"address":"juno130mdu9a0etmeuw52qfxk73pn0ga6gawk4k539x","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A1SgSrlikj83agLUJPYDuWTjPkw4rPzkWgMMy/5RxANy"},"account_number":42191,"sequence":202},"original_vesting":[{"denom":"ujuno","amount":"78432000000"}],"delegated_free":[{"denom":"ujuno","amount":"31802746321"}],"delegated_vesting":[{"denom":"ujuno","amount":"57432000000"}],"end_time":2006348400},"start_time":1633100400,"vesting_periods":[{"length":0,"amount":[{"denom":"ujuno","amount":"21000000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1665000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"833000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"416000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"375000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"333000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"291000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"208000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"166000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"124000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"83000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"42000000"}]}]}`, + + `{"@type":"/cosmos.vesting.v1beta1.PeriodicVestingAccount","base_vesting_account":{"base_account":{"address":"juno18qw9ydpewh405w4lvmuhlg9gtaep79vy2gmtr2","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+hZFIZ3i+5jD83trhShTmD/bAAXpIyb6tHJDJtiOAn6"},"account_number":23705,"sequence":1253},"original_vesting":[{"denom":"ujuno","amount":"433838270000"}],"delegated_free":[{"denom":"ujuno","amount":"509388774646"}],"delegated_vesting":[{"denom":"ujuno","amount":"431220000000"}],"end_time":2006348400},"start_time":1633100400,"vesting_periods":[{"length":0,"amount":[{"denom":"ujuno","amount":"2618270000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]}]}`, + + `{"@type":"/cosmos.vesting.v1beta1.PeriodicVestingAccount","base_vesting_account":{"base_account":{"address":"juno1a8u47ggy964tv9trjxfjcldutau5ls705djqyu","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AjQmoovTUzJNCKi0xb8fGI3GHoJtC1s90xbfFSuczxo7"},"account_number":46157,"sequence":4478},"original_vesting":[{"denom":"ujuno","amount":"431220000000"}],"delegated_free":[{"denom":"ujuno","amount":"231978485341"}],"delegated_vesting":[{"denom":"ujuno","amount":"407576000001"}],"end_time":2006348400},"start_time":1633100400,"vesting_periods":[{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"12500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"6250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"3125000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2812000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2500000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"2187000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1875000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1562000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"1250000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"937000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"625000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]},{"length":2592000,"amount":[{"denom":"ujuno","amount":"312000000"}]}]}`, + } + + // Array of vesting accounts + var vestingAccounts []*vestingtypes.PeriodicVestingAccount + + // Iterate over json accounts, unmarshal and fund + for _, jsonEntry := range jsonAccounts { + + // Unmarshal account + var acc vestingtypes.PeriodicVestingAccount + if err := json.Unmarshal([]byte(jsonEntry), &acc); err != nil { + panic(err) + } + + acc = *vestingtypes.NewPeriodicVestingAccount(acc.BaseAccount, acc.OriginalVesting, acc.StartTime, acc.VestingPeriods) + + // Set account with keeper + k.AccountKeeper.SetAccount(ctx, &acc) + + // Fund the account from bank keeper + funds := sdk.NewCoins(sdk.NewCoin("ujuno", sdk.NewInt(100_000_000_000_000))) + if err := banktestutil.FundAccount(k.BankKeeper, ctx, acc.GetAddress(), funds); err != nil { + panic(err) + } + + // Append vesting account + vestingAccounts = append(vestingAccounts, &acc) + } + + return vestingAccounts, nil +} diff --git a/app/upgrades/v20/upgrade_test.go b/app/upgrades/v20/upgrade_test.go new file mode 100644 index 000000000..f808eadf6 --- /dev/null +++ b/app/upgrades/v20/upgrade_test.go @@ -0,0 +1,73 @@ +package v20_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/CosmosContracts/juno/v19/app/apptesting" + v20 "github.com/CosmosContracts/juno/v19/app/upgrades/v20" +) + +type UpgradeTestSuite struct { + apptesting.KeeperTestHelper +} + +func (s *UpgradeTestSuite) SetupTest() { + s.Setup() +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(UpgradeTestSuite)) +} + +// Ensures the test does not error out. +func (s *UpgradeTestSuite) TestUpgrade() { + s.Setup() + + preUpgradeChecks(s) + + upgradeHeight := int64(5) + s.ConfirmUpgradeSucceeded(v20.UpgradeName, upgradeHeight) + + postUpgradeChecks(s) +} + +func preUpgradeChecks(s *UpgradeTestSuite) { + // Setup mainnet account + _, err := v20.CreateMainnetVestingAccount(s.Ctx, s.App.AppKeepers) + s.Require().NoError(err) + + // Create 3 generic validators + val1 := s.SetupValidator(stakingtypes.Bonded) + val2 := s.SetupValidator(stakingtypes.Bonded) + val3 := s.SetupValidator(stakingtypes.Bonded) + + // Get last validator, set as mock jack validator + val, found := s.App.AppKeepers.StakingKeeper.GetValidator(s.Ctx, val3) + s.Require().True(found) + v20.JackValidatorAddress = val.OperatorAddress + + validators := []sdk.ValAddress{val1, val2, val3} + + // Should equal 4, including default validator + s.Require().Equal(4, len(s.App.AppKeepers.StakingKeeper.GetAllValidators(s.Ctx))) + + // Create delegations to each validator 2x, ensuring multiple delegations + // are created for each validator and combined in state. + for i := 0; i < 2; i++ { + for _, delegator := range v20.Core1VestingAccounts { + delegatorAddr := sdk.MustAccAddressFromBech32(delegator.Address) + + for _, validator := range validators { + s.StakingHelper.Delegate(delegatorAddr, validator, sdk.NewInt(1_000_000)) + } + } + } +} + +func postUpgradeChecks(_ *UpgradeTestSuite) { +} diff --git a/app/upgrades/v20/upgrades.go b/app/upgrades/v20/upgrades.go new file mode 100644 index 000000000..3fc7950dc --- /dev/null +++ b/app/upgrades/v20/upgrades.go @@ -0,0 +1,97 @@ +package v20 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/CosmosContracts/juno/v19/app/keepers" + "github.com/CosmosContracts/juno/v19/app/upgrades" +) + +const ( + // Charter Council's SubDAO Address + CharterCouncil = "juno1nmezpepv3lx45mndyctz2lzqxa6d9xzd2xumkxf7a6r4nxt0y95qypm6c0" + JackKey = "jack" +) + +// JackValidatorAddress must be mutable for testing +var JackValidatorAddress = "junovaloper130mdu9a0etmeuw52qfxk73pn0ga6gawk2tz77l" + +type IndividualAccount struct { + Owner string + Address string +} + +// Core1VestingAccounts https://daodao.zone/dao/juno1j6glql3xmrcnga0gytecsucq3kd88jexxamxg3yn2xnqhunyvflqr7lxx3/members +var Core1VestingAccounts = []IndividualAccount{ + { + Owner: "block", + Address: "juno17py8gfneaam64vt9kaec0fseqwxvkq0flmsmhg", + }, + { + Owner: "dimi", + Address: "juno1s33zct2zhhaf60x4a90cpe9yquw99jj0zen8pt", + }, + { + Owner: JackKey, + Address: "juno130mdu9a0etmeuw52qfxk73pn0ga6gawk4k539x", + }, + { + Owner: "jake", + Address: "juno18qw9ydpewh405w4lvmuhlg9gtaep79vy2gmtr2", + }, + { + Owner: "wolf", + Address: "juno1a8u47ggy964tv9trjxfjcldutau5ls705djqyu", + }, +} + +func CreateV20UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + k *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + logger := ctx.Logger().With("upgrade", UpgradeName) + + nativeDenom := upgrades.GetChainsDenomToken(ctx.ChainID()) + logger.Info(fmt.Sprintf("With native denom %s", nativeDenom)) + + // Run migrations + logger.Info(fmt.Sprintf("pre migrate version map: %v", vm)) + versionMap, err := mm.RunMigrations(ctx, cfg, vm) + if err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("post migrate version map: %v", versionMap)) + + // Migrate Core-1 vesting account remaining funds -> Council SubDAO + if ctx.ChainID() == "juno-1" { + if err := migrateCore1VestingAccounts(ctx, k, nativeDenom); err != nil { + return nil, err + } + } + + return versionMap, err + } +} + +// Migrate balances from the Core-1 vesting accounts to the Council SubDAO. +func migrateCore1VestingAccounts(ctx sdk.Context, keepers *keepers.AppKeepers, bondDenom string) error { + for _, account := range Core1VestingAccounts { + // A new vesting contract will not be created if the account name is 'wolf'. + if err := MoveVestingCoinFromVestingAccount(ctx, + keepers, + bondDenom, + account.Owner, + sdk.MustAccAddressFromBech32(account.Address), + sdk.MustAccAddressFromBech32(CharterCouncil), + ); err != nil { + return err + } + } + return nil +} diff --git a/app/upgrades/v20/vesting.go b/app/upgrades/v20/vesting.go new file mode 100644 index 000000000..5da70a974 --- /dev/null +++ b/app/upgrades/v20/vesting.go @@ -0,0 +1,179 @@ +package v20 + +import ( + "fmt" + "time" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + authvestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + + "github.com/CosmosContracts/juno/v19/app/keepers" +) + +// Stops a vesting account and returns all tokens back to the council +func MoveVestingCoinFromVestingAccount(ctx sdk.Context, keepers *keepers.AppKeepers, bondDenom string, owner string, accAddr sdk.AccAddress, councilAccAddr sdk.AccAddress) error { + now := ctx.BlockHeader().Time + + stdAcc := keepers.AccountKeeper.GetAccount(ctx, accAddr) + vacc, ok := stdAcc.(*authvestingtypes.PeriodicVestingAccount) + if !ok { + // For e2e testing + fmt.Printf("account " + accAddr.String() + " is not a vesting account.\n") + return nil + } + + fmt.Printf("\n\n== Vesting Account Address: %s (%s) ==\n", vacc.GetAddress().String(), owner) + + // Gets vesting coins (These get returned back to council / a new vesting contract made from) + vestingCoins := vacc.GetVestingCoins(now) + fmt.Printf("Vesting Coins: %v\n", vestingCoins) + + // Display locked & spendable funds + lockedCoins := keepers.BankKeeper.LockedCoins(ctx, accAddr) + fmt.Printf("Locked Coins: %v\n", lockedCoins) + spendableCoins := keepers.BankKeeper.SpendableCoins(ctx, accAddr) + fmt.Printf("Spendable Coins: %v\n", spendableCoins) + + // Instantly complete any re-deleations. + amt, err := completeAllRedelegations(ctx, now, keepers, accAddr) + if err != nil { + return err + } + fmt.Println("Redelegated Amount: ", amt) + + // Instantly unbond all delegations. + amt, err = unbondAllAndFinish(ctx, now, keepers, owner, accAddr) + if err != nil { + return err + } + fmt.Println("Unbonded Amount: ", amt) + + // Pre transfer balance + councilBeforeBal := keepers.BankKeeper.GetBalance(ctx, councilAccAddr, bondDenom) + + // Set the vesting account to a base account + keepers.AccountKeeper.SetAccount(ctx, vacc.BaseAccount) + + // Moves vesting tokens to the council. + if err := transferUnvestedTokensToCouncil(ctx, keepers, accAddr, councilAccAddr, vestingCoins); err != nil { + return err + } + + // Log new council balance + councilAfterBal := keepers.BankKeeper.GetBalance(ctx, councilAccAddr, bondDenom) + fmt.Printf("Council Balance Before: %v\n", councilBeforeBal) + fmt.Printf("Council Balance After: %v\n", councilAfterBal) + + // Ensure the post validation checks are met. + err = postValidation(ctx, keepers, bondDenom, owner, accAddr, councilAccAddr, vestingCoins, councilBeforeBal) + return err +} + +func postValidation(ctx sdk.Context, keepers *keepers.AppKeepers, bondDenom string, owner string, accAddr sdk.AccAddress, councilAccAddr sdk.AccAddress, vestingCoins sdk.Coins, councilBeforeBal sdk.Coin) error { + // Council balance should only increase by exactly the council + vestedCoins + councilAfterBal := keepers.BankKeeper.GetBalance(ctx, councilAccAddr, bondDenom) + if !councilBeforeBal.Add(vestingCoins[0]).IsEqual(councilAfterBal) { + return fmt.Errorf("ERROR: core1BeforeBal (%v) + unvestedCoins (%v) != core1BalAfter (%v)", councilBeforeBal, vestingCoins, councilAfterBal) + } + + // vesting account should have no future vesting periods + newVacc := keepers.AccountKeeper.GetAccount(ctx, accAddr) + if _, ok := newVacc.(*authvestingtypes.PeriodicVestingAccount); ok { + return fmt.Errorf("ERROR: account %s still is a vesting account", accAddr.String()) + } + + // ensure the account has 0 delegations, redelegations, or unbonding delegations, + // if the account is Jack's account, ensure it has 1 delegation to his validator + delegations := keepers.StakingKeeper.GetAllDelegatorDelegations(ctx, accAddr) + if !(len(delegations) == 0 || (owner == JackKey && len(delegations) == 1)) { + return fmt.Errorf("ERROR: account %s still has delegations", accAddr.String()) + } + + redelegations := keepers.StakingKeeper.GetRedelegations(ctx, accAddr, 65535) + if len(redelegations) != 0 { + return fmt.Errorf("ERROR: account %s still has redelegations", accAddr.String()) + } + + unbondingDelegations := keepers.StakingKeeper.GetAllUnbondingDelegations(ctx, accAddr) + if len(unbondingDelegations) != 0 { + return fmt.Errorf("ERROR: account %s still has unbonding delegations", accAddr.String()) + } + + return nil +} + +// Transfer funds from the vesting account to the Council SubDAO. +func transferUnvestedTokensToCouncil(ctx sdk.Context, keepers *keepers.AppKeepers, accAddr sdk.AccAddress, councilAccAddr sdk.AccAddress, vestingCoins sdk.Coins) error { + fmt.Printf("Sending Vesting Coins to Council: %v\n", vestingCoins) + err := keepers.BankKeeper.SendCoins(ctx, accAddr, councilAccAddr, vestingCoins) + return err +} + +// Completes all re-delegations and returns the amount of tokens which were re-delegated. +func completeAllRedelegations(ctx sdk.Context, now time.Time, keepers *keepers.AppKeepers, accAddr sdk.AccAddress) (math.Int, error) { + redelegatedAmt := math.ZeroInt() + + for _, activeRedelegation := range keepers.StakingKeeper.GetRedelegations(ctx, accAddr, 65535) { + redelegationSrc, _ := sdk.ValAddressFromBech32(activeRedelegation.ValidatorSrcAddress) + redelegationDst, _ := sdk.ValAddressFromBech32(activeRedelegation.ValidatorDstAddress) + + // set all entry completionTime to now so we can complete re-delegation + for i := range activeRedelegation.Entries { + activeRedelegation.Entries[i].CompletionTime = now + redelegatedAmt = redelegatedAmt.Add(math.Int(activeRedelegation.Entries[i].SharesDst)) + } + + keepers.StakingKeeper.SetRedelegation(ctx, activeRedelegation) + _, err := keepers.StakingKeeper.CompleteRedelegation(ctx, accAddr, redelegationSrc, redelegationDst) + if err != nil { + return redelegatedAmt, err + } + } + + return redelegatedAmt, nil +} + +// Returns the amount of tokens which were unbonded (not rewards) +func unbondAllAndFinish(ctx sdk.Context, now time.Time, keepers *keepers.AppKeepers, owner string, accAddr sdk.AccAddress) (math.Int, error) { + unbondedAmt := math.ZeroInt() + + // Unbond all delegations from the account + for _, delegation := range keepers.StakingKeeper.GetAllDelegatorDelegations(ctx, accAddr) { + validatorValAddr := delegation.GetValidatorAddr() + if _, found := keepers.StakingKeeper.GetValidator(ctx, validatorValAddr); !found { + continue + } + + // Jack's account has a delegation to his validator which is not unbonded. + if owner == JackKey && validatorValAddr.String() == JackValidatorAddress { + continue + } + + _, err := keepers.StakingKeeper.Undelegate(ctx, accAddr, validatorValAddr, delegation.GetShares()) + if err != nil { + return math.ZeroInt(), err + } + } + + // Take all unbonding and complete them. + for _, unbondingDelegation := range keepers.StakingKeeper.GetAllUnbondingDelegations(ctx, accAddr) { + validatorStringAddr := unbondingDelegation.ValidatorAddress + validatorValAddr, _ := sdk.ValAddressFromBech32(validatorStringAddr) + + // Complete unbonding delegation + for i := range unbondingDelegation.Entries { + unbondingDelegation.Entries[i].CompletionTime = now + unbondedAmt = unbondedAmt.Add(unbondingDelegation.Entries[i].Balance) + } + + keepers.StakingKeeper.SetUnbondingDelegation(ctx, unbondingDelegation) + _, err := keepers.StakingKeeper.CompleteUnbonding(ctx, accAddr, validatorValAddr) + if err != nil { + return math.ZeroInt(), err + } + } + + return unbondedAmt, nil +}