-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
527a9b0
commit 774b6c5
Showing
4 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,3 @@ function safeMint(address to) public onlyOwner{ | |
totalSupply++; | ||
_mint(to,tokenID); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.7; | ||
|
||
contract EnglishAuction{ | ||
address payable public seller; | ||
uint256 public timeToEnd; | ||
bool public running; | ||
|
||
address public highestBidder; | ||
uint public highestBid; | ||
|
||
constructor(){ | ||
seller = payable(msg.sender); | ||
|
||
|
||
} | ||
|
||
function startAuction() public{ | ||
require(!running); | ||
require(seller == msg.sender); | ||
|
||
running = true; | ||
timeToEnd = block.timestamp + 1 minutes; | ||
|
||
} | ||
|
||
function bid() public payable{ | ||
require(running); | ||
|
||
require(msg.value > highestBid); | ||
|
||
payable(highestBidder).transfer(highestBid); | ||
|
||
highestBidder = msg.sender; | ||
highestBid = msg.value; | ||
|
||
} | ||
|
||
function win() public{ | ||
require(running); | ||
require(timeToEnd <= block.timestamp); | ||
|
||
running = false; | ||
seller.transfer(highestBid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.7; | ||
|
||
interface IEnglishAuction{ | ||
function bid() external payable; | ||
} | ||
|
||
contract auctionHack{ | ||
IEnglishAuction public auctionContrcat; | ||
|
||
constructor(address addy){ | ||
auctionContrcat = IEnglishAuction(addy); | ||
} | ||
|
||
function bid() public payable{ | ||
auctionContrcat.bid{value: msg.value}(); | ||
} | ||
|
||
fallback() external payable{ | ||
|
||
} | ||
|
||
receive() external payable{ | ||
|
||
} | ||
} |