-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1139 from alleslabs/feat/call-erc20-factory
feat: call erc20 factory
- Loading branch information
Showing
9 changed files
with
141 additions
and
5 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
114 changes: 114 additions & 0 deletions
114
src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxCallErc20Factory.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,114 @@ | ||
import { Flex, Text } from "@chakra-ui/react"; | ||
|
||
import { ExplorerLink } from "lib/components/ExplorerLink"; | ||
import { CustomIcon } from "lib/components/icon"; | ||
import type { TxDataJsonRpc } from "lib/services/types"; | ||
import type { HexAddr20, Option } from "lib/types"; | ||
|
||
import { EvmInfoLabelValue } from "./EvmInfoLabelValue"; | ||
import { EvmTxMethodAccordion } from "./EvmTxMethodAccordion"; | ||
|
||
interface EvmTxCallErc20FactoryProps { | ||
evmTxData: TxDataJsonRpc; | ||
} | ||
|
||
export const EvmTxCallErc20Factory = ({ | ||
evmTxData, | ||
}: EvmTxCallErc20FactoryProps) => { | ||
const { from, to } = evmTxData.tx; | ||
const { logs } = evmTxData.txReceipt; | ||
const contractAddress = logs[0]?.address as Option<HexAddr20>; | ||
|
||
return ( | ||
<EvmTxMethodAccordion | ||
msgIcon="instantiate" | ||
content={ | ||
<Flex gap={1}> | ||
Create{" "} | ||
{contractAddress ? ( | ||
<Flex gap={1} align="center"> | ||
<CustomIcon | ||
name="contract-address" | ||
boxSize={3} | ||
color="primary.main" | ||
/> | ||
<ExplorerLink | ||
value={contractAddress} | ||
type="evm_contract_address" | ||
showCopyOnHover | ||
/> | ||
</Flex> | ||
) : ( | ||
<Text variant="body2" color="text.disabled"> | ||
- | ||
</Text> | ||
)}{" "} | ||
via ERC20 Factory | ||
</Flex> | ||
} | ||
> | ||
<EvmInfoLabelValue | ||
label="Creator" | ||
value={ | ||
<ExplorerLink | ||
type="user_address" | ||
value={from} | ||
showCopyOnHover | ||
textFormat="normal" | ||
fixedHeight={false} | ||
/> | ||
} | ||
/> | ||
<EvmInfoLabelValue | ||
label="ERC20 Factory" | ||
value={ | ||
to ? ( | ||
<Flex gap={1} align="center"> | ||
<CustomIcon | ||
name="contract-address" | ||
boxSize={3} | ||
color="primary.main" | ||
/> | ||
<ExplorerLink | ||
value={to} | ||
type="evm_contract_address" | ||
showCopyOnHover | ||
textFormat="normal" | ||
fixedHeight={false} | ||
/> | ||
</Flex> | ||
) : ( | ||
<Text variant="body2" color="text.disabled"> | ||
- | ||
</Text> | ||
) | ||
} | ||
/> | ||
<EvmInfoLabelValue | ||
label="Created Contract" | ||
value={ | ||
contractAddress ? ( | ||
<Flex gap={1} align="center"> | ||
<CustomIcon | ||
name="contract-address" | ||
boxSize={3} | ||
color="primary.main" | ||
/> | ||
<ExplorerLink | ||
value={contractAddress} | ||
type="evm_contract_address" | ||
showCopyOnHover | ||
textFormat="normal" | ||
fixedHeight={false} | ||
/> | ||
</Flex> | ||
) : ( | ||
<Text variant="body2" color="text.disabled"> | ||
- | ||
</Text> | ||
) | ||
} | ||
/> | ||
</EvmTxMethodAccordion> | ||
); | ||
}; |
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