Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: V4 create behind feature flag [1/n] #4444

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/components/strings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ export const CYCLE_EXPLANATION = (
</Trans>
)

export const RULESET_EXPLANATION = (
<Trans>
<p>With unlocked rulesets, you can edit your project's rules at any time.</p>
<p>
With locked rulesets, you can lock your project's rules for a period of time
(like 3 minutes, 2 years, or 14 days), helping you build trust with your
supporters.
</p>
<p>
This choice isn't permanent — you can switch between locked and unlocked
rulesets in the future.
</p>
</Trans>
)

export const LOCKED_PAYOUT_EXPLANATION = (
<Trans>
If locked, this payout can't be edited or removed until the lock expires or
Expand Down
81 changes: 81 additions & 0 deletions src/locales/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ msgstr ""
msgid "Payout recipients:"
msgstr ""

msgid "Your project's first ruleset will start on <0>{0} at {1}</0>. Your project will be visible on <1>juicebox.money</1> once you finish setting your project up, but supporters won't be able to pay or interact with it until the first ruleset begins."
msgstr ""

msgid "Lock until"
msgstr ""

Expand Down Expand Up @@ -437,6 +440,9 @@ msgstr ""
msgid "Payer issuance rate"
msgstr ""

msgid "None of your project's ETH can be paid out. All ETH will stay in your project for token redemptions or use in future rulesets."
msgstr ""

msgid "Project Details"
msgstr ""

Expand Down Expand Up @@ -542,6 +548,9 @@ msgstr ""
msgid "This cycle has upcoming changes"
msgstr ""

msgid "<0/> Your project's rules cannot be edited during the first ruleset."
msgstr ""

msgid "While enabled, the project owner can change the project's <0>payment terminals</0> at any time."
msgstr ""

Expand All @@ -557,6 +566,9 @@ msgstr ""
msgid "You would receive <0/>"
msgstr ""

msgid "Simple token rules that will work for most projects. You can edit these rules in future rulesets."
msgstr ""

msgid "The issuance reduction rate is disabled if you are using unlocked cycles (because they have no duration)."
msgstr ""

Expand Down Expand Up @@ -833,6 +845,9 @@ msgstr ""
msgid "Automated"
msgstr ""

msgid "Ruleset"
msgstr ""

msgid "Back to settings"
msgstr ""

Expand Down Expand Up @@ -1046,6 +1061,9 @@ msgstr ""
msgid "No overflow"
msgstr ""

msgid "A fixed amount of ETH can be paid out from your project each ruleset. You can send specific ETH amounts (or ETH amounts based on USD values) to one or more recipients. Any remaining ETH will stay in your project for token redemptions or use in future rulesets."
msgstr ""

msgid "Export tokens CSV"
msgstr ""

Expand Down Expand Up @@ -1181,6 +1199,9 @@ msgstr ""
msgid "No results"
msgstr ""

msgid "The project's owner can edit the project's rules and start new rulesets at any time."
msgstr ""

msgid "ETH transfers to project"
msgstr ""

Expand All @@ -1202,6 +1223,9 @@ msgstr ""
msgid "Fee from <0><1/></0>"
msgstr ""

msgid "Reserved percent"
msgstr ""

msgid "Later"
msgstr ""

Expand All @@ -1214,6 +1238,9 @@ msgstr ""
msgid "{receivedTokenSymbolText} Token"
msgstr ""

msgid "Ruleset #1 starts when you create your project. With unlocked rulesets, you can edit your project's rules at any time. This gives you more flexibility, but may appear risky to supporters. Switching to locked rulesets will help you build supporter confidence."
msgstr ""

msgid "Issuance reduction rate:"
msgstr ""

Expand Down Expand Up @@ -1418,6 +1445,9 @@ msgstr ""
msgid "<0>Juicebox is a <1>governance-minimal</1> protocol. There are only a few levers that can be tuned, none of which impose changes for users without their consent. The Juicebox governance smart contract can adjust these levers.</0><2>The Juicebox protocol is governed by a community of JBX token holders who vote on proposals fortnightly.</2><3>Juicebox is on-chain and non-custodial. Project creators actually own their projects, and JuiceboxDAO has no way to access project's ETH or change their rules.</3>"
msgstr ""

msgid "<0>With unlocked rulesets, you can edit your project's rules at any time.</0><1>With locked rulesets, you can lock your project's rules for a period of time (like 3 minutes, 2 years, or 14 days), helping you build trust with your supporters.</1><2>This choice isn't permanent — you can switch between locked and unlocked rulesets in the future.</2>"
msgstr ""

msgid "Pay {projectTitle}"
msgstr ""

Expand Down Expand Up @@ -1784,6 +1814,9 @@ msgstr ""
msgid "Created project"
msgstr ""

msgid "Next ruleset, the project will issue {0} tokens per 1 ETH. The ruleset after that, the project will issue {1} tokens per 1 ETH."
msgstr ""

msgid "An address is required"
msgstr ""

Expand All @@ -1802,6 +1835,9 @@ msgstr ""
msgid "Project rules"
msgstr ""

msgid "Set a duration for locked rulesets."
msgstr ""

msgid "Upload"
msgstr ""

Expand Down Expand Up @@ -2105,6 +2141,9 @@ msgstr ""
msgid "Reset website"
msgstr ""

msgid "Decay percent"
msgstr ""

msgid "Payout allocated to this project's {versionName} payment terminal. <0>Learn more</0>."
msgstr ""

Expand Down Expand Up @@ -2420,6 +2459,9 @@ msgstr ""
msgid "While enabled, the project owner can change the project's <0>controller</0> at any time."
msgstr ""

msgid "<0>With Locked Rulesets, your project's rules are locked for a period of time.</0><1><2>This helps build trust with your contributors.</2></1>"
msgstr ""

msgid "Ruleset #"
msgstr ""

Expand Down Expand Up @@ -2501,6 +2543,9 @@ msgstr ""
msgid "Disclose any details to your contributors before they pay your project."
msgstr ""

msgid "The issuance rate is reduced by this percentage every ruleset (every <0>{0}</0>). The higher this rate, the more incentive to pay this project earlier."
msgstr ""

msgid "One or more reserved token recipients"
msgstr ""

Expand Down Expand Up @@ -2615,6 +2660,9 @@ msgstr ""
msgid "Your edits will take effect in <0>cycle #{0}</0>. The current cycle (#{currentFCNumber}) won't be altered."
msgstr ""

msgid "Leave this blank to start your first ruleset immediately after you finish setting up your project."
msgstr ""

msgid "All of this project's ETH will be paid out. Token holders will receive <0>no ETH</0> when redeeming their tokens."
msgstr ""

Expand Down Expand Up @@ -2642,6 +2690,9 @@ msgstr ""
msgid "Give permissions to {0} on project #{projectId}"
msgstr ""

msgid "Pay out ETH from your project to any Ethereum wallet or Juicebox project. ETH which <0>isn't</0> paid out will be available for token redemptions, or for use in future rulesets. Payouts reset each ruleset."
msgstr ""

msgid "<0>Juicebox has had <1>multiple security audits</1>, and has handled tens of thousands of ETH through its protocol.</0><2>However, Juicebox is still experimental software. Although the Juicebox contract team have done their part to shape the smart contracts for public use and have tested the code thoroughly, the risk of exploits is never 0%.</2><3>Due to their public nature, any exploits to the contracts may have irreversible consequences, including loss of ETH. Please use Juicebox with caution.</3><4><5>Learn more about the risks.</5></4>"
msgstr ""

Expand Down Expand Up @@ -2855,6 +2906,9 @@ msgstr ""
msgid "Paying another Juicebox project may mint its tokens. Select an address to receive these tokens."
msgstr ""

msgid "Set a future date & time to start your project's first ruleset."
msgstr ""

msgid "Get help planning or setting up my project."
msgstr ""

Expand Down Expand Up @@ -3071,6 +3125,9 @@ msgstr ""
msgid "Connect wallet to deploy"
msgstr ""

msgid "Unlocked Rulesets"
msgstr ""

msgid "Your wallet isn't allowed to process held fees."
msgstr ""

Expand All @@ -3086,6 +3143,9 @@ msgstr ""
msgid "Check User Wallet Address"
msgstr ""

msgid "Rulesets"
msgstr ""

msgid "Set ENS text record for {ensName}"
msgstr ""

Expand Down Expand Up @@ -3140,6 +3200,9 @@ msgstr ""
msgid "Yes, start over"
msgstr ""

msgid "Ruleset #1 starts when you create your project. With locked rulesets, if you edit your project's rules during Ruleset #1, those edits will be <0>queued</0> for the next ruleset."
msgstr ""

msgid "All {tokensText} will go to the project owner:"
msgstr ""

Expand Down Expand Up @@ -3314,6 +3377,9 @@ msgstr ""
msgid "{0} is not a valid integer"
msgstr ""

msgid "Rulesets & Payouts"
msgstr ""

msgid "The unallocated portion of your total will go to the wallet that owns the project by default."
msgstr ""

Expand Down Expand Up @@ -3431,6 +3497,9 @@ msgstr ""
msgid "No changes"
msgstr ""

msgid "After {0} (your first ruleset), your project will not issue any tokens unless you edit the issuance rate."
msgstr ""

msgid "Project ENS name"
msgstr ""

Expand All @@ -3446,6 +3515,9 @@ msgstr ""
msgid "After {0} (your first cycle), your project will not issue any tokens unless you edit the issuance rate."
msgstr ""

msgid "In other words: instead of taking effect immediately, those edits will take effect when the next ruleset starts (Ruleset #2). If you need more flexibility, switch to unlocked rulesets."
msgstr ""

msgid "New NFTs will available on your project page shortly."
msgstr ""

Expand Down Expand Up @@ -3560,6 +3632,9 @@ msgstr ""
msgid "Redeem {tokensLabel} for ETH"
msgstr ""

msgid "Locked Rulesets"
msgstr ""

msgid "Made a mistake?"
msgstr ""

Expand Down Expand Up @@ -4223,6 +4298,9 @@ msgstr ""
msgid "The maximum supply of this NFT in circulation."
msgstr ""

msgid "Each ruleset, the project will issue {discountRate}% fewer tokens per ETH."
msgstr ""

msgid "Payout and reserved token recipients cannot exceed 100%"
msgstr ""

Expand Down Expand Up @@ -4301,6 +4379,9 @@ msgstr ""
msgid "End"
msgstr ""

msgid "The issuance reduction rate is disabled if you are using unlocked rulesets (because they have no duration)."
msgstr ""

msgid "Message sent!"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getProjectIdFromLaunchReceipt = (
* Attempt to find the transaction receipt from a transaction hash.

* Will retry up to 5 times with a 2 second delay between each attempt. If no
* receipt is found after 5 attempts, undefined is returned.
* receipt is not found after 5 attempts, undefined is returned.
*
* @param txHash transaction hash
* @returns transaction receipt or undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import isEqual from 'lodash/isEqual'
import { CreatePage } from 'models/createPage'
import { ProjectTokensSelection } from 'models/projectTokenSelection'
import { TreasurySelection } from 'models/treasurySelection'
import { useRouter } from 'next/router'
import { ballotStrategiesFn } from 'packages/v2v3/constants/ballotStrategies'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { useDefaultJBETHPaymentTerminal } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBETHPaymentTerminal'
import { MAX_DISTRIBUTION_LIMIT } from 'packages/v2v3/utils/math'
import { useEffect, useState } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import {
ETH_PAYOUT_SPLIT_GROUP,
RESERVED_TOKEN_SPLIT_GROUP,
} from 'constants/splits'
import { ProjectMetadataContext } from 'contexts/ProjectMetadataContext'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { V2V3ContractsContext } from 'packages/v2v3/contexts/Contracts/V2V3ContractsContext'
import { NftRewardsContext } from 'packages/v2v3/contexts/NftRewards/NftRewardsContext'
import { V2V3ProjectContext } from 'packages/v2v3/contexts/Project/V2V3ProjectContext'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BigNumber } from '@ethersproject/bignumber'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import { V2V3ProjectContractsContext } from 'packages/v2v3/contexts/ProjectContracts/V2V3ProjectContractsContext'
import {
V2V3FundAccessConstraint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useJBPrices } from 'packages/v2v3/hooks/JBPrices'
import { DEFAULT_JB_721_DELEGATE_VERSION } from 'packages/v2v3/hooks/defaultContracts/useDefaultJB721Delegate'
import { useDefaultJBController } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBController'
import { useDefaultJBETHPaymentTerminal } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBETHPaymentTerminal'
import { LaunchProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx'
import { LaunchV2V3ProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx'
import { useV2ProjectTitle } from 'packages/v2v3/hooks/useProjectTitle'
import { V2V3CurrencyOption } from 'packages/v2v3/models/currencyOption'
import {
Expand Down Expand Up @@ -61,7 +61,7 @@ interface JB721DelegateLaunchFundingCycleData {

interface LaunchProjectWithNftsTxArgs {
tiered721DelegateData: DeployTiered721DelegateData
projectData: LaunchProjectData
projectData: LaunchV2V3ProjectData
}

type JB721DelegateLaunchProjectData = JB721DelegateLaunchFundingCycleData & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import { BigNumber } from 'ethers'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { V2V3ProjectContractsContext } from 'packages/v2v3/contexts/ProjectContracts/V2V3ProjectContractsContext'
import { V2V3ContractName } from 'packages/v2v3/models/contracts'
import { useContext } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import { V2V3ContractName } from 'packages/v2v3/models/contracts'
import useV2ContractReader from './useV2ContractReader'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import { DEFAULT_MEMO, DEFAULT_METADATA } from 'constants/transactionDefaults'
import { BigNumber } from 'ethers'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'

export function getAddToBalanceArgsV3({
projectId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import { DEFAULT_MEMO, DEFAULT_METADATA } from 'constants/transactionDefaults'
import { BigNumber } from 'ethers'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'

export function getAddToBalanceArgsV3_1({
projectId,
Expand Down
2 changes: 1 addition & 1 deletion src/packages/v2v3/hooks/transactor/useDistributePayouts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { t } from '@lingui/macro'
import { ETH_TOKEN_ADDRESS } from 'constants/juiceboxTokens'
import {
DEFAULT_MEMO,
DEFAULT_METADATA,
Expand All @@ -8,7 +9,6 @@ import { ProjectMetadataContext } from 'contexts/ProjectMetadataContext'
import { TransactionContext } from 'contexts/Transaction/TransactionContext'
import { BigNumber } from 'ethers'
import { TransactorInstance } from 'hooks/useTransactor'
import { ETH_TOKEN_ADDRESS } from 'packages/v2v3/constants/juiceboxTokens'
import { V2V3ProjectContractsContext } from 'packages/v2v3/contexts/ProjectContracts/V2V3ProjectContractsContext'
import {
PaymentTerminalVersion,
Expand Down
Loading
Loading