https://github.com/almostfancy/true-dutch
True Dutch Auction solidity smart contract
https://github.com/almostfancy/true-dutch
ethereum foundry smart-contracts solidity solmate
Last synced: about 1 year ago
JSON representation
True Dutch Auction solidity smart contract
- Host: GitHub
- URL: https://github.com/almostfancy/true-dutch
- Owner: AlmostFancy
- License: isc
- Created: 2022-05-16T16:57:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T14:43:03.000Z (about 3 years ago)
- Last Synced: 2024-11-18T15:47:42.807Z (over 1 year ago)
- Topics: ethereum, foundry, smart-contracts, solidity, solmate
- Language: Solidity
- Homepage:
- Size: 343 KB
- Stars: 23
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/AlmostFancy/true-dutch/blob/master/LICENSE.txt)
[](https://www.npmjs.com/package/@almost-fancy/true-dutch)
## Installation
Forge:
```sh
forge install almostfancy/true-dutch
```
Hardhat or Truffle:
```sh
npm install -D @almost-fancy/true-dutch
```
## Usage
To get started, you can use the library as follows:
```solidity
pragma solidity ^0.8.4;
import { TrueDutchAuction } from "@almost-fancy/true-dutch/src/TrueDutchAuction.sol";
contract AlmostFancy is TrueDutchAuction, ERC721A {
constructor(address payable _beneficiary)
ERC721A("AlmostFancy", "AF")
TrueDutchAuction(
DutchAuctionConfig({
saleStartTime: dutchSaleTime,
startPriceWei: 0.99 ether,
endPriceWei: 0.09 ether,
duration: 9 hours,
dropInterval: 15 minutes,
maxBidsPerAddress: 0,
available: 1111,
maxPerTx: 3
}),
_beneficiary
)
{}
function placeBid(uint256 quantity) external payable {
_placeAuctionBid(msg.sender, quantity);
}
function _handleBidPlaced(
address whom,
uint256 quantity,
uint256 priceToPay
) internal override {
uint256 cost = priceToPay * quantity;
_safeMint(whom, quantity); // call ERC721A#_safeMint to actually get the asset to the caller
}
}
```
## License
Distributed under the ISC License. See `LICENSE.txt` for more information.