-
Notifications
You must be signed in to change notification settings - Fork 51
Add llc modal #297
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
Open
0xfirefist
wants to merge
14
commits into
main
Choose a base branch
from
add-llc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add llc modal #297
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d0518ad
add llc modal to stake panel
8d44e5e
add llc to locked modal
26cb732
signLlc method in stake connection
dfea5fc
show llc on wallet connect
240e5f5
correct comments
b389428
rename sign llc
f103b95
some requested changes - comments
540301a
fix callback dependencies bug
143f876
update error message
19d1274
fix use callback bug
a4b1ad2
isLlcMember remove async
6d4c72b
remove error and async from isllcmember calls
3b16426
Merge branch 'main' into add-llc
ff8e6be
do It (#305)
guibescos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
import Spinner from '@components/Spinner' | ||
import CloseIcon from '@components/icons/CloseIcon' | ||
import { Transition, Dialog } from '@headlessui/react' | ||
import { Fragment } from 'react' | ||
|
||
type LlcModalProps = { | ||
isLlcModalOpen: boolean | ||
setIsLlcModalOpen: (open: boolean) => void | ||
onSignLlc: () => void | ||
isSigning?: boolean | ||
} | ||
export function LlcModal({ | ||
isSigning, | ||
isLlcModalOpen, | ||
setIsLlcModalOpen, | ||
onSignLlc, | ||
}: LlcModalProps) { | ||
return ( | ||
<> | ||
{/* TODO: refactor base modal to follow composition approach */} | ||
<Transition appear show={isLlcModalOpen} as={Fragment}> | ||
<Dialog | ||
as="div" | ||
className="relative z-10" | ||
onClose={() => setIsLlcModalOpen(false)} | ||
> | ||
<Transition.Child | ||
as={Fragment} | ||
enter="ease-out duration-300" | ||
enterFrom="opacity-0" | ||
enterTo="opacity-100" | ||
leave="ease-in duration-200" | ||
leaveFrom="opacity-100" | ||
leaveTo="opacity-0" | ||
> | ||
<div className="fixed inset-0 bg-black bg-opacity-50" /> | ||
</Transition.Child> | ||
<div className="fixed inset-0 overflow-y-auto"> | ||
<div className="flex min-h-full items-center justify-center p-4 text-center"> | ||
<Transition.Child | ||
as={Fragment} | ||
enter="ease-out duration-300" | ||
enterFrom="opacity-0 scale-95" | ||
enterTo="opacity-100 scale-100" | ||
leave="ease-in duration-200" | ||
leaveFrom="opacity-100 scale-100" | ||
leaveTo="opacity-0 scale-95" | ||
> | ||
<Dialog.Panel className="diaglogPanel"> | ||
<button | ||
className="diaglogClose" | ||
onClick={() => setIsLlcModalOpen(false)} | ||
> | ||
<span className="mr-3">close</span> <CloseIcon /> | ||
</button> | ||
<div className=""> | ||
<Dialog.Title | ||
as="h1" | ||
className="mx-auto max-w-xl px-6 py-6 text-center text-base18 font-semibold" | ||
> | ||
JOINDER AGREEMENT TO OPERATING AGREEMENT OF PYTH DAO LLC | ||
</Dialog.Title> | ||
<div className="scrollbar mx-auto mb-4 max-h-[50vh] max-w-xl pr-4 text-justify"> | ||
<p className="pb-3 leading-6 "> | ||
This Joinder Agreement to the Operating Agreement (this | ||
“<strong>Joinder</strong>”) is made and entered into as | ||
of the date hereof (the “<strong>Effective Date</strong> | ||
”) by and between PYTH DAO LLC, a non-profit limited | ||
liability company incorporated as per the laws of | ||
Republic of the Marshall Islands (the “ | ||
<strong>Company</strong>”) and you (the “ | ||
<strong>Joining Party</strong>”). Capitalized terms used | ||
but not defined in this Joinder shall have the | ||
respective meanings ascribed to such terms in the | ||
Operating Agreement (as defined below). | ||
</p> | ||
<h2 className="pb-3 pt-2 font-semibold"> | ||
The Joining Party acknowledges that: | ||
</h2> | ||
<p className="pb-3"> | ||
The Members of the Company have entered into that | ||
{/* TODO: put the right date here */} | ||
certain Operating Agreement, dated as of [__] (the “ | ||
0xfirefist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<strong>Operating Agreement</strong>”), a copy of which | ||
is available at the following link:{' '} | ||
<a | ||
href="https://cloudflare-ipfs.com/ipfs/QmP2GmL1n2WbHd7AtHqyXVWFyyHH36aZLfVZbNoqhommJi" | ||
className="underline md:basis-[195px]" | ||
target="_blank" | ||
> | ||
Operating Agreement | ||
</a> | ||
.{' '} | ||
</p> | ||
<p className="pb-3"> | ||
The Joining Party desires to become a Member of the | ||
Company, pursuant to the terms and conditions set forth | ||
in the Operating Agreement. | ||
</p> | ||
<p className="pb-3"> | ||
Pursuant to the Article III of the Operating Agreement, | ||
the Joining Party intends to acquire a Membership | ||
Interest in the Company by staking PYTH SPL Tokens in | ||
the Pyth Staking Program. | ||
</p> | ||
<p className="pb-3"> | ||
Pursuant to Article IX of the Operating Agreement, any | ||
prospective member may become a Member automatically by | ||
acquiring a Membership Interest as described in Article | ||
III of the Operating Agreement and upon signing an | ||
agreement (including electronically via their wallet | ||
address) stating, among other things that they agree to | ||
become a Member of the Company and be bound by the terms | ||
of the Operating Agreement. | ||
</p> | ||
<h1 className="pb-6 text-center text-base18 font-semibold"> | ||
AGREEMENT | ||
</h1> | ||
<p className="pb-3"> | ||
NOW, THEREFORE, in consideration of the mutual covenants | ||
and agreements herein contained, and other good and | ||
valuable consideration, the receipt and sufficiency of | ||
which are hereby acknowledged, the Joining Party and the | ||
Company agree as follows: | ||
</p> | ||
<p className="pb-3"> | ||
<u>Joinder</u>. The Joining Party hereby agrees to (i) | ||
become a Member, pursuant to Articles III and IX of the | ||
Operating Agreement, and (ii) be bound by and adhere to | ||
the terms and conditions of the Operating Agreement. | ||
</p> | ||
<p className="pb-3"> | ||
<u>Disclaimer</u>. The Joining Party has had the | ||
opportunity to consult with its own tax adviser and | ||
counsel to discuss and understand any tax and other | ||
legal consequences of acquisition, ownership and | ||
disposition of the Tokens, and any voting of their | ||
Membership Interests. | ||
</p> | ||
<p className="pb-3"> | ||
<u>Representations and Warranties of Joining Party</u>. | ||
The Joining Party hereby represents and warrants to | ||
Company as follows: | ||
</p> | ||
<p className="pb-3"> | ||
<u>Authorization</u>. The Joining Party has full power | ||
and authority and, with respect to any individual, the | ||
capacity to enter into this Joinder. This Joinder when | ||
executed and delivered by Joining Party, will constitute | ||
valid and legally binding obligations of the Joining | ||
Party, enforceable in accordance with its terms. | ||
</p> | ||
<p className="pb-3"> | ||
<u>Restricted Persons</u>. The Joining Party is not a | ||
resident of Iran, Syria, Cuba, North Korea, or the | ||
Crimea, Donetsk, or Luhansk regions of the Ukraine or | ||
any other regions and jurisdictions, as updated per RMI | ||
government guidelines and set forth in the Pyth | ||
Governance Program. | ||
</p> | ||
<p className="pb-3"> | ||
<u>Miscellaneous.</u> | ||
</p> | ||
<p className="pb-3"> | ||
<u>Governing Law</u>. This Joinder is governed by and | ||
shall be construed in accordance with the laws of the | ||
Republic of the Marshall Islands without regard to the | ||
conflicts of law principles thereof. | ||
</p> | ||
<p className="pb-3"> | ||
<u>Amendment</u>. Any provision of this Joinder may be | ||
amended only by a written agreement executed by you and | ||
the Company. | ||
</p> | ||
</div> | ||
|
||
<button | ||
type="button" | ||
className="primary-btn px-8 py-3 text-base font-semibold hover:bg-blueGemHover" | ||
onClick={onSignLlc} | ||
disabled={isSigning} | ||
> | ||
{isSigning ? <Spinner /> : 'Sign LLC agreement'} | ||
</button> | ||
</div> | ||
</Dialog.Panel> | ||
</Transition.Child> | ||
</div> | ||
</div> | ||
</Dialog> | ||
</Transition> | ||
</> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { StakeAccount, StakeConnection } from '@pythnetwork/staking' | ||
import toast from 'react-hot-toast' | ||
import { useMutation, useQueryClient } from 'react-query' | ||
import { StakeConnectionQueryKey } from './useStakeConnection' | ||
|
||
export function useJoinDaoLlcMutation() { | ||
const queryClient = useQueryClient() | ||
|
||
return useMutation( | ||
['sign-llc-mutation'], | ||
async ({ | ||
stakeConnection, | ||
mainStakeAccount, | ||
}: { | ||
stakeConnection: StakeConnection | ||
mainStakeAccount: StakeAccount | ||
}) => { | ||
await stakeConnection.joinDaoLlc(mainStakeAccount) | ||
toast.success(`Successfully signed LLC agreement!`) | ||
}, | ||
{ | ||
onSuccess() { | ||
// invalidate all except stake connection | ||
queryClient.invalidateQueries({ | ||
predicate: (query) => query.queryKey[0] !== StakeConnectionQueryKey, | ||
}) | ||
}, | ||
|
||
onError(error: Error) { | ||
toast.error(error.message) | ||
}, | ||
} | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.