0

I'm new on web3, I want to create a code that can buy an item from a store using erc20 and erc721, I'm still confused about how can I do it I did so many searches on youtube and google and still don't have a clear idea. I want to make like the following transaction 0xf45589ed29f6cb075a1254716db7e2245b6093ab60f3794c6d46c4818e5beaa8. I don't know if should I use the safeTransferFrom using openzeppelin, or should I use a specific method on Web3.

1

You touch more than one topic. web3 and solidity.

You could transfer tokens using IERC20 interface of a ERC20 token in your smart contract.

safeTransferFrom is in ERC721, to send tokenid (nft) to another contract. eg.

https://docs.openzeppelin.com/contracts/2.x/api/token/erc721#ERC721-safeTransferFrom-address-address-uint256-

Good start and I recommend you to do more examples.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.