diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd084b3f3..4b1c408dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Features - [#2433](https://github.com/poanetwork/blockscout/pull/2433) - Add a functionality to try Eth RPC methods in the documentation +- [#2412](https://github.com/poanetwork/blockscout/pull/2412) - dark theme +- [#2399](https://github.com/poanetwork/blockscout/pull/2399) - decode verified smart contract's logs - [#2391](https://github.com/poanetwork/blockscout/pull/2391) - Controllers Improvements - [#2379](https://github.com/poanetwork/blockscout/pull/2379) - Disable network selector when is empty - [#2374](https://github.com/poanetwork/blockscout/pull/2374) - decode constructor arguments for verified smart contracts @@ -12,11 +14,14 @@ - [#2324](https://github.com/poanetwork/blockscout/pull/2324) - set timeout for loading message on the main page ### Fixes +- [#2413](https://github.com/poanetwork/blockscout/pull/2413) - remove outer tables for decoded data +- [#2416](https://github.com/poanetwork/blockscout/pull/2416) - Fix "page not found" handling in the router - [#2410](https://github.com/poanetwork/blockscout/pull/2410) - preload smart contract for logs decoding - [#2405](https://github.com/poanetwork/blockscout/pull/2405) - added templates for table loader and tile loader - [#2398](https://github.com/poanetwork/blockscout/pull/2398) - show only one decoded candidate - [#2395](https://github.com/poanetwork/blockscout/pull/2395) - new block loading animation - [#2389](https://github.com/poanetwork/blockscout/pull/2389) - Reduce Lodash lib size (86% of lib methods are not used) +- [#2387](https://github.com/poanetwork/blockscout/pull/2387) - fix not existing keys in transaction json rpc - [#2378](https://github.com/poanetwork/blockscout/pull/2378) - Page performance: exclude moment.js localization files except EN, remove unused css - [#2368](https://github.com/poanetwork/blockscout/pull/2368) - add two columns of smart contract info - [#2375](https://github.com/poanetwork/blockscout/pull/2375) - Update created_contract_code_indexed_at on transaction import conflict diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss index cf79ee46e8..e91df91740 100644 --- a/apps/block_scout_web/assets/css/app.scss +++ b/apps/block_scout_web/assets/css/app.scss @@ -128,6 +128,7 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/new_smart_contract"; @import "components/radio_big"; @import "components/btn_no_border"; +@import "theme/dark-theme"; :export { dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color; @@ -135,4 +136,6 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; dashboardLineColorPrice: $dashboard-line-color-price; primary: $primary; secondary: $secondary; + darkprimary: $dark-primary; + darksecondary: $dark-secondary; } diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 48c6c50f02..0d892b25ca 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -252,4 +252,10 @@ $navbar-logo-width: auto !default; @include media-breakpoint-up(xl) { padding-right: 0; } +} + +.nav-item-networks { + .topnav-nav-link { + transition: none !important; + } } \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_base_variables.scss b/apps/block_scout_web/assets/css/theme/_base_variables.scss index 9f1b82c887..2238327bd4 100644 --- a/apps/block_scout_web/assets/css/theme/_base_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_base_variables.scss @@ -70,7 +70,10 @@ $colors: map-merge( ); $primary: $indigo !default; +$dark-primary: #9b62ff !default; +$dark-primary-alternate: #9b62ff !default; $secondary: #7dd79f !default; +$dark-secondary: #87e1a9 !default; $tertiary: $purple !default; $success: $green !default; $info: $cyan !default; diff --git a/apps/block_scout_web/assets/css/theme/_dai_variables.scss b/apps/block_scout_web/assets/css/theme/_dai_variables.scss index 50cbcfa290..0c09660240 100644 --- a/apps/block_scout_web/assets/css/theme/_dai_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_dai_variables.scss @@ -62,4 +62,9 @@ $card-tab-active: $secondary; // Badges $badge-neutral-color: #20446e; $badge-neutral-background-color: rgba(#20446e, .1); -$api-text-monospace-color: #20446e; \ No newline at end of file +$api-text-monospace-color: #20446e; + +// Dark theme +$dark-primary: #15bba6; +$dark-secondary: #93d7ff; +$dark-primary-alternate: #15bba6; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_dark-theme.scss b/apps/block_scout_web/assets/css/theme/_dark-theme.scss new file mode 100644 index 0000000000..e648e01982 --- /dev/null +++ b/apps/block_scout_web/assets/css/theme/_dark-theme.scss @@ -0,0 +1,470 @@ +$body-dark: #1c1d31; // body background +$dark-bg: #22223a; // hero shade +$dark-light-bg: #282945; // pills bg shade +$dark-light: #313355; // tile light top share +$labels-dark: #8a8dba; // header nav, labels + +// Switcher +.dark-mode-changer { + display: inline-flex; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + background: transparent; + border: none; + cursor: pointer; + margin-right: 5px; + outline: none !important; + box-shadow: none !important; + transition: .2s ease-in; + &:hover { + opacity: .8; + } + svg path { + fill: #828ba0; + } + &--dark { + svg path { + fill: $dark-primary; + } + } +} + +.dark-theme-applied { + color: #fff; + + // navbar + .navbar.navbar-primary { + background-color: $dark-light-bg; + } + .navbar-brand .navbar-logo { + filter: brightness(0) invert(1); + } + .navbar.navbar-primary .navbar-nav .nav-link { + color: $labels-dark; + .nav-link-icon { + svg path { + fill: $labels-dark; + } + } + &.active, &:hover { + .nav-link-icon { + svg path { + fill: $dark-primary; + } + } + &:before { + background-color: $dark-primary; + } + } + } + .navbar.navbar-primary .form-control { + background-color: $dark-bg; + border-color: $dark-bg; + color: #fff; + &::placeholder { + color: $labels-dark; + } + } + .navbar.navbar-primary .navbar-toggler .navbar-toggler-icon { + filter: invert(1); + } + + // footer + .footer { + background: $dark-light-bg; + color: $labels-dark; + } + .footer-social-icon, + .footer-link { + color: $labels-dark; + } + .footer-social-icon:hover, + .footer-link:hover { + color: #fff; + } + .footer-list ul li::before { + background-color: $dark-secondary; + } + + // hero stats + + .layout-container .dashboard-banner-container { + background-image: none; + background-color: $dark-bg; + } + .dashboard-banner-network-plain-container, + .dashboard-banner-network-plain-container::after { + background-color: $dark-light-bg; + } + .dashboard-banner-network-stats-label, + .dashboard-banner-chart-legend .dashboard-banner-chart-legend-label { + color: $labels-dark; + } + .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(1)::before { + background-color: $dark-primary; + } + .dashboard-banner-network-stats-item::before { + background-color: $dark-secondary; + } + .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(2)::before { + background-color: $dark-secondary; + } + + // main container, layout, cards + .layout-container main { + background-color: $body-dark; + } + + .card { + background-color: $dark-light-bg; + box-shadow: 0 0 30px 0 rgba(23, 24, 41, 0.5); + } + + .card-header { + border-bottom-color: darken($labels-dark, 30); + } + + .address-detail-hash-title { + color: #fff; + } + + .card-tabs { + border-bottom-color: darken($labels-dark, 30); + } + + .card-tab { + background-color: transparent; + &:hover:not(.active) { + background-color: rgba($dark-primary, .15); + color: $dark-primary; + } + &.active { + background-color: $dark-primary-alternate; + color: #fff; + } + } + + .card-background-1 { + background-color: $dark-primary-alternate; + } + + // Components + a { + color: $dark-primary; + } + + .tile { + border-top-color: $dark-light; + border-bottom-color: $dark-light; + border-right-color: $dark-light; + background-color: $dark-light; + color: $labels-dark; + &:not([class^="tile tile-type"]) { + border-left-color: $dark-light; + } + &.tile-type-coin-balance { + border-left-color: $dark-light; + } + .tile-title { + color: #fff; + } + .tile-transaction-type-block { + background-color: transparent; + } + } + .tile-bottom-contents { + background-color: $dark-bg; + } + a.tile-title { + color: #fff !important; + } + .tile.tile-type-block .tile-transaction-type-block a { + color: #fff; + } + .fade-up-blocks-chain .tile-type-block-animation { + background-color: $dark-light; + border-top-color: $dark-light; + border-right-color: $dark-light; + border-bottom-color: $dark-light; + } + .fade-up-blocks-chain .tile-type-block-animation:after { + background-color: $dark-light; + } + .cube-animation-title { + color: $labels-dark; + } + .tile .tile-body a, + .tile span[data-address-hash] { color: $dark-primary; } + .fade-up-blocks-chain .tile-type-block-animation .tile-type-line-up { + background-color: $dark-primary; + } + .tile.tile-type-block { + border-left-color: $dark-primary + } + .tile.tile-type-block .tile-status-label { + color: $dark-primary; + } + .tile.tile-type-block .tile-transaction-type-block { + border-right-color: $dark-primary; + border-top-color: $dark-primary; + border-bottom-color: $dark-primary; + } + .tile .progress { + background-color: rgba(#fff, .2); + } + .tile .progress .progress-bar { + background-color: $dark-primary; + } + .tile .tile-title-lg:not([data-balance-change-sign]) { + color: $dark-primary; + } + + // btns + + .btn-line { + background-color: transparent; + border-color: $dark-primary; + color: $dark-primary; + &:hover { + border-color: $dark-primary; + background-color: $dark-primary; + color: #fff; + } + } + + .btn-copy-icon, .btn-qr-icon { + border-color: $dark-primary; + path { + fill: $dark-primary; + } + &:hover { + background-color: $dark-primary; + path { + fill: #fff; + } + } + } + + // pagination + .pagination-container .pagination .page-link { + color: $labels-dark; + border-color: $dark-light; + background-color: $dark-light; + &:not(.no-hover):hover { + color: #fff; + background-color: $dark-primary; + path { + fill: #fff; + } + } + &[disabled] { + color: $labels-dark; + border-color: $dark-light; + background-color: $dark-light; + } + } + + // dropdown + .dropdown-menu { + background-color: $dark-light; + border-left-color: $dark-light; + border-right-color: $dark-light; + border-bottom-color: $dark-light; + } + + .dropdown-item { + color: #fff; + &:hover { + background-color: rgba(#fff, .1); + } + } + .dropdown-item.active { + background-color: $dark-primary; + } + .btn-dropdown-line { + background-color: $dark-light; + border-color: $dark-light; + color: $labels-dark; + } + + // table + .stakes-table-th { + background-color: $dark-light; + color: $labels-dark; + } + .stakes-td { + border-bottom-color: darken($labels-dark, 30); + } + .table th, .table td { + border-top-color: darken($labels-dark, 30); + } + hr { + border-top-color: darken($labels-dark, 30); + } + + // api's + .api-anchors-list { + background-color: $dark-light; + } + .api-doc-list-item { + border-bottom-color: darken($labels-dark, 30); + } + .card-subtitle, + .api-anchors-list-item-title, + .api-doc-list-item-title { + color: #fff; + } + .api-text-monospace { + color: $dark-primary; + } + .api-text-monospace-background { + background-color: rgba($dark-primary, .15); + } + .badge.badge-neutral { + background-color: rgba($dark-primary, .15); + color: $dark-primary; + } + + // download csv button + .download-all-transactions .download-all-transactions-link svg path { + fill: $dark-primary; + } + + //tooltips + .tooltip .arrow:before { + border-top-color: $dark-primary; + border-bottom-color: $dark-primary; + } + .tooltip > .tooltip-inner {background-color: $dark-primary;} + + //network select + .network-selector-overlay { + background-color: rgba($dark-bg, .9); + } + .network-selector { + background-color: $dark-light-bg; + } + .network-selector-title { + color: #fff; + } + .network-selector-text { + color: $labels-dark; + } + .network-selector-close path { + fill: #fff; + } + .network-selector-search-container { + background-color: $dark-light; + } + .network-selector-search-container path { + fill: $labels-dark; + } + .network-selector-search-input { + color: #fff !important; + &::placeholder { + color: $labels-dark; + } + } + .network-selector-tab { + color: $labels-dark; + &:hover, &.active { + color: #fff; + } + &.active { + &:after { + background-color: $dark-primary; + } + } + } + .network-selector-item, + .network-selector-tabs-container { + border-bottom-color: darken($labels-dark, 30); + } + .network-selector-item-title { + color: #fff; + } + .network-selector-item-type { + color: $labels-dark; + } + .radio .radio-icon { + border-color: $labels-dark + } + .network-selector-item-url:hover .network-selector-item-type { + color: #fff; + } + + //coin dropdown + .token-balance-dropdown.dropdown-menu { + border-color: $dark-light !important; + box-shadow: 0 0 30px 0 rgba(23, 24, 41, 0.5) !important; + } + .token-balance-dropdown .dropdown-search-icon path { + fill: $labels-dark; + } + .token-balance-dropdown .dropdown-search-field { + background-color: $dark-light; + border-color: $dark-light; + color: #fff; + &::placeholder { + color: $labels-dark; + } + } + .token-balance-dropdown[aria-labelledby="dropdown-tokens"] .dropdown-items .dropdown-item:hover { + color: #fff !important; + } + .dropdown-header { + color: $labels-dark; + } + .border-bottom { + border-bottom-color: darken($labels-dark, 30) !important; + } + + // coin balance history chart + .chartjs-render-monitor[data-chart="coinBalanceHistoryChart"] { + filter: brightness(0) invert(1) !important; + } + + // logs search + .logs-search-input, .logs-search-btn, .logs-search-btn-cancel { + background-color: $dark-light; + border-color: $dark-light; + color: #fff; + } + + .logs-search-btn { + color: $labels-dark; + } + + .logs-search-btn { + &:hover { + background-color: $dark-primary; + color: #fff; + } + } + + .logs-search-input { + &::placeholder { + color: $labels-dark; + } + } + + // code + pre { + color: #fff; + } + + // info allert + .alert-info { + color: $labels-dark; + background-color: $dark-light; + border-color: $dark-light; + } + + // dark text + .text-dark { + color: #fff; + } + +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss b/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss index 68feab4dfc..dff677d7cc 100644 --- a/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss @@ -74,4 +74,9 @@ $card-tab-active: $tertiary; // Badges $badge-neutral-color: $tertiary; $badge-neutral-background-color: rgba($tertiary, .1); -$api-text-monospace-color: $tertiary; \ No newline at end of file +$api-text-monospace-color: $tertiary; + +// Dark theme +$dark-primary: #8588ff; +$dark-secondary: #4ad7a7; +$dark-primary-alternate: #5b5ed8; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss b/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss index 0755d3e4b4..0b5cac0c43 100644 --- a/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss @@ -56,4 +56,18 @@ $card-tab-active: $secondary; $dashboard-banner-gradient-end ); } +} + +// Dark theme +$dark-primary: #49a2ee; +$dark-secondary: #4ad7a7; +$dark-primary-alternate: #49a2ee; + +.dark-theme-applied { + .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(1)::before { + background-color: $dark-primary !important; + } + .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(2)::before { + background-color: $dark-secondary !important; + } } \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_goerli_variables.scss b/apps/block_scout_web/assets/css/theme/_goerli_variables.scss index 7900dd4c3b..04f953b477 100644 --- a/apps/block_scout_web/assets/css/theme/_goerli_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_goerli_variables.scss @@ -78,3 +78,8 @@ $card-tab-active: $sub-accent-color; $badge-neutral-color: $sub-accent-color; $badge-neutral-background-color: rgba($sub-accent-color, .1); $api-text-monospace-color: $sub-accent-color; + +// Dark theme +$dark-primary: #e1995a; +$dark-secondary: #aeaeae; +$dark-primary-alternate: #e1995a; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_kovan_variables.scss b/apps/block_scout_web/assets/css/theme/_kovan_variables.scss index 351f046726..a4edc629d0 100644 --- a/apps/block_scout_web/assets/css/theme/_kovan_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_kovan_variables.scss @@ -74,4 +74,9 @@ $badge-success-color: #15bba6; $badge-success-background-color: rgba(#15bba6, .1); $badge-neutral-color: $tertiary; $badge-neutral-background-color: rgba($tertiary, .1); -$api-text-monospace-color: $tertiary; \ No newline at end of file +$api-text-monospace-color: $tertiary; + +// Dark theme +$dark-primary: #42e2d7; +$dark-secondary: #1f857f; +$dark-primary-alternate: #1f857f; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_lukso_variables.scss b/apps/block_scout_web/assets/css/theme/_lukso_variables.scss index 65f9a73b5f..a7b608bfa8 100644 --- a/apps/block_scout_web/assets/css/theme/_lukso_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_lukso_variables.scss @@ -151,3 +151,20 @@ $dashboard-banner-network-plain-container-height: 150px; $badge-neutral-color: $tertiary; $badge-neutral-background-color: rgba($tertiary, .1); $api-text-monospace-color: $tertiary; + +// Dark theme +$dark-primary: #fdcec4; +$dark-secondary: #a96c55; +$dark-primary-alternate: #a96c55; + +.dark-theme-applied { + .dashboard-banner-network-stats-value { + color: $dark-primary !important; + } + .layout-container .dashboard-banner-container { + background-color: #282945 !important; + } + .dashboard-banner-network-plain-container::after { + box-shadow: none !important; + } +} diff --git a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss index 4033934dd6..120a11c222 100644 --- a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss @@ -71,4 +71,9 @@ $api-text-monospace-color: $primary; .dropdown-items .dropdown-item:hover { color: $primary !important; } -} \ No newline at end of file +} + +// Dark theme +$dark-primary: #9b62ff; +$dark-secondary: #87e1a9; +$dark-primary-alternate: #7e50d0; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_poa_variables.scss b/apps/block_scout_web/assets/css/theme/_poa_variables.scss index 4033934dd6..120a11c222 100644 --- a/apps/block_scout_web/assets/css/theme/_poa_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_poa_variables.scss @@ -71,4 +71,9 @@ $api-text-monospace-color: $primary; .dropdown-items .dropdown-item:hover { color: $primary !important; } -} \ No newline at end of file +} + +// Dark theme +$dark-primary: #9b62ff; +$dark-secondary: #87e1a9; +$dark-primary-alternate: #7e50d0; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss b/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss index 1e62ea6d69..4fa700c50e 100644 --- a/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss @@ -57,3 +57,8 @@ $card-tab-active: $secondary; ); } } + +// Dark theme +$dark-primary: #38a9f5; +$dark-secondary: #76f1ff; +$dark-primary-alternate: #38a9f5; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss b/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss index 1e62ea6d69..4fa700c50e 100644 --- a/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss @@ -57,3 +57,8 @@ $card-tab-active: $secondary; ); } } + +// Dark theme +$dark-primary: #38a9f5; +$dark-secondary: #76f1ff; +$dark-primary-alternate: #38a9f5; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_rsk_variables.scss b/apps/block_scout_web/assets/css/theme/_rsk_variables.scss index 76029e1a34..d33996a89e 100644 --- a/apps/block_scout_web/assets/css/theme/_rsk_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_rsk_variables.scss @@ -65,3 +65,8 @@ $card-tab-active: $secondary; // Badges $badge-neutral-color: #1a323b; $badge-neutral-background-color: rgba(#1a323b, .1); + +// Dark theme +$dark-primary: #38c5a4; +$dark-secondary: #e39a54; +$dark-primary-alternate: #30ab8d; diff --git a/apps/block_scout_web/assets/css/theme/_sokol_variables.scss b/apps/block_scout_web/assets/css/theme/_sokol_variables.scss index 444cdff178..8d479f397d 100644 --- a/apps/block_scout_web/assets/css/theme/_sokol_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_sokol_variables.scss @@ -72,4 +72,9 @@ $card-tab-active: $sub-accent-color; // Badges $badge-neutral-color: $tertiary; -$badge-neutral-background-color: rgba($tertiary, .1); \ No newline at end of file +$badge-neutral-background-color: rgba($tertiary, .1); + +// Dark theme +$dark-primary: #40bfb2; +$dark-secondary: #25c9ff; +$dark-primary-alternate: #1c9f90; \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/app.js b/apps/block_scout_web/assets/js/app.js index a800597331..a33dab821d 100644 --- a/apps/block_scout_web/assets/js/app.js +++ b/apps/block_scout_web/assets/js/app.js @@ -35,6 +35,7 @@ import './pages/favorites' import './pages/network-search' import './pages/layout' import './pages/verification_form' +import './pages/dark-mode-switcher' import './pages/admin/tasks.js' diff --git a/apps/block_scout_web/assets/js/lib/market_history_chart.js b/apps/block_scout_web/assets/js/lib/market_history_chart.js index d54d998580..098faac0a8 100644 --- a/apps/block_scout_web/assets/js/lib/market_history_chart.js +++ b/apps/block_scout_web/assets/js/lib/market_history_chart.js @@ -88,6 +88,17 @@ function getMarketCapData (marketHistoryData, availableSupply) { } } +// colors for light and dark theme +var priceLineColor +var mcapLineColor +if (localStorage.getItem('current-color-mode') === 'dark') { + priceLineColor = sassVariables.darkprimary + mcapLineColor = sassVariables.darksecondary +} else { + priceLineColor = sassVariables.dashboardLineColorPrice + mcapLineColor = sassVariables.dashboardLineColorMarket +} + class MarketHistoryChart { constructor (el, availableSupply, marketHistoryData) { this.price = { @@ -96,8 +107,8 @@ class MarketHistoryChart { data: getPriceData(marketHistoryData), fill: false, pointRadius: 0, - backgroundColor: sassVariables.dashboardLineColorPrice, - borderColor: sassVariables.dashboardLineColorPrice, + backgroundColor: priceLineColor, + borderColor: priceLineColor, lineTension: 0 } this.marketCap = { @@ -106,8 +117,8 @@ class MarketHistoryChart { data: getMarketCapData(marketHistoryData, availableSupply), fill: false, pointRadius: 0, - backgroundColor: sassVariables.dashboardLineColorMarket, - borderColor: sassVariables.dashboardLineColorMarket, + backgroundColor: mcapLineColor, + borderColor: mcapLineColor, lineTension: 0 } this.availableSupply = availableSupply diff --git a/apps/block_scout_web/assets/js/pages/dark-mode-switcher.js b/apps/block_scout_web/assets/js/pages/dark-mode-switcher.js new file mode 100644 index 0000000000..e9e0bdc524 --- /dev/null +++ b/apps/block_scout_web/assets/js/pages/dark-mode-switcher.js @@ -0,0 +1,11 @@ +import $ from 'jquery' + +$('.dark-mode-changer').click(function () { + if (localStorage.getItem('current-color-mode') === 'dark') { + localStorage.setItem('current-color-mode', 'light') + } else { + localStorage.setItem('current-color-mode', 'dark') + } + // reload each theme switch + document.location.reload(true) +}) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex index 9e05643187..d3ea4e5303 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex @@ -115,4 +115,6 @@ defmodule BlockScoutWeb.AddressLogsController do not_found(conn) end end + + def search_logs(conn, _), do: not_found(conn) end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index f6d9b8a30f..ba29c766c1 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -130,6 +130,8 @@ defmodule BlockScoutWeb.AddressTransactionController do end end + def token_transfers_csv(conn, _), do: not_found(conn) + def transactions_csv(conn, %{"address_id" => address_hash_string}) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash) do @@ -149,4 +151,6 @@ defmodule BlockScoutWeb.AddressTransactionController do not_found(conn) end end + + def transactions_csv(conn, _), do: not_found(conn) end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex index 2c16cd1b03..ba5d547cf0 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex @@ -52,6 +52,8 @@ defmodule BlockScoutWeb.ChainController do end end + def search(conn, _), do: not_found(conn) + def token_autocomplete(conn, %{"q" => term}) when is_binary(term) do if term == "" do json(conn, "{}") diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex index 311feb4591..ff0a4e67aa 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex @@ -30,6 +30,8 @@ defmodule BlockScoutWeb.SmartContractController do end end + def index(conn, _), do: not_found(conn) + def show(conn, params) do with true <- ajax?(conn), {:ok, address_hash} <- Chain.string_to_address_hash(params["id"]), diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index 4f5a8e1bed..7a1f5b3ed9 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -261,6 +261,6 @@ defmodule BlockScoutWeb.Router do get("/api_docs", APIDocsController, :index) get("/eth_rpc_api_docs", APIDocsController, :eth_rpc) - get("/:page", PageNotFoundController, :index) + get("/*path", PageNotFoundController, :index) end end diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex index 1b5cb5c4fd..3fb638b1d9 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex @@ -11,6 +11,76 @@ ) %> +
<%= gettext "Decoded" %>
+
+ <%= case decode(@log, @log.transaction) do %> + <% {:error, :contract_not_verified} -> %> +
+ <%= gettext "To see decoded input data, the contract must be verified." %> + <%= case @log.transaction do %> + <% %{to_address: %{hash: hash}} -> %> + <%= gettext "Verify the contract " %><%= gettext "here" %> + <% _ -> %> + <%= nil %> + <% end %> +
+ <% {:error, :could_not_decode} -> %> +
+ <%= gettext "Failed to decode log data." %> +
+ <% {:ok, method_id, text, mapping} -> %> + + + + + + + + + +
Method Id0x<%= method_id %>
Call<%= text %>
+
+ " class="table thead-light table-bordered"> + + + + + + + + <%= for {name, type, indexed?, value} <- mapping do %> + + + + + + + + <% end %> +
<%= gettext "Name" %><%= gettext "Type" %><%= gettext "Indexed?" %><%= gettext "Data" %>
+ <%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> + <% :error -> %> + <%= nil %> + <% copy_text -> %> + + + + + + <% end %> + <%= name %><%= type %><%= indexed? %> +
<%= BlockScoutWeb.ABIEncodedValueView.value_html(type, value) %>
+
+
+ <% _ -> %> + <%= nil %> + <% end %>
<%= gettext "Topics" %>
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index f965f20e0c..2c221e4471 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -1,8 +1,18 @@ -
-<%= render BlockScoutWeb.LayoutView, "_network_selector.html" %> \ No newline at end of file +<%= render BlockScoutWeb.LayoutView, "_network_selector.html" %> + \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex index b3b6ba0665..c3b0fe2ff1 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex @@ -24,6 +24,11 @@ +
<%= if not Explorer.Chain.finished_indexing?() do %>
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex index f009eeb2b3..9e68d7e1bd 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex @@ -1,4 +1,5 @@ -" class="table thead-light table-bordered table-responsive transaction-info-table"> +
+
" class="table thead-light table-bordered"> @@ -7,49 +8,52 @@ -
<%= gettext "Method Id" %> 0x<%= @method_id %>Call <%= @text %>
+ +
<%= unless Enum.empty?(@mapping) do %> - " class="table thead-light table-bordered table-responsive"> - - - - - - - <%= for {name, type, value} <- @mapping do %> +
+
<%= gettext "Name" %><%= gettext "Type" %><%= gettext "Data" %>
" class="table thead-light table-bordered"> + + + + + - - - - + - <% end %> -
<%= gettext "Name" %><%= gettext "Type" %><%= gettext "Data" %>
- <%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> - <% :error -> %> - <%= nil %> - <% copy_text -> %> - - - - - - <% end %> - <%= name %><%= type %> - <%= case BlockScoutWeb.ABIEncodedValueView.value_html(type, value) do %> - <% :error -> %> -
- <%= gettext "Error rendering value" %> -
- <% value -> %> -
<%= value %>
+ <%= for {name, type, value} <- @mapping do %> +
+ <%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> + <% :error -> %> + <%= nil %> + <% copy_text -> %> + + + + + <% end %> - -
+ + <%= name %> + <%= type %> + + <%= case BlockScoutWeb.ABIEncodedValueView.value_html(type, value) do %> + <% :error -> %> +
+ <%= gettext "Error rendering value" %> +
+ <% value -> %> +
<%= value %>
+ <% end %> + + + <% end %> + +
<% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex index 5a52821601..ff3e46d42a 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex @@ -39,43 +39,45 @@ <%= text %> - " class="table thead-light table-bordered table-responsive"> - - - - - - - - <%= for {name, type, indexed?, value} <- mapping do %> +
+
<%= gettext "Name" %><%= gettext "Type" %><%= gettext "Indexed?" %><%= gettext "Data" %>
" class="table thead-light table-bordered"> - - - - - - - <% end %> -
- <%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> - <% :error -> %> - <%= nil %> - <% copy_text -> %> - - - - - - <% end %> - <%= name %><%= type %><%= indexed? %> -
<%= BlockScoutWeb.ABIEncodedValueView.value_html(type, value) %>
-
+ + <%= gettext "Name" %> + <%= gettext "Type" %> + <%= gettext "Indexed?" %> + <%= gettext "Data" %> + + <%= for {name, type, indexed?, value} <- mapping do %> + + + <%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> + <% :error -> %> + <%= nil %> + <% copy_text -> %> + + + + + + <% end %> + + <%= name %> + <%= type %> + <%= indexed? %> + +
<%= BlockScoutWeb.ABIEncodedValueView.value_html(type, value) %>
+ + + <% end %> + + <% _ -> %> <%= nil %> <% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_logs_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_logs_view.ex index 7155e65206..3cdfaf1f9b 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/address_logs_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/address_logs_view.ex @@ -1,3 +1,9 @@ defmodule BlockScoutWeb.AddressLogsView do use BlockScoutWeb, :view + + alias Explorer.Chain.Log + + def decode(log, transaction) do + Log.decode(log, transaction) + end end diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index a96252e762..39f24b16aa 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -62,7 +62,7 @@ msgid "(query)" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:35 +#: lib/block_scout_web/templates/layout/app.html.eex:40 msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgstr "" @@ -87,7 +87,7 @@ msgid "API for the %{subnetwork} - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:56 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:66 msgid "Accounts" msgstr "" @@ -157,7 +157,7 @@ msgid "Block Height: %{height}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:50 +#: lib/block_scout_web/templates/layout/app.html.eex:55 msgid "Block Mined, awaiting import..." msgstr "" @@ -178,13 +178,13 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:87 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:16 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:20 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:26 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:30 msgid "Blocks" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:49 +#: lib/block_scout_web/templates/layout/app.html.eex:54 msgid "Blocks Indexed" msgstr "" @@ -333,14 +333,6 @@ msgstr "" msgid "Curl" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:44 -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:18 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:113 -msgid "Data" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:53 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:188 @@ -384,7 +376,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_balance_card.html.eex:15 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:21 -#: lib/block_scout_web/templates/layout/app.html.eex:55 +#: lib/block_scout_web/templates/layout/app.html.eex:60 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 #: lib/block_scout_web/templates/transaction/overview.html.eex:196 @@ -410,7 +402,7 @@ msgid "Fetching tokens..." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:26 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:36 msgid "Forked Blocks (Reorgs)" msgstr "" @@ -464,7 +456,7 @@ msgid "IN" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:51 +#: lib/block_scout_web/templates/layout/app.html.eex:56 msgid "Indexing Tokens" msgstr "" @@ -496,7 +488,7 @@ msgid "Inventory" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:52 +#: lib/block_scout_web/templates/layout/app.html.eex:57 msgid "Less than" msgstr "" @@ -517,7 +509,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:31 -#: lib/block_scout_web/templates/layout/app.html.eex:53 +#: lib/block_scout_web/templates/layout/app.html.eex:58 #: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:121 msgid "Market Cap" @@ -565,10 +557,11 @@ msgid "Must be set to:" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:46 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:50 -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:16 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:45 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 msgid "Name" msgstr "" @@ -617,7 +610,7 @@ msgid "Parent Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:44 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:54 #: lib/block_scout_web/views/transaction_view.ex:143 #: lib/block_scout_web/views/transaction_view.ex:177 msgid "Pending" @@ -635,7 +628,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:24 -#: lib/block_scout_web/templates/layout/app.html.eex:54 +#: lib/block_scout_web/templates/layout/app.html.eex:59 msgid "Price" msgstr "" @@ -684,8 +677,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:102 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:119 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:118 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:135 msgid "Search" msgstr "" @@ -790,7 +783,7 @@ msgid "To" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:6 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:16 msgid "Toggle navigation" msgstr "" @@ -841,12 +834,6 @@ msgstr "" msgid "Top Accounts - %{subnetwork} Explorer" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:83 -msgid "Topics" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/block/overview.html.eex:67 msgid "Total Difficulty" @@ -889,7 +876,7 @@ msgstr "" #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:35 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:45 #: lib/block_scout_web/views/address_view.ex:305 msgid "Transactions" msgstr "" @@ -917,7 +904,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/block/overview.html.eex:80 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:23 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:33 msgid "Uncles" msgstr "" @@ -932,7 +919,7 @@ msgid "Used" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:39 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:49 msgid "Validated" msgstr "" @@ -1085,17 +1072,17 @@ msgid "Loading...." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:64 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:74 msgid "APIs" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:68 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 msgid "GraphQL" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:73 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:83 msgid "RPC" msgstr "" @@ -1145,48 +1132,37 @@ msgid "Static Call" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:14 msgid "Decoded" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 -msgid "Indexed?" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:17 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 -msgid "Type" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:3 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:4 msgid "Method Id" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:19 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:19 msgid "To see decoded input data, the contract must be verified." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:1 -msgid "Transaction Info" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:13 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:2 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:16 msgid "Transaction Inputs" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:22 #: lib/block_scout_web/templates/transaction/_decoded_input.html.eex:11 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:22 msgid "Verify the contract " msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:22 #: lib/block_scout_web/templates/transaction/_decoded_input.html.eex:11 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:22 msgid "here" @@ -1198,26 +1174,10 @@ msgid "Failed to decode input data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:46 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:49 msgid "Error rendering value" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:28 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:58 -msgid "Copy Value" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 -msgid "Failed to decode log data." -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:42 -msgid "Log Data" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/address_coin_balance/index.html.eex:34 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:61 @@ -1494,8 +1454,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:96 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:100 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:112 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:116 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1721,7 +1681,7 @@ msgid "ETH RPC API Documentation" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:88 msgid "Eth RPC" msgstr "" @@ -1815,3 +1775,50 @@ msgstr "" #: lib/block_scout_web/templates/address_contract/index.html.eex:53 msgid "Constructor Arguments" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:59 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:59 +msgid "Copy Value" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:115 +msgid "Data" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:29 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 +msgid "Failed to decode log data." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:48 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 +msgid "Indexed?" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:43 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:43 +msgid "Log Data" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 +msgid "Topics" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 +msgid "Type" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 367d2a3973..1ed758dd63 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -62,7 +62,7 @@ msgid "(query)" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:35 +#: lib/block_scout_web/templates/layout/app.html.eex:40 msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgstr "" @@ -87,7 +87,7 @@ msgid "API for the %{subnetwork} - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:56 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:66 msgid "Accounts" msgstr "" @@ -157,7 +157,7 @@ msgid "Block Height: %{height}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:50 +#: lib/block_scout_web/templates/layout/app.html.eex:55 msgid "Block Mined, awaiting import..." msgstr "" @@ -178,13 +178,13 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:87 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:16 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:20 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:26 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:30 msgid "Blocks" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:49 +#: lib/block_scout_web/templates/layout/app.html.eex:54 msgid "Blocks Indexed" msgstr "" @@ -333,14 +333,6 @@ msgstr "" msgid "Curl" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:44 -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:18 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:113 -msgid "Data" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:53 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:188 @@ -384,7 +376,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_balance_card.html.eex:15 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:21 -#: lib/block_scout_web/templates/layout/app.html.eex:55 +#: lib/block_scout_web/templates/layout/app.html.eex:60 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 #: lib/block_scout_web/templates/transaction/overview.html.eex:196 @@ -410,7 +402,7 @@ msgid "Fetching tokens..." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:26 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:36 msgid "Forked Blocks (Reorgs)" msgstr "" @@ -464,7 +456,7 @@ msgid "IN" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:51 +#: lib/block_scout_web/templates/layout/app.html.eex:56 msgid "Indexing Tokens" msgstr "" @@ -496,7 +488,7 @@ msgid "Inventory" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/app.html.eex:52 +#: lib/block_scout_web/templates/layout/app.html.eex:57 msgid "Less than" msgstr "" @@ -517,7 +509,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:31 -#: lib/block_scout_web/templates/layout/app.html.eex:53 +#: lib/block_scout_web/templates/layout/app.html.eex:58 #: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:121 msgid "Market Cap" @@ -565,10 +557,11 @@ msgid "Must be set to:" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:46 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:50 -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:16 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:45 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 msgid "Name" msgstr "" @@ -617,7 +610,7 @@ msgid "Parent Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:44 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:54 #: lib/block_scout_web/views/transaction_view.ex:143 #: lib/block_scout_web/views/transaction_view.ex:177 msgid "Pending" @@ -635,7 +628,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:24 -#: lib/block_scout_web/templates/layout/app.html.eex:54 +#: lib/block_scout_web/templates/layout/app.html.eex:59 msgid "Price" msgstr "" @@ -684,8 +677,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:102 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:119 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:118 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:135 msgid "Search" msgstr "" @@ -790,7 +783,7 @@ msgid "To" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:6 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:16 msgid "Toggle navigation" msgstr "" @@ -841,12 +834,6 @@ msgstr "" msgid "Top Accounts - %{subnetwork} Explorer" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:83 -msgid "Topics" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/block/overview.html.eex:67 msgid "Total Difficulty" @@ -889,7 +876,7 @@ msgstr "" #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:35 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:45 #: lib/block_scout_web/views/address_view.ex:305 msgid "Transactions" msgstr "" @@ -917,7 +904,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/block/overview.html.eex:80 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:23 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:33 msgid "Uncles" msgstr "" @@ -932,7 +919,7 @@ msgid "Used" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:39 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:49 msgid "Validated" msgstr "" @@ -1085,17 +1072,17 @@ msgid "Loading...." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:64 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:74 msgid "APIs" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:68 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 msgid "GraphQL" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:73 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:83 msgid "RPC" msgstr "" @@ -1145,48 +1132,37 @@ msgid "Static Call" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:14 msgid "Decoded" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 -msgid "Indexed?" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:17 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 -msgid "Type" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:3 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:4 msgid "Method Id" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:19 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:19 msgid "To see decoded input data, the contract must be verified." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:1 -msgid "Transaction Info" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:13 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:2 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:16 msgid "Transaction Inputs" msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:22 #: lib/block_scout_web/templates/transaction/_decoded_input.html.eex:11 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:22 msgid "Verify the contract " msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:22 #: lib/block_scout_web/templates/transaction/_decoded_input.html.eex:11 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:22 msgid "here" @@ -1198,25 +1174,10 @@ msgid "Failed to decode input data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:46 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:49 msgid "Error rendering value" msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:28 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:58 -msgid "Copy Value" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 -msgid "Failed to decode log data." -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:42 -msgid "Log Data" -msgstr "" +"" #, elixir-format #: lib/block_scout_web/templates/address_coin_balance/index.html.eex:34 @@ -1494,8 +1455,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:96 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:100 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:112 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:116 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1721,7 +1682,7 @@ msgid "ETH RPC API Documentation" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:88 msgid "Eth RPC" msgstr "" @@ -1815,3 +1776,50 @@ msgstr "" #: lib/block_scout_web/templates/address_contract/index.html.eex:53 msgid "Constructor Arguments" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:59 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:59 +msgid "Copy Value" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:115 +msgid "Data" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:29 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 +msgid "Failed to decode log data." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:48 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 +msgid "Indexed?" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:43 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:43 +msgid "Log Data" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 +msgid "Topics" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 +#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 +msgid "Type" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/errors.pot b/apps/block_scout_web/priv/gettext/errors.pot index ca584666e5..cdaaac6299 100644 --- a/apps/block_scout_web/priv/gettext/errors.pot +++ b/apps/block_scout_web/priv/gettext/errors.pot @@ -1,52 +1,52 @@ -## This file is a PO Template file. -## -## `msgid`s here are often extracted from source code. -## Add new translations manually only if they're dynamic -## translations that can't be statically extracted. -## -## Run `mix gettext.extract` to bring this file up to -## date. Leave `msgstr`s empty as changing them here as no -## effect: edit them in PO (`.po`) files instead. -## From Ecto.Changeset.cast/4 +## This file is a PO Template file. +## +## `msgid`s here are often extracted from source code. +## Add new translations manually only if they're dynamic +## translations that can't be statically extracted. +## +## Run `mix gettext.extract` to bring this file up to +## date. Leave `msgstr`s empty as changing them here as no +## effect: edit them in PO (`.po`) files instead. +## From Ecto.Changeset.cast/4 msgid "can't be blank" msgstr "" -## From Ecto.Changeset.unique_constraint/3 +## From Ecto.Changeset.unique_constraint/3 msgid "has already been taken" msgstr "" -## From Ecto.Changeset.put_change/3 +## From Ecto.Changeset.put_change/3 msgid "is invalid" msgstr "" -## From Ecto.Changeset.validate_acceptance/3 +## From Ecto.Changeset.validate_acceptance/3 msgid "must be accepted" msgstr "" -## From Ecto.Changeset.validate_format/3 +## From Ecto.Changeset.validate_format/3 msgid "has invalid format" msgstr "" -## From Ecto.Changeset.validate_subset/3 +## From Ecto.Changeset.validate_subset/3 msgid "has an invalid entry" msgstr "" -## From Ecto.Changeset.validate_exclusion/3 +## From Ecto.Changeset.validate_exclusion/3 msgid "is reserved" msgstr "" -## From Ecto.Changeset.validate_confirmation/3 +## From Ecto.Changeset.validate_confirmation/3 msgid "does not match confirmation" msgstr "" -## From Ecto.Changeset.no_assoc_constraint/3 +## From Ecto.Changeset.no_assoc_constraint/3 msgid "is still associated with this entry" msgstr "" msgid "are still associated with this entry" msgstr "" -## From Ecto.Changeset.validate_length/3 +## From Ecto.Changeset.validate_length/3 msgid "should be %{count} character(s)" msgid_plural "should be %{count} character(s)" msgstr[0] "" @@ -77,7 +77,7 @@ msgid_plural "should have at most %{count} item(s)" msgstr[0] "" msgstr[1] "" -## From Ecto.Changeset.validate_number/3 +## From Ecto.Changeset.validate_number/3 msgid "must be less than %{number}" msgstr "" diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex index f021bfa153..7992c0e63c 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex @@ -353,4 +353,8 @@ defmodule EthereumJSONRPC.Transaction do _ -> {key, quantity_to_integer(chain_id)} end end + + defp entry_to_elixir(_) do + {nil, nil} + end end diff --git a/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs b/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs index ad7780181d..a8a8fcdfd2 100644 --- a/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs +++ b/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs @@ -2,4 +2,14 @@ defmodule EthereumJSONRPC.TransactionTest do use ExUnit.Case, async: true doctest EthereumJSONRPC.Transaction + + alias EthereumJSONRPC.Transaction + + describe "to_elixir/1" do + test "skips unsupported keys" do + map = %{"key" => "value", "key1" => "value1"} + + assert %{nil: nil} = Transaction.to_elixir(map) + end + end end diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 0e01212c37..46eda15b62 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -273,7 +273,7 @@ defmodule Explorer.Chain do from(log in Log, inner_join: transaction in assoc(log, :transaction), order_by: [desc: transaction.block_number, desc: transaction.index], - preload: [:transaction], + preload: [:transaction, transaction: [to_address: :smart_contract]], where: transaction.block_number < ^block_number, or_where: transaction.block_number == ^block_number and transaction.index > ^transaction_index, or_where: