import { getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
import { ERC20TokenContract } from '@0x/contracts-erc20';
import { Web3ProviderEngine } from '@0x/subproviders';
import { BigNumber } from '@0x/utils';

interface ProposedAction {
    target: string;
    data: string;
    value: BigNumber;
}

interface Proposal {
    actions: ProposedAction[];
    description: string;
    executionEpoch?: BigNumber;
}

const { zrxToken } = getContractAddressesForChainOrThrow(1);
const zrx = new ERC20TokenContract(zrxToken, new Web3ProviderEngine());

export const proposals: Proposal[] = [
    {
        actions: [
            {
                target: zrxToken,
                data: zrx
                    .transfer('0xf9347f751a6a1467Abc722eC7d80bA2698dd9d6c', new BigNumber('400000e18'))
                    .getABIEncodedTransactionData(),
                value: new BigNumber(0),
            },
        ],
        description:
            '# [Proposal] Z-1 Community Treasury Ecosystem Value Experiment\n\n## TL;DR\n\nWe propose an operations model, team, and budget for a six-month, experimental initiative funded by the community treasury. The overall goal is to actively drive value creation and capture for the 0x protocol. We explain our thinking behind the proposal and why we think the community and broader 0x ecosystem will quickly and sustainably benefit from the initiative.\n\n_Note: This proposal is an updated version of the draft [published in the 0x Governance and Research forum](https://gov.0x.org/t/0xdao-community-treasury-proposal-1/883) and incorporates revisions based on feedback received. Notably, we have updated the budget to reflect more recent cost projections using industry-standard, publicly referenceable price data pulled on 5/23/2021 (original projections were done using price data pulled on 4/26/2021)._\n\n## Introduction\n\nRecognizing the ever-changing dynamics and increasing competitiveness of the broader cryptocurrency environment, the 0x community ambassadors propose an ambitious, six-month (26 weeks), experimental initiative focused on value creation and capture for the 0x protocol and its broader ecosystem. We’re confident that taking a bold approach to treasury management will create an immediate source of differentiation for 0x and enable us to most efficiently and effectively allocate community treasury funds at this stage in our growth. More importantly, if successful, we envision this initiative will turn into a sustainable source of meaningful, long-term value that will accelerate the flywheel of reflexivity and help to manifest the larger vision for the 0x ecosystem.\n\n## Background\n\nThe 0x protocol’s mission is to create a tokenized world where all value flows freely. After years of development and cultivation, it is clear that the protocol has achieved significant product-market fit. We explicitly adopt the protocol’s mission as our own for the duration of this experiment.\n\nRecently, the protocol began to actualize a phased approach for evolving into a multi-chain, crypto-economic primitive. As the prime developer of the protocol, 0x Labs has positioned itself well to drive and execute this technological maturation. In parallel, with the establishment of the 0xDAO and the community treasury, the 0x community is now positioned to take a more active and accountable role in protocol development.\n\n## Purpose\n\nLeveraging the 0xDAO community treasury, best practices from strategic innovation methodologies and frameworks (such as Jobs To Be Done, Design Thinking, Lean Startup, etc.), and a scrappy team of community members, we aim to deliberately – and with rigor – begin the process of direct community governance with an initial focus on ecosystem value creation and capture. Passage of this proposal will formally authorize the initiative and provide funding for operations.\n\n## Scope\n\nUsing the contextual framework described above, we have loosely categorized potential areas of experimentation below. Initial prioritization will be determined by the team and the strategy they develop once the effort is formally established. We welcome and will continue to actively seek out community input. It’s important to note that this list is meant to be illustrative in nature, and not meant to be all-encompassing or presented in any sort of priority order.\n- Adding features and improving protocol functionality\n- Performing tokenomics review, optimization, and potential revamp\n- Incentivizing and improving support for new and existing market makers\n- Providing liquidity to select ZRX pairs\n- Incentivizing order flow and trading volume, including via relayers, dApps, etc.\n- Improving the user experience for staking\n- Building and updating developer and user tools, including documentation refresh\n- Developing more sophisticated research and analytics capabilities\n- Assisting with dApps and new integrations, especially projects using order books\n- Experimenting with new business models and monetization paths, including new use cases for Mesh\n- Strengthening our community through outreach and rewards\n- Ramping up marketing\n- Driving support for strategic initiatives\n- Conceptualizing and executing social media campaigns\n- Hosting and advertising 0x hackathons\n- Engaging with emerging developer communities, such as BSC, Polygon, Solana, etc.\n\n## Operations\n\nIn considering the scope and how to best execute to achieve our intended goals, we [sought input from the community](https://gov.0x.org/t/request-for-input-and-feedback-0xdao-grant-program/853) regarding operations models. Augmenting the feedback we received with our own research and observations, experience, and vision of what this optimally could be, we’ve landed on a model that has a full-time lead who will be responsible and accountable for overall administration and day-to-day management; a core team who will drive strategy development, execution, and decision-making in their areas of expertise; and a council who will assist as needed and approve the disbursement of funds (most likely via Gnosis Safe multisig). Like many successful funds, we also plan to enlist a small group of external advisors to provide a more expansive perspective and to perform oversight.\n\nUsing this model to jumpstart our efforts does not mean that the community will take a back seat – quite the opposite, in fact. We’re hoping this approach enables us to proactively create opportunities for the discovery, acceleration, and synthesis of pathways to high-impact outcomes, while also expanding the opportunities for our growing community to be active participants.\n\nTo get started, the team will identify our most immediate needs, gaps, goals, and opportunities and create a strategic plan and roadmap that’s aligned with 0xLabs and the broader 0x ecosystem. We expect this process to take no longer than 2-3 weeks. Then, using proven innovation strategies and techniques, we will begin executing on the plan. As a preview, our discussions to date have uncovered opportunities in marketing, integration, trading/liquidity incentives, and other areas that we expect to include in our strategy and execution planning.\n\nPart of our ethos in establishing this effort is to empower community members who have demonstrated operational capabilities, maintained a sustained commitment to growing the ecosystem, have demonstrated a willingness to dedicate the time required, and have expertise in domains that are critical to our desired outcomes. Initially these consist of innovation strategy and execution, marketing, finance, and engineering.\n\nWith that in mind, we propose the following:\n\nLead: [@nikita](https://gov.0x.org/u/nikita) (full-time, 1040 hours) \\\nCore Team: [@SonOfPegasus](https://gov.0x.org/u/sonofpegasus), [@0xSHA](https://gov.0x.org/u/0xsha) (part-time, 182 hours each) \\\nCouncil: [@JoaoCampos89](https://gov.0x.org/u/joaocampos89), [@gabririgo](https://gov.0x.org/u/gabririgo) (part-time, 26 hours each) \\\nAdvisors: [@mintcloud](https://gov.0x.org/u/mintcloud) + others TBD\n\nIn the spirit of bold experimentation, we propose that compensation should maximize skin-in-the-game incentives through the use of crypto-native constructs wherever possible. To this end, we propose basing compensation in the protocol’s native token (ZRX), and we are exploring a streaming distribution mechanic (such as Sablier or Superfluid) to facilitate compensation payments. While we acknowledge that using a native token for baseline values is somewhat provocative and may result in significant swings in USD value – both to the upside and the downside – we feel strongly that this type of experimentation is crucial for learning and informing future efforts. Importantly, crypto-native funds and projects that have implemented a similar approach of compensating directly in a native token have had early success.\n\n## Budget\n\nIn determining an appropriate budget, we reviewed the budgets and best practices of other projects and considered our unique needs and goals. As a result, we feel we’ve landed in a place that feels “right” for us, and is the best balance of short-term aggressiveness and long-term prudence.\n\nCurrently, the community treasury holds 2m ZRX and the external development pool holds 103m ZRX. While 0x Labs has indicated an openness to allocating additional funds to the community treasury from the development pool in the future, we intend to operate this initiative with the goal of becoming self-sustaining, rather than a cost center.\n\nWe propose an overall budget for this experiment of 400k ZRX. We feel this will provide enough runway to conceptualize, articulate, and execute on a strategy with a responsible, risk/reward ratio, keeping in mind that the overall goal of the initiative is to accelerate value creation and capture. We leave open the possibility of requesting supplemental treasury funds for opportunities that may be developed during the experiment which require -- or could be optimized with -- additional capital (for example, liquidity provision). Any funds not spent will be returned to the treasury.\n\nFor budgetary planning purposes, we are setting the cost basis reference in our budget in ZRX (1 ZRX = 1 ZRX). This enables us to plan using a fixed, capital expense cost basis, rather than one that is continuously fluctuating, particularly for compensation. Using this approach, we need to set a conversion rate to calculate known costs.\n\nFor compensation (recurring costs to attract, retain, and reward work performance), we are referencing the Coinbase 200-day EMA ZRX/USD price (sourced from [Trading View](https://www.tradingview.com/symbols/ZRXUSD/technicals/)). This normalizes the cost basis to align with the period of performance and incentivizes the team to deliver sustainable results. As of 5/23/2021, the 200-day EMA is 1 ZRX = $1.22. All things considered, we believe the 200-day EMA is a more appropriate reference than the 200-day SMA ($1.08) or the market closing price ($.80). Using an hourly rate comparable to other protocols ($100/hr) this equates to 82 ZRX/hr. This rate will be set for the duration of the six-month experiment and will be the same for all team members. Because this is not an employer/employee arrangement, compensation does not include any benefits, tax withholding, etc.\n\nFor expenses (short-term, discrete costs paid in return for goods and services), we are referencing the Coinbase 30-day EMA ZRX/USD price (sourced from [Trading View](https://www.tradingview.com/symbols/ZRXUSD/technicals/)) to estimate costs. We expect the bulk of the expense cost (legal services) will likely be initiated soon after we begin operations, and this price best informs a near-term budgetary outlay. As of 5/23/2021, the 30-day EMA is 1 ZRX = $1.47. In addition to legal services, we expect to incur costs associated with general admin (including setup costs), compliance (including grantee verification), gas, etc. Using estimated costs incurred by other protocols ($50k), this equates to ~34k ZRX. If the price of ZRX remains under $1.47 for an extended period of time, the expense costs (in ZRX) will be higher and the deficit will come from the funding category. Conversely, if we have overestimated the cost of expenses, any surplus will be allocated to the funding category.\n\n| **Cost in ZRX** | **Category**                             |\n|----------------:|------------------------------------------|\n|         246,594 | Funding opportunities (including grants) |\n|         119,392 | Team compensation (1456 hours * 82)      |\n|          34,014 | Expenses ($50k / $1.47)                  |\n|     **400,000** | **Total budget**                         |\n\n## Timeline\n\nIf approved, the effort will begin operating shortly after the proposal passes and will run for a period of six months (26 weeks), at which time it may be extended or modified by a community vote, or will simply expire, depending on learnings and results. If warranted, interim adjustments may be made prior to the end of the six-month period via the on-chain governance process. Progress, operational, and outcome metrics will be reported to the community on a regular basis.\n\n## Success Metrics\n\nWe expect success to be measured objectively and subjectively. Specific metrics will be developed as part of the strategy formulation process. The lists below are notional, but objective success metrics could include:\n- Level of community engagement\n- Performance against metrics for workstreams\n- Number of ecosystem partners\n- Number of engaged external developers\n- ZRX trading volume\n\nAdditionally, subjective success metrics could include:\n- Improved sentiment and goodwill within the community and broader ecosystem\n- Improvement in 0x’s brand and positioning in the market\n\n## Conclusion\n\nThe DAO as a concept is still nascent and rapidly evolving. We’re in an ideal position to capitalize on the learnings, successes, and failures of others while still being early enough to shape what “best-in-class” looks like. While lofty and aspirational, our desire for this initiative to explore the true potential of a community-run DAO aligns well with the ambitious vision set forth by 0x Labs. They’ve done an incredible job laying the foundation; it’s time for us to help blaze the path forward.\n\nWe anticipate that the community and broader 0x ecosystem will quickly benefit from this initiative. Even though it may feel like we’re “building the airplane while in flight,” we’re confident there’s plenty we can do that will add noticeable, high-impact value for 0x stakeholders, even as we iterate, experiment, test, and learn. We hope all stakeholders are as excited as we are for this next step in our shared journey.\n\n### References:\n\n[1] [draft proposal discussion in forum](https://gov.0x.org/t/0xdao-community-treasury-proposal-1/883) \\\n[2] [discussion on operations model in forum](https://gov.0x.org/t/request-for-input-and-feedback-0xdao-grant-program/853) \\\n[3] [ZRX price analysis at Trading View](https://www.tradingview.com/symbols/ZRXUSD/technicals/)\n\n### Forum Profile Links:\n\n[@nikita](https://gov.0x.org/u/nikita) \\\n[@SonOfPegasus](https://gov.0x.org/u/sonofpegasus) \\\n[@0xSHA](https://gov.0x.org/u/0xsha) \\\n[@JoaoCampos89](https://gov.0x.org/u/joaocampos89) \\\n[@gabririgo](https://gov.0x.org/u/gabririgo) \\\n[@mintcloud](https://gov.0x.org/u/mintcloud)\n\n### Fund Receiving Address:\n\nGnosis Multisig Safe [0xf9347f751a6a1467Abc722eC7d80bA2698dd9d6c](https://etherscan.io/address/0xf9347f751a6a1467Abc722eC7d80bA2698dd9d6c)\n',
    },
];
