Skip to content

Commit

Permalink
feat: + danger contract call (#2507)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv authored Sep 5, 2024
1 parent 685df0a commit ee7a3d1
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 189 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"@rabby-wallet/eth-watch-keyring": "1.0.0",
"@rabby-wallet/gnosis-sdk": "1.3.8",
"@rabby-wallet/page-provider": "0.4.0",
"@rabby-wallet/rabby-action": "^0.1.1-beta.3",
"@rabby-wallet/rabby-action": "0.1.2",
"@rabby-wallet/rabby-api": "0.7.31",
"@rabby-wallet/rabby-security-engine": "2.0.7-beta",
"@rabby-wallet/rabby-security-engine": "2.0.7",
"@rabby-wallet/rabby-swap": "0.0.39",
"@rabby-wallet/widgets": "1.0.9",
"@rematch/core": "2.2.0",
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/Actions/ApproveNFT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,6 @@ const ApproveNFT = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1048"
engineResult={engineResultMap['1048']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
title={t('page.signTx.interacted')}
/>

<SecurityListItem
id="1045"
engineResult={engineResultMap['1045']}
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/Actions/ApproveNFTCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ const ApproveNFTCollection = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1056"
engineResult={engineResultMap['1056']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
title={t('page.signTx.interacted')}
/>

<SecurityListItem
id="1055"
engineResult={engineResultMap['1055']}
Expand Down
15 changes: 8 additions & 7 deletions src/ui/views/Approval/components/Actions/ContractCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const ContractCall = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -125,18 +124,20 @@ const ContractCall = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
<SubRow>{t('page.signTx.trusted')}</SubRow>
</SubCol>
)}

<SecurityListItem
id="1152"
engineResult={engineResultMap['1152']}
title={t('page.signTx.tokenApprove.flagByRabby')}
dangerText={t('page.signTx.yes')}
/>

<SecurityListItem
id="1135"
engineResult={engineResultMap['1135']}
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/CrossSwapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ const CrossSwapToken = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -267,12 +266,6 @@ const CrossSwapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/CrossToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ const Swap = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -268,12 +267,6 @@ const Swap = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/MultiSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ const MultiSwap = ({
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ const Swap = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -327,12 +326,6 @@ const Swap = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/SwapLimitPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ const SwapLimitPay = ({
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/Actions/TokenApprove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,6 @@ const TokenApprove = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1025"
title={t('page.signTx.interacted')}
engineResult={engineResultMap['1025']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
/>

<SecurityListItem
id="1024"
engineResult={engineResultMap['1024']}
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/UnWrapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ const UnWrapToken = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -207,12 +206,6 @@ const UnWrapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 0 additions & 7 deletions src/ui/views/Approval/components/Actions/WrapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ const WrapToken = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -207,12 +206,6 @@ const WrapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface ContractData {
name: string;
logo_url: string;
} | null;
hasInteraction: boolean;
bornAt: number | null;
rank: number | null;
title?: string;
Expand Down Expand Up @@ -64,12 +63,6 @@ export const ContractPopup: React.FC<Props> = ({ data }) => {
<Values.Protocol value={data.protocol} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.deployTimeTitle')}</Row>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface NFTSpenderData {
name: string;
logo_url: string;
} | null;
hasInteraction: boolean;
bornAt: number | null;
rank: number | null;
riskExposure: number;
Expand Down Expand Up @@ -107,12 +106,6 @@ export const NFTSpenderPopup: React.FC<Props> = ({ data }) => {
: '-'}
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.addressNote')}</Row>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface SpenderData {
name: string;
logo_url: string;
} | null;
hasInteraction: boolean;
bornAt: number | null;
rank: number | null;
riskExposure: number;
Expand Down Expand Up @@ -107,12 +106,6 @@ export const SpenderPopup: React.FC<Props> = ({ data }) => {
: '-'}
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.addressNote')}</Row>
<Row>
Expand Down
8 changes: 0 additions & 8 deletions src/ui/views/Approval/components/CommonAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export const CommonAction = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -107,13 +106,6 @@ export const CommonAction = ({
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/TypedDataActions/BatchPermit2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,6 @@ const Permit2 = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1112"
engineResult={engineResultMap['1112']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
title={t('page.signTx.interacted')}
/>

<SecurityListItem
id="1111"
engineResult={engineResultMap['1111']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const ContractCall = ({
<ViewMore
type="contract"
data={{
hasInteraction: requireData.hasInteraction,
bornAt: requireData.bornAt,
protocol: requireData.protocol,
rank: requireData.rank,
Expand All @@ -128,12 +127,6 @@ const ContractCall = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/TypedDataActions/Permit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@ const Permit = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1080"
engineResult={engineResultMap['1080']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
title={t('page.signTx.interacted')}
/>

<SecurityListItem
id="1079"
engineResult={engineResultMap['1079']}
Expand Down
10 changes: 0 additions & 10 deletions src/ui/views/Approval/components/TypedDataActions/Permit2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ const Permit2 = ({
title={t('page.signTx.trustValueTitle')}
/>

<SecurityListItem
id="1074"
engineResult={engineResultMap['1074']}
warningText={<Values.Interacted value={false} />}
defaultText={
<Values.Interacted value={requireData.hasInteraction} />
}
title={t('page.signTx.interacted')}
/>

<SecurityListItem
id="1073"
engineResult={engineResultMap['1073']}
Expand Down
Loading

0 comments on commit ee7a3d1

Please sign in to comment.