I'm trying to develop NFT's contract with reference to unicoeos/eosio.nft.
Also I'm trying to develop NFT's shop contract in order to trade NFT and eosio.token.
The logic trading NFT and eosio.token is:
- Dealer registers his NFT in a table for the shop's contract.
- Buyer sends transaction to buy dealer's NFT in the table.
- The shop's contract validate some parameters in the transaction.
- The shop's contract run
transfer
action for eosio.token contract as inline action to send EOS to Dealer from Buyer. - The shop's contract run
transfer
action for NFT' contract as inline action to send NFT to Buyer from Dealer.
I think it is a normal trade with two other token.
But transfer
action for both eosio.token's and NFT's contract have to require sender authority.
In above case, it is required the authority for Buyer to run transfer
for eosio.token (in the list 4)
and the authority for Dealer to run transfer
for NFT (in the list 5).
When buyer sends transaction to buy dealer's NFT, it is possible to permit buyer's authority but not possible to permit dealer's authority.
So how do shop's contract send NFT without dealer's authority ? Thank you for your help!