-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
956 additions
and
669 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
25 changes: 25 additions & 0 deletions
25
src/components/transactions/TxDetails/TxData/SafeUpdate/index.tsx
This file contains 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,25 @@ | ||
import { Box, Stack } from '@mui/material' | ||
import type { TransactionData } from '@safe-global/safe-gateway-typescript-sdk' | ||
import DecodedData from '../DecodedData' | ||
|
||
function SafeUpdate({ txData }: { txData?: TransactionData }) { | ||
return ( | ||
<Stack mr={5} spacing={2}> | ||
<Box | ||
bgcolor="border.background" | ||
p={2} | ||
textAlign="center" | ||
fontWeight={700} | ||
fontSize={18} | ||
borderRadius={1} | ||
width="100%" | ||
> | ||
Safe version update | ||
</Box> | ||
|
||
<DecodedData txData={txData} toInfo={txData?.to} /> | ||
</Stack> | ||
) | ||
} | ||
|
||
export default SafeUpdate |
This file contains 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 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
42 changes: 6 additions & 36 deletions
42
src/components/tx-flow/flows/UpdateSafe/UpdateSafeReview.tsx
This file contains 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 |
---|---|---|
@@ -1,55 +1,25 @@ | ||
import { useContext } from 'react' | ||
import { Typography } from '@mui/material' | ||
|
||
import ExternalLink from '@/components/common/ExternalLink' | ||
import { useCurrentChain } from '@/hooks/useChains' | ||
import useSafeInfo from '@/hooks/useSafeInfo' | ||
import { createUpdateSafeTxs } from '@/services/tx/safeUpdateParams' | ||
import { createMultiSendCallOnlyTx } from '@/services/tx/tx-sender' | ||
import { createMultiSendCallOnlyTx, createTx } from '@/services/tx/tx-sender' | ||
import { SafeTxContext } from '../../SafeTxProvider' | ||
import SignOrExecuteForm from '@/components/tx/SignOrExecuteForm' | ||
import useAsync from '@/hooks/useAsync' | ||
import { getLatestSafeVersion } from '@/utils/chains' | ||
|
||
export const UpdateSafeReview = () => { | ||
const { safe, safeLoaded } = useSafeInfo() | ||
const chain = useCurrentChain() | ||
const { setSafeTx, setSafeTxError } = useContext(SafeTxContext) | ||
|
||
const latestSafeVersion = getLatestSafeVersion(chain) | ||
|
||
useAsync(async () => { | ||
if (!chain || !safeLoaded) { | ||
return | ||
} | ||
if (!chain || !safeLoaded) return | ||
|
||
const txs = await createUpdateSafeTxs(safe, chain) | ||
createMultiSendCallOnlyTx(txs).then(setSafeTx).catch(setSafeTxError) | ||
}, [safe, safeLoaded, chain, setSafeTx, setSafeTxError]) | ||
const safeTxPromise = txs.length > 1 ? createMultiSendCallOnlyTx(txs) : createTx(txs[0]) | ||
|
||
return ( | ||
<SignOrExecuteForm> | ||
<Typography mb={2}> | ||
Update now to take advantage of new features and the highest security standards available. | ||
</Typography> | ||
|
||
<Typography mb={2}> | ||
To check details about updates added by this smart contract version please visit{' '} | ||
<ExternalLink href={`https://github.com/safe-global/safe-contracts/releases/tag/v${latestSafeVersion}`}> | ||
latest Safe Account contracts changelog | ||
</ExternalLink> | ||
</Typography> | ||
|
||
<Typography mb={2}> | ||
You will need to confirm this update just like any other transaction. This means other signers will have to | ||
confirm the update in case more than one confirmation is required for this Safe Account. | ||
</Typography> | ||
safeTxPromise.then(setSafeTx).catch(setSafeTxError) | ||
}, [safe, safeLoaded, chain, setSafeTx, setSafeTxError]) | ||
|
||
<Typography mb={2}> | ||
<b>Warning:</b> this upgrade will invalidate all unexecuted transactions. This means you will be unable to | ||
access or execute them after the upgrade. Please make sure to execute any remaining transactions before | ||
upgrading. | ||
</Typography> | ||
</SignOrExecuteForm> | ||
) | ||
return <SignOrExecuteForm /> | ||
} |
Oops, something went wrong.