Storing Collateral in smart contract for Coin and FA #407
-
I am keeping collateral in object. code: let fa_store = fungible_asset::create_store(constructor_ref, fa_metadata); fungible_asset::deposit(fa_store, fa);` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
I probably need more context here -- do you have a deployment link so I can see the code? Also, could you pls be clearer on the issue you're facing? From what I can tell you're trying to store user collateral (APT) in a secondary store, and that is being reflected in your Petra balance? AFAIK Petra only displays balances in primary stores. |
Beta Was this translation helpful? Give feedback.
to support coin and fa you have two options:
(1) create a coin to fungible asset wrapper, here's an example
(2) create separate entry functions for coin and fa, here's a rewards contract that stores both fungible assets and coins to later distribute as airdrops.
although, ^this doesn't store both coin and fa inside an object, it stores them in the admin account, similar to what you're doing. but that made sense for the requirement.
also, here's aave v3 implemented in move for reference :)