Deploy token vesting contract

Goal: deploy a token vesting contract

Download contract

curl -Lso core_token_vesting_v2.wasm \
https://github.com/NibiruChain/cw-nibiru/releases/download/latest/core_token_vesting_v2.wasm

Store contract

FROM=nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl

nibid tx wasm store core_token_vesting_v2.wasm \
--from $FROM \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 0.025unibi \
--yes | tx

Save the code id for the next step.

Instantiate contract

The amount cannot be changed after instantiation.

CODE_ID=3
AMOUNT=100000000unibi
FROM=nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl
ADMIN=nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl # admin and from can be different

cat << EOF | jq | tee instantiate.json
{
    "admin": "$ADMIN",
    "managers": ["$ADMIN"]
}
EOF

nibid tx wasm instantiate $CODE_ID "$(cat instantiate.json)" \
--admin $ADMIN \
--from $FROM \
--label "contract label" \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 0.025unibi \
--amount $AMOUNT \
--yes | tx

Save the contract address from the response, e.g. nibi1unyuj8qnmygvzuex3dwmg9yzt9alhvyeat0uu0jedg2wj33efl5qlplsk6.

Prepare the reward user message

Execute the reward user message

Use the contract address from the previous step

Last updated

Was this helpful?