Get collateral status

Get collateral status on Spark

Ethereum
Ethereum

Reads onchain state

Ready to run on Base

Reads whether an address has an asset enabled as collateral in a Spark market. Spark tracks collateral use per user, per reserve, as a bit in that account's configuration bitmap. This action reads the pool, finds the reserve's id, and pulls that bit for the named account, returning isCollateralEnabled as a boolean. Supplying an asset does not guarantee it counts toward borrowing power; this flag decides it. Reach for it before a borrow so a predicate can require the collateral is switched on, or to branch: enable collateral only when it is currently off, then proceed to the borrow in the same transaction.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

More on Spark · 25

On other protocols · 2