How does WETH (Wrapped ETH) pre-auth work on Rarible

Hello There!

How does WETH pre-auth work in Raible? How to build it in Moralis? Could you please guide us or share any article about that.

This means, Before the user bids to an NFT, we have to Pre-auth WETH amount, and if the user wins, We will deduct that Pre-auth WETH and transfer the NFT to the user.

Thanks

Hi, @neil,

Can you give more details?
What is pre-auth?
What is WETH?

I could assume that you mean https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
that is Wrapped Ether and this means that is an ERC20 token like any other ERC20 token that you know.

By pre-auth you could refer maybe to allowance?

Hi @cryptokid,

Thanks for the replay; yes, you are right about WETH.

My problem is how to build a system like Rarible or Open Sea. These are the features that I would like to implement.

  1. customer bid an auction, and they pre-auth(sign) WETH (Means system check they have WETH in the wallet if they have WETH pre-auth(sign) it).

  2. If the customer wins system automatically deducts the WETH that has already been allocated.

Thanks

You could mean the approve part, similar to what is done here for an NFT token in Moralis Rarible clone tutorial (https://www.youtube.com/watch?v=mMu8mFPNNdA&ab_channel=MoralisWeb3): https://github.com/MoralisWeb3/youtube-tutorials/blob/35c6a6e45861f9f69205c9ceb2ae57eec2761b81/rarible-clone/frontend/main.js#L293

The ERC20 token standard has
approve function - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/aefcb3e8aa4ee8da8e2b7022ffe4dcb57fbb0fdf/contracts/token/ERC20/ERC20.sol#L131

allowance function - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/aefcb3e8aa4ee8da8e2b7022ffe4dcb57fbb0fdf/contracts/token/ERC20/ERC20.sol#L120

transferFrom function - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/aefcb3e8aa4ee8da8e2b7022ffe4dcb57fbb0fdf/contracts/token/ERC20/ERC20.sol#L149

among other functions related to allowance

1 Like