Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 23 hours 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 (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T14:43:03.000Z (over 1 year ago)
- Last Synced: 2024-11-18T15:47:42.807Z (1 day 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
[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://github.com/AlmostFancy/true-dutch/blob/master/LICENSE.txt)
[![NPM](https://img.shields.io/npm/v/@almost-fancy/true-dutch)](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.