Giter Club home page Giter Club logo

crvfunder's Introduction

veFunder - CRV Fundraising via Emissions

The Curve DAO currently subsidises liquidity pools in exchange for fees. There's some bribing action happening, where external protocols influence veCRV voters in favor of their gauge, but largely the gauge is focussed on AMMs. This is because it's the current paradigm.

With the new generalised cross-chain gauge architecture, Curve inflation can be directed to any arbitrary ERC20 on a sidechain, with any arbitrary on-chain logic (subject to DAO approval). This has the potential to fund more than just subsidised liquidity pools. This product aims to showcase exactly this: a DAO approved crowdfunding endeavor. This also has the potential to position Curve DAO as a decentralised public goods funding source: provided it adds value to the Curve ecosystem.

Overview

Dependencies

Testing

To run the unit tests:

$ brownie test -x

Deployment

To deploy first edit the scripts/deploy.py file to unlock the appropriate account, then run the following:

$ brownie run deploy --network mainnet

Deployment Addresses

Below is a list of callable methods on the Gauge Factory V1 contract.

  1. deploy_gauge(_receiver: address, _max_emissions: uint256) -> address: nonpayable: Deploy a new fundraising gauge
>>> tx = factory.deploy_gauge(alice, 200 * 10 ** 18, {"from": alice, "priority_fee": "2 gwei"})
Transaction sent: 0xaa0af656794ef7bf25ae986b82ccf91c148c5af70869f9cdf7f23ab5cbcb35e6
  Gas price: 0.0 gwei   Gas limit: 9007199254740991   Nonce: 4
  GaugeFactoryV1.deploy_gauge confirmed   Block: 14376787   Gas used: 193770 (85.00%)
>>> tx.events["NewGauge"]
OrderedDict([('_instance', '0x521629cbe068e58b43f1aEaB73E47fC43231E67C'), ('_receiver', '0x66aB6D9362d4F35596279692F0251Db635165871'), ('_max_emissions', 200000000000000000000))])

Note: A gauge does not automatically receive emissions, it must be voted in by the Curve DAO and then veCRV voters must allocate voting power to change the gauge weight.

  1. implementation() -> address: view: Get the implementation address used for creating proxies. This address is fixed at deployment and non-upgradeable
>>> factory.implementation()
0xE7eD6747FaC5360f88a2EFC03E00d25789F69291
  1. get_gauge_count() -> uint256: view: Get the total number of gauges deployed (these aren't necessarily voted in by the DAO
>>> factory.get_gauge_count()
1
  1. get_gauge_by_idx(_idx: uint256) -> address: view: Get the address of the gauge deployed at index _idx. This function returns ZERO_ADDRESS for indexes past get_gauge_count()
>>> [factory.get_gauge_by_idx(i) for i in range(factory.get_gauge_count())]
["0x521629cbe068e58b43f1aEaB73E47fC43231E67C"]

After a gauge is deployed, voted in by the DAO, and receiving emissions, the receiver must call the Minter to collect their accumulated CRV.

  1. receiver() -> address: view: The account which receives emissions from this gauge.
>>> gauge.receiver()
'0x66aB6D9362d4F35596279692F0251Db635165871'
  1. max_emissions() -> uint256: view: The maximum amount of emissions receiver() will receive, afterwards emissions will not accrue (akin to a supply burn)
>>> gauge.max_emissions()
200000000000000000000
  1. claimable_tokens_write(_user: address) -> uint256: nonpayable: The amount of CRV currently claimable by _user. This is a write method, but should be changed in the ABI to be a view method and called via eth_call.
>>> gauge.claimable_tokens_write.call(alice)
1180591620717411303424

License

(c) Curve.Fi, 2020 - All rights reserved.

Links

Discord Link

crvfunder's People

Contributors

bout3fiddy avatar skellet0r avatar zcor avatar

Stargazers

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

Watchers

 avatar

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.