Hello Fuel team!
Let’s say I have a following function:
pub fn checkAssetOwnership(checked_asset: AssetId) -> bool {
let num_inputs = input_count().as_u64();
let mut i = 0;
while i < num_inputs {
match input_type(i) {
Input::Coin => {
let asset_id = input_asset_id(i).unwrap();
if asset_id == checked_asset {
return true;
}
},
_ => {},
}
i = i + 1;
}
false
Let’s consider that I have another contract which minted an NFT and owns it.
I wish to send a transaction from that contract to another one to check the ownership using the function above (attaching the input). Is there any way of how I can send an Input from a contract address to check the ownership? If it’s not possible, could you please suggest any alternatives (if any) to achieve that.
Hey @calldelegation! Seems that the answer solves the problem I’ve got, thank you!
For anyone who has the same question as I did, it might be useful to read the following question to understand how balance is stored for contracts and what’s the difference between account balance and contract balance: How to get the balance of an EOA address in sway