├── apps
├── explorer
│ ├── priv
│ │ └── repo
│ │ │ ├── migrations
│ │ │ ├── .gitkeep
│ │ │ ├── 20190301120328_add_index_to_consensus.exs
│ │ │ ├── 20190313085740_add_index_symobl_in_tokens.exs
│ │ │ ├── 20180626143840_add_inserted_at_index_to_blocks.exs
│ │ │ ├── 20181221143000_create_blocks_miner_hash_index.exs
│ │ │ ├── 20190314084907_add_index_to_to_address_hash.exs
│ │ │ ├── 20180522154252_create_btree_gist_extension.exs
│ │ │ ├── 20190318151809_add_inserted_at_index_to_accounts.exs
│ │ │ ├── 20190613065856_add_tx_hash_inserted_at_index.exs
│ │ │ ├── 20190305095926_add_index_to_value_fetched_at.exs
│ │ │ ├── 20190827120224_add_index_on_token_transfer_token_id.exs
│ │ │ ├── 20191218120138_logs_block_number_index_index.exs
│ │ │ ├── 20181206200140_rename_block_rewards_to_emission_rewards.exs
│ │ │ ├── 20190228102650_add_index_created_contract_address_hash.exs
│ │ │ ├── 20190215080049_add_index_on_fetched_coin_balance_to_addresses.exs
│ │ │ ├── 20181213111656_add_metadata_field_to_address_names.exs
│ │ │ ├── 20190214135850_add_index_on_block_number_to_address_token_balances.exs
│ │ │ ├── 20190219082636_add_indexes_for_block_reward_query.exs
│ │ │ ├── 20181212115448_add_indexes_to_token_transfers.exs
│ │ │ ├── 20181015173318_add_case_insensitive_extension.exs
│ │ │ ├── 20190215093358_add_compound_index_address_token_balances.exs
│ │ │ ├── 20191007082500_add_indexes_for_token_instances_query.exs
│ │ │ ├── 20190910170703_create_indexes_for_block_number_in_token_transfers_and_transactions.exs
│ │ │ ├── 20191010075740_add_error_to_token_instances.exs
│ │ │ ├── 20190213180502_add_earliest_processing_start_to_transactions.exs
│ │ │ ├── 20190807113117_create_suggested_indexes.exs
│ │ │ ├── 20190208113202_add_unique_index_to_rewards.exs
│ │ │ ├── 20190421143300_add_index_to_bsdr.exs
│ │ │ ├── 20191009121635_add_token_transfer_sorting_indexes.exs
│ │ │ ├── 20190114204640_add_tokens_holder_count.exs
│ │ │ ├── scripts
│ │ │ │ └── 20190326202921_lose_consensus_for_invalid_blocks.sql
│ │ │ ├── 20190124082812_add_index_on_transaction_nonce_and_from_address_hash.exs
│ │ │ ├── 20190513134025_add_refetch_needed_to_block.exs
│ │ │ ├── 20191208135613_block_rewards_block_hash_partial_index.exs
│ │ │ ├── 20180919175123_alter_token_decimals_to_bigint.exs
│ │ │ ├── 20180424203101_create_market_history.exs
│ │ │ ├── 20190102141900_index_current_token_holders.exs
│ │ │ ├── 20190424170833_change_block_size_to_nullable.exs
│ │ │ ├── 20190625085852_add_additional_contract_fields.exs
│ │ │ ├── 20191220113006_pending_block_operations_block_hash_partial_index.exs
│ │ │ ├── 20190228220746_add_internal_transactions_indexed_at_to_blocks.exs
│ │ │ ├── 20190208143201_add_index_on_address_hash_block_number_and_token_contract_address_hash_for_current_token_balance.exs
│ │ │ ├── 20180508183700_create_users.exs
│ │ │ ├── 20190215105501_add_constructor_arguments_to_smart_contracts.exs
│ │ │ ├── 20190709103104_add_external_libraries_to_smart_contracts.exs
│ │ │ ├── 20180522154253_create_block_rewards.exs
│ │ │ ├── 20190313103912_change_transactions_v_column_type.exs
│ │ │ ├── 20191128124415_remove_duplicate_indexes_token_entities.exs
│ │ │ ├── 20190118040301_create_tokens_primary_key.exs
│ │ │ ├── 20190228152333_change_constructor_arguments_to_text.exs
│ │ │ ├── 20190321185644_add_old_value_for_current_token_balances.exs
│ │ │ ├── 20190325081658_remove_unique_address_hash_decompiled_contracts.exs
│ │ │ ├── 20181126203826_add_index_to_addresses.exs
│ │ │ ├── 20181221145054_add_contract_methods.exs
│ │ │ ├── 20190403080447_add_full_text_search_tokens.exs
│ │ │ ├── 20190116082843_add_created_contract_indexed_at_to_transactions.exs
│ │ │ ├── 20181011193212_add_fields_to_internal_transactions.exs
│ │ │ ├── 20191018120546_create_pending_block_operations.exs
│ │ │ ├── 20190516140202_add_address_hash_index_to_decompiled_smart_contracts.exs
│ │ │ ├── 20180117221921_create_address.exs
│ │ │ ├── 20181029174420_update_tokens_table_decimals_from_bigint_to_numeric.exs
│ │ │ ├── 20181017141409_add_index_to_internal_transaction_table.exs
│ │ │ ├── 20190118152240_block_second_degree_relations_composite_primary_key.exs
│ │ │ ├── 20181008195723_create_administrators.exs
│ │ │ ├── 20190508152922_add_old_block_hash_for_transactions.exs
│ │ │ ├── 20190516160535_add_decompiled_and_verified_flag_to_addresses.exs
│ │ │ ├── 20190319081821_create_decompiled_smart_contracts.exs
│ │ │ ├── 20181121170616_add_block_number_to_token_transfers.exs
│ │ │ ├── 20190807111216_remove_duplicate_indexes.exs
│ │ │ └── 20181024164623_logs_composite_primary_key.exs
│ │ │ └── seeds.exs
│ ├── test
│ │ ├── support
│ │ │ ├── fixture
│ │ │ │ └── vcr_cassettes
│ │ │ │ │ ├── .gitkeep
│ │ │ │ │ ├── import_skipped_blocks_perform_1.json
│ │ │ │ │ ├── import_transaction_perform_1.json
│ │ │ │ │ ├── import_block_perform_later_1_latest.json
│ │ │ │ │ ├── import_internal_transaction_perform_1.json
│ │ │ │ │ └── internal_transaction_importer_import_1_from_core-trace.json
│ │ │ └── fakes
│ │ │ │ └── no_op_source.ex
│ │ ├── explorer
│ │ │ ├── chain
│ │ │ │ ├── data_test.exs
│ │ │ │ ├── hash_test.exs
│ │ │ │ ├── hash
│ │ │ │ │ ├── nonce_test.exs
│ │ │ │ │ └── full_test.exs
│ │ │ │ ├── transaction
│ │ │ │ │ └── status_test.exs
│ │ │ │ ├── internal_transaction
│ │ │ │ │ ├── type_test.exs
│ │ │ │ │ └── call_type_test.exs
│ │ │ │ ├── staking_pool_test.exs
│ │ │ │ ├── cache
│ │ │ │ │ └── pending_transactions_test.exs
│ │ │ │ ├── staking_pools_delegator_test.exs
│ │ │ │ └── decompiled_smart_contract_test.exs
│ │ │ └── counters
│ │ │ │ ├── addresses_counter_test.exs
│ │ │ │ └── addresses_with_balance_counter_test.exs
│ │ └── string
│ │ │ └── chars
│ │ │ └── explorer
│ │ │ └── chain
│ │ │ ├── data_test.exs
│ │ │ └── address_test.exs
│ ├── .gitignore
│ ├── coveralls.json
│ ├── lib
│ │ ├── explorer
│ │ │ ├── tracer.ex
│ │ │ ├── repo
│ │ │ │ └── prometheus_logger.ex
│ │ │ ├── schema.ex
│ │ │ ├── chain
│ │ │ │ ├── smart_contract
│ │ │ │ │ └── external_library.ex
│ │ │ │ ├── gas.ex
│ │ │ │ ├── supply
│ │ │ │ │ └── exchange_rate.ex
│ │ │ │ └── import
│ │ │ │ │ └── stage
│ │ │ │ │ └── addresses.ex
│ │ │ ├── known_tokens
│ │ │ │ └── source
│ │ │ │ │ └── my_ether_wallet.ex
│ │ │ ├── paging_options.ex
│ │ │ ├── logger.ex
│ │ │ ├── accounts
│ │ │ │ └── user
│ │ │ │ │ └── authenticate.ex
│ │ │ └── market
│ │ │ │ └── history
│ │ │ │ └── source.ex
│ │ └── explorer.ex
│ ├── benchmarks
│ │ └── explorer
│ │ │ └── chain
│ │ │ └── recent_collated_transactions.benchee
│ ├── .sobelow-conf
│ ├── config
│ │ ├── test.secret.exs.example
│ │ ├── dev.secret.exs.example
│ │ └── test
│ │ │ ├── geth.exs
│ │ │ ├── ganache.exs
│ │ │ ├── rsk.exs
│ │ │ └── parity.exs
│ └── package.json
├── block_scout_web
│ ├── assets
│ │ ├── js
│ │ │ ├── pages
│ │ │ │ ├── stakes.js
│ │ │ │ ├── layout.js
│ │ │ │ └── dark-mode-switcher.js
│ │ │ ├── lib
│ │ │ │ ├── awesomplete.js
│ │ │ │ ├── reload_button.js
│ │ │ │ ├── stop_propagation.js
│ │ │ │ ├── tooltip.js
│ │ │ │ ├── loading_element.js
│ │ │ │ ├── pretty_json.js
│ │ │ │ ├── transaction_input_dropdown.js
│ │ │ │ ├── clipboard_buttons.js
│ │ │ │ └── utils.js
│ │ │ ├── locale.js
│ │ │ └── view_specific
│ │ │ │ ├── raw_trace
│ │ │ │ └── code_highlighting.js
│ │ │ │ └── address_contract
│ │ │ │ └── code_highlighting.js
│ │ ├── .babelrc
│ │ ├── css
│ │ │ ├── components
│ │ │ │ ├── _description-list.scss
│ │ │ │ ├── _nounderline-link.scss
│ │ │ │ ├── _filter.scss
│ │ │ │ ├── _stakes_variables.scss
│ │ │ │ ├── _qr-code.scss
│ │ │ │ ├── _btn_line.scss
│ │ │ │ ├── _btn_qr.scss
│ │ │ │ ├── _btn_copy.scss
│ │ │ │ ├── _btn_full.scss
│ │ │ │ ├── _btn_contract.scss
│ │ │ │ ├── _coin-balance-tile.scss
│ │ │ │ ├── stakes
│ │ │ │ │ ├── _modal_become_candidate.scss
│ │ │ │ │ ├── _modal_stake.scss
│ │ │ │ │ ├── _copy_icon.scss
│ │ │ │ │ └── _stakes_btn_remove_pool.scss
│ │ │ │ ├── _panels.scss
│ │ │ │ ├── _erc721_token_image_container.scss
│ │ │ │ ├── _modal_variables.scss
│ │ │ │ ├── _transaction-input.scss
│ │ │ │ ├── _inventory_token_instance_image_container.scss
│ │ │ │ ├── _alerts.scss
│ │ │ │ ├── _btn_no_border.scss
│ │ │ │ ├── _btn_address_card.scss
│ │ │ │ ├── _i_tooltip.scss
│ │ │ │ ├── _table.scss
│ │ │ │ ├── _highlight.scss
│ │ │ │ ├── _address_link.scss
│ │ │ │ ├── _dot.scss
│ │ │ │ └── _btn_dropdown_line.scss
│ │ │ ├── theme
│ │ │ │ ├── _ellaism_variables.scss
│ │ │ │ ├── _expanse_variables.scss
│ │ │ │ ├── _gochain_variables.scss
│ │ │ │ ├── _callisto_variables.scss
│ │ │ │ ├── _musicoin_variables.scss
│ │ │ │ ├── _wanchain_variables.scss
│ │ │ │ ├── _tomochain_variables.scss
│ │ │ │ ├── _fonts.scss
│ │ │ │ ├── _dai_variables-non-critical.scss
│ │ │ │ ├── _poa_variables-non-critical.scss
│ │ │ │ ├── _xusdt_variables-non-critical.scss
│ │ │ │ ├── _ether1_variables-non-critical.scss
│ │ │ │ ├── _kovan_variables-non-critical.scss
│ │ │ │ ├── _lukso_variables-non-critical.scss
│ │ │ │ ├── _neutral_variables-non-critical.scss
│ │ │ │ ├── _rsk_variables-non-critical.scss
│ │ │ │ ├── _ethereum_variables-non-critical.scss
│ │ │ │ ├── _pirl_variables.scss
│ │ │ │ ├── _rinkeby_variables-non-critical.scss
│ │ │ │ ├── _ropsten_variables-non-critical.scss
│ │ │ │ ├── _social_variables.scss
│ │ │ │ ├── _ethercore_variables-non-critical.scss
│ │ │ │ ├── _ethereum_classic_variables-non-critical.scss
│ │ │ │ ├── _tobalaba_variables.scss
│ │ │ │ ├── _goerli_variables-non-critical.scss
│ │ │ │ └── _sokol_variables-non-critical.scss
│ │ │ ├── _layout.scss
│ │ │ ├── _elements.scss
│ │ │ ├── non-critical.scss
│ │ │ ├── _code.scss
│ │ │ └── _helpers.scss
│ │ ├── .eslintrc
│ │ ├── __mocks__
│ │ │ └── css
│ │ │ │ └── app.scss.js
│ │ ├── static
│ │ │ ├── images
│ │ │ │ ├── eth.png
│ │ │ │ ├── ethereum.png
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── lukso_logo.png
│ │ │ │ ├── expanse_logo.png
│ │ │ │ ├── favicon-16x16.png
│ │ │ │ ├── favicon-32x32.png
│ │ │ │ ├── gochain_logo.png
│ │ │ │ ├── wanchain_logo.png
│ │ │ │ ├── icons
│ │ │ │ │ ├── blockchair.png
│ │ │ │ │ ├── etherchain.png
│ │ │ │ │ ├── etherscan.png
│ │ │ │ │ ├── blockchair@2x.png
│ │ │ │ │ ├── etherchain@2x.png
│ │ │ │ │ ├── etherscan@2x.png
│ │ │ │ │ ├── plus.svg
│ │ │ │ │ ├── remove.svg
│ │ │ │ │ ├── dots.svg
│ │ │ │ │ ├── copy.svg
│ │ │ │ │ ├── check-1.svg
│ │ │ │ │ ├── stake.svg
│ │ │ │ │ ├── withdraw.svg
│ │ │ │ │ └── move-stake.svg
│ │ │ │ ├── lukso_logo_footer.png
│ │ │ │ ├── lukso_dashboard_image.png
│ │ │ │ ├── errors-img
│ │ │ │ │ ├── etc-page-not-found.png
│ │ │ │ │ ├── etc-tx-not-found.png
│ │ │ │ │ ├── eth-page-not-found.png
│ │ │ │ │ ├── eth-tx-not-found.png
│ │ │ │ │ ├── kovan-tx-not-found.png
│ │ │ │ │ ├── lukso-tx-not-found.png
│ │ │ │ │ ├── poa-page-not-found.png
│ │ │ │ │ ├── poa-tx-not-found.png
│ │ │ │ │ ├── rsk-page-not-found.png
│ │ │ │ │ ├── rsk-tx-not-found.png
│ │ │ │ │ ├── sokol-tx-not-found.png
│ │ │ │ │ ├── xdai-tx-not-found.png
│ │ │ │ │ ├── etc-block-not-found.png
│ │ │ │ │ ├── etc-tx-not-found@2x.png
│ │ │ │ │ ├── eth-block-not-found.png
│ │ │ │ │ ├── eth-tx-not-found@2x.png
│ │ │ │ │ ├── goerli-tx-not-found.png
│ │ │ │ │ ├── kovan-page-not-found.png
│ │ │ │ │ ├── lukso-page-not-found.png
│ │ │ │ │ ├── poa-block-not-found.png
│ │ │ │ │ ├── poa-tx-not-found@2x.png
│ │ │ │ │ ├── rinkeby-tx-not-found.png
│ │ │ │ │ ├── ropsten-tx-not-found.png
│ │ │ │ │ ├── rsk-block-not-found.png
│ │ │ │ │ ├── rsk-tx-not-found@2x.png
│ │ │ │ │ ├── sokol-page-not-found.png
│ │ │ │ │ ├── xdai-block-not-found.png
│ │ │ │ │ ├── xdai-page-not-found.png
│ │ │ │ │ ├── xdai-tx-not-found@2x.png
│ │ │ │ │ ├── etc-block-not-found@2x.png
│ │ │ │ │ ├── etc-page-not-found@2x.png
│ │ │ │ │ ├── eth-block-not-found@2x.png
│ │ │ │ │ ├── eth-page-not-found@2x.png
│ │ │ │ │ ├── goerli-block-not-found.png
│ │ │ │ │ ├── goerli-page-not-found.png
│ │ │ │ │ ├── goerli-tx-not-found@2x.png
│ │ │ │ │ ├── koan-block-not-found@2x.png
│ │ │ │ │ ├── kovan-block-not-found.png
│ │ │ │ │ ├── kovan-page-not-found@2x.png
│ │ │ │ │ ├── kovan-tx-not-found@2x.png
│ │ │ │ │ ├── lukso-block-not-found.png
│ │ │ │ │ ├── lukso-page-not-found@2x.png
│ │ │ │ │ ├── lukso-tx-not-found@2x.png
│ │ │ │ │ ├── poa-block-not-found@2x.png
│ │ │ │ │ ├── poa-page-not-found@2x.png
│ │ │ │ │ ├── rinkeby-block-not-found.png
│ │ │ │ │ ├── rinkeby-page-not-found.png
│ │ │ │ │ ├── rinkeby-tx-not-found@2x.png
│ │ │ │ │ ├── ropsten-block-not-found.png
│ │ │ │ │ ├── ropsten-page-not-found.png
│ │ │ │ │ ├── ropsten-tx-not-found@2x.png
│ │ │ │ │ ├── rsk-block-not-found@2x.png
│ │ │ │ │ ├── rsk-page-not-found@2x.png
│ │ │ │ │ ├── sokol-block-not-found.png
│ │ │ │ │ ├── sokol-page-not-found@2x.png
│ │ │ │ │ ├── sokol-tx-not-found@2x.png
│ │ │ │ │ ├── xdai-block-not-found@2x.png
│ │ │ │ │ ├── xdai-page-not-found@2x.png
│ │ │ │ │ ├── goerli-block-not-found@2x.png
│ │ │ │ │ ├── goerli-page-not-found@2x.png
│ │ │ │ │ ├── kovan-block-not-found@2x.png
│ │ │ │ │ ├── lukso-block-not-found@2x.png
│ │ │ │ │ ├── rinkeby-page-not-found@2x.png
│ │ │ │ │ ├── rinnkeby-block-not-found.png
│ │ │ │ │ ├── ropsten-page-not-found@2x.png
│ │ │ │ │ ├── sokol-block-not-found@2x.png
│ │ │ │ │ ├── rinkeby-block-not-found@2x.png
│ │ │ │ │ ├── rinnkeby-block-not-found@2x.png
│ │ │ │ │ └── ropsten-block-not-found@2x.png
│ │ │ │ ├── network-selector-icons
│ │ │ │ │ ├── lukso-l14-testnet.svg
│ │ │ │ │ ├── ethereum-classic.svg
│ │ │ │ │ ├── ethereum-mainnet.svg
│ │ │ │ │ ├── circle-xusdt.svg
│ │ │ │ │ ├── xdai-chain.svg
│ │ │ │ │ └── kovan-testnet.svg
│ │ │ │ ├── pirl_logo.svg
│ │ │ │ ├── transaction.svg
│ │ │ │ └── ellaism_logo.svg
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── mstile-150x150.png
│ │ │ ├── android-chrome-192x192.png
│ │ │ ├── android-chrome-512x512.png
│ │ │ ├── robots.txt
│ │ │ ├── browserconfig.xml
│ │ │ └── manifest.webmanifest
│ │ ├── postcss.config.js
│ │ ├── README.md
│ │ └── __tests__
│ │ │ ├── pages
│ │ │ └── transaction.js
│ │ │ └── lib
│ │ │ └── currency.js
│ ├── lib
│ │ ├── block_scout_web
│ │ │ ├── views
│ │ │ │ ├── icons_view.ex
│ │ │ │ ├── address_token_view.ex
│ │ │ │ ├── admin
│ │ │ │ │ ├── dashboard_view.ex
│ │ │ │ │ ├── session_view.ex
│ │ │ │ │ └── setup_view.ex
│ │ │ │ ├── tokens
│ │ │ │ │ ├── instance_view.ex
│ │ │ │ │ ├── transfer_view.ex
│ │ │ │ │ ├── read_contract_view.ex
│ │ │ │ │ ├── instance
│ │ │ │ │ │ ├── transfer_view.ex
│ │ │ │ │ │ └── metadata_view.ex
│ │ │ │ │ └── inventory_view.ex
│ │ │ │ ├── error_422.ex
│ │ │ │ ├── page_not_found.ex
│ │ │ │ ├── transaction_token_transfer_view.ex
│ │ │ │ ├── address_contract_verification_view.ex
│ │ │ │ ├── pending_transaction_view.ex
│ │ │ │ ├── transaction_internal_transaction_view.ex
│ │ │ │ ├── address_validation_view.ex
│ │ │ │ ├── address_read_contract_view.ex
│ │ │ │ ├── common_components_view.ex
│ │ │ │ ├── address_logs_view.ex
│ │ │ │ ├── transaction_log_view.ex
│ │ │ │ ├── address_token_transfer_view.ex
│ │ │ │ ├── address_internal_transaction_view.ex
│ │ │ │ ├── api
│ │ │ │ │ ├── v1
│ │ │ │ │ │ └── supply_view.ex
│ │ │ │ │ └── rpc
│ │ │ │ │ │ └── eth_view.ex
│ │ │ │ ├── address_transaction_view.ex
│ │ │ │ ├── block_transaction_view.ex
│ │ │ │ ├── error_view.ex
│ │ │ │ ├── transaction_raw_trace_view.ex
│ │ │ │ └── render_helpers.ex
│ │ │ ├── templates
│ │ │ │ ├── address_token
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── block_transaction
│ │ │ │ │ ├── _metatags.html.eex
│ │ │ │ │ └── 404.html.eex
│ │ │ │ ├── address_contract
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_transaction
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_validation
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── tokens
│ │ │ │ │ ├── holder
│ │ │ │ │ │ └── _metatags.html.eex
│ │ │ │ │ ├── inventory
│ │ │ │ │ │ └── _metatags.html.eex
│ │ │ │ │ ├── transfer
│ │ │ │ │ │ └── _metatags.html.eex
│ │ │ │ │ ├── read_contract
│ │ │ │ │ │ └── _metatags.html.eex
│ │ │ │ │ └── overview
│ │ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_read_contract
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_token_transfer
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_decompiled_contract
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── address_internal_transaction
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── transaction_log
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── layout
│ │ │ │ │ └── _default_title.html.eex
│ │ │ │ ├── transaction_raw_trace
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── transaction_token_transfer
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── icons
│ │ │ │ │ ├── _active_icon.html.eex
│ │ │ │ │ ├── _test_network_icon.html.eex
│ │ │ │ │ ├── _accounts_icon.html.eex
│ │ │ │ │ ├── _block_icon.html.eex
│ │ │ │ │ ├── _search_icon.html.eex
│ │ │ │ │ ├── _apps_icon.html.eex
│ │ │ │ │ ├── _api_icon.html.eex
│ │ │ │ │ └── _network_icon.html.eex
│ │ │ │ ├── transaction_internal_transaction
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── block
│ │ │ │ │ └── _link.html.eex
│ │ │ │ ├── transaction
│ │ │ │ │ ├── _link.html.eex
│ │ │ │ │ └── invalid.html.eex
│ │ │ │ ├── common_components
│ │ │ │ │ ├── _btn_line.html.eex
│ │ │ │ │ ├── _progress_from_to.html.eex
│ │ │ │ │ ├── _btn_add_line.html.eex
│ │ │ │ │ ├── _btn_add_full.html.eex
│ │ │ │ │ ├── _i_tooltip.html.eex
│ │ │ │ │ ├── _modal_close_button.html.eex
│ │ │ │ │ └── _modal_bottom_disclaimer.html.eex
│ │ │ │ ├── api_docs
│ │ │ │ │ ├── _module_item.html.eex
│ │ │ │ │ ├── _metatags.html.eex
│ │ │ │ │ └── _module_card.html.eex
│ │ │ │ ├── address
│ │ │ │ │ └── _link.html.eex
│ │ │ │ ├── form
│ │ │ │ │ └── text_field.html.eex
│ │ │ │ ├── chain
│ │ │ │ │ └── _metatags.html.eex
│ │ │ │ ├── smart_contract
│ │ │ │ │ └── _function_response.html.eex
│ │ │ │ ├── page_not_found
│ │ │ │ │ └── index.html.eex
│ │ │ │ └── error422
│ │ │ │ │ └── index.html.eex
│ │ │ ├── tracer.ex
│ │ │ ├── controllers
│ │ │ │ ├── admin
│ │ │ │ │ └── dashboard_controller.ex
│ │ │ │ ├── page_not_found_controller.ex
│ │ │ │ ├── common_components_controller.ex
│ │ │ │ ├── api
│ │ │ │ │ └── v1
│ │ │ │ │ │ └── supply_controller.ex
│ │ │ │ └── api_docs_controller.ex
│ │ │ ├── prometheus
│ │ │ │ ├── exporter.ex
│ │ │ │ └── instrumenter.ex
│ │ │ ├── cldr.ex
│ │ │ ├── resolvers
│ │ │ │ ├── block.ex
│ │ │ │ └── address.ex
│ │ │ ├── plug
│ │ │ │ ├── allow_iframe.ex
│ │ │ │ ├── graphql.ex
│ │ │ │ └── fetch_user_from_session.ex
│ │ │ └── channels
│ │ │ │ └── exchange_rate_channel.ex
│ │ └── phoenix
│ │ │ └── param.ex
│ ├── test
│ │ ├── block_scout_web
│ │ │ ├── views
│ │ │ │ ├── tokens
│ │ │ │ │ ├── transfer_view_test.exs
│ │ │ │ │ └── read_contract_view_test.exs
│ │ │ │ ├── address_transaction_view_test.exs
│ │ │ │ └── wei_helpers_test.exs
│ │ │ ├── controllers
│ │ │ │ ├── page_not_found_controller_test.exs
│ │ │ │ └── api
│ │ │ │ │ └── v1
│ │ │ │ │ └── supply_controller_test.exs
│ │ │ └── features
│ │ │ │ ├── pages
│ │ │ │ ├── app_page.ex
│ │ │ │ └── address_contract_page.ex
│ │ │ │ └── viewing_tokens_test.exs
│ │ └── phoenix
│ │ │ └── param
│ │ │ └── explorer
│ │ │ └── chain
│ │ │ └── block_test.exs
│ ├── config
│ │ └── dev.secret.exs.example
│ └── .sobelow-conf
├── indexer
│ ├── test
│ │ ├── indexer_test.exs
│ │ └── support
│ │ │ └── indexer
│ │ │ ├── block
│ │ │ └── catchup_supervisor_case.ex
│ │ │ └── fetcher
│ │ │ ├── token_supervisor_case.ex
│ │ │ ├── uncle_block_supervisor_case.ex
│ │ │ ├── block_reward_supervisor_case.ex
│ │ │ ├── coin_balance_supervisor_case.ex
│ │ │ ├── contract_code_supervisor_case.ex
│ │ │ ├── token_balance_supervisor_case.ex
│ │ │ ├── token_updater_supervisor_case.ex
│ │ │ ├── pending_transaction_supervisor_case.ex
│ │ │ ├── replaced_transaction_supervisor_case.ex
│ │ │ └── internal_transaction_supervisor_case.ex
│ ├── lib
│ │ ├── indexer.ex
│ │ └── indexer
│ │ │ ├── tracer.ex
│ │ │ └── transform
│ │ │ └── blocks
│ │ │ ├── base.ex
│ │ │ └── clique.ex
│ └── .gitignore
└── ethereum_jsonrpc
│ ├── lib
│ ├── ethereum_jsonrpc
│ │ ├── tracer.ex
│ │ ├── block
│ │ │ ├── by_hash.ex
│ │ │ ├── by_number.ex
│ │ │ └── by_nephew.ex
│ │ ├── fetched_beneficiary.ex
│ │ ├── parity
│ │ │ └── traces.ex
│ │ ├── fetched_beneficiaries.ex
│ │ ├── http
│ │ │ └── httpoison.ex
│ │ └── logs.ex
│ └── rsk.ex
│ ├── test
│ ├── ethereum_jsonrpc
│ │ ├── blocks_test.exs
│ │ ├── uncle_test.exs
│ │ ├── uncles_test.exs
│ │ ├── geth
│ │ │ └── calls_tests.exs
│ │ ├── parity
│ │ │ ├── trace_test.exs
│ │ │ └── trace
│ │ │ │ ├── action_test.exs
│ │ │ │ └── result_test.exs
│ │ └── transaction_test.exs
│ └── support
│ │ └── ethereum_jsonrpc
│ │ ├── web_socket
│ │ └── case.ex
│ │ └── case
│ │ ├── geth
│ │ └── mox.ex
│ │ └── parity
│ │ └── mox.ex
│ └── config
│ ├── dev.exs
│ └── prod.exs
├── rel
├── plugins
│ └── .gitignore
└── commands
│ ├── migrate.sh
│ ├── seed.sh
│ └── clear_build.sh
├── .tool-versions
├── blockscout.png
├── bin
├── deployment
│ ├── start
│ ├── stop
│ ├── migrate
│ ├── health_check
│ └── build
├── test
└── install_chrome_headless.sh
├── docker
├── restart.sh
├── deploy.sh
└── README.md
├── .dockerignore
├── prometheus.yml
├── coveralls.json
├── .formatter.exs
├── .pairs
├── config
├── dev.exs
├── prod.exs
└── test.exs
├── ISSUE_TEMPLATE.md
└── appspec.yml
/apps/explorer/priv/repo/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rel/plugins/.gitignore:
--------------------------------------------------------------------------------
1 | *.*
2 | !*.exs
3 | !.gitignore
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.tool-versions:
--------------------------------------------------------------------------------
1 | elixir 1.9.4
2 | erlang 22.2
3 | nodejs 12.14.1
4 |
--------------------------------------------------------------------------------
/apps/explorer/.gitignore:
--------------------------------------------------------------------------------
1 | priv/.recovery
2 | priv/solc_compilers/
3 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/pages/stakes.js:
--------------------------------------------------------------------------------
1 | import '../../css/stakes.scss'
2 |
--------------------------------------------------------------------------------
/blockscout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/blockscout.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env"]
3 | }
4 |
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/import_skipped_blocks_perform_1.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/import_transaction_perform_1.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_later_1_latest.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/import_internal_transaction_perform_1.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_description-list.scss:
--------------------------------------------------------------------------------
1 | dt {
2 | font-weight: normal;
3 | }
4 |
--------------------------------------------------------------------------------
/apps/explorer/coveralls.json:
--------------------------------------------------------------------------------
1 | {
2 | "skip_files": [
3 | "lib/explorer/application.ex"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_from_core-trace.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/rel/commands/migrate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | release_ctl eval --mfa "Explorer.ReleaseTasks.migrate/1" --argv -- "$@"
--------------------------------------------------------------------------------
/rel/commands/seed.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | release_ctl eval --mfa "Explorer.ReleaseTasks.seed/1" --argv -- "$@"
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/awesomplete.js:
--------------------------------------------------------------------------------
1 | import 'awesomplete/awesomplete.css'
2 | import 'awesomplete'
3 |
--------------------------------------------------------------------------------
/bin/deployment/start:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | systemctl start explorer.service
6 |
7 | exit 0
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_nounderline-link.scss:
--------------------------------------------------------------------------------
1 | a.nounderline {
2 | text-decoration: none;
3 | }
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "standard",
3 | "env": {
4 | "browser": true
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/__mocks__/css/app.scss.js:
--------------------------------------------------------------------------------
1 | export default {
2 | primary: "#4786ff",
3 | secondary: "#ced4da"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ellaism_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #4a4a4a;
2 | $secondary: #01c85c;
3 | $tertiary: #466d85;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_expanse_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #1f4c55;
2 | $secondary: #e08e64;
3 | $tertiary: #333333;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_gochain_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #586a8f;
2 | $secondary: #00bcd4;
3 | $tertiary: #6f87b2;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_callisto_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #34c88a;
2 | $secondary: #163f59;
3 | $tertiary: #466d85;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_musicoin_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #171717;
2 | $secondary: #ff9000;
3 | $tertiary: #727272;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_wanchain_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #3680f8;
2 | $secondary: #2ccfc5;
3 | $tertiary: #7289af;
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/icons_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.IconsView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/indexer/test/indexer_test.exs:
--------------------------------------------------------------------------------
1 | defmodule IndexerTest do
2 | use Explorer.DataCase, async: true
3 |
4 | doctest Indexer
5 | end
6 |
--------------------------------------------------------------------------------
/apps/indexer/lib/indexer.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer do
2 | @moduledoc """
3 | Indexes an Ethereum-based chain using JSONRPC.
4 | """
5 | end
6 |
--------------------------------------------------------------------------------
/apps/indexer/lib/indexer/tracer.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Tracer do
2 | @moduledoc false
3 |
4 | use Spandex.Tracer, otp_app: :indexer
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_filter.scss:
--------------------------------------------------------------------------------
1 | .filter {
2 | min-width: 100%;
3 | transform: translate3d(0, 34px, 0px) !important;
4 | }
5 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_stakes_variables.scss:
--------------------------------------------------------------------------------
1 | $stakes-banned-background: #fff3f7 !default;
2 | $stakes-banned-color: #ff7986 !default;
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/eth.png
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/tracer.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Tracer do
2 | @moduledoc false
3 |
4 | use Spandex.Tracer, otp_app: :explorer
5 | end
6 |
--------------------------------------------------------------------------------
/docker/restart.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker stop blockscout;
3 | docker rm blockscout;
4 | docker stop postgres;
5 | docker rm postgres;
6 | make start;
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_token_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressTokenView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/reload_button.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $('[data-selector="reload-button"]').click(() => window.location.reload())
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/apple-touch-icon.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/ethereum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/ethereum.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/favicon.ico
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/mstile-150x150.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/admin/dashboard_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Admin.DashboardView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/instance_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.InstanceView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/lukso_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/lukso_logo.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_qr-code.scss:
--------------------------------------------------------------------------------
1 | .qr-code {
2 | display: block;
3 | margin-right: auto;
4 | margin-left: auto;
5 | width: 100%;
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_tomochain_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #211841;
2 | $secondary: #f16950;
3 | $tertiary: #8b84bc;
4 | $btn-contract-color: $primary;
5 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/stop_propagation.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $('[data-selector="stop-propagation"]').click((event) => event.stopPropagation())
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/tooltip.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $(function () {
4 | $('body').tooltip({ selector: '[data-toggle="tooltip"]' })
5 | })
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/expanse_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/expanse_logo.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/favicon-16x16.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/favicon-32x32.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/gochain_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/gochain_logo.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/wanchain_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/wanchain_logo.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/error_422.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Error422View do
2 | use BlockScoutWeb, :view
3 |
4 | @dialyzer :no_match
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/data_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.DataTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.Data
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/hash_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.HashTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.Hash
5 | end
6 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | _build
2 | deps
3 | apps/block_scout_web/assets/node_modules
4 | apps/explorer/node_modules
5 | test
6 | .git
7 | .circleci
8 | logs
9 | apps/*/test
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/android-chrome-192x192.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/android-chrome-512x512.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/blockchair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/blockchair.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/etherchain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/etherchain.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/etherscan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/etherscan.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_token/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/block_transaction/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.BlockView, "_metatags.html", conn: @conn, block: @block %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/tracer.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tracer do
2 | @moduledoc false
3 |
4 | use Spandex.Tracer, otp_app: :block_scout_web
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/blockchair@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/blockchair@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/etherchain@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/etherchain@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/etherscan@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/icons/etherscan@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/lukso_logo_footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/lukso_logo_footer.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_contract/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_validation/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/tokens/holder/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= BlockScoutWeb.Tokens.OverviewView.render "_metatags.html", conn: @conn, token: @token %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/tokens/inventory/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= BlockScoutWeb.Tokens.OverviewView.render "_metatags.html", conn: @conn, token: @token %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= BlockScoutWeb.Tokens.OverviewView.render "_metatags.html", conn: @conn, token: @token %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/page_not_found.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.PageNotFoundView do
2 | use BlockScoutWeb, :view
3 |
4 | @dialyzer :no_match
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/transaction_token_transfer_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.TransactionTokenTransferView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/tracer.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Tracer do
2 | @moduledoc false
3 |
4 | use Spandex.Tracer, otp_app: :ethereum_jsonrpc
5 | end
6 |
--------------------------------------------------------------------------------
/prometheus.yml:
--------------------------------------------------------------------------------
1 | scrape_configs:
2 | - job_name: block_scout
3 | scheme: 'http'
4 | scrape_interval: 10s
5 | static_configs:
6 | - targets: ['localhost:4000']
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/lukso_dashboard_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/lukso_dashboard_image.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_read_contract/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/tokens/read_contract/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= BlockScoutWeb.Tokens.OverviewView.render "_metatags.html", conn: @conn, token: @token %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_contract_verification_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressContractVerificationView do
2 | use BlockScoutWeb, :view
3 | end
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/views/tokens/transfer_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.TransferViewTest do
2 | use BlockScoutWeb.ConnCase, async: true
3 | end
4 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/blocks_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.BlocksTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Blocks
5 | end
6 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/uncle_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.UncleTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Uncle
5 | end
6 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/uncles_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.UnclesTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Uncles
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/hash/nonce_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Hash.NonceTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.Hash.Nonce
5 | end
6 |
--------------------------------------------------------------------------------
/bin/deployment/stop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | if systemctl is-active explorer.service; then
6 | systemctl stop explorer.service
7 | fi
8 |
9 | exit 0
10 |
--------------------------------------------------------------------------------
/bin/test:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -ex
4 |
5 | mix format --check-formatted
6 | mix credo --strict
7 | mix sobelow --config
8 | mix dialyzer --halt-exit-status
9 | mix test
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/loading_element.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $('button[data-loading="animation"]').click(event => {
4 | $('#loading').removeClass('d-none')
5 | })
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_decompiled_contract/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.AddressView, "_metatags.html", conn: @conn, address: @address %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.TransactionView, "_metatags.html", conn: @conn, transaction: @transaction %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/layout/_default_title.html.eex:
--------------------------------------------------------------------------------
1 |
2 | <%= gettext("%{subnetwork} Explorer - BlockScout", subnetwork: subnetwork_title()) %>
3 |
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction_raw_trace/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.TransactionView, "_metatags.html", conn: @conn, transaction: @transaction %>
2 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/pending_transaction_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.PendingTransactionView do
2 | use BlockScoutWeb, :view
3 |
4 | @dialyzer :no_match
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/views/tokens/read_contract_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.ReadContractViewTest do
2 | use BlockScoutWeb.ConnCase, async: true
3 | end
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_fonts.scss:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css?family=Nunito:200,300,400,600,700');
2 | @import url('https://fonts.googleapis.com/css?family=Roboto');
3 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction_token_transfer/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.TransactionView, "_metatags.html", conn: @conn, transaction: @transaction %>
2 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/geth/calls_tests.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Geth.CallsTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Geth.Calls
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-tx-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-tx-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_active_icon.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction_internal_transaction/_metatags.html.eex:
--------------------------------------------------------------------------------
1 | <%= render BlockScoutWeb.TransactionView, "_metatags.html", conn: @conn, transaction: @transaction %>
2 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/parity/trace_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Parity.TraceTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Parity.Trace
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/benchmarks/explorer/chain/recent_collated_transactions.benchee:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/explorer/benchmarks/explorer/chain/recent_collated_transactions.benchee
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/etc-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/etc-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/eth-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/eth-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/koan-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/koan-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/poa-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/poa-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-page-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-page-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rsk-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rsk-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-tx-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-tx-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/xdai-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/xdai-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/transfer_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.TransferView do
2 | use BlockScoutWeb, :view
3 |
4 | alias BlockScoutWeb.Tokens.OverviewView
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/transaction/status_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Transaction.StatusTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.Transaction.Status
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/test/string/chars/explorer/chain/data_test.exs:
--------------------------------------------------------------------------------
1 | defmodule String.Chars.Explorer.Chain.DataTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest String.Chars.Explorer.Chain.Data
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_line.scss:
--------------------------------------------------------------------------------
1 | $btn-line-bg: #fff !default;
2 | $btn-line-color: $secondary !default;
3 |
4 | .btn-line {
5 | @include btn-line($btn-line-bg, $btn-line-color);
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/goerli-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/goerli-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/kovan-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/kovan-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/lukso-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/lukso-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinnkeby-block-not-found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinnkeby-block-not-found.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-page-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-page-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/sokol-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/sokol-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.TransactionInternalTransactionView do
2 | use BlockScoutWeb, :view
3 | @dialyzer :no_match
4 | end
5 |
--------------------------------------------------------------------------------
/apps/explorer/test/string/chars/explorer/chain/address_test.exs:
--------------------------------------------------------------------------------
1 | defmodule String.Chars.Explorer.Chain.AddressTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest String.Chars.Explorer.Chain.Address
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | require('autoprefixer')({
4 | browsers: [
5 | 'last 4 versions'
6 | ]
7 | })
8 | ]
9 | };
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinkeby-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinkeby-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/rinnkeby-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/rinnkeby-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/errors-img/ropsten-block-not-found@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hubs/blockscout/master/apps/block_scout_web/assets/static/images/errors-img/ropsten-block-not-found@2x.png
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/block/_link.html.eex:
--------------------------------------------------------------------------------
1 | <%= link(
2 | gettext("Block #%{number}", number: to_string(@block.number)),
3 | to: block_path(BlockScoutWeb.Endpoint, :show, @block)
4 | ) %>
5 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/read_contract_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.ReadContractView do
2 | use BlockScoutWeb, :view
3 |
4 | alias BlockScoutWeb.Tokens.OverviewView
5 | end
6 |
--------------------------------------------------------------------------------
/docker/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | docker stop blockscout;
4 | docker rm blockscout;
5 | docker rmi blockscout_prod;
6 | docker stop postgres;
7 | docker rm postgres;
8 | docker rmi postgres;
9 | make start;
10 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/parity/trace/action_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Parity.Trace.ActionTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Parity.Trace.Action
5 | end
6 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/parity/trace/result_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Parity.Trace.ResultTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Parity.Trace.Result
5 | end
6 |
--------------------------------------------------------------------------------
/coveralls.json:
--------------------------------------------------------------------------------
1 | {
2 | "coverage_options": {
3 | "treat_no_relevant_lines_as_covered": true,
4 | "minimum_coverage": 88
5 | },
6 | "terminal_options": {
7 | "file_column_width": 120
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_qr.scss:
--------------------------------------------------------------------------------
1 | $btn-qr-color: $primary !default;
2 | $btn-qr-dimensions: 31px !default;
3 |
4 | .btn-qr-icon {
5 | @include square-icon-button($btn-qr-color, $btn-qr-dimensions);
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/locale.js:
--------------------------------------------------------------------------------
1 | import moment from 'moment'
2 | import numeral from 'numeral'
3 | import 'numeral/locales'
4 |
5 | export const locale = 'en'
6 |
7 | moment.locale(locale)
8 | numeral.locale(locale)
9 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/internal_transaction/type_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.InternalTransaction.TypeTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.InternalTransaction.Type
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/instance/transfer_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.Instance.TransferView do
2 | use BlockScoutWeb, :view
3 |
4 | alias BlockScoutWeb.Tokens.Instance.OverviewView
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/plus.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_copy.scss:
--------------------------------------------------------------------------------
1 | $btn-copy-color: $primary !default;
2 | $btn-copy-dimensions: 31px !default;
3 |
4 | .btn-copy-icon {
5 | @include square-icon-button($btn-copy-color, $btn-copy-dimensions);
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/config/dev.secret.exs.example:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # Configures the endpoint
4 | config :block_scout_web, BlockScoutWeb.Endpoint,
5 | secret_key_base: "RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5"
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/admin/session_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Admin.SessionView do
2 | use BlockScoutWeb, :view
3 |
4 | import BlockScoutWeb.AdminRouter.Helpers
5 |
6 | alias BlockScoutWeb.FormView
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/admin/setup_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Admin.SetupView do
2 | use BlockScoutWeb, :view
3 |
4 | import BlockScoutWeb.AdminRouter.Helpers
5 |
6 | alias BlockScoutWeb.FormView
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/internal_transaction/call_type_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.InternalTransaction.CallTypeTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest Explorer.Chain.InternalTransaction.CallType
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_full.scss:
--------------------------------------------------------------------------------
1 | $btn-full-primary-bg: $primary !default;
2 | $btn-full-primary-color: #fff !default;
3 |
4 | .btn-full-primary {
5 | @include btn-full($btn-full-primary-bg, $btn-full-primary-color);
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/views/address_transaction_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressTransactionViewTest do
2 | use BlockScoutWeb.ConnCase, async: true
3 |
4 | doctest BlockScoutWeb.AddressTransactionView
5 | end
6 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190301120328_add_index_to_consensus.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToConsensus do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:blocks, [:consensus]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/.sobelow-conf:
--------------------------------------------------------------------------------
1 | [
2 | verbose: false,
3 | private: true,
4 | skip: false,
5 | router: "lib/block_scout_web/router.ex",
6 | exit: "low",
7 | format: "compact",
8 | ignore: ["Config.Headers", "Config.CSWH"]
9 | ]
10 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190313085740_add_index_symobl_in_tokens.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexSymoblInTokens do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:tokens, [:symbol]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/controllers/admin/dashboard_controller.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Admin.DashboardController do
2 | use BlockScoutWeb, :controller
3 |
4 | def index(conn, _) do
5 | render(conn, "index.html")
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_validation_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressValidationView do
2 | use BlockScoutWeb, :view
3 |
4 | # import BlockScoutWeb.AddressView, only: [contract?: 1, smart_contract_verified?: 1]
5 | end
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_contract.scss:
--------------------------------------------------------------------------------
1 | $btn-contract-color: $primary !default;
2 | $btn-contract-dimensions: 31px !default;
3 |
4 | .btn-contract-icon {
5 | @include square-icon-button($btn-contract-color, $btn-contract-dimensions);
6 | }
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_dai_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #17314f;
3 | $secondary: #15bba6;
4 | $tertiary: #93d7ff;
5 | $additional-font: #fff;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_poa_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #5c34a2;
3 | $secondary: #87e1a9;
4 | $tertiary: #bf9cff;
5 | $additional-font: #fff;
6 |
7 | $btn-line-color: $primary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_xusdt_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #2b9f7a;
3 | $secondary: #20745a;
4 | $tertiary: #fff;
5 | $additional-font: #fff;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/views/wei_helpers_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.WeiHelpersTest do
2 | use ExUnit.Case
3 |
4 | # Needed for doctest
5 | alias Explorer.Chain.Wei
6 |
7 | doctest BlockScoutWeb.WeiHelpers, import: true
8 | end
9 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/config/dev.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :ethereum_jsonrpc, EthereumJSONRPC.Tracer, env: "dev", disabled?: true
4 |
5 | config :logger, :ethereum_jsonrpc,
6 | level: :debug,
7 | path: Path.absname("logs/dev/ethereum_jsonrpc.log")
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180626143840_add_inserted_at_index_to_blocks.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddInsertedAtIndexToBlocks do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:blocks, :inserted_at))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181221143000_create_blocks_miner_hash_index.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateBlocksMinerHashIndex do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:blocks, [:miner_hash]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ether1_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #840032;
3 | $secondary: #343434;
4 | $tertiary: #7f7f7f;
5 | $additional-font: #ff95db;
6 |
7 | $btn-line-color: #4b021e; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_kovan_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #101f25;
3 | $secondary: #35e3d8;
4 | $tertiary: #1f857f;
5 | $additional-font: #99fff9;
6 |
7 | $btn-line-color: $tertiary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_lukso_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #1d3154;
3 | $secondary: #fdcec4;
4 | $tertiary: #a96c55;
5 | $additional-font: #a1ded1;
6 |
7 | $btn-line-color: $primary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_neutral_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #5c34a2;
3 | $secondary: #87e1a9;
4 | $tertiary: #bf9cff;
5 | $additional-font: #fff;
6 |
7 | $btn-line-color: $primary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_rsk_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #101f25;
3 | $secondary: #27ac8d;
4 | $tertiary: #e39a54;
5 | $additional-font: #a1ded1;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction/_link.html.eex:
--------------------------------------------------------------------------------
1 | <%= link(@transaction_hash,
2 | to: transaction_path(BlockScoutWeb.Endpoint, :show, @transaction_hash),
3 | "data-test": "transaction_hash_link",
4 | class: "text-truncate") %>
5 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190314084907_add_index_to_to_address_hash.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToToAddressHash do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:transactions, [:to_address_hash]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/.formatter.exs:
--------------------------------------------------------------------------------
1 | [
2 | inputs: [
3 | ".credo.exs",
4 | ".formatter.exs",
5 | "apps/*/mix.exs",
6 | "apps/*/{benchmarks,config,lib,priv,test}/**/*.{ex,exs}",
7 | "mix.exs",
8 | "{config}/**/*.{ex,exs}"
9 | ],
10 | line_length: 120
11 | ]
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_coin-balance-tile.scss:
--------------------------------------------------------------------------------
1 | .tile.tile-type-coin-balance {
2 | [data-balance-change-sign="Positive"] {
3 | color: $green;
4 | }
5 |
6 | [data-balance-change-sign="Negative"] {
7 | color: $red;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/stakes/_modal_become_candidate.scss:
--------------------------------------------------------------------------------
1 | .modal-become-candidate {
2 | max-width: 100%;
3 | width: 280px;
4 |
5 | @include media-breakpoint-down(sm) {
6 | margin-left: auto;
7 | margin-right: auto;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ethereum_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #153550;
3 | $secondary: #49a2ee;
4 | $tertiary: #4ad7a7;
5 | $additional-font: #89cae6;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_pirl_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #343434;
2 | $secondary: #a2d729;
3 | $tertiary: #7f7f7f;
4 |
5 | $footer-background-color: $primary;
6 | $footer-title-color: #fff;
7 | $footer-text-color: #fff;
8 | $footer-item-disc-color: $secondary;
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_rinkeby_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #153550;
3 | $secondary: #38a9f5;
4 | $tertiary: #76f1ff;
5 | $additional-font: #89cae6;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ropsten_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #153550;
3 | $secondary: #38a9f5;
4 | $tertiary: #76f1ff;
5 | $additional-font: #89cae6;
6 |
7 | $btn-line-color: $secondary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_social_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #a375ff;
2 | $secondary: #00f0bd;
3 | $tertiary: #53a9ff;
4 |
5 | $footer-background-color: $primary;
6 | $footer-title-color: #fff;
7 | $footer-text-color: #fff;
8 | $footer-item-disc-color: $secondary;
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180522154252_create_btree_gist_extension.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateBtreeGistExtension do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute("CREATE EXTENSION IF NOT EXISTS btree_gist")
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190318151809_add_inserted_at_index_to_accounts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddInsertedAtIndexToAccounts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:addresses, :inserted_at))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190613065856_add_tx_hash_inserted_at_index.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddTxHashInsertedAtIndex do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:transactions, [:hash, :inserted_at]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ethercore_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #3a6ea7;
3 | $secondary: #558ac3;
4 | $tertiary: #3a6ea7;
5 | $additional-font: #bdbdff;
6 |
7 | $btn-line-color: $tertiary; // button border and font color && hover bg color
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #1c1c3d;
3 | $secondary: #4ad7a7;
4 | $tertiary: #5959d8;
5 | $additional-font: #bdbdff;
6 |
7 | $btn-line-color: $tertiary; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_tobalaba_variables.scss:
--------------------------------------------------------------------------------
1 | $primary: #633d99;
2 | $secondary: #6cc04a;
3 | $tertiary: #a566ff;
4 |
5 | $footer-background-color: $primary;
6 | $footer-title-color: #fff;
7 | $footer-text-color: #fff;
8 | $footer-item-disc-color: $secondary;
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/prometheus/exporter.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Prometheus.Exporter do
2 | @moduledoc """
3 | Exports `Prometheus` metrics at `/metrics`
4 | """
5 |
6 | @dialyzer :no_match
7 |
8 | use Prometheus.PlugExporter
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressReadContractView do
2 | use BlockScoutWeb, :view
3 |
4 | def queryable?(inputs), do: Enum.any?(inputs)
5 |
6 | def address?(type), do: type == "address"
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/common_components_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.CommonComponentsView do
2 | use BlockScoutWeb, :view
3 |
4 | def balance_percentage_enabled? do
5 | Application.get_env(:block_scout_web, :show_percentage)
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/.sobelow-conf:
--------------------------------------------------------------------------------
1 | [
2 | verbose: false,
3 | private: true,
4 | skip: true,
5 | exit: "low",
6 | format: "compact",
7 | ignore: ["Config.HTTPS"],
8 | ignore_files: [
9 | "lib/explorer/smart_contract/solidity/code_compiler.ex"
10 | ]
11 | ]
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_panels.scss:
--------------------------------------------------------------------------------
1 | .panels {
2 | &__container {
3 | padding: 20px;
4 | }
5 | }
6 |
7 | .pagination {
8 | text-align: right;
9 | margin: 10px;
10 | }
11 |
12 | .monospace {
13 | font-family: $font-family-monospace;
14 | }
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190305095926_add_index_to_value_fetched_at.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToValueFetchedAt do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:address_coin_balances, [:value_fetched_at]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/.pairs:
--------------------------------------------------------------------------------
1 | pairs:
2 | cj: CJ Bryan; cj
3 | dr: Doc Ritezel; doc
4 | mo: Matt Olenick; matto
5 | db: Derek Barnes; dgb
6 | rdwb: Desmond Bowe; des
7 |
8 | email:
9 | prefix: pair
10 | domain: ministryofvelocity.com
11 | no_solo_prefix: true
12 |
13 | global: true
14 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss:
--------------------------------------------------------------------------------
1 | /* ERC721 image block */
2 | .erc721-image {
3 | display: flex;
4 | justify-content: center;
5 | }
6 |
7 | .erc721-image img {
8 | height: 150px;
9 | }
10 | /* ERC721 image block end */
11 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_modal_variables.scss:
--------------------------------------------------------------------------------
1 | $modal-overlay-color: rgba($primary, 0.9) !default;
2 | $modal-horizontal-padding: 30px !default;
3 | $modal-vertical-padding: 25px !default;
4 | $modal-border-radius: 10px !default;
5 | $modal-gray-background: #f6f7f9 !default;
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_logs_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressLogsView do
2 | use BlockScoutWeb, :view
3 |
4 | alias Explorer.Chain.Log
5 |
6 | def decode(log, transaction) do
7 | Log.decode(log, transaction)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/inventory_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.InventoryView do
2 | use BlockScoutWeb, :view
3 |
4 | import BlockScoutWeb.Tokens.Instance.OverviewView, only: [image_src: 1]
5 |
6 | alias BlockScoutWeb.Tokens.OverviewView
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/config/test.secret.exs.example:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # Configure your database
4 | config :explorer, Explorer.Repo,
5 | database: "explorer_test",
6 | hostname: "localhost",
7 | pool: Ecto.Adapters.SQL.Sandbox,
8 | port: "5432",
9 | ownership_timeout: 60_000
10 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190827120224_add_index_on_token_transfer_token_id.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexOnTokenTransferTokenId do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create_if_not_exists(index(:token_transfers, [:token_id]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191218120138_logs_block_number_index_index.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.LogsBlockNumberIndexIndex do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create_if_not_exists(index(:logs, ["block_number DESC, index DESC"]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_transaction-input.scss:
--------------------------------------------------------------------------------
1 | .transaction-input-text {
2 | white-space: pre;
3 | color: black;
4 |
5 | pre {
6 | code {
7 | color: black;
8 | }
9 | }
10 | }
11 |
12 | .transaction-input-table {
13 | overflow-x: scroll;
14 | }
15 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/view_specific/raw_trace/code_highlighting.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 | import hljs from 'highlight.js'
3 |
4 | // only activate highlighting on pages with this selector
5 | if ($('[data-activate-highlight]').length > 0) {
6 | hljs.initHighlightingOnLoad()
7 | }
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/remove.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_btn_line.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/repo/prometheus_logger.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.PrometheusLogger do
2 | @moduledoc """
3 | Log `Ecto` query durations as `Prometheus` metrics.
4 | """
5 |
6 | @dialyzer {:no_match, [log: 1, setup: 0]}
7 |
8 | use Prometheus.EctoInstrumenter
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/_layout.scss:
--------------------------------------------------------------------------------
1 | .layout-container {
2 | display: flex;
3 | flex-direction: column;
4 | min-height: 100vh;
5 |
6 | main {
7 | flex-grow: 1;
8 | background-color: #fbfafc;
9 | }
10 | }
11 |
12 | .logs-hash {
13 | line-height: 24px !important;
14 | }
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181206200140_rename_block_rewards_to_emission_rewards.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.RenameBlockRewardsToEmissionRewards do
2 | use Ecto.Migration
3 |
4 | def change do
5 | rename(table(:block_rewards), to: table(:emission_rewards))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190228102650_add_index_created_contract_address_hash.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexCreatedContractAddressHas do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:transactions, [:created_contract_address_hash]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/README.md:
--------------------------------------------------------------------------------
1 | # Javascript structure files
2 |
3 | ## lib
4 |
5 | * This folder is used to place `component` files, that may span in multiple pages.
6 |
7 | ## pages
8 |
9 | * This folder is used to place `page` specific files, that won't be reusable in other locations.
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_goerli_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #2b2b2b;
3 | $secondary: #eac247;
4 | $tertiary: #929292;
5 | $additional-font: #ffffff;
6 | $sub-accent-color: #a46f30;
7 |
8 | $btn-line-color: $sub-accent-color; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/theme/_sokol_variables-non-critical.scss:
--------------------------------------------------------------------------------
1 | // general
2 | $primary: #093731;
3 | $secondary: #40bfb2;
4 | $tertiary: #25c9ff;
5 | $additional-font: #93e8dd;
6 | $sub-accent-color: #1c9f90;
7 |
8 | $btn-line-color: $sub-accent-color; // button border and font color && hover bg color
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190215080049_add_index_on_fetched_coin_balance_to_addresses.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexOnFetchedCoinBalanceToAddresses do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:addresses, [:fetched_coin_balance]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.PageNotFoundController do
2 | use BlockScoutWeb, :controller
3 |
4 | def index(conn, _params) do
5 | conn
6 | |> put_status(:not_found)
7 | |> render("index.html")
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_inventory_token_instance_image_container.scss:
--------------------------------------------------------------------------------
1 | /* ERC721 image block */
2 | .inventory-erc721-image {
3 | display: flex;
4 | justify-content: center;
5 | }
6 |
7 | .inventory-erc721-image img {
8 | height: 50px;
9 | }
10 | /* ERC721 image block end */
11 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/stakes/_modal_stake.scss:
--------------------------------------------------------------------------------
1 | .modal-stake {
2 | max-width: 100%;
3 | width: 460px;
4 |
5 | @include media-breakpoint-down(sm) {
6 | margin-left: auto;
7 | margin-right: auto;
8 | }
9 | }
10 |
11 | .modal-stake-two-cols {
12 | display: flex;
13 | }
14 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/transaction_log_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.TransactionLogView do
2 | use BlockScoutWeb, :view
3 | @dialyzer :no_match
4 |
5 | alias Explorer.Chain.Log
6 |
7 | def decode(log, transaction) do
8 | Log.decode(log, transaction)
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/config/prod.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :ethereum_jsonrpc, EthereumJSONRPC.Tracer, env: "production", disabled?: true
4 |
5 | config :logger, :ethereum_jsonrpc,
6 | level: :info,
7 | path: Path.absname("logs/prod/ethereum_jsonrpc.log"),
8 | rotate: %{max_bytes: 52_428_800, keep: 19}
9 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181213111656_add_metadata_field_to_address_names.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddMetadataFieldToAddressNames do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:address_names) do
6 | add(:metadata, :map)
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190214135850_add_index_on_block_number_to_address_token_balances.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexOnBlockNumberToAddressTokenBalances do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:address_token_balances, [:block_number]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190219082636_add_indexes_for_block_reward_query.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexesForBlockRewardQuery do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:blocks, [:number]))
6 | create(index(:emission_rewards, [:block_range]))
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/dots.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/explorer/config/dev.secret.exs.example:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # Configure your database
4 | config :explorer, Explorer.Repo,
5 | database: "explorer_dev",
6 | hostname: "localhost",
7 | username: "postgres",
8 | password: "",
9 | pool_size: 20,
10 | timeout: 80_000
11 |
--------------------------------------------------------------------------------
/apps/explorer/test/support/fakes/no_op_source.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.ExchangeRates.Source.NoOpSource do
2 | @moduledoc false
3 |
4 | alias Explorer.ExchangeRates.Source
5 |
6 | @behaviour Source
7 |
8 | @impl Source
9 | def format_data(_), do: []
10 |
11 | @impl Source
12 | def source_url, do: ""
13 | end
14 |
--------------------------------------------------------------------------------
/config/dev.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # DO NOT make it `:debug` or all Ecto logs will be shown for indexer
4 | config :logger, :console, level: :info
5 |
6 | config :logger, :ecto,
7 | level: :debug,
8 | path: Path.absname("logs/dev/ecto.log")
9 |
10 | config :logger, :error, path: Path.absname("logs/dev/error.log")
11 |
--------------------------------------------------------------------------------
/bin/deployment/migrate:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | cd /opt/app || exit 1
6 |
7 | export HOME=/home/ec2-user
8 | export MIX_ENV=prod
9 |
10 | source /etc/environment
11 |
12 | export DATABASE_URL
13 | export POOL_SIZE
14 | export ECTO_USE_SSL
15 |
16 | mix ecto.create
17 | mix ecto.migrate
18 |
19 | exit 0
20 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/copy.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181212115448_add_indexes_to_token_transfers.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexesToTokenTransfers do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index("token_transfers", [:from_address_hash]))
6 | create(index("token_transfers", [:to_address_hash]))
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/pages/layout.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $(document).click(function (event) {
4 | var clickover = $(event.target)
5 | var _opened = $('.navbar-collapse').hasClass('show')
6 | if (_opened === true && $('.navbar').find(clickover).length < 1) {
7 | $('.navbar-toggler').click()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/support/ethereum_jsonrpc/web_socket/case.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.WebSocket.Case do
2 | use ExUnit.CaseTemplate
3 |
4 | import EthereumJSONRPC.Case, only: [module: 2]
5 |
6 | setup do
7 | module("ETHEREUM_JSONRPC_WEB_SOCKET_CASE", "EthereumJSONRPC.WebSocket.Case.Mox").setup()
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/docker/README.md:
--------------------------------------------------------------------------------
1 | # BlockScout Docker Integration
2 |
3 | This integration is not production ready, and should be used for local BlockScout deployment only.
4 |
5 | For usage instructions and ENV variables, see the [docker integration documentation](https://docs.blockscout.com/for-developers/information-and-settings/docker-integration-local-use-only).
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181015173318_add_case_insensitive_extension.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddCaseInsensitiveExtension do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute(
6 | "CREATE EXTENSION IF NOT EXISTS citext",
7 | "DROP EXTENSION IF EXISTS citext"
8 | )
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190215093358_add_compound_index_address_token_balances.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddCompoundIndexAddressTokenBalances do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:address_current_token_balances, [:block_number], name: :address_cur_token_balances_index))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191007082500_add_indexes_for_token_instances_query.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexesForTokenInstrancesQuery do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create_if_not_exists(index(:token_instances, [:token_id]))
6 | create_if_not_exists(index(:tokens, [:type]))
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/pretty_json.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | function prettyPrint (element) {
4 | const jsonString = element.dataset.json
5 | const pretty = JSON.stringify(JSON.parse(jsonString), undefined, 2)
6 | element.innerHTML = pretty
7 | }
8 |
9 | $('[data-json]').each((_index, element) => prettyPrint(element))
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/cldr.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Cldr do
2 | @moduledoc """
3 | Cldr global configuration.
4 | """
5 |
6 | use Cldr,
7 | default_locale: "en",
8 | locales: ["en"],
9 | gettext: BlockScoutWeb.Gettext,
10 | generate_docs: false,
11 | providers: [Cldr.Number, Cldr.Unit]
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/schema.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Schema do
2 | @moduledoc "Common configuration for Explorer schemas."
3 |
4 | defmacro __using__(_opts) do
5 | quote do
6 | use Ecto.Schema
7 |
8 | import Ecto.{Changeset, Query}
9 |
10 | @timestamps_opts [type: :utc_datetime_usec]
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190910170703_create_indexes_for_block_number_in_token_transfers_and_transactions.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateIndexesForBlockNumberInTokenTransfersAndTransactions do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create_if_not_exists(index(:token_transfers, [:block_number]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/indexer/lib/indexer/transform/blocks/base.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Transform.Blocks.Base do
2 | @moduledoc """
3 | Default block transformer to be used.
4 | """
5 |
6 | alias Indexer.Transform.Blocks
7 |
8 | @behaviour Blocks
9 |
10 | @impl Blocks
11 | def transform(block) when is_map(block) do
12 | block
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/stakes/_copy_icon.scss:
--------------------------------------------------------------------------------
1 | $copy-icon-color: $primary !default;
2 |
3 | .copy-icon {
4 | cursor: pointer;
5 | height: 18px;
6 | width: 18px;
7 |
8 | svg {
9 | display: block;
10 | height: 100%;
11 | width: 100%;
12 | }
13 |
14 | path {
15 | fill: $copy-icon-color;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_test_network_icon.html.eex:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191010075740_add_error_to_token_instances.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddErrorToTokenInstances do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:token_instances) do
6 | add(:error, :string)
7 | end
8 |
9 | create(index(:token_instances, [:error]))
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_alerts.scss:
--------------------------------------------------------------------------------
1 | $alert-danger-background-color: #fff3f7 !default;
2 | $alert-danger-border-color: #fff3f7 !default;
3 | $alert-danger-color: #ff7986 !default;
4 |
5 | .alert-danger {
6 | background-color: $alert-danger-background-color;
7 | border-color: $alert-danger-border-color;
8 | color: $alert-danger-color;
9 | }
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_no_border.scss:
--------------------------------------------------------------------------------
1 | $btn-no-border-bg: #fff !default;
2 | $btn-no-border-color: $primary !default;
3 |
4 | .btn-no-border {
5 | @include btn-line($btn-no-border-bg, $btn-no-border-color);
6 |
7 | border-color: $btn-no-border-bg;
8 |
9 | &:hover {
10 | border-color: $btn-no-border-color;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_accounts_icon.html.eex:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190213180502_add_earliest_processing_start_to_transactions.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddEarliestProcessingStartToTransactions do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:transactions) do
6 | add(:earliest_processing_start, :utc_datetime_usec)
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190807113117_create_suggested_indexes.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateSuggestedIndexes do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create_if_not_exists(index(:address_token_balances, [:block_number, :address_hash]))
6 | create_if_not_exists(index(:block_rewards, [:block_hash]))
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_token_transfer_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressTokenTransferView do
2 | use BlockScoutWeb, :view
3 |
4 | def format_current_filter(filter) do
5 | case filter do
6 | "to" -> gettext("To")
7 | "from" -> gettext("From")
8 | _ -> gettext("All")
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/tokens/instance/metadata_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Tokens.Instance.MetadataView do
2 | use BlockScoutWeb, :view
3 |
4 | alias BlockScoutWeb.Tokens.Instance.OverviewView
5 |
6 | def format_metadata(nil), do: ""
7 |
8 | def format_metadata(metadata), do: Poison.encode!(metadata, pretty: true)
9 | end
10 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190208113202_add_unique_index_to_rewards.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddUniqueIndexToRewards do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(
6 | unique_index(
7 | :block_rewards,
8 | [:address_hash, :block_hash, :address_type]
9 | )
10 | )
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190421143300_add_index_to_bsdr.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToBsdr do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:block_second_degree_relations) do
6 | # Null for old relations without fetched index
7 | add(:index, :integer, null: true)
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/chain/smart_contract/external_library.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.SmartContract.ExternalLibrary do
2 | @moduledoc """
3 | The representation of an external library that was used for a smart contract.
4 | """
5 |
6 | use Ecto.Schema
7 |
8 | embedded_schema do
9 | field(:name)
10 | field(:address_hash)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191009121635_add_token_transfer_sorting_indexes.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddTokenTransferSortingIndexes do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(
6 | index(
7 | :token_transfers,
8 | ["block_number DESC", "log_index DESC"]
9 | )
10 | )
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressInternalTransactionView do
2 | use BlockScoutWeb, :view
3 |
4 | def format_current_filter(filter) do
5 | case filter do
6 | "to" -> gettext("To")
7 | "from" -> gettext("From")
8 | _ -> gettext("All")
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/block/catchup_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Block.Catchup.Supervisor.Case do
2 | alias Indexer.Block.Catchup
3 |
4 | def start_supervised!(fetcher_arguments) when is_map(fetcher_arguments) do
5 | [fetcher_arguments]
6 | |> Catchup.Supervisor.child_spec()
7 | |> ExUnit.Callbacks.start_supervised!()
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_address_card.scss:
--------------------------------------------------------------------------------
1 | $btn-address-card-icon-color: $primary !default;
2 | $btn-address-card-icon-dimensions: 31px !default;
3 |
4 | .btn-address-card-icon {
5 | @include square-icon-button($btn-address-card-icon-color, $btn-address-card-icon-dimensions);
6 |
7 | svg {
8 | height: 10px;
9 | width: 20px;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/api/v1/supply_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.API.V1.SupplyView do
2 | use BlockScoutWeb, :view
3 |
4 | def render("supply.json", %{total: total_supply, circulating: circulating_supply}) do
5 | %{
6 | "total_supply" => total_supply,
7 | "circulating_supply" => circulating_supply
8 | }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190114204640_add_tokens_holder_count.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddTokensHolderCount do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:tokens) do
6 | # `NULL` so it can be filled in in the background while upgrading
7 | add(:holder_count, :integer, null: true)
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/explorer/config/test/geth.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :explorer,
4 | json_rpc_named_arguments: [
5 | transport: EthereumJSONRPC.Mox,
6 | transport_options: [],
7 | variant: EthereumJSONRPC.Geth
8 | ],
9 | subscribe_named_arguments: [
10 | transport: EthereumJSONRPC.Mox,
11 | transport_options: [],
12 | variant: EthereumJSONRPC.Geth
13 | ]
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/scripts/20190326202921_lose_consensus_for_invalid_blocks.sql:
--------------------------------------------------------------------------------
1 | UPDATE blocks SET consensus = FALSE, updated_at = NOW()
2 | WHERE consensus AND number IN (
3 | SELECT b0.number - 1 FROM "blocks" AS b0
4 | LEFT JOIN "blocks" AS b1 ON (b0."parent_hash" = b1."hash") AND b1."consensus"
5 | WHERE b0."number" > 0 AND b0."consensus" AND b1."hash" IS NULL
6 | );
7 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/transaction_input_dropdown.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $('.tx-input-dropdown').click(function (e) {
4 | e.preventDefault()
5 |
6 | var el = $(e.currentTarget)
7 | var target = $(el.attr('data-target'))
8 |
9 | target.show()
10 | target.siblings('.transaction-input').hide()
11 | $('#tx-input-decoding-button').text(el.text())
12 | })
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_module_item.html.eex:
--------------------------------------------------------------------------------
1 |
2 | <%= "#{String.capitalize(@module.name)}" %>
3 | ?module=<%= @module.name %>
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/controllers/page_not_found_controller_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.PageNotFoundControllerTest do
2 | use BlockScoutWeb.ConnCase
3 |
4 | describe "GET index/2" do
5 | test "returns 404 status", %{conn: conn} do
6 | conn = get(conn, "/wrong", %{})
7 |
8 | assert html_response(conn, 404)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190124082812_add_index_on_transaction_nonce_and_from_address_hash.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexOnTransactionNonceAndFromAddressHash do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:transactions, [:nonce, :from_address_hash, :block_hash]))
6 | create(index(:transactions, [:block_hash, :error]))
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/view_specific/address_contract/code_highlighting.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 | import hljs from 'highlight.js'
3 | import hljsDefineSolidity from 'highlightjs-solidity'
4 |
5 | // only activate highlighting on pages with this selector
6 | if ($('[data-activate-highlight]').length > 0) {
7 | hljsDefineSolidity(hljs)
8 | hljs.initHighlightingOnLoad()
9 | }
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/check-1.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/controllers/common_components_controller.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.CommonComponentsController do
2 | use BlockScoutWeb, :controller
3 |
4 | def index(conn, params) do
5 | []
6 | |> handle_render(conn, params)
7 | end
8 |
9 | defp handle_render(_full_options, conn, _params) do
10 | render(conn, "index.html")
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/config/test/ganache.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :explorer,
4 | json_rpc_named_arguments: [
5 | transport: EthereumJSONRPC.Mox,
6 | transport_options: [],
7 | variant: EthereumJSONRPC.Ganache
8 | ],
9 | subscribe_named_arguments: [
10 | transport: EthereumJSONRPC.Mox,
11 | transport_options: [],
12 | variant: EthereumJSONRPC.Ganache
13 | ]
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190513134025_add_refetch_needed_to_block.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddRefetchNeededToBlock do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:blocks) do
6 | add(:refetch_needed, :boolean, default: false)
7 | end
8 |
9 | execute("UPDATE blocks SET refetch_needed = TRUE WHERE consensus", "")
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191208135613_block_rewards_block_hash_partial_index.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.BlockRewardsBlockHashPartialIndex do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute(
6 | "CREATE INDEX IF NOT EXISTS block_rewards_block_hash_partial_index on block_rewards(block_hash) WHERE address_type='validator';"
7 | )
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressTransactionView do
2 | use BlockScoutWeb, :view
3 |
4 | alias Explorer.Chain.{Address}
5 |
6 | def format_current_filter(filter) do
7 | case filter do
8 | "to" -> gettext("To")
9 | "from" -> gettext("From")
10 | _ -> gettext("All")
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/lukso-l14-testnet.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/resolvers/block.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Resolvers.Block do
2 | @moduledoc false
3 |
4 | alias Explorer.Chain
5 |
6 | def get_by(_, %{number: number}, _) do
7 | case Chain.number_to_block(number) do
8 | {:ok, _} = result -> result
9 | {:error, :not_found} -> {:error, "Block number #{number} was not found."}
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_i_tooltip.scss:
--------------------------------------------------------------------------------
1 | $i-tooltip-background: #a3a9b5 !default;
2 | $i-tooltip-background-active: $primary !default;
3 |
4 | .i-tooltip {
5 | display: block;
6 | height: 16px;
7 | width: 16px;
8 |
9 | path {
10 | fill: $i-tooltip-background;
11 | }
12 |
13 | &:hover {
14 | path {
15 | fill: $i-tooltip-background-active;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_table.scss:
--------------------------------------------------------------------------------
1 | .table-font {
2 | thead th,
3 | td,
4 | th {
5 | border-top: none;
6 | border-bottom: none;
7 | }
8 |
9 | i {
10 | color: $gray-500;
11 | }
12 |
13 | img {
14 | width: 12px;
15 | }
16 | }
17 |
18 | .table-horizontal {
19 | th {
20 | width: 35%;
21 | }
22 | }
23 |
24 | .address-cell {
25 | width: 150px;
26 | }
27 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180919175123_alter_token_decimals_to_bigint.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AlterTokenDecimalsToBigint do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table("tokens") do
6 | modify(:decimals, :bigint)
7 | end
8 | end
9 |
10 | def down do
11 | alter table("tokens") do
12 | modify(:decimals, :smallint)
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/config/prod.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # Do not print debug messages in production
4 |
5 | config :logger, :console, level: :info
6 |
7 | config :logger, :ecto,
8 | level: :info,
9 | path: Path.absname("logs/prod/ecto.log"),
10 | rotate: %{max_bytes: 52_428_800, keep: 19}
11 |
12 | config :logger, :error,
13 | path: Path.absname("logs/prod/error.log"),
14 | rotate: %{max_bytes: 52_428_800, keep: 19}
15 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/pages/dark-mode-switcher.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | $('.dark-mode-changer').click(function () {
4 | if (localStorage.getItem('current-color-mode') === 'dark') {
5 | localStorage.setItem('current-color-mode', 'light')
6 | } else {
7 | localStorage.setItem('current-color-mode', 'dark')
8 | }
9 | // reload each theme switch
10 | document.location.reload(true)
11 | })
12 |
--------------------------------------------------------------------------------
/apps/explorer/config/test/rsk.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :explorer,
4 | transport: EthereumJSONRPC.HTTP,
5 | json_rpc_named_arguments: [
6 | transport: EthereumJSONRPC.Mox,
7 | transport_options: [],
8 | variant: EthereumJSONRPC.RSK
9 | ],
10 | subscribe_named_arguments: [
11 | transport: EthereumJSONRPC.Mox,
12 | transport_options: [],
13 | variant: EthereumJSONRPC.RSK
14 | ]
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180424203101_create_market_history.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateMarketHistory do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:market_history) do
6 | add(:date, :date)
7 | add(:closing_price, :decimal)
8 | add(:opening_price, :decimal)
9 | end
10 |
11 | create(unique_index(:market_history, :date))
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/seeds.exs:
--------------------------------------------------------------------------------
1 | # Script for populating the database. You can run it as:
2 | #
3 | # mix run priv/repo/seeds.exs
4 | #
5 | # Inside the script, you can read and write to any of your
6 | # repositories directly:
7 | #
8 | # Explorer.Repo.insert!(%Explorer.SomeSchema{})
9 | #
10 | # We recommend using the bang functions (`insert!`, `update!`
11 | # and so on) as they will fail if something goes wrong.
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_block_icon.html.eex:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_search_icon.html.eex:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/explorer/config/test/parity.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | config :explorer,
4 | transport: EthereumJSONRPC.HTTP,
5 | json_rpc_named_arguments: [
6 | transport: EthereumJSONRPC.Mox,
7 | transport_options: [],
8 | variant: EthereumJSONRPC.Parity
9 | ],
10 | subscribe_named_arguments: [
11 | transport: EthereumJSONRPC.Mox,
12 | transport_options: [],
13 | variant: EthereumJSONRPC.Parity
14 | ]
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190102141900_index_current_token_holders.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.IndexCurrentTokenHolders do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(
6 | index(:address_current_token_balances, [:token_contract_address_hash],
7 | where: "address_hash != '\\x0000000000000000000000000000000000000000' AND value > 0"
8 | )
9 | )
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190424170833_change_block_size_to_nullable.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.ChangeBlockSizeToNullable do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table(:blocks) do
6 | modify(:size, :integer, null: true)
7 | end
8 | end
9 |
10 | def down do
11 | alter table(:blocks) do
12 | modify(:size, :integer, null: false)
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190625085852_add_additional_contract_fields.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddAdditionalContractFields do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:smart_contracts) do
6 | add(:optimization_runs, :integer, null: true)
7 | add(:evm_version, :string, null: true)
8 | add(:external_libraries, :jsonb, null: true)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/bin/deployment/health_check:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 | # Timeout after 2 min if we still haven't gotten a response
5 | timeout 120s bash </dev/null; then
10 | exit 0
11 | fi
12 | done
13 | }
14 |
15 | ping_server
16 | EOT
17 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/address/_link.html.eex:
--------------------------------------------------------------------------------
1 | <%= if @address do %>
2 | <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @address), "data-test": "address_hash_link", class: assigns[:class] do %>
3 | <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address: @address, contract: @contract, truncate: assigns[:truncate], use_custom_tooltip: @use_custom_tooltip %>
4 | <% end %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191220113006_pending_block_operations_block_hash_partial_index.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.PendingBlockOperationsBlockHashPartialIndex do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute(
6 | "CREATE INDEX pending_block_operations_block_hash_index_partial ON pending_block_operations(block_hash) WHERE fetch_internal_transactions=true;"
7 | )
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/supply_controller.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.API.V1.SupplyController do
2 | use BlockScoutWeb, :controller
3 |
4 | alias Explorer.Chain
5 |
6 | def supply(conn, _) do
7 | total_supply = Chain.total_supply()
8 | circulating_supply = Chain.circulating_supply()
9 |
10 | render(conn, :supply, total: total_supply, circulating: circulating_supply)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/chain/gas.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Gas do
2 | @moduledoc """
3 | A measurement roughly equivalent to computational steps. Every operation has a gas expenditure; for most operations
4 | it is ~3-10, although some expensive operations have expenditures up to 700 and a transaction itself has an
5 | expenditure of 21000.
6 | """
7 |
8 | @typedoc @moduledoc
9 | @type t :: non_neg_integer()
10 | end
11 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190228220746_add_internal_transactions_indexed_at_to_blocks.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddInternalTransactionsIndexedAtToBlocks do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:blocks) do
6 | # `null` when `internal_transactions` has never been fetched
7 | add(:internal_transactions_indexed_at, :utc_datetime_usec, null: true)
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/__tests__/pages/transaction.js:
--------------------------------------------------------------------------------
1 | import { reducer, initialState } from '../../js/pages/transaction'
2 |
3 | test('RECEIVED_NEW_BLOCK', () => {
4 | const state = { ...initialState, blockNumber: 1 }
5 | const action = {
6 | type: 'RECEIVED_NEW_BLOCK',
7 | msg: {
8 | blockNumber: 5
9 | }
10 | }
11 | const output = reducer(state, action)
12 |
13 | expect(output.confirmations).toBe(4)
14 | })
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190208143201_add_index_on_address_hash_block_number_and_token_contract_address_hash_for_current_token_balance.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexOnAddressHashBlockNumberAndTokenContractAddressHashForCurrentTokenBalance do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(index(:address_current_token_balances, [:address_hash, :block_number, :token_contract_address_hash]))
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-classic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "repository": {
3 | "type": "git",
4 | "url": "git+https://github.com/poanetwork/blockscout.git"
5 | },
6 | "private": true,
7 | "name": "blockscout",
8 | "author": "POA Network",
9 | "license": "GPL-3.0",
10 | "engines": {
11 | "node": "12.x",
12 | "npm": "6.x"
13 | },
14 | "scripts": {},
15 | "dependencies": {
16 | "keccak": "^2.0.0",
17 | "solc": "^0.6.1"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180508183700_create_users.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateUsers do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:users) do
6 | add(:username, :string, null: false)
7 | add(:password_hash, :string, null: false)
8 |
9 | timestamps()
10 | end
11 |
12 | create(index(:users, ["lower(username)"], unique: true, name: :unique_username))
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190215105501_add_constructor_arguments_to_smart_contracts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddConstructorArgumentsToSmartContracts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute("ALTER TABLE smart_contracts DROP COLUMN IF EXISTS constructor_arguments")
6 |
7 | alter table(:smart_contracts) do
8 | add(:constructor_arguments, :string, null: true)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/stake.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190709103104_add_external_libraries_to_smart_contracts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddExternalLibrariesToSmartContracts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:smart_contracts) do
6 | remove(:external_libraries)
7 | end
8 |
9 | alter table(:smart_contracts) do
10 | add(:external_libraries, {:array, :map}, default: [])
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/bin/deployment/build:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | cd /opt/app || exit 1
6 |
7 | export HOME=/home/ec2-user
8 | export MIX_ENV=prod
9 |
10 | source /etc/environment
11 |
12 | mix local.rebar --force
13 | mix local.hex --force
14 |
15 | mix deps.get
16 |
17 | mix compile
18 |
19 | # Install node dependencies
20 | pushd apps/explorer || exit 1
21 | npm install
22 | popd
23 |
24 | chown -R ec2-user:ec2-user /opt/app
25 |
26 | exit 0
27 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/plug/allow_iframe.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Plug.AllowIframe do
2 | @moduledoc """
3 | Allows for iframes by deleting the
4 | [`X-Frame-Options` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options)
5 | """
6 |
7 | alias Plug.Conn
8 |
9 | def init(opts), do: opts
10 |
11 | def call(conn, _opts) do
12 | Conn.delete_resp_header(conn, "x-frame-options")
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180522154253_create_block_rewards.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateBlockRewards do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:block_rewards, primary_key: false) do
6 | add(:block_range, :int8range)
7 | add(:reward, :decimal)
8 | end
9 |
10 | create(constraint(:block_rewards, :no_overlapping_ranges, exclude: ~s|gist (block_range WITH &&)|))
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.ChangeTransactionsVColumnType do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table(:transactions) do
6 | modify(:v, :numeric, precision: 100, null: false)
7 | end
8 | end
9 |
10 | def down do
11 | alter table(:transactions) do
12 | modify(:v, :integer, null: false)
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191128124415_remove_duplicate_indexes_token_entities.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.RemoveDuplicateIndexesTokenEntities do
2 | use Ecto.Migration
3 |
4 | def change do
5 | drop_if_exists(index(:address_token_balances, [:block_number], name: "address_token_balances_block_number_index"))
6 |
7 | drop_if_exists(index(:token_instances, [:token_id], name: "token_instances_token_id_index"))
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.TransactionTest do
2 | use ExUnit.Case, async: true
3 |
4 | doctest EthereumJSONRPC.Transaction
5 |
6 | alias EthereumJSONRPC.Transaction
7 |
8 | describe "to_elixir/1" do
9 | test "skips unsupported keys" do
10 | map = %{"key" => "value", "key1" => "value1"}
11 |
12 | assert %{nil: nil} = Transaction.to_elixir(map)
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190118040301_create_tokens_primary_key.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateTokensPrimaryKey do
2 | use Ecto.Migration
3 |
4 | def up do
5 | # Don't use `modify` as it requires restating the whole column description
6 | execute("ALTER TABLE tokens ADD PRIMARY KEY (contract_address_hash)")
7 | end
8 |
9 | def down do
10 | execute("ALTER TABLE tokens DROP CONSTRAINT tokens_pkey")
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190228152333_change_constructor_arguments_to_text.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.ChangeConstructorArgumentsToText do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table(:smart_contracts) do
6 | modify(:constructor_arguments, :text)
7 | end
8 | end
9 |
10 | def down do
11 | alter table(:smart_contracts) do
12 | modify(:constructor_arguments, :string)
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190321185644_add_old_value_for_current_token_balances.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddOldValueForCurrentTokenBalances do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:address_current_token_balances) do
6 | # A transient field for deriving token holder count deltas during address_current_token_balances upserts
7 | add(:old_value, :decimal, null: true)
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_highlight.scss:
--------------------------------------------------------------------------------
1 | //replace the default background color from highlightjs
2 | .hljs {
3 | background: $gray-100;
4 | }
5 |
6 | .line-numbers {
7 | [data-line-number] {
8 | &:before {
9 | content: attr(data-line-number);
10 | display: inline-block;
11 | border-right: 1px solid $gray-400;
12 | padding: 0 0.5em;
13 | margin-right: 0.5em;
14 | color: $gray-600;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_progress_from_to.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
<%= @from %>
4 |
<%= @to %>
5 |
6 |
9 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/form/text_field.html.eex:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_apps_icon.html.eex:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer do
2 | @moduledoc """
3 | Explorer keeps the contexts that define your domain
4 | and business logic.
5 |
6 | Contexts are also responsible for managing your data, regardless
7 | if it comes from the database, an external API or others.
8 | """
9 |
10 | @doc """
11 | Returns the configured coin for `Explorer`
12 | """
13 | def coin do
14 | Application.get_env(:explorer, :coin)
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/known_tokens/source/my_ether_wallet.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.KnownTokens.Source.MyEtherWallet do
2 | @moduledoc """
3 | Adapter for fetching known tokens from MyEtherWallet's GitHub
4 | """
5 |
6 | alias Explorer.KnownTokens.Source
7 |
8 | @behaviour Source
9 |
10 | @impl Source
11 | def source_url do
12 | "https://raw.githubusercontent.com/kvhnuke/etherwallet/mercury/app/scripts/tokens/ethTokens.json"
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190325081658_remove_unique_address_hash_decompiled_contracts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.RemoveUniqueAddressHashDecompiledContracts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | drop(index(:decompiled_smart_contracts, [:address_hash]))
6 |
7 | create(
8 | unique_index(:decompiled_smart_contracts, [:address_hash, :decompiler_version], name: :address_decompiler_version)
9 | )
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_metatags.html.eex:
--------------------------------------------------------------------------------
1 |
2 | <%= gettext "API for the %{subnetwork} - BlockScout", subnetwork: LayoutView.subnetwork_title() %>
3 |
4 | ">
5 |
6 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block/by_hash.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Block.ByHash do
2 | @moduledoc """
3 | Block format as returned by [`eth_getBlockByHash`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash)
4 | """
5 |
6 | @include_transactions true
7 |
8 | def request(%{id: id, hash: hash}) do
9 | EthereumJSONRPC.request(%{id: id, method: "eth_getBlockByHash", params: [hash, @include_transactions]})
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181126203826_add_index_to_addresses.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToAddresses do
2 | use Ecto.Migration
3 |
4 | def up do
5 | execute(
6 | "CREATE INDEX addresses_fetched_coin_balance_hash_index ON addresses (fetched_coin_balance DESC, hash ASC) WHERE fetched_coin_balance > 0"
7 | )
8 | end
9 |
10 | def down do
11 | execute("DROP INDEX addresses_fetched_coin_balance_hash_index")
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/api/rpc/eth_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.API.RPC.EthView do
2 | use BlockScoutWeb, :view
3 |
4 | alias BlockScoutWeb.API.RPC.EthRPCView
5 |
6 | def render("responses.json", %{responses: responses}) do
7 | EthRPCView.render("responses.json", %{responses: responses})
8 | end
9 |
10 | def render("response.json", %{response: response}) do
11 | EthRPCView.render("response.json", %{response: response})
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181221145054_add_contract_methods.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddContractMethods do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:contract_methods) do
6 | add(:identifier, :integer, null: false)
7 | add(:abi, :map, null: false)
8 | add(:type, :string, null: false)
9 |
10 | timestamps()
11 | end
12 |
13 | create(unique_index(:contract_methods, [:identifier, :abi]))
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/paging_options.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.PagingOptions do
2 | @moduledoc """
3 | Defines paging options for paging by a stable key such as a timestamp or block
4 | number and index.
5 | """
6 |
7 | @type t :: %__MODULE__{key: key, page_size: page_size, page_number: page_number}
8 |
9 | @typep key :: any()
10 | @typep page_size :: non_neg_integer()
11 | @typep page_number :: pos_integer()
12 |
13 | defstruct [:key, :page_size, page_number: 1]
14 | end
15 |
--------------------------------------------------------------------------------
/apps/indexer/lib/indexer/transform/blocks/clique.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Transform.Blocks.Clique do
2 | @moduledoc """
3 | Handles block transforms for Clique chain.
4 | """
5 |
6 | alias Indexer.Transform.Blocks
7 |
8 | @behaviour Blocks
9 |
10 | @impl Blocks
11 | def transform(%{number: 0} = block), do: block
12 |
13 | def transform(block) when is_map(block) do
14 | miner_address = Blocks.signer(block)
15 |
16 | %{block | miner_hash: miner_address}
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/config/test.exs:
--------------------------------------------------------------------------------
1 | use Mix.Config
2 |
3 | # Print only warnings and errors during test
4 |
5 | config :logger, :console, level: :warn
6 |
7 | config :logger, :ecto,
8 | level: :warn,
9 | path: Path.absname("logs/test/ecto.log")
10 |
11 | config :logger, :error, path: Path.absname("logs/test/error.log")
12 |
13 | config :explorer, Explorer.ExchangeRates,
14 | source: Explorer.ExchangeRates.Source.NoOpSource,
15 | store: :none
16 |
17 | config :explorer, Explorer.KnownTokens, store: :none
18 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/rsk.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.RSK do
2 | @moduledoc """
3 | Ethereum JSONRPC methods that are/are not supported by [RSK](https://www.rsk.co/).
4 | """
5 |
6 | @behaviour EthereumJSONRPC.Variant
7 |
8 | def fetch_internal_transactions(_, _), do: :ignore
9 | def fetch_pending_transactions(_), do: :ignore
10 | def fetch_block_internal_transactions(_block_numbers, _json_rpc_named_arguments), do: :ignore
11 | def fetch_beneficiaries(_, _), do: :ignore
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_address_link.scss:
--------------------------------------------------------------------------------
1 | .address-link {
2 | &__font {
3 | font-family: $font-family-monospace;
4 | }
5 |
6 | &__type {
7 | padding: 0 3px;
8 | }
9 |
10 | &__seperator {
11 | margin: 0 2px;
12 | }
13 |
14 | &__copy-button {
15 | background-color: $gray-100;
16 | appearance: none;
17 | border-color: transparent transparent transparent $border-color;
18 |
19 | i {
20 | color: $gray-500 !important;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/withdraw.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/chain/_metatags.html.eex:
--------------------------------------------------------------------------------
1 |
2 | <%= gettext("%{subnetwork} %{network} Explorer", subnetwork: LayoutView.subnetwork_title(), network: LayoutView.network_title()) %>
3 |
4 | ">
5 |
6 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/logger.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Logger do
2 | @moduledoc """
3 | Helpers for `Logger`.
4 | """
5 |
6 | @doc """
7 | Sets `keyword` in `Logger.metadata/1` around `fun`.
8 | """
9 | def metadata(fun, keyword) when is_function(fun, 0) and is_list(keyword) do
10 | metadata_before = Logger.metadata()
11 |
12 | try do
13 | Logger.metadata(keyword)
14 | fun.()
15 | after
16 | Logger.reset_metadata(metadata_before)
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/pirl_logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/plug/graphql.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Plug.GraphQL do
2 | @moduledoc """
3 | Default query for GraphiQL interface.
4 | """
5 | @default_transaction_hash "0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f"
6 |
7 | def default_query do
8 | transaction_hash = System.get_env("GRAPHIQL_TRANSACTION") || @default_transaction_hash
9 |
10 | "{transaction(hash: \"#{transaction_hash}\") { hash, blockNumber, value, gasUsed }}"
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_btn_add_line.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | *Describe your issue here.*
2 |
3 | ### Environment
4 |
5 | * Elixir & Erlang/OTP versions (`elixir -version`):
6 | * Operating System:
7 | * Blockscout Version/branch:
8 |
9 | ### Steps to reproduce
10 |
11 | *Tell us how to reproduce this issue. ❤️ if you can push up a branch to your fork with a regression test we can run to reproduce locally.*
12 |
13 | ### Expected behaviour
14 |
15 | *Tell us what should happen.*
16 |
17 | ### Actual behaviour
18 |
19 | *Tell us what happens instead.*
20 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_api_icon.html.eex:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_function_response.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 | [ <%= @function_name %> method Response ]
4 |
5 | [<%= for item <- @outputs do %>
6 | <%= if named_argument?(item) do %><%= item["name"] %>
7 | <% end %>
8 | (<%= item["type"] %>) : <%= values(item["value"], item["type"]) %><% end %>]
9 |
10 |
11 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block/by_number.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Block.ByNumber do
2 | @moduledoc """
3 | Block format as returned by [`eth_getBlockByNumber`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash)
4 | """
5 |
6 | import EthereumJSONRPC, only: [integer_to_quantity: 1]
7 |
8 | def request(%{id: id, number: number}) do
9 | EthereumJSONRPC.request(%{id: id, method: "eth_getBlockByNumber", params: [integer_to_quantity(number), true]})
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190403080447_add_full_text_search_tokens.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddFullTextSearchTokens do
2 | use Ecto.Migration
3 |
4 | def up do
5 | execute("CREATE EXTENSION pg_trgm")
6 |
7 | execute("""
8 | CREATE INDEX tokens_trgm_idx ON tokens USING GIN (to_tsvector('english', symbol || ' ' || name))
9 | """)
10 | end
11 |
12 | def down do
13 | execute("DROP INDEX tokens_trgm_idx")
14 | execute("DROP EXTENSION pg_trgm")
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-mainnet.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/tokens/overview/_metatags.html.eex:
--------------------------------------------------------------------------------
1 |
2 | <%= "#{token_name(@token)} (#{token_symbol(@token)}) - #{LayoutView.subnetwork_title()} - BlockScout" %>
3 |
4 |
5 | ">
6 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/features/pages/app_page.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AppPage do
2 | @moduledoc false
3 |
4 | use Wallaby.DSL
5 |
6 | import Wallaby.Query, only: [css: 1, css: 2]
7 |
8 | def visit_page(session) do
9 | visit(session, "/")
10 | end
11 |
12 | def indexed_status(text) do
13 | css("[data-selector='indexed-status'] [data-indexed-ratio]", text: text)
14 | end
15 |
16 | def still_indexing?() do
17 | css("[data-selector='indexed-status']")
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/support/ethereum_jsonrpc/case/geth/mox.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Case.Geth.Mox do
2 | @moduledoc """
3 | `EthereumJSONRPC.Case` for mocking connecting to Geth using `Mox`
4 | """
5 |
6 | def setup do
7 | %{
8 | block_interval: 500,
9 | json_rpc_named_arguments: [transport: EthereumJSONRPC.Mox, transport_options: [], variant: EthereumJSONRPC.Geth],
10 | subscribe_named_arguments: [transport: EthereumJSONRPC.Mox, transport_options: []]
11 | }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_btn_add_full.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190116082843_add_created_contract_indexed_at_to_transactions.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddCreatedContractIndexedAtToTransactions do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:transactions) do
6 | # `null` when `created_contract_code` has never been fetched
7 | add(:created_contract_code_indexed_at, :utc_datetime_usec, null: true)
8 | end
9 |
10 | create(index(:transactions, [:created_contract_code_indexed_at]))
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/phoenix/param/explorer/chain/block_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Phoenix.Param.Explorer.Chain.BlockTest do
2 | use ExUnit.Case
3 |
4 | import Explorer.Factory
5 |
6 | test "without consensus" do
7 | block = build(:block, consensus: false)
8 |
9 | assert Phoenix.Param.to_param(block) == to_string(block.hash)
10 | end
11 |
12 | test "with consensus" do
13 | block = build(:block, consensus: true)
14 |
15 | assert Phoenix.Param.to_param(block) == to_string(block.number)
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/test/support/ethereum_jsonrpc/case/parity/mox.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Case.Parity.Mox do
2 | @moduledoc """
3 | `EthereumJSONRPC.Case` for mocking connecting to Parity using `Mox`
4 | """
5 |
6 | def setup do
7 | %{
8 | block_interval: 500,
9 | json_rpc_named_arguments: [transport: EthereumJSONRPC.Mox, transport_options: [], variant: EthereumJSONRPC.Parity],
10 | subscribe_named_arguments: [transport: EthereumJSONRPC.Mox, transport_options: []]
11 | }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181011193212_add_fields_to_internal_transactions.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddFieldsToInternalTransactions do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table("internal_transactions") do
6 | add(:block_number, :integer)
7 | add(:transaction_index, :integer)
8 | end
9 | end
10 |
11 | def down do
12 | alter table("internal_transactions") do
13 | remove(:block_number)
14 | remove(:transaction_index)
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/stakes/_stakes_btn_remove_pool.scss:
--------------------------------------------------------------------------------
1 | $stakes-btn-remove-pool-color: $primary !default;
2 |
3 | .stakes-btn-remove-pool {
4 | align-items: center;
5 | color: $stakes-btn-remove-pool-color;
6 | cursor: pointer;
7 | display: flex;
8 | font-size: 12px;
9 | font-weight: 600;
10 | height: 36px;
11 | justify-content: center;
12 | text-align: center;
13 |
14 | svg {
15 | margin-right: 10px;
16 | }
17 |
18 | path {
19 | fill: $stakes-btn-remove-pool-color;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/clipboard_buttons.js:
--------------------------------------------------------------------------------
1 | import ClipboardJS from 'clipboard'
2 | import $ from 'jquery'
3 |
4 | const clipboard = new ClipboardJS('[data-clipboard-text]')
5 |
6 | clipboard.on('success', ({ trigger }) => {
7 | const copyButton = $(trigger)
8 | copyButton.tooltip('dispose')
9 |
10 | copyButton.tooltip({
11 | title: 'Copied!',
12 | trigger: 'click',
13 | placement: 'top'
14 | }).tooltip('show')
15 |
16 | setTimeout(() => {
17 | copyButton.tooltip('dispose')
18 | }, 1000)
19 | })
20 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20191018120546_create_pending_block_operations.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreatePendingBlockOperations do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:pending_block_operations, primary_key: false) do
6 | add(:block_hash, references(:blocks, column: :hash, type: :bytea, on_delete: :delete_all),
7 | null: false,
8 | primary_key: true
9 | )
10 |
11 | timestamps(null: false, type: :utc_datetime_usec)
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/appspec.yml:
--------------------------------------------------------------------------------
1 | version: 0.0
2 | os: linux
3 | files:
4 | - source: .
5 | destination: /opt/app
6 | hooks:
7 | ApplicationStop:
8 | - location: bin/deployment/stop
9 | timeout: 300
10 | AfterInstall:
11 | - location: bin/deployment/build
12 | ApplicationStart:
13 | - location: bin/deployment/migrate
14 | runas: ec2-user
15 | timeout: 300
16 | - location: bin/deployment/start
17 | timeout: 3600
18 | ValidateService:
19 | - location: bin/deployment/health_check
20 | timeout: 3600
21 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/transaction.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/prometheus/instrumenter.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Prometheus.Instrumenter do
2 | @moduledoc """
3 | Phoenix request metrics for `Prometheus`.
4 | """
5 |
6 | @dialyzer {:no_match,
7 | [
8 | phoenix_channel_join: 3,
9 | phoenix_channel_receive: 3,
10 | phoenix_controller_call: 3,
11 | phoenix_controller_render: 3,
12 | setup: 0
13 | ]}
14 |
15 | use Prometheus.PhoenixInstrumenter
16 | end
17 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_i_tooltip.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/controllers/api_docs_controller.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.APIDocsController do
2 | use BlockScoutWeb, :controller
3 |
4 | alias BlockScoutWeb.Etherscan
5 | alias Explorer.EthRPC
6 |
7 | def index(conn, _params) do
8 | conn
9 | |> assign(:documentation, Etherscan.get_documentation())
10 | |> render("index.html")
11 | end
12 |
13 | def eth_rpc(conn, _params) do
14 | conn
15 | |> assign(:documentation, EthRPC.methods())
16 | |> render("eth_rpc.html")
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190516140202_add_address_hash_index_to_decompiled_smart_contracts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddAddressHashIndexToDecompiledSmartContracts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute(
6 | """
7 | CREATE INDEX IF NOT EXISTS decompiled_smart_contracts_address_hash_index ON decompiled_smart_contracts(address_hash);
8 | """,
9 | """
10 | DROP INDEX IF EXISTS decompiled_smart_contracts_address_hash_index
11 | """
12 | )
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_dot.scss:
--------------------------------------------------------------------------------
1 | .transaction {
2 | &__dot {
3 | display: inline-block;
4 | height: 10px;
5 | width: 10px;
6 | border-radius: 50%;
7 | margin-left: 5px;
8 | vertical-align: baseline;
9 |
10 | &--pending {
11 | background-color: $gray-500;
12 | }
13 | &--success {
14 | background-color: $success;
15 | }
16 | &--failed {
17 | background-color: $danger;
18 | }
19 | &--out_of_gas {
20 | background-color: $warning;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_close_button.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20180117221921_create_address.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateAddress do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:addresses, primary_key: false) do
6 | add(:fetched_coin_balance, :numeric, precision: 100)
7 | add(:fetched_coin_balance_block_number, :bigint)
8 | add(:hash, :bytea, null: false, primary_key: true)
9 | add(:contract_code, :bytea, null: true)
10 |
11 | timestamps(null: false, type: :utc_datetime_usec)
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181029174420_update_tokens_table_decimals_from_bigint_to_numeric.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.UpdateTokensTableDecimalsFromBigintToNumeric do
2 | use Ecto.Migration
3 |
4 | def up do
5 | alter table("tokens") do
6 | modify(:decimals, :decimal)
7 | end
8 | end
9 |
10 | def down do
11 | execute("""
12 | ALTER TABLE tokens
13 | ALTER COLUMN decimals TYPE bigint
14 | USING CASE WHEN decimals > 9223372036854775807 THEN NULL ELSE decimals END;
15 | """)
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/rel/commands/clear_build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | rm -rf ./_build
4 | rm -rf ./deps
5 | logs=$(find . -not -path '*/\.*' -name "logs" -type d)
6 | dev=$(find ${logs} -name "dev")
7 | files_and_dirs_in_logs_dev=$(ls -d ${dev}/*)
8 | rm -rf $files_and_dirs_in_logs_dev
9 |
10 | test=$(find ${logs} -name "test")
11 | files_and_dirs_in_logs_test=$(ls -d ${test}/*)
12 | rm -rf $files_and_dirs_in_logs_test
13 |
14 | find . -name "node_modules" -type d -exec rm -rf '{}' +
15 |
16 | case "$1" in
17 | -f)
18 | rm -rf ./apps/block_scout_web/priv/static;;
19 | esac
20 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/ellaism_logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_module_card.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
8 | <%= for action <- @module.actions do %>
9 | <%= render "_action_tile.html", module_name: @module.name, action: action %>
10 | <% end %>
11 |
12 |
13 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181017141409_add_index_to_internal_transaction_table.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddIndexToInternalTransactionTable do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create(
6 | index("internal_transactions", [
7 | :to_address_hash,
8 | :from_address_hash,
9 | :created_contract_address_hash,
10 | :type,
11 | :index
12 | ])
13 | )
14 |
15 | create(index(:internal_transactions, ["block_number DESC, transaction_index DESC, index DESC"]))
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/counters/addresses_counter_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Counters.AddressesCounterTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Counters.AddressesCounter
5 |
6 | test "populates the cache with the number of all addresses" do
7 | insert(:address, fetched_coin_balance: 0)
8 | insert(:address, fetched_coin_balance: 1)
9 | insert(:address, fetched_coin_balance: 2)
10 |
11 | start_supervised!(AddressesCounter)
12 | AddressesCounter.consolidate()
13 |
14 | assert AddressesCounter.fetch() == 3
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/bin/install_chrome_headless.sh:
--------------------------------------------------------------------------------
1 | export DISPLAY=:99.0
2 | sh -e /etc/init.d/xvfb start
3 | export CHROMEDRIVER_VERSION=`curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE`
4 | curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
5 | unzip chromedriver_linux64.zip
6 | sudo chmod +x chromedriver
7 | sudo mv chromedriver /usr/local/bin
8 | wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
9 | sudo apt install ./google-chrome-stable_current_amd64.deb
10 | sudo apt-get install libstdc++6
11 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190118152240_block_second_degree_relations_composite_primary_key.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.BlockSecondDegreeRelationsCompositePrimaryKey do
2 | use Ecto.Migration
3 |
4 | def up do
5 | # Don't use `modify` as it requires restating the whole column description
6 | execute("ALTER TABLE block_second_degree_relations ADD PRIMARY KEY (nephew_hash, uncle_hash)")
7 | end
8 |
9 | def down do
10 | execute("ALTER TABLE block_second_degree_relations DROP CONSTRAIN block_second_degree_relations_pkey")
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/icons/move-stake.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181008195723_create_administrators.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateAdministrators do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:administrators) do
6 | add(:role, :string, null: false)
7 | add(:user_id, references(:users, column: :id, on_delete: :delete_all), null: false)
8 |
9 | timestamps()
10 | end
11 |
12 | create(unique_index(:administrators, :role, name: :owner_role_limit, where: "role = 'owner'"))
13 | create(unique_index(:administrators, :user_id))
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190508152922_add_old_block_hash_for_transactions.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddOldBlockHashForTransactions do
2 | use Ecto.Migration
3 |
4 | def change do
5 | alter table(:transactions) do
6 | # A transient field for deriving old block hash during transaction upserts.
7 | # Used to force refetch of a block in case a transaction is re-collated
8 | # in a different block. See: https://github.com/poanetwork/blockscout/issues/1911
9 | add(:old_block_hash, :bytea, null: true)
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/_elements.scss:
--------------------------------------------------------------------------------
1 | hr {
2 | border-bottom: none;
3 | border-left: none;
4 | border-right: none;
5 | border-top: 1px solid #f5f6fa;
6 | margin: 30px 0;
7 | }
8 |
9 | svg {
10 | -moz-osx-font-smoothing: grayscale;
11 | -webkit-font-smoothing: antialiased;
12 | display: inline-block;
13 | font-style: normal;
14 | font-variant: normal;
15 | text-rendering: auto;
16 | line-height: 1;
17 | }
18 |
19 | dl {
20 | margin-bottom: 12px;
21 |
22 | &:last-child {
23 | margin-bottom: 0;
24 | }
25 |
26 | dd {
27 | margin: 0;
28 | }
29 | }
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/resolvers/address.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Resolvers.Address do
2 | @moduledoc false
3 |
4 | alias Explorer.Chain
5 |
6 | def get_by(_, %{hashes: hashes}, _) do
7 | case Chain.hashes_to_addresses(hashes) do
8 | [] -> {:error, "Addresses not found."}
9 | result -> {:ok, result}
10 | end
11 | end
12 |
13 | def get_by(_, %{hash: hash}, _) do
14 | case Chain.hash_to_address(hash) do
15 | {:error, :not_found} -> {:error, "Address not found."}
16 | {:ok, _} = result -> result
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190516160535_add_decompiled_and_verified_flag_to_addresses.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddDecompiledAndVerifiedFlagToAddresses do
2 | use Ecto.Migration
3 |
4 | def change do
5 | execute(
6 | """
7 | ALTER TABLE addresses
8 | ADD COLUMN IF NOT EXISTS decompiled BOOLEAN,
9 | ADD COLUMN IF NOT EXISTS verified BOOLEAN;
10 | """,
11 | """
12 | ALTER TABLE addresses
13 | DROP COLUMN IF EXISTS decompiled,
14 | DROP COLUMN IF EXISTS verified;
15 | """
16 | )
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/token_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.Token.Supervisor.Case do
2 | alias Indexer.Fetcher.Token
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> Token.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/accounts/user/authenticate.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Accounts.User.Authenticate do
2 | @moduledoc """
3 | Represents the data required to authenticate a user.
4 | """
5 |
6 | use Explorer.Schema
7 |
8 | import Ecto.Changeset
9 |
10 | embedded_schema do
11 | field(:username, :string)
12 | field(:password, :string)
13 | end
14 |
15 | @required_attrs ~w(password username)a
16 |
17 | def changeset(params \\ %{}) do
18 | %__MODULE__{}
19 | |> cast(params, @required_attrs)
20 | |> validate_required(@required_attrs)
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/block_transaction_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.BlockTransactionView do
2 | use BlockScoutWeb, :view
3 |
4 | import BlockScoutWeb.Gettext, only: [gettext: 1]
5 |
6 | def block_not_found_message({:ok, true}) do
7 | gettext("Easy Cowboy! This block does not exist yet!")
8 | end
9 |
10 | def block_not_found_message({:ok, false}) do
11 | gettext("This block has not been processed yet.")
12 | end
13 |
14 | def block_not_found_message({:error, :hash}) do
15 | gettext("Block not found, please try again later.")
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/error_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.ErrorView do
2 | use BlockScoutWeb, :view
3 |
4 | def render("404.html", _assigns) do
5 | "Page not found"
6 | end
7 |
8 | def render("422.html", _assigns) do
9 | "Unprocessable entity"
10 | end
11 |
12 | def render("500.html", _assigns) do
13 | "Internal server error"
14 | end
15 |
16 | # In case no render clause matches or no
17 | # template is found, let's render it as 500
18 | def template_not_found(_template, assigns) do
19 | render("500.html", assigns)
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/transaction/invalid.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
<%= gettext "Invalid Transaction Hash" %>
7 |
8 | <%= @transaction_hash %> <%= gettext "is not a valid transaction hash" %>
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/chain/supply/exchange_rate.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Supply.ExchangeRate do
2 | @moduledoc """
3 | Defines the supply API for calculating supply for coins from exchange_rate..
4 | """
5 |
6 | use Explorer.Chain.Supply
7 |
8 | alias Explorer.ExchangeRates.Token
9 | alias Explorer.Market
10 |
11 | def circulating do
12 | exchange_rate().available_supply
13 | end
14 |
15 | def total do
16 | exchange_rate().total_supply
17 | end
18 |
19 | def exchange_rate do
20 | Market.get_exchange_rate(Explorer.coin()) || Token.null()
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/circle-xusdt.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/staking_pool_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.StakingPoolTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Chain.StakingPool
5 |
6 | describe "changeset/2" do
7 | test "with valid attributes" do
8 | params = params_for(:staking_pool)
9 | changeset = StakingPool.changeset(%StakingPool{}, params)
10 | assert changeset.valid?
11 | end
12 |
13 | test "with invalid attributes" do
14 | changeset = StakingPool.changeset(%StakingPool{}, %{staking_address_hash: 0})
15 | refute changeset.valid?
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/uncle_block_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.UncleBlock.Supervisor.Case do
2 | alias Indexer.Fetcher.UncleBlock
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> UncleBlock.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_bottom_disclaimer.html.eex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/block_reward_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.BlockReward.Supervisor.Case do
2 | alias Indexer.Fetcher.BlockReward
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> BlockReward.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/coin_balance_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.CoinBalance.Supervisor.Case do
2 | alias Indexer.Fetcher.CoinBalance
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> CoinBalance.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/cache/pending_transactions_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Cache.PendingTransactionsTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Chain.Cache.PendingTransactions
5 |
6 | describe "update_pending/1" do
7 | test "adds a new pending transaction" do
8 | transaction = insert(:transaction, block_hash: nil, error: nil)
9 |
10 | PendingTransactions.update([transaction])
11 |
12 | assert [%{hash: pending_transaction_hash}] = PendingTransactions.all()
13 |
14 | assert transaction.hash == pending_transaction_hash
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/contract_code_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.ContractCode.Supervisor.Case do
2 | alias Indexer.Fetcher.ContractCode
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> ContractCode.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/token_balance_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.TokenBalance.Supervisor.Case do
2 | alias Indexer.Fetcher.TokenBalance
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> TokenBalance.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/token_updater_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.TokenUpdater.Supervisor.Case do
2 | alias Indexer.Fetcher.TokenUpdater
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> TokenUpdater.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/plug/fetch_user_from_session.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.Plug.FetchUserFromSession do
2 | @moduledoc """
3 | Fetches a `t:Explorer.Accounts.User.t/0` record if a user id is found in the session.
4 | """
5 |
6 | import Plug.Conn
7 |
8 | alias Explorer.Accounts
9 |
10 | def init(opts), do: opts
11 |
12 | def call(conn, _opts) do
13 | with user_id when not is_nil(user_id) <- get_session(conn, :user_id),
14 | {:ok, user} <- Accounts.fetch_user(user_id) do
15 | assign(conn, :user, user)
16 | else
17 | _ -> conn
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/phoenix/param.ex:
--------------------------------------------------------------------------------
1 | alias Explorer.Chain.{Address, Block, Hash, Transaction}
2 |
3 | defimpl Phoenix.Param, for: [Address, Transaction] do
4 | def to_param(%@for{hash: hash}) do
5 | @protocol.to_param(hash)
6 | end
7 | end
8 |
9 | defimpl Phoenix.Param, for: Block do
10 | def to_param(%@for{consensus: true, number: number}) do
11 | to_string(number)
12 | end
13 |
14 | def to_param(%@for{consensus: false, hash: hash}) do
15 | to_string(hash)
16 | end
17 | end
18 |
19 | defimpl Phoenix.Param, for: Hash do
20 | def to_param(hash) do
21 | to_string(hash)
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block/by_nephew.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Block.ByNephew do
2 | @moduledoc """
3 | Block format as returned by [`eth_getUncleByBlockHashAndIndex`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getUncleByBlockHashAndIndex)
4 | """
5 |
6 | import EthereumJSONRPC, only: [integer_to_quantity: 1]
7 |
8 | def request(%{id: id, nephew_hash: nephew_hash, index: index}) do
9 | EthereumJSONRPC.request(%{
10 | id: id,
11 | method: "eth_getUncleByBlockHashAndIndex",
12 | params: [nephew_hash, integer_to_quantity(index)]
13 | })
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/hash/full_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Hash.FullTest do
2 | use ExUnit.Case, async: true
3 |
4 | alias Explorer.Chain.Hash
5 |
6 | doctest Hash.Full
7 |
8 | describe "cast" do
9 | test ~S|is not confused by big integer that starts with <<48, 120>> which is "0x"| do
10 | assert {:ok, _} =
11 | Hash.Full.cast(
12 | <<48, 120, 238, 242, 122, 170, 157, 194, 106, 180, 42, 65, 178, 64, 202, 214, 148, 99, 171, 74, 64, 18,
13 | 14, 163, 47, 7, 39, 180, 235, 9, 98, 158>>
14 | )
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190319081821_create_decompiled_smart_contracts.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.CreateDecompiledSmartContracts do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:decompiled_smart_contracts) do
6 | add(:decompiler_version, :string, null: false)
7 | add(:decompiled_source_code, :text, null: false)
8 | add(:address_hash, references(:addresses, column: :hash, on_delete: :delete_all, type: :bytea), null: false)
9 |
10 | timestamps()
11 | end
12 |
13 | create(unique_index(:decompiled_smart_contracts, :address_hash))
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

5 |
6 |
7 |
Page not found
8 |
The requested path was not found on BlockScout.
9 |
Back Home
10 |
11 |
12 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/market/history/source.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Market.History.Source do
2 | @moduledoc """
3 | Interface for a source that allows for fetching of market history.
4 | """
5 |
6 | @typedoc """
7 | Record of market values for a specific date.
8 | """
9 | @type record :: %{
10 | closing_price: Decimal.t(),
11 | date: Date.t(),
12 | opening_price: Decimal.t()
13 | }
14 |
15 | @doc """
16 | Fetch history for a specified amount of days in the past.
17 | """
18 | @callback fetch_history(previous_days :: non_neg_integer()) :: {:ok, [record()]} | :error
19 | end
20 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/xdai-chain.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/transaction_raw_trace_view.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.TransactionRawTraceView do
2 | use BlockScoutWeb, :view
3 | @dialyzer :no_match
4 |
5 | alias Explorer.Chain.InternalTransaction
6 |
7 | def render("scripts.html", %{conn: conn}) do
8 | render_scripts(conn, "raw_trace/code_highlighting.js")
9 | end
10 |
11 | def raw_traces_with_lines(internal_transactions) do
12 | internal_transactions
13 | |> InternalTransaction.internal_transactions_to_raw()
14 | |> Jason.encode!(pretty: true)
15 | |> String.split("\n")
16 | |> Enum.with_index(1)
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/pending_transaction_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.PendingTransaction.Supervisor.Case do
2 | alias Indexer.Fetcher.PendingTransaction
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> PendingTransaction.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/components/_btn_dropdown_line.scss:
--------------------------------------------------------------------------------
1 | $btn-dropdown-line-bg: #fff !default;
2 | $btn-dropdown-line-color: #e2e5ec !default;
3 | $btn-dropdown-line-color-hover: #f5f6fa !default;
4 | $btn-dropdown-line-font: #333;
5 |
6 | .btn-dropdown-line {
7 | @include btn-line($btn-dropdown-line-bg, $btn-dropdown-line-color);
8 | border-color: $btn-dropdown-line-color;
9 | color: $btn-dropdown-line-font;
10 | outline: none !important;
11 |
12 | &:hover {
13 | background-color: $btn-dropdown-line-color-hover;
14 | border-color: $btn-dropdown-line-color;
15 | color: $btn-dropdown-line-font;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/non-critical.scss:
--------------------------------------------------------------------------------
1 | // Bootstrap Core CSS
2 | @import "node_modules/bootstrap/scss/functions";
3 | @import "node_modules/bootstrap/scss/variables";
4 | @import "node_modules/bootstrap/scss/mixins";
5 |
6 | @import "theme/variables-non-critical";
7 |
8 | @import "node_modules/bootstrap/scss/modal";
9 | @import "node_modules/bootstrap/scss/tooltip";
10 |
11 | @import "components/i_tooltip";
12 | @import "components/check_tooltip";
13 | @import "components/tooltip";
14 |
15 | @import "components/qr-code";
16 | @import "components/modal_variables";
17 | @import "components/modal";
18 | @import "components/modal_status";
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/replaced_transaction_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.ReplacedTransaction.Supervisor.Case do
2 | alias Indexer.Fetcher.ReplacedTransaction
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1
11 | )
12 |
13 | [merged_fetcher_arguments]
14 | |> ReplacedTransaction.Supervisor.child_spec()
15 | |> ExUnit.Callbacks.start_supervised!()
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/error422/index.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

5 |
6 |
7 |
Unprocessable Entity
8 |
The request was well-formed but was unable to be followed due to semantic errors. Maybe, you mistype a hash of tx/block/address?
9 |
Back Home
10 |
11 |
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/block_transaction/404.html.eex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

5 |
6 |
7 |
<%= gettext("Block Details") %>
8 |
<%= block_not_found_message(@block_above_tip) %>
9 |
Back Home
10 |
11 |
12 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/controllers/api/v1/supply_controller_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.API.V1.SupplyControllerTest do
2 | use BlockScoutWeb.ConnCase
3 |
4 | alias Explorer.Chain
5 |
6 | test "supply", %{conn: conn} do
7 | request = get(conn, api_v1_supply_path(conn, :supply))
8 | assert response = json_response(request, 200)
9 |
10 | assert response["total_supply"] == Chain.total_supply()
11 | assert response["circulating_supply"] == Chain.circulating_supply()
12 | end
13 |
14 | def api_v1_supply_path(conn, action) do
15 | "/api" <> ApiRoutes.api_v1_supply_path(conn, action)
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181121170616_add_block_number_to_token_transfers.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.AddBlockNumberToTokenTransfers do
2 | @moduledoc """
3 | Use `priv/repo/migrations/scripts/20181121170616_token_transfers_update_block_number_in_batches.sql` to migrate data.
4 |
5 | ```sh
6 | mix ecto.migrate
7 | psql -d $DATABASE -a -f priv/repo/migrations/scripts/20181121170616_token_transfers_update_block_number_in_batches.sql
8 | ```
9 | """
10 |
11 | use Ecto.Migration
12 |
13 | def change do
14 | alter table(:token_transfers) do
15 | add(:block_number, :integer)
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/_code.scss:
--------------------------------------------------------------------------------
1 | pre {
2 | white-space: pre-wrap;
3 | }
4 |
5 | .pre-wrap code {
6 | white-space: pre-wrap;
7 | }
8 |
9 | .pre-decompiled code {
10 | white-space: pre-wrap;
11 | counter-increment: line;
12 | }
13 |
14 | .pre-decompiled code::before {
15 | content: counter(line);
16 | display: inline-block;
17 | width: 3em;
18 | border-right: 1px solid #ddd;
19 | padding: 0 .5em;
20 | margin-right: .5em;
21 | color: #888;
22 | -webkit-user-select: none;
23 | }
24 |
25 | .pre-scrollable-shorty {
26 | max-height: $pre-scrollable-max-height / 7;
27 | }
28 |
29 | .tile pre {
30 | margin-bottom: 0;
31 | }
32 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/__tests__/lib/currency.js:
--------------------------------------------------------------------------------
1 | import { formatUsdValue } from '../../js/lib/currency'
2 |
3 | test('formatUsdValue', () => {
4 | window.localized = {
5 | 'Less than': 'Less than'
6 | }
7 | expect(formatUsdValue(0)).toEqual('$0.000000 USD')
8 | expect(formatUsdValue(0.0000001)).toEqual('Less than $0.000001 USD')
9 | expect(formatUsdValue(0.123456789)).toEqual('$0.123457 USD')
10 | expect(formatUsdValue(0.1234)).toEqual('$0.123400 USD')
11 | expect(formatUsdValue(1.23456789)).toEqual('$1.23 USD')
12 | expect(formatUsdValue(1.2)).toEqual('$1.20 USD')
13 | expect(formatUsdValue(123456.789)).toEqual('$123,457 USD')
14 | })
15 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20190807111216_remove_duplicate_indexes.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.RemoveDuplicateIndexes do
2 | use Ecto.Migration
3 |
4 | def change do
5 | drop_if_exists(
6 | index(:decompiled_smart_contracts, [:address_hash], name: "decompiled_smart_contracts_address_hash_index")
7 | )
8 |
9 | drop_if_exists(
10 | index(:staking_pools_delegators, [:delegator_address_hash],
11 | name: "staking_pools_delegators_delegator_address_hash_index"
12 | )
13 | )
14 |
15 | drop_if_exists(index(:transactions, [:to_address_hash], name: "transactions_to_address_hash_index"))
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/indexer/test/support/indexer/fetcher/internal_transaction_supervisor_case.ex:
--------------------------------------------------------------------------------
1 | defmodule Indexer.Fetcher.InternalTransaction.Supervisor.Case do
2 | alias Indexer.Fetcher.InternalTransaction
3 |
4 | def start_supervised!(fetcher_arguments \\ []) when is_list(fetcher_arguments) do
5 | merged_fetcher_arguments =
6 | Keyword.merge(
7 | fetcher_arguments,
8 | flush_interval: 50,
9 | max_batch_size: 1,
10 | max_concurrency: 1,
11 | poll: false
12 | )
13 |
14 | [merged_fetcher_arguments]
15 | |> InternalTransaction.Supervisor.child_spec()
16 | |> ExUnit.Callbacks.start_supervised!()
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/js/lib/utils.js:
--------------------------------------------------------------------------------
1 | import debounce from 'lodash/debounce'
2 |
3 | export function batchChannel (func) {
4 | let msgs = []
5 | const debouncedFunc = debounce(() => {
6 | func.apply(this, [msgs])
7 | msgs = []
8 | }, 1000, { maxWait: 5000 })
9 | return (msg) => {
10 | msgs.push(msg)
11 | debouncedFunc()
12 | }
13 | }
14 |
15 | export function showLoader (isTimeout, loader) {
16 | if (isTimeout) {
17 | const timeout = setTimeout(function () {
18 | loader.removeAttr('hidden')
19 | loader.show()
20 | }, 100)
21 | return timeout
22 | } else {
23 | loader.hide()
24 | return null
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/fetched_beneficiary.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.FetchedBeneficiary do
2 | @moduledoc """
3 | A single balance request params for the beneficiary of a block.
4 | """
5 |
6 | alias Explorer.Chain.Block.Reward.AddressType
7 | alias Explorer.Chain.Hash
8 |
9 | @type params :: %{
10 | address_hash: EthereumJSONRPC.hash(),
11 | address_type: AddressType.t(),
12 | block_hash: Hash.Full.t(),
13 | block_number: non_neg_integer(),
14 | reward: String.t()
15 | }
16 | @type error :: %{code: integer(), message: String.t(), data: %{block_number: non_neg_integer()}}
17 | end
18 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/parity/traces.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Parity.Traces do
2 | @moduledoc """
3 | Trace returned by
4 | [`trace_replayTransaction`](https://wiki.parity.io/JSONRPC-trace-module.html#trace_replaytransaction), which is an
5 | extension to the Ethereum JSONRPC standard that is only supported by [Parity](https://wiki.parity.io/).
6 | """
7 |
8 | alias EthereumJSONRPC.Parity.Trace
9 |
10 | def elixir_to_params(elixir) when is_list(elixir) do
11 | Enum.map(elixir, &Trace.elixir_to_params/1)
12 | end
13 |
14 | def to_elixir(traces) when is_list(traces) do
15 | Enum.map(traces, &Trace.to_elixir/1)
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/counters/addresses_with_balance_counter_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Counters.AddressesWithBalanceCounterTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Counters.AddressesWithBalanceCounter
5 |
6 | test "populates the cache with the number of addresses with fetched coin balance greater than 0" do
7 | insert(:address, fetched_coin_balance: 0)
8 | insert(:address, fetched_coin_balance: 1)
9 | insert(:address, fetched_coin_balance: 2)
10 |
11 | start_supervised!(AddressesWithBalanceCounter)
12 | AddressesWithBalanceCounter.consolidate()
13 |
14 | assert AddressesWithBalanceCounter.fetch() == 2
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/fetched_beneficiaries.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.FetchedBeneficiaries do
2 | @moduledoc """
3 | Balance params and errors from a batch request to fetch beneficiaries.
4 | """
5 |
6 | alias EthereumJSONRPC.FetchedBeneficiary
7 |
8 | defstruct params_set: MapSet.new(),
9 | errors: []
10 |
11 | @typedoc """
12 | * `params_set` - all the balance request params from requests that succeeded in the batch.
13 | * `errors` - all the errors from requests that failed in the batch.
14 | """
15 | @type t :: %__MODULE__{params_set: MapSet.t(FetchedBeneficiary.params()), errors: [FetchedBeneficiary.error()]}
16 | end
17 |
--------------------------------------------------------------------------------
/apps/explorer/lib/explorer/chain/import/stage/addresses.ex:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.Import.Stage.Addresses do
2 | @moduledoc """
3 | Imports addresses before anything else that references them because an unused address is still valid and recoverable
4 | if the other stage(s) don't commit.
5 | """
6 |
7 | alias Explorer.Chain.Import.{Runner, Stage}
8 |
9 | @behaviour Stage
10 |
11 | @runner Runner.Addresses
12 |
13 | @impl Stage
14 | def runners, do: [@runner]
15 |
16 | @chunk_size 50
17 |
18 | @impl Stage
19 | def multis(runner_to_changes_list, options) do
20 | Stage.chunk_every(runner_to_changes_list, @runner, @chunk_size, options)
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/apps/explorer/priv/repo/migrations/20181024164623_logs_composite_primary_key.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Repo.Migrations.LogsCompositePrimaryKey do
2 | use Ecto.Migration
3 |
4 | def up do
5 | # Remove old id
6 | alter table(:logs) do
7 | remove(:id)
8 | end
9 |
10 | # Don't use `modify` as it requires restating the whole column description
11 | execute("ALTER TABLE logs ADD PRIMARY KEY (transaction_hash, index)")
12 | end
13 |
14 | def down do
15 | execute("ALTER TABLE logs DROP CONSTRAINT logs_pkey")
16 |
17 | # Add back old id
18 | alter table(:logs) do
19 | add(:id, :bigserial, primary_key: true)
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/staking_pools_delegator_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.StakingPoolsDelegatorTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Chain.StakingPoolsDelegator
5 |
6 | describe "changeset/2" do
7 | test "with valid attributes" do
8 | params = params_for(:staking_pools_delegator)
9 | changeset = StakingPoolsDelegator.changeset(%StakingPoolsDelegator{}, params)
10 | assert changeset.valid?
11 | end
12 |
13 | test "with invalid attributes" do
14 | changeset = StakingPoolsDelegator.changeset(%StakingPoolsDelegator{}, %{pool_address_hash: 0})
15 | refute changeset.valid?
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/features/viewing_tokens_test.exs:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.ViewingTokensTest do
2 | use BlockScoutWeb.FeatureCase, async: true
3 |
4 | alias BlockScoutWeb.TokenPage
5 |
6 | describe "viewing token holders" do
7 | test "list the token holders", %{session: session} do
8 | token = insert(:token)
9 |
10 | insert_list(
11 | 2,
12 | :address_current_token_balance,
13 | token_contract_address_hash: token.contract_address_hash
14 | )
15 |
16 | session
17 | |> TokenPage.visit_page(token.contract_address)
18 | |> assert_has(TokenPage.token_holders(count: 2))
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/apps/indexer/.gitignore:
--------------------------------------------------------------------------------
1 | # The directory Mix will write compiled artifacts to.
2 | /_build/
3 |
4 | # If you run "mix test --cover", coverage assets end up here.
5 | /cover/
6 |
7 | # The directory Mix downloads your dependencies sources to.
8 | /deps/
9 |
10 | # Where 3rd-party dependencies like ExDoc output generated docs.
11 | /doc/
12 |
13 | # Ignore .fetch files in case you like to edit your project deps locally.
14 | /.fetch
15 |
16 | # If the VM crashes, it generates a dump, let's ignore it too.
17 | erl_crash.dump
18 |
19 | # Also ignore archive artifacts (built via "mix archive.build").
20 | *.ez
21 |
22 | # Ignore package tarball (built via "mix hex.build").
23 | indexer-*.tar
24 |
25 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/channels/exchange_rate_channel.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.ExchangeRateChannel do
2 | @moduledoc """
3 | Establishes pub/sub channel for address page live updates.
4 | """
5 | use BlockScoutWeb, :channel
6 |
7 | intercept(["new_rate"])
8 |
9 | def join("exchange_rate:new_rate", _params, socket) do
10 | {:ok, %{}, socket}
11 | end
12 |
13 | def handle_out("new_rate", %{exchange_rate: exchange_rate, market_history_data: market_history_data}, socket) do
14 | push(socket, "new_rate", %{
15 | exchange_rate: exchange_rate,
16 | market_history_data: market_history_data
17 | })
18 |
19 | {:noreply, socket}
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/views/render_helpers.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.RenderHelpers do
2 | @moduledoc """
3 | Helper functions to render partials from view modules
4 | """
5 | use BlockScoutWeb, :view
6 |
7 | @doc """
8 | Renders html using:
9 | * A list of args including `:view_module` and `:partial` to render a partial with the required keyword list.
10 | * Text that will pass directly through to the template
11 | """
12 | def render_partial(args) when is_list(args) do
13 | render(
14 | Keyword.get(args, :view_module),
15 | Keyword.get(args, :partial),
16 | args
17 | )
18 | end
19 |
20 | def render_partial(text), do: text
21 | end
22 |
--------------------------------------------------------------------------------
/apps/block_scout_web/test/block_scout_web/features/pages/address_contract_page.ex:
--------------------------------------------------------------------------------
1 | defmodule BlockScoutWeb.AddressContractPage do
2 | @moduledoc false
3 |
4 | use Wallaby.DSL
5 |
6 | import Wallaby.Query, only: [css: 1]
7 |
8 | def on_page?(session, address) do
9 | current_path(session) =~ address_contract_path(address)
10 | end
11 |
12 | def click_verify_and_publish(session) do
13 | click(session, css("[data-test='verify_and_publish']"))
14 | end
15 |
16 | def visit_page(session, address) do
17 | visit(session, address_contract_path(address))
18 | end
19 |
20 | defp address_contract_path(address) do
21 | "/address/#{address.hash}/contracts"
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/http/httpoison.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.HTTP.HTTPoison do
2 | @moduledoc """
3 | Uses `HTTPoison` for `EthereumJSONRPC.HTTP`
4 | """
5 |
6 | alias EthereumJSONRPC.HTTP
7 |
8 | @behaviour HTTP
9 |
10 | @impl HTTP
11 | def json_rpc(url, json, options) when is_binary(url) and is_list(options) do
12 | case HTTPoison.post(url, json, [{"Content-Type", "application/json"}], options) do
13 | {:ok, %HTTPoison.Response{body: body, status_code: status_code}} ->
14 | {:ok, %{body: body, status_code: status_code}}
15 |
16 | {:error, %HTTPoison.Error{reason: reason}} ->
17 | {:error, reason}
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/logs.ex:
--------------------------------------------------------------------------------
1 | defmodule EthereumJSONRPC.Logs do
2 | @moduledoc """
3 | Collection of logs included in return from
4 | [`eth_getTransactionReceipt`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt).
5 | """
6 |
7 | alias EthereumJSONRPC.Log
8 |
9 | @type elixir :: [Log.elixir()]
10 | @type t :: [Log.t()]
11 |
12 | @spec elixir_to_params(elixir) :: [map]
13 | def elixir_to_params(elixir) when is_list(elixir) do
14 | Enum.map(elixir, &Log.elixir_to_params/1)
15 | end
16 |
17 | @spec to_elixir(t) :: elixir
18 | def to_elixir(logs) when is_list(logs) do
19 | Enum.map(logs, &Log.to_elixir/1)
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/css/_helpers.scss:
--------------------------------------------------------------------------------
1 | .pr-0-md {
2 | padding-right: 0 !important;
3 |
4 | @include media-breakpoint-down(md) {
5 | padding-right: 15px !important;
6 | }
7 | }
8 |
9 | .pl-0-md {
10 | padding-left: 0 !important;
11 |
12 | @include media-breakpoint-down(md) {
13 | padding-left: 15px !important;
14 | }
15 | }
16 |
17 | .card-mr-50-md {
18 | margin-right: $common-container-margin;
19 |
20 | @include media-breakpoint-down(md) {
21 | margin-right: 0;
22 | }
23 | }
24 |
25 | .clearfix:after {
26 | clear: both;
27 | content: " "; /* Older browser do not support empty content */
28 | display: block;
29 | height: 0;
30 | visibility: hidden;
31 | }
32 |
--------------------------------------------------------------------------------
/apps/block_scout_web/assets/static/images/network-selector-icons/kovan-testnet.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/explorer/test/explorer/chain/decompiled_smart_contract_test.exs:
--------------------------------------------------------------------------------
1 | defmodule Explorer.Chain.DecompiledSmartContractTest do
2 | use Explorer.DataCase
3 |
4 | alias Explorer.Chain.DecompiledSmartContract
5 |
6 | describe "changeset/2" do
7 | test "with valid attributes" do
8 | params = params_for(:decompiled_smart_contract)
9 | changeset = DecompiledSmartContract.changeset(%DecompiledSmartContract{}, params)
10 |
11 | assert changeset.valid?
12 | end
13 |
14 | test "with invalid attributes" do
15 | changeset = DecompiledSmartContract.changeset(%DecompiledSmartContract{}, %{elixir: "erlang"})
16 |
17 | refute changeset.valid?
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/apps/block_scout_web/lib/block_scout_web/templates/icons/_network_icon.html.eex:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------