Pledge and exercise
The investor pledges 100 ECONOMIC units to the issuer as collateral. The units stay in the investor’s position, locked; the issuer can take part of them (exercise) and release the rest.
1. Pledge
R=$(alias_tx encumbrance pledge "$ASSET" 0 100 "$ISSUER" --exercisable --from investor); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null
EID=$(aevad query encumbrance by-holder "$INVESTOR" --node "$AEVA_NODE" -o json | jq -r '.encumbrances | max_by(.id | tonumber) | .id')
echo "pledge: $AEVA_EXPLORER/encumbrances/$EID"
aevad query rights position "$ASSET" 0 "$INVESTOR" --node "$AEVA_NODE" -o json | jq -r '"units \(.position.units), encumbered \(.position.encumbered)"'The position shows the pledged units as encumbered: they count toward the investor’s holdings but cannot be transferred.
2. The beneficiary exercises 40 units
R=$(alias_tx encumbrance exercise "$EID" 40 --from issuer); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null
aevad query encumbrance encumbrance "$EID" --node "$AEVA_NODE" -o json | jq -r '"status \(.encumbrance.status), units left \(.encumbrance.units)"'An exercise is a transfer from the holder to the beneficiary, so the beneficiary must pass the kind’s policy (OPEN here).
3. The beneficiary releases the rest
R=$(alias_tx encumbrance release "$EID" --from issuer); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null
aevad query encumbrance encumbrance "$EID" --node "$AEVA_NODE" -o json | jq -r '"status \(.encumbrance.status)"'
aevad query rights position "$ASSET" 0 "$INVESTOR" --node "$AEVA_NODE" -o json | jq -r '"units \(.position.units), encumbered \(.position.encumbered)"'Expected output
status STATUS_RELEASEDThe investor could not have released the pledge: without
--holder-release-after, only the beneficiary can. See
Encumbrances.
Last updated