Hi All! Seeking advice on one of the issues that the INC4 team is facing with a smart contract in one of the dApps that we’re currently developing.
For our dApp it’s required to pay for mining of an NFT by means of the ft token (for example nDAI)
The smart contract of our NFT is on the nft.testnet account.
The ft token smart contract is on the ft.testnet account.
For NFT, storage_deposit (NEP-145) is already called in the ft.testnet contract.
The user bob.testnet calls the nft_mint method in the smart contract nft.testnet with a deposit in NEAR to pay for storage.
nft.testnet calls the ft_transfer method of the ft.testnet smart contract to transfer stake from the bob.testnet balance to the nft.testnet balance.
But according to the standard ft_transfer, the requirement is that it should be initiated by predecessor_account_id and it does not fall into the flow described above.
A reverse implementation is possible with a call to ft_transfer_call in ft.testnet and a subsequent call to nft.testnet for mining NFTs. But as far as we can see from the implementation of the ft token in the call nft.testnet (near-sdk-rs/core_impl.rs at 95954cad746502aeb64e42a8bd5bbbb1ce0df8cc · near/near-sdk-rs · GitHub), the deposit as storage is not transferred.
That is, bob.testnet will not be able to pay for storage.
Is there any way to tackle this? I’d be grateful to hear your thoughts on possible solutions.