Exercise 3: Tokenized House Bidding with Smart Contract Settlement

Use-case 2) Selling fractionalized RWA on an English Auction

We chose ERC-1155 as a token standard for this boot camp because it allows us to represent a non-fungible asset with the certain amount of fungible tokens making it fractionalized.

As we mentioned, if we issue Alice 20 RealEstateToken tokens and she sends 5 of them to Bob, that means that Bob now owns the 25% of the real estate token representation. In the same way, she can also put on auction the certain percentage of her real estate token.

Create EnglishAuction.sol

English Auction and Ducth Auction are the two most popular decentralized auctions. We will build our own English Auction for RealEstateToken in Solidity.

It is the minimal implementation. The address which deployed the contract will be listed as seller, let's say that's Alice. When Alice calls the startAuction function, the contract will lock her ERC-1155 tokens inside it.

Auction lasts for 7 days.

The bidding is in native coin only (avax for Avalanche Fuji). Anyone can bid, by depositing ether amount greater than the current highest bidder. All bidders can withdraw their bids, excluding the current highest bidder.

After 7 days, anyone can call the endAuction function which will transfer ERC-1155 real estate tokens to the highest bidder and the highest bid amount in ether to Alice.

Inside the ./use-cases folder create the EnglishAuction.sol file.

Deploy EnglishAuction.sol to Ethereum Sepolia

To deploy the EnglishAuction.sol token to Avalanche Fuji we will need to provide the following information to constructor:

  • fractionalizedRealEstateTokenAddress: The address of the RealEstateToken.sol smart contract we previously deployed

Last updated