Coder Social home page Coder Social logo

partybid's Introduction

PartyBid

PartyBid is a protocol that allows a group of internet homies to pool their funds together in order to win an NFT auction.

PartyDAO 🥳

PartyBid is the first product developed by PartyDAO, a decentralized autonomous organization that builds and ships products. PartyDAO was created initially for the purpose of shipping PartyBid. To keep up with PartyDAO, follow @prtyDAO on Twitter and Mirror. Acquire 10 $PARTY tokens to join the DAO and party with us.

Features

  • A PartyBid contract is deployed targeting a single NFT auction
  • Anyone can contribute ETH to the PartyBid while the auction is still live
  • Anyone who has contributed to the PartyBid can trigger a bid on the targeted NFT auction
  • After the auction closes, if the PartyBid won the NFT, the token is fractionalized; all contributors whose funds were used to win the auction are rewarded with ERC-20 tokens representing a fractionalized share of the NFT. Tokens are fractionalized using fractional.art contracts
  • If a PartyBid wins the NFT, a 2.5 ETH fee and 2.5% of the fractional token supply is transferred to the PartyDAO multisig.

Functions

PartyBidFactory

  • startParty - deploy a PartyBid contract, specifying the NFT auction to target

PartyBid

  • contribute - contribute ETH to the PartyBid
  • bid - trigger a bid on the NFT auction. Always submits the minimum possible bid to beat the current high bidder. Reverts if the PartyBid is already the high bidder. finalize - call once after the auction closes to record and finalize the results of the auction. Deploys the fractionalized NFT vault if the PartyBid won.
  • claim - call once per contributor after the auction closes to claim fractionalized ERC-20 tokens (for any funds that were used to win the auction) and/or excess ETH (if the auction was lost, or if the funds were not used to win the auction)
  • recover - callable by the PartyDAO multisig to withdraw the NFT if (and only if) the auction was incorrectly marked as Lost

Repo Layout

  • contracts/PartyBid.sol - core logic contract for PartyBid
  • contracts/PartyBidFactory.sol - factory contract used to deploy new PartyBid instances in a gas-efficient manner
  • contracts/market-wrapper - MarketWrapper contracts enable PartyBid to integrate with different NFT auction implementations using a common interface
  • deploy - Deployment script for contracts
  • test - Hardhat tests for the core protocol
  • contracts/external - External protocols' contracts (Fractional Art, Zora Auction House, Foundation Market), copied to this repo for use in integration testing.
  • contracts/test - Contracts written for use in testing

Installation

  1. Install dependencies
npm i
  1. Setup your .env file in order to deploy the contracts
touch .env && cat .env.example > .env

Then, populate the values in .env.

Tests

To run the Hardhat tests, simply run

npm run test

Deployment

You can find the address of deployed PartyBid Factories on each chain at deploy/deployed-contracts

To deploy a new PartyBid Factory, first ensure you've populated your .env file. The RPC endpoint should point chain you want to deploy the contracts, and the private key of the Deployer account should be funded with ETH on that chain .

Next, add a config file to deploy/configs/[CHAIN_NAME].json specifying the addresses of the necessary external protocols on that chain. You can use other files in that folder to see which contract addresses must be populated.

Finally, run

npm run deploy:partybid

Security Review

The findings from the security review for PartyBid contracts can be found here. The security review was completed by Alex Towle.

Credits

License

PartyBid contracts are reproduceable under the terms of MIT license.

MIT © PartyDAO

partybid's People

Contributors

anna-carroll avatar brickfigpigsinglettuce avatar johncpalmer avatar msfeldstein avatar solimander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

partybid's Issues

Docs: typo in README's Features section for fee percentages

Summary

In the README's Features section, it's written:

If a PartyBid wins the NFT, a 2.5 ETH fee and 2.5% of the fractional token supply is transferred to the PartyDAO multisig.

The 2.5 ETH took me by surprise -- I double-checked the About page says this about what happens when a party is victorious:

Fee: Only on successful purchases by Parties, PartyBid charges a fee of 2.5% of both the ETH used in the purchase and the resulting tokens.

I'm interested in cutting a PR to resolve this ✌️

Trouble getting tests to Pass

Hello Folks!

I'm trying to run the tests to try and contribute some code. I wanted to ask, out-of-the-box my tests aren't passing, the error is always the same:

       ZORA
         "before all" hook for "Has correct balances before contribute":
     InvalidInputError: Transaction gasPrice (0) is too low for the next block, which has a baseFeePerGas of 875000000
      at HardhatNode._validateAutominedTx (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1520:17)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
      at runNextTicks (internal/process/task_queues.js:64:3)
      at listOnTimeout (internal/timers.js:526:9)
      at processTimers (internal/timers.js:500:7)
      at HardhatNode.sendTransaction (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:415:5)
      at EthModule._sendTransactionAndReturnHash (node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:1500:18)
      at HardhatNetworkProvider.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:106:18)
      at EthersProviderWrapper.send (node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)```
      
I assume this is a problem with the `london` fork and I've seen some issues in the Nomic Labs [Github](https://github.com/nomiclabs/hardhat/issues/1766) but I wanted to ask: What is your setup that I can replicate and have the tests pass? 

Unable to claim unused ETH

hi y'all – I'm running into difficulty reclaiming the ETH I contributed to a PartyBid that was not successful. More details below...

Environment

Behavior

  1. Visit the PartyBid to which you contributed ETH. In this case, https://www.partybid.app/party/0xc94a63198f58b694917d3ae02e8b64f7ac3c6e75
  2. Click the "Connect Wallet" button in the page chrome
  3. Observe the "Connect to PartyBid" dialog appears
  4. Select "WalletConnect"
  5. Observe the "Successfully connected!" toast appears and a snippet of the wallet address I just connected to PartyBid appears where the "Connect Wallet" button previously had
  6. Click the "Claim unused ETH!!!" button
  7. Observe the "Claim unused ETH!!!" button has change state and is no longer clickable:

Screen Shot 2021-12-09 at 9 58 13 PM

Actual
7. ❗️Visit the wallet you successfully connected to PartyBid in "Step 5." and notice no ETH has been received

Expected
7. ✅ Visit the wallet you successfully connected to PartyBid in "Step 5." and notice the ETH you contributed to the party has been received

about function _getMaximumBid()

    function _getMaximumBid() internal view returns (uint256 _maxBid) {
        _maxBid = (totalContributedToParty * 100) / (100 + FEE_PERCENT);
    }

It seems below code is right:

    function _getMaximumBid() internal view returns (uint256 _maxBid) {
        _maxBid = (totalContributedToParty * (100 - FEE_PERCENT)) / 100 ;
    }

re-structure Factory deployment & events

  • deploy PartyBid, PartyBuy, and collectionParty implementations separately from factory
  • have functions for multisig to update implementations deployed
  • log deployedAt[proxy] = block.timestamp for all deployed proxies
  • emit Party___Deployed event with all the params in Implementation initialize so it's always available from the Party contract
  • emit ProxyDeployed event with only the address when any proxy is deployed (for discoverability)

On frontend, get event from Party contract itself always & always verify that contract was deployed by factory

RE: alextowle Audit #2 Change

  1. Check for Zora Auction Currency

There is no check to ensure that Zora auctions are settled in ETH. User funds do not appear to be at risk as the Zora AuctionHouse contract will revert if the specified bid amount is not provided in the target currency. This said, PartyBid instances that target Zora auctions that aren’t settled in ether are a waste of time for PartyBid users.

To prevent such instances from being created by the PartyBidFactory, a check can be made in the ZoraMarketWrapper’s auctionIdMatchesToken function that the auction’s currency is ether (address 0).

Looking at this suggested implementation, renaming auctionIdMatchesToken as validAuctionIdForToken may make sense since this additional check is included here.

Ability to create parties in other networks

Hello, dear PartyDAO team!

The gas fees in the ERC-20 network is extremely expensive, it burns an incredible amount of money, I have participated in only two parties, while paying over $100 gas fees. Could you please bring your product to other networks and make it possible to use it on cheaper L2 solutions like ZkSync, Arbitrum, Optimism?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.