How to swap tokens from one smart contract to another atomically?

Cryptocurrency News and Public Mining Pools

How to swap tokens from one smart contract to another atomically?

Hi,

So I have three ERC1155 contracts, one for NFTs, one for NFT accessories one for "decorated" NFTs. I want to provide the option to burn one NFT and one accessory for a decorated NFT, what is the best way to go about this?

I thought about just white listing the contract and checking msg.sender and then just perform the burn and mint in the same contract but I'm looking for the community's opinion. Are cases like this solved via existing code or does anyone have some examples?

submitted by /u/hl3mukkel
[link] [comments]