Skip to content

Commit

Permalink
Blueprint contracts support (#2009)
Browse files Browse the repository at this point in the history
Fixes #1907
  • Loading branch information
tom2drum authored Jun 13, 2024
1 parent aeb16bf commit c3420f6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mocks/contract/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const verified: SmartContract = {
},
evm_version: 'default',
is_verified: true,
is_blueprint: false,
name: 'WPOA',
optimization_enabled: true,
optimization_runs: 1500,
Expand Down Expand Up @@ -101,10 +102,12 @@ export const selfDestructed: SmartContract = {
export const withChangedByteCode: SmartContract = {
...verified,
is_changed_bytecode: true,
is_blueprint: true,
};

export const nonVerified: SmartContract = {
is_verified: false,
is_blueprint: false,
creation_bytecode: 'creation_bytecode',
deployed_bytecode: 'deployed_bytecode',
is_self_destructed: false,
Expand Down
1 change: 1 addition & 0 deletions types/api/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface SmartContract {
optimization_runs: number | null;
name: string | null;
verified_at: string | null;
is_blueprint: boolean | null;
is_verified: boolean | null;
is_verified_via_eth_bytecode_db: boolean | null;
is_changed_bytecode: boolean | null;
Expand Down
8 changes: 8 additions & 0 deletions ui/address/contract/ContractCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ const ContractCode = ({ addressHash, contractQuery, channel }: Props) => {
return (
<>
<Flex flexDir="column" rowGap={ 2 } mb={ 6 } _empty={{ display: 'none' }}>
{ data?.is_blueprint && (
<Box>
<span>This is an </span>
<LinkExternal href="https://eips.ethereum.org/EIPS/eip-5202">
ERC-5202 Blueprint contract
</LinkExternal>
</Box>
) }
{ data?.is_verified && (
<Skeleton isLoaded={ !isPlaceholderData }>
<Alert status="success" flexWrap="wrap" rowGap={ 3 } columnGap={ 5 }>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c3420f6

Please sign in to comment.