In this assignment, you will write a Solidity smart contract following a given interface and two TypeScript functional tests for it. You will not receive any grading scripts this time.
As with all assignments, don’t hesitate to Google, but do not copy verbatim or directly from your peers. Your code must compile and run to receive any credit.
Submission guidelines: Push frequently to your GitHub repository before due.
GitHub Classroom invite for HW6: https://classroom.github.com/a/o7kyVw4z
Deadline: Nov 29, 2022 16:00 PST
deBay (6%)
deBay is an auction platform. Think of it as eBay but decentralized.
- An auction struct consists of (but not limited to):
- Item name
- The initiator
- Item image URL
- Description
- Price floor
- Anyone can start an auction and anyone else can bid.
- Every new bid must be higher than the current bid.
- The initiator cannot bid on their own auctions.
- Bidders who are outbid can retrieve their funds.
- Bidders also have the option of leaving these funds in the contract, depositing more funds, then submitting a higher bid for the same item.
- Bidders can also recycle their funds to be used to bid on other items, without their funds leaving the contract.
- Every bid has a deadline, which is a timestamp.
- Nobody can bid past the deadline. However, anyone can settle a bid past the deadline (announcing the bid winner).
- Nobody can start an auction, bid, settle, deposit more funds, or withdraw funds when the contract is paused.
1) Solidity (4%)
You must implement the smart contract following the given skeleton code.
Grading point distribution:
function startAuction(string calldata name, string calldata imgUrl, string calldata description, uint256 floor, uint256 deadline) external
: 1%