Git Product home page Git Product logo

v3's Introduction

V3 ๐“€จ

This repository contains the core contracts that compose the ZORA V3 Protocol.

This protocol is a Hyperstructure. It is unstoppable, free, expansive, permissionless, and credibly neutral.

Documentation is available at docs.zora.co

Architecture

          ,-.                  ,-.
          `-'                  `-'
          /|\                  /|\
           |                    |              ,----------------.          ,-----------------.          ,-----------------------.
          / \                  / \             |ZoraMarketModule|          |ZoraModuleManager|          |ZoraProtocolFeeSettings|
      Participant            zoraDAO           `-------+--------'          `--------+--------'          `-----------+-----------'
           |                    |             registers market module               |                               |
           |                    |-------------------------------------------------->|                               |
           |                    |                      |                            |                               |
           |                    |                      |                            |  mints module ownership NFT   |
           |                    |                      |                            |------------------------------>|
           |                    |                      |                            |                               |
           |                    |                      |   transfers module ownership NFT                           |
           |                    |<----------------------------------------------------------------------------------|
           |                    |                      |                            |                               |
           |          approves market module           |                            |                               |
           |------------------------------------------>|                            |                               |
           |                    |                      |                            |                               |
           |            uses market module             |                            |                               |
           |------------------------------------------>|                            |                               |
      Participant            zoraDAO           ,-------+--------.          ,--------+--------.          ,-----------+-----------.
          ,-.                  ,-.             |ZoraMarketModule|          |ZoraModuleManager|          |ZoraProtocolFeeSettings|
          `-'                  `-'             `----------------'          `-----------------'          `-----------------------'
          /|\                  /|\
           |                    |
          / \                  / \

ZORA V3 has many market modules, which are individual containers a user can opt in to. All of these modules share the same approval space, and as such can save ZORA users gas in the long term by not requiring new ERC-20 and ERC-721 approvals for every market.

When a new market is registered, a ZORA Module Fee Switch NFT, or ZORF, is minted to the DAO. This fee switch is set to 0 by default. At any time, the holder of the NFT can choose to set a fee, which provides an income stream to the holder on all future transactions in that module.

Once registered, anyone is able to use the market module by approving it via the ZoraModuleManager.

Contributing

ZORA V3 is meant to be as extensible as possible. As such, there are a number of ways for developers to contribute. This protocol is being developed in the open, and anyone can propose a module, audit a module, or suggest new module types for the community to begin using.

As the protocol matures, so too will these contribution guidelines. If you have a suggestion on how we can collaborate better on this protocol, please let us know.

Registering a New Module

New modules are added to V3 in three stages. We track which stage each module is in with PR labels:

  • Draft / RFC
  • Community Audit
  • Ready for Deployment

Note that we also include a 4th label, "ZORA Bug Bounty" for Modules that are created by the ZORA core team and ready for a community audit.

Draft / RFC

In this stage, the ZORA community is able to give design feedback and start discussions about what the module aims to accomplish. A new draft module can be started by creating a new pull request.

Community Audit

Once a module has been designed, built, tested and documented, the module can undergo community audits. If a vulnerability is found during this phase, feel free to leave a comment directly in the PR. If the module has been audited by a third party, the audit report can be included in the PR.

Modules that are written by the ZORA core team are open to our bug bounty program, which allows community auditors to claim up to 25 ETH for vulnerabilities that may have been missed during development. The rubric we use to determine bug bounties is inspired by ImmuneFi and is as follows:

Level Example Maximum Bug Bounty
5. Critical - Empty or freeze the protocol's holdings (e.g. economic attacks, flash loans, reentrancy, MEV, logic errors) Up to 25 ETH
4. High - Token holders temporarily unable to transfer holdings
- Users spoof each other
- Transient Consensus Failures
Up to 10 ETH
3. Medium - Contract consumes unbounded gas
- Block stuffing
- Griefing denial of service (i.e. attacker spends as much in gas as damage to the contract)
- Gas griefing
Up to 5 ETH
2. Low - Contract fails to deliver promised returns, but doesn't lose value Up to 1 ETH
1. None - Best practices
Not sure? Let's talk :~)

The ZORA Core team will commit to publicly disclosing all bug bounty payouts for applicable modules, as defined above.

Although not required, developers outside the ZORA core team are able to create and fund their own bug bounty programs, if desired. Feel free to outline your audit program in your PR description.

After a module has undergone a community audit (ideally about 3-7 days), the module can be deployed and registered. If a vulnerability is found post-deployment, you can email [email protected] directly.

Registering a Module

Since the ZORA DAO is currently controlled by a multi-sig, the ZORA Core team will deploy and register audited modules manually. If the module is marked with a "Ready for Deployment" label, it will be picked up in the next available deployment window by the ZORA core team. Once deployed, the contract address will be available in the addresses/ directory.

Leaving Feedback

If you have suggestions or comments on how we can better collaborate on this codebase and/or the protocol as a whole, please create an issue outlining your ideas and suggestions. We can then use the issue tracker as an open discussion forum.

Local Development

  1. Install Foundry
  2. Install dependencies with yarn & forge update
  3. Compile the contracts with yarn build
  4. Run tests with yarn test

v3's People

Contributors

almndbtr avatar bjfresh avatar iainnash avatar izqui avatar jgeary avatar kulkarohan avatar neodaoist avatar tbtstl avatar wk0 avatar z0r0z 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

v3's Issues

Testnet Errors

Created an NFT but that's all.

  1. Can't mint it more than once.
  2. Can't change the theme.
  3. can't go to "Single Edition"
  4. Can go to "Drop collection", choosing folder but can't go forward...
    error_04
    error_03
    error_02
    error_01

Collection offers

Are there plans to update Offers.sol to support collection wide offers?

Suggestions

Hello, I used your testnet, you used an easy and understandable interface.
But different tokens can be added in the bridging network
I believe that this project can come to better places.
I wish you success in advance, I hope to see you in beautiful places

Confirming the medium of reporting security vulnerabilities

Summary

If we want to participate in the security vulnerability portion of the community audit, what communication method does the @ourzora team prefer? ๐Ÿ’ญ

Reconciling differences

In the Enter Zora V3, I see that the Community Bug Bounty section says to email either of these addresses:

We have an up to 25 ETH community bug bounty for any vulnerabilities discovered. If you find any vulnerability that could result in the loss of user funds or NFTs, reach out to [email protected] or [email protected]

However, the Community Audit section of this README isn't particularly clear on whether or not we should be emailing those addresses, commenting directly in the PR, or taking another method. ๐Ÿ˜…


๐Ÿฆ Twitter Equivalent of this issue: tweet

Bug report: `yarn build` throws "Error occured: _h.match is not a function" on fresh clone

Summary

Starting with a fresh clone of 479e45c, changing directory into the repo, running yarn to install dependencies, and running yarn build throws this error:

"Error occured: _h.match is not a function"

Full trace
$ git rev-parse HEAD
479e45ccf29b2c9fe48cdf60373212c45c060e56

$ yarn
yarn install v1.22.15
[1/4] Resolving packages...
success Already up-to-date.
$ husky install
husky - Git hooks installed
Done in 0.26s.

$ yarn build --show-stack-traces
yarn run v1.22.15
$ forge build && yarn typechain --show-stack-traces
compiling...
no files changed, compilation skipped.
$ typechain --target=ethers-v5 'dist/artifacts/*/*.json' --out-dir dist/typechain --show-stack-traces
Error occured:  _h.match is not a function
Stack trace:  TypeError: _h.match is not a function
    at extractBytecode (/workspaces/v3/node_modules/typechain/dist/parser/abiParser.js:217:70)
    at Ethers.transformAbiOrFullJsonFile (/workspaces/v3/node_modules/@typechain/ethers-v5/dist/index.js:55:58)
    at Ethers.transformFile (/workspaces/v3/node_modules/@typechain/ethers-v5/dist/index.js:30:21)
    at runTypeChain (/workspaces/v3/node_modules/typechain/dist/typechain/runTypeChain.js:54:82)
    at async main (/workspaces/v3/node_modules/typechain/dist/cli/cli.js:49:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Investigating the trace ๐Ÿ”Ž

I grep'd for this function call:

$ grep -rn "_h.match" .
./node_modules/typechain/dist/parser/abiParser.js:217:    if ((_h = json.bytecode) === null || _h === void 0 ? void 0 : _h.match(bytecodeRegex)) {

Here's the full expression in context:

    if ((_h = json.bytecode) === null || _h === void 0 ? void 0 : _h.match(bytecodeRegex)) {
        return extractLinkReferences(json.bytecode, json.linkReferences);
    }

I pulled up packages/typechain/src/parser/abiParser.ts at main and I think this is the source:

  if (json.bytecode?.match(bytecodeRegex)) {
    return extractLinkReferences(json.bytecode, json.linkReferences)
  }

I tested this out on two local machines, ensuring that Foundry is installed for both:

  • Ubuntu 20.04.3 LTS
  • Mac OS Monterey v12.2.1

Would love a pointer for how to get yarn build working on my machine! ๐Ÿ™‡โ€โ™‚๏ธ

contracts/test/utils/VM.sol: typo in annotation

Summary

stopPrank()'s annotation cites prankStart() at the end:

/// @dev Stop smart contract calls using the specified address with prankStart()
function stopPrank() external;

However, prankStart() doesn't exist beyond this citation: startPrank() does! ๐Ÿ˜‰

/// @dev Performs all the following smart contract calls with specified `msg.sender`, (newSender)
function startPrank(address) external;

Removed

Removed for security reason.

Html & css

Need to solve small visual bug:
Connected to https://testnet.zora.co/
I clicked the menu in the upper right part of the site - a black drop-down profile menu appeared on the screen (your balance, etc.)
then I click the Personalize link, I get the Personalize menu on the right side of the screen, but the profile drop-down menu remains in place. Need to fix this.

scr

Contracts are not much Gas Optimized

Most of the Zora-V3 contracts are using require statements for reverting errors. Which is not a very gas-efficient way to revert errors. The require statements stores Strings which costs a lot of Gas (deploying + function Calling & Reverting).
And as the protocol aims to be Gas Efficient, Then it would be much better to not use require statements to revert the errors.
Instead, use Custom Errors. Which is a new solidity feature (introduced in 0.8.*)
Custom errors do the same thing but cost much less gas than the require statements.
For more info read this

Thanks,
AB Dee

Application Error on the Market and Profile Page on the UI

There is a persistent user interface problem that has been hindering me from accessing any NFTs which were created via pre-Create "mint" function for 1/1 editions such as .txt and .md files, and my personal profile page, for almost a month now.

It affects market dot zora dot co links with exceptions at time. Several other friends have reported encountering the same problem across both Chromium-based, and other types of browsers both on desktop and mobile.

I hope this is the right place open this issue.
Screenshot 2022-12-14 at 01 54 51

hi

the page structure is quite colorless, you can work in the background a little more, it also cuts the bridge fees from the metamask wallet 2 times

minor bug

when creating a collection on the zora testnet network when it's finished and clicking "view mint page" it occurs a link error but when going to the profile and check on the zora testnet collection section it works fine

this addres i am using to test : 0x1216Fcc0e9fDD122872429Ec1DE3970174C1C053

Auction V3 Storage Slot Optimization

One way to save 2 slots would be to limit the size of a few fields to a more reasonable number.

Duration can easily be uint32 (probably not a great idea to have an auction beyond 100 years etc).

uint32+uint16+address is still less than uint256 (one storage slot)

firstBidTime and startTime can both be uint126 to save one slot as well

address
uint16 finderFeeBps
uint32 duration
uint128 firstBidTime
uint128 startTime

saves two slots over the current configuration.

Originally posted by @iainnash in #122 (comment)

Report a bug

I tried to bridge gETH to Zora testnet, 3 times.
First 2 trying was on default setting, sending 0.1 ETH and paying gas fee suggested,
After second Failure, I changed bridging amount and gas fee, which were 0.11 ETH and aggressive gas fee.
But I could not complete again bridging.

Here are three HXs that were not completed.

Typos in `ZoraProtocolFeeSettings.t.sol`

Summary

๐Ÿ”ฌ"recieve" is misspelled. Proposed quick fix: s/recieve/receive

function test_SetFeeParams() public {
init();
mint();
vm.prank(address(registrar));
ZPFS.setFeeParams(address(module), address(feeRecipient), 1);
(uint16 feeBps, address reciever) = ZPFS.moduleFeeSetting(address(module));
require(feeBps == 1);
require(reciever == address(feeRecipient));
}
function test_ResetParamsToZero() public {
init();
mint();
vm.prank(address(registrar));
ZPFS.setFeeParams(address(module), address(feeRecipient), 0);
(uint16 feeBps, address reciever) = ZPFS.moduleFeeSetting(address(module));
require(feeBps == 0);
require(reciever == address(feeRecipient));
}

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.