ctrlTxid and ctrlGidx. OptionVault uses beaconTxid and beaconGidx. The contract checks for one unit of the asset on an input:
contracts/option_vault.ark @ 9fc10ef
Issue one unit with no control asset
Issue the asset with an amount of 1 and without a control asset. The operator rejects a reissue of an asset that has no control asset. Nobody can mint a second unit of this asset. Issue Assets explains the issuance.Check the asset
A script cannot see the issuance of an asset. Before you store an id in a contract, make sure that the supply is 1 and that the asset has no control asset. The constructor of the oracle output needs the txid in reverse byte order. This order is the reverse of the display order. The code below also converts the id to the constructor arguments.check-id.ts
Find the output offchain
A contract script needs only the id, but a settler must also find the output. The indexer returns outputs for scripts or outpoints, not for an asset id, and the asset query returns the supply, the metadata, and the control asset, not the holder. The settler asks the indexer for the oracle’s current script. Whoever runs the oracle publishes that script. The open-source oracle service publishes it at its/api/status endpoint. The settler keeps the output that holds the unit. After a migrate, the operator publishes the new script.
The sources have no indexer query that returns the output that holds a given asset unit.