From 0faf7961866391af568fdc4061ef9bc36d197b4d Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 12 May 2025 20:05:06 +0530 Subject: [PATCH] Add lps_lockup module account to lock up a percentage of total tokens supply --- app/app.yaml | 2 ++ scripts/init.sh | 29 ++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/app/app.yaml b/app/app.yaml index 75fae7f0..c25df19a 100644 --- a/app/app.yaml +++ b/app/app.yaml @@ -33,6 +33,8 @@ modules: - account: registry - account: record_rent - account: authority_rent + - account: lps_lockup + permissions: [] - name: bank config: "@type": cosmos.bank.module.v1.Module diff --git a/scripts/init.sh b/scripts/init.sh index efb1b366..796fdc67 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -9,6 +9,16 @@ STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"} MIN_GAS_PRICE=${MIN_GAS_PRICE:-"0.001"} LOGLEVEL=${LOGLEVEL:-"info"} +# lps_lockup module account address +LPS_LOCKUP_MODULE_ACCOUNT_ADDRESS="laconic1mprsxp9jqe0d0lp88fxuccthwgy7tqgt5x9y65" + +# TODO: Try using `lnt` denom +# Locked amount: 116640 * 10^18 alnt (90% of 129600 * 10^18 alnt) +LOCKED_AMOUNT="116640000000000000000000" + +# Early supports: 12960 * 10^18 alnt (10% of 129600 * 10^18 alnt) +EARLY_SUPPORTS="12960000000000000000000" + input_genesis_file=${GENESIS_FILE} if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data" ]; then @@ -117,7 +127,24 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data" ]; then # Allocate genesis accounts (cosmos formatted addresses) # 10^30 alnt | 10^12 lnt - laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING + laconicd genesis add-genesis-account $KEY $EARLY_SUPPORTS$DENOM --keyring-backend $KEYRING + + # Add lps_lockup module account to auth accounts + echo "Adding lps_lockup module account to auth accounts" + update_genesis '.app_state["auth"]["accounts"] += [{"@type": "/cosmos.auth.v1beta1.ModuleAccount", "base_account": {"address": "'$LPS_LOCKUP_MODULE_ACCOUNT_ADDRESS'", "pub_key": null, "account_number": "0", "sequence": "0"}, "name": "lps_lockup", "permissions": []}]' + + # Allocate locked amount to lps_lockup module account + echo "Allocating locked amount to lps_lockup module account" + update_genesis '.app_state["bank"]["balances"] += [{"address": "'$LPS_LOCKUP_MODULE_ACCOUNT_ADDRESS'", "coins": [{"denom": "'$DENOM'", "amount": "'$LOCKED_AMOUNT'"}]}]' + + # Update the supply to include the locked amount + echo "Updating total supply to include locked amount" + # Get the existing supply amount + EXISTING_SUPPLY=$(jq -r '.app_state.bank.supply[0].amount' $HOME/.laconicd/config/genesis.json) + # Calculate the new total supply by adding the locked amount + TOTAL_SUPPLY=$(bc <<< "$EXISTING_SUPPLY + $LOCKED_AMOUNT") + echo "New total supply: $TOTAL_SUPPLY" + update_genesis '.app_state["bank"]["supply"][0]["amount"] = "'$TOTAL_SUPPLY'"' # Sign genesis transaction # 10^15 alnt -- 2.45.2