commit
f7511aa948
@ -1,3 +1,50 @@ |
|||||||
$primary: #16465b; |
// general |
||||||
$secondary: #5ab3ff; |
$primary: #153550; |
||||||
$tertiary: #77a4c5; |
$secondary: #49a2ee; |
||||||
|
$tertiary: #4ad7a7; |
||||||
|
$additional-font: #89cae6; |
||||||
|
|
||||||
|
// footer |
||||||
|
$footer-background-color: $primary; |
||||||
|
$footer-title-color: #fff; |
||||||
|
$footer-text-color: #89cae6; |
||||||
|
$footer-item-disc-color: $secondary; |
||||||
|
.footer-logo { filter: brightness(0) invert(1); } |
||||||
|
|
||||||
|
// dashboard |
||||||
|
$dashboard-line-color-price: $tertiary; // price left border |
||||||
|
|
||||||
|
$dashboard-banner-chart-legend-value-color: $additional-font; // chart labels |
||||||
|
|
||||||
|
$dashboard-stats-item-value-color: $additional-font; // stat values |
||||||
|
|
||||||
|
$dashboard-stats-item-border-color: $secondary; // stat border |
||||||
|
|
||||||
|
$dashboard-banner-gradient-start: $primary; // gradient begin |
||||||
|
|
||||||
|
$dashboard-banner-gradient-end: lighten($primary, 5); // gradient end |
||||||
|
|
||||||
|
$dashboard-banner-network-plain-container-background-color: #1c476c; // stats bg |
||||||
|
|
||||||
|
|
||||||
|
// navigation |
||||||
|
.navbar { box-shadow: 0px 0px 30px 0px rgba(21, 53, 80, 0.12); } // header shadow |
||||||
|
$header-icon-border-color-hover: $secondary; // top border on hover |
||||||
|
$header-icon-color-hover: $secondary; // nav icon on hover |
||||||
|
.dropdown-item:hover, .dropdown-item:focus { background-color: $secondary !important; } // dropdown item on hover |
||||||
|
|
||||||
|
// buttons |
||||||
|
$btn-line-bg: #fff; // button bg |
||||||
|
$btn-line-color: $secondary; // button border and font color && hover bg color |
||||||
|
$btn-copy-color: $secondary; // btn copy |
||||||
|
$btn-qr-color: $secondary; // btn qr-code |
||||||
|
|
||||||
|
//links & tile |
||||||
|
.tile a { color: $secondary !important; } // links color for badges |
||||||
|
.tile-type-block { |
||||||
|
border-left: 4px solid $secondary; |
||||||
|
} // tab active bg |
||||||
|
|
||||||
|
// card |
||||||
|
$card-background-1: $secondary; |
||||||
|
$card-tab-active: $secondary; |
||||||
|
@ -1,11 +1,50 @@ |
|||||||
$primary: #5b389f; |
// general |
||||||
$secondary: #7dd79f; |
$primary: #5c34a2; |
||||||
$tertiary: #997fdc; |
$secondary: #87e1a9; |
||||||
|
$tertiary: #bf9cff; |
||||||
|
$additional-font: #fff; |
||||||
|
|
||||||
$header-links-color-active: #333; |
// footer |
||||||
$button-secondary-color: $primary; |
$footer-background-color: #3c226a; |
||||||
|
|
||||||
$footer-background-color: $primary; |
|
||||||
$footer-title-color: #fff; |
$footer-title-color: #fff; |
||||||
$footer-text-color: #fff; |
$footer-text-color: #bda6e7; |
||||||
$footer-item-disc-color: $secondary; |
$footer-item-disc-color: $secondary; |
||||||
|
.footer-logo { filter: brightness(0) invert(1); } |
||||||
|
|
||||||
|
// dashboard |
||||||
|
$dashboard-line-color-price: $tertiary; // price left border |
||||||
|
|
||||||
|
$dashboard-banner-chart-legend-value-color: $additional-font; // chart labels |
||||||
|
|
||||||
|
$dashboard-stats-item-value-color: $additional-font; // stat values |
||||||
|
|
||||||
|
$dashboard-stats-item-border-color: $secondary; // stat border |
||||||
|
|
||||||
|
$dashboard-banner-gradient-start: $primary; // gradient begin |
||||||
|
|
||||||
|
$dashboard-banner-gradient-end: lighten($primary, 5); // gradient end |
||||||
|
|
||||||
|
$dashboard-banner-network-plain-container-background-color: #865bd4; // stats bg |
||||||
|
|
||||||
|
|
||||||
|
// navigation |
||||||
|
.navbar { box-shadow: 0px 0px 30px 0px rgba(21, 53, 80, 0.12); } // header shadow |
||||||
|
$header-icon-border-color-hover: $primary; // top border on hover |
||||||
|
$header-icon-color-hover: $primary; // nav icon on hover |
||||||
|
.dropdown-item:hover, .dropdown-item:focus { background-color: $primary !important; } // dropdown item on hover |
||||||
|
|
||||||
|
// buttons |
||||||
|
$btn-line-bg: #fff; // button bg |
||||||
|
$btn-line-color: $primary; // button border and font color && hover bg color |
||||||
|
$btn-copy-color: $primary; // btn copy |
||||||
|
$btn-qr-color: $primary; // btn qr-code |
||||||
|
|
||||||
|
//links & tile |
||||||
|
.tile a { color: $primary !important; } // links color for badges |
||||||
|
.tile-type-block { |
||||||
|
border-left: 4px solid $primary; |
||||||
|
} // tab active bg |
||||||
|
|
||||||
|
// card |
||||||
|
$card-background-1: $primary; |
||||||
|
$card-tab-active: $primary; |
||||||
|
@ -0,0 +1,50 @@ |
|||||||
|
// general |
||||||
|
$primary: #101f25; |
||||||
|
$secondary: #27ac8d; |
||||||
|
$tertiary: #e39a54; |
||||||
|
$additional-font: #a1ded1; |
||||||
|
|
||||||
|
// footer |
||||||
|
$footer-background-color: $primary; |
||||||
|
$footer-title-color: #fff; |
||||||
|
$footer-text-color: $additional-font; |
||||||
|
$footer-item-disc-color: $secondary; |
||||||
|
.footer-logo { filter: brightness(0) invert(1); } |
||||||
|
|
||||||
|
// dashboard |
||||||
|
$dashboard-line-color-price: $tertiary; // price left border |
||||||
|
|
||||||
|
$dashboard-banner-chart-legend-value-color: $additional-font; // chart labels |
||||||
|
|
||||||
|
$dashboard-stats-item-value-color: $additional-font; // stat values |
||||||
|
|
||||||
|
$dashboard-stats-item-border-color: $secondary; // stat border |
||||||
|
|
||||||
|
$dashboard-banner-gradient-start: $primary; // gradient begin |
||||||
|
|
||||||
|
$dashboard-banner-gradient-end: lighten($primary, 5); // gradient end |
||||||
|
|
||||||
|
$dashboard-banner-network-plain-container-background-color: #1a323b; // stats bg |
||||||
|
|
||||||
|
|
||||||
|
// navigation |
||||||
|
.navbar { box-shadow: 0px 0px 30px 0px rgba(21, 53, 80, 0.12); } // header shadow |
||||||
|
$header-icon-border-color-hover: $secondary; // top border on hover |
||||||
|
$header-icon-color-hover: $secondary; // nav icon on hover |
||||||
|
.dropdown-item:hover, .dropdown-item:focus { background-color: $secondary !important; } // dropdown item on hover |
||||||
|
|
||||||
|
// buttons |
||||||
|
$btn-line-bg: #fff; // button bg |
||||||
|
$btn-line-color: $secondary; // button border and font color && hover bg color |
||||||
|
$btn-copy-color: $secondary; // btn copy |
||||||
|
$btn-qr-color: $secondary; // btn qr-code |
||||||
|
|
||||||
|
//links & tile |
||||||
|
.tile a { color: $secondary !important; } // links color for badges |
||||||
|
.tile-type-block { |
||||||
|
border-left: 4px solid $secondary; |
||||||
|
} // tab active bg |
||||||
|
|
||||||
|
// card |
||||||
|
$card-background-1: $secondary; |
||||||
|
$card-tab-active: $secondary; |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 5.3 KiB |
@ -1 +1,2 @@ |
|||||||
priv/.recovery |
priv/.recovery |
||||||
|
priv/solc_compilers/ |
||||||
|
@ -0,0 +1,92 @@ |
|||||||
|
defmodule Explorer.SmartContract.SolcDownloader do |
||||||
|
@moduledoc """ |
||||||
|
Checks to see if the requested solc compiler version exists, and if not it |
||||||
|
downloads and stores the file. |
||||||
|
""" |
||||||
|
use GenServer |
||||||
|
|
||||||
|
alias Explorer.SmartContract.Solidity.CompilerVersion |
||||||
|
|
||||||
|
@latest_compiler_refetch_time :timer.minutes(30) |
||||||
|
|
||||||
|
def ensure_exists(version) do |
||||||
|
path = file_path(version) |
||||||
|
|
||||||
|
if File.exists?(path) do |
||||||
|
path |
||||||
|
else |
||||||
|
{:ok, compiler_versions} = CompilerVersion.fetch_versions() |
||||||
|
|
||||||
|
if version in compiler_versions do |
||||||
|
GenServer.call(__MODULE__, {:ensure_exists, version}, 60_000) |
||||||
|
else |
||||||
|
false |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
def start_link(_) do |
||||||
|
GenServer.start_link(__MODULE__, [], name: __MODULE__) |
||||||
|
end |
||||||
|
|
||||||
|
# sobelow_skip ["Traversal"] |
||||||
|
@impl true |
||||||
|
def init([]) do |
||||||
|
File.mkdir(compiler_dir()) |
||||||
|
|
||||||
|
{:ok, []} |
||||||
|
end |
||||||
|
|
||||||
|
# sobelow_skip ["Traversal"] |
||||||
|
@impl true |
||||||
|
def handle_call({:ensure_exists, version}, _from, state) do |
||||||
|
path = file_path(version) |
||||||
|
|
||||||
|
if fetch?(version, path) do |
||||||
|
temp_path = file_path("#{version}-tmp") |
||||||
|
|
||||||
|
contents = download(version) |
||||||
|
|
||||||
|
file = File.open!(temp_path, [:write, :exclusive]) |
||||||
|
|
||||||
|
IO.binwrite(file, contents) |
||||||
|
|
||||||
|
File.rename(temp_path, path) |
||||||
|
end |
||||||
|
|
||||||
|
{:reply, path, state} |
||||||
|
end |
||||||
|
|
||||||
|
defp fetch?("latest", path) do |
||||||
|
case File.stat(path) do |
||||||
|
{:error, :enoent} -> |
||||||
|
true |
||||||
|
|
||||||
|
{:ok, %{mtime: mtime}} -> |
||||||
|
last_modified = NaiveDateTime.from_erl!(mtime) |
||||||
|
diff = Timex.diff(NaiveDateTime.utc_now(), last_modified, :milliseconds) |
||||||
|
|
||||||
|
diff > @latest_compiler_refetch_time |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
defp fetch?(_, path) do |
||||||
|
not File.exists?(path) |
||||||
|
end |
||||||
|
|
||||||
|
defp file_path(version) do |
||||||
|
Path.join(compiler_dir(), "#{version}.js") |
||||||
|
end |
||||||
|
|
||||||
|
defp compiler_dir do |
||||||
|
Application.app_dir(:explorer, "priv/solc_compilers/") |
||||||
|
end |
||||||
|
|
||||||
|
defp download(version) do |
||||||
|
download_path = "https://ethereum.github.io/solc-bin/bin/soljson-#{version}.js" |
||||||
|
|
||||||
|
download_path |
||||||
|
|> HTTPoison.get!([], timeout: 60_000) |
||||||
|
|> Map.get(:body) |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue