Skip to content

badbabybearbots/contracts

Repository files navigation

Bad Baby Bear Bots Smart Contracts

WARNING: The contracts provided here are as is. BBBB does not warrant that these will work on a live environment. It is possible that these contracts are out dated and it is possible for BBBB to update these contracts without prior notification. Use at your own risk.

The contracts defined here are to allow auditors to evaluate the code that are being developed and specifically for the purpose of the Bad Baby Bear Bots NFT project.

1. Provenance Strategy

The following describes how this project will implement a fair NFT sale and minting.

  1. Art will be generated using an art engine similar to this.
  2. The final generated art will be hashed using CIDs and each art CID will be added to its relative metadata.
  3. Each art metadata will be hashed using CIDs and the provenance hash will be a sequence of these.
  4. Before the NFT sale, the art as well as the provenance hash will be posted.
  5. When the contract is deployed, the code will reserve the first 16 NFTs for the team.
  6. The sale will begin as described on the START_DATE specified in BadBabyBearBotsCollection.sol. Minting merely assigns token IDs to owners.
  7. No art will be revealed (assigned to a token ID) until withdraw is called, in which the starting image assigned will depend on the last block number recorded.

2. Self Regulation

The following describes how the contracts will prevent any scams and/or rug pulls on our side.

  1. The BadBabyBearBotsCollection.sol has the BBBB multisig wallet and the DAO hard coded when deployed. In the withdraw function the funds will be transferred to only these contracts and cannot change (immutable)
  2. The BBBBMultisigWallet.sol will be the only smart wallet used to disburse funds to suppliers. Requesters and approvers will be assigned at the discretion of BBBB. The wallet will prevent requests more than 20 ETH
  3. The BBBBDAOFI.sol will be the only smart wallet used to disburse funds to NFT and blockchain projects. Requesters can only be BBBB and approvers can only be NFT holders. The wallet will prevent requests more than 5 ETH

Preventing Rug Pulls from the Multisig Wallet

Only 1 request per teir is allowed per respective cooldown. This means it would take at best 10 months to withdraw 465 ETH.

·------------------|------------|------------|----------------·
| Threshold        · Approvers  · Cooldown   · Max per Month  |
···················|············|············|·················
| Up to 0.05 ETH   ·     1      · 1 day      · 1.5 ETH        |
···················|············|············|·················
| Up to 0.50 ETH   ·     2      · 3 days     · 5 ETH          |
···················|············|············|·················
| Up to 5.00 ETH   ·     3      · 7 days     · 20 ETH         |
···················|············|············|·················
| Up to 20.0 ETH   ·     4      · 30 days    · 20 ETH         |
·------------------|------------|------------|----------------·
| Total                                        46.5 ETH       |
·------------------|------------|------------|----------------·

All transactions have metadata with more information about each transaction. It would look like the following. The total of the amount should be equal to the request amount.

[
   {
      "amount": "0.00001",
      "beneficiary": "Netlify",
      "purpose": "Serverless charge",
      "website": "https://netlify.com",
      "reference": 10000000
   },
   {
      "amount": "0.05",
      "beneficiary": "Designer A",
      "purpose": "Payment for Invoice",
      "reference": 10000001
   }
]

Preventing Rug Pulls from the DAO

The following table shows all the possible tier approvals.

·------------------|------------·
| Threshold        · Approvers  |
···················|·············
| Up to 0.1 ETH    ·     1      | 
···················|·············
| Up to 0.5 ETH    ·     2      |
···················|·············
| Up to 1.0 ETH    ·     3      |
···················|·············
| Up to 5.0 ETH    ·     4      |
·------------------|------------·

All transactions have metadata with more information about each transaction. It would look like the following. The total of the amount should be equal to the request amount.

{
   "amount": "0.1",
   "beneficiary": "An external NFT Project",
   "purpose": "Gas",
   "website": "https://nft-example.com/",
   "reference": 10000000
}

3. Auditing

Install

$ cp .env.sample to .env
$ npm install

You will need to provide a private key to deploy to a testnet and a Coin Market Cap Key to see gas price conversions when testing.

Testing

Make sure in .env to set the BLOCKCHAIN_NETWORK to hardhat.

$ npm test

Reports

The following is an example gas report from the tests ran in this project and could change based on the cost of ETH itself.

·------------------------------------|---------------------------|-------------|-----------------------------·
|        Solc version: 0.8.9         ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 12450000 gas  │
·····································|···························|·············|······························
|  Methods                           ·              200 gwei/gas               ·       3141.03 usd/eth       │
·······················|·············|·············|·············|·············|···············|··············
|  Contract            ·  Method     ·  Min        ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
·······················|·············|·············|·············|·············|···············|··············
|  BadBabyBearBots     ·  mint       ·      64357  ·      96573  ·      80465  ·            2  ·      50.55  │
·······················|·············|·············|·············|·············|···············|··············
|  BadBabyBearBots     ·  withdraw   ·          -  ·          -  ·      67116  ·            1  ·      42.16  │
·······················|·············|·············|·············|·············|···············|··············
|  BBBBMultisigWallet  ·  approve    ·      64170  ·      82320  ·      71949  ·           14  ·      45.20  │
·······················|·············|·············|·············|·············|···············|··············
|  BBBBMultisigWallet  ·  cancel     ·          -  ·          -  ·      61061  ·            2  ·      38.36  │
·······················|·············|·············|·············|·············|···············|··············
|  BBBBMultisigWallet  ·  grantRole  ·     101228  ·     118328  ·     104078  ·            6  ·      65.38  │
·······················|·············|·············|·············|·············|···············|··············
|  BBBBMultisigWallet  ·  request    ·     106454  ·     113453  ·     109457  ·            7  ·      68.76  │
·······················|·············|·············|·············|·············|···············|··············
|  BBBBMultisigWallet  ·  withdraw   ·          -  ·          -  ·      65975  ·            5  ·      41.45  │
·······················|·············|·············|·············|·············|···············|··············
|  Deployments                       ·                                         ·  % of limit   ·             │
·····································|·············|·············|·············|···············|··············
|  BadBabyBearBots                   ·          -  ·          -  ·    2062255  ·       16.6 %  ·    1295.52  │
·····································|·············|·············|·············|···············|··············
|  BBBBMultisigWallet                ·          -  ·          -  ·    2282113  ·       18.3 %  ·    1433.64  │
·------------------------------------|-------------|-------------|-------------|---------------|-------------·

Verifying Contracts

$ npx hardhat verify --network testnet 0x12345678890 ""

About

Official contracts of Bad Baby Bear Bots

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published