After Width: | Height: | Size: 806 B |
@ -0,0 +1,7 @@ |
||||
// general |
||||
$primary: #2b9f7a; |
||||
$secondary: #20745a; |
||||
$tertiary: #fff; |
||||
$additional-font: #fff; |
||||
|
||||
$btn-line-color: $secondary; // button border and font color && hover bg color |
@ -0,0 +1,97 @@ |
||||
// general |
||||
$primary: #2b9f7a; |
||||
$secondary: #20745a; |
||||
$tertiary: #fff; |
||||
$additional-font: #fff; |
||||
|
||||
$tile-body-a-color: $primary; |
||||
$tile-type-block-color: $primary; |
||||
$tile-type-progress-bar-color: $primary; |
||||
a.tile-title { color: $primary !important; } |
||||
|
||||
// footer |
||||
$footer-background-color: #282d31; |
||||
$footer-title-color: #fff; |
||||
$footer-text-color: $additional-font; |
||||
$footer-item-disc-color: $secondary; |
||||
$footer-social-icon-color: $secondary; |
||||
|
||||
// dashboard |
||||
$dashboard-line-color-price: #fff; // price left border |
||||
|
||||
$dashboard-banner-chart-legend-label-color: #fff; |
||||
$dashboard-stats-item-label-color: $dashboard-banner-chart-legend-label-color; |
||||
$dashboard-banner-chart-legend-value-color: #fff; // chart labels |
||||
$dashboard-stats-item-value-color: #fff; // stat values |
||||
|
||||
$dashboard-stats-item-border-color: $secondary; // stat border |
||||
|
||||
$dashboard-banner-gradient-start: $primary; // gradient begin |
||||
|
||||
$dashboard-banner-gradient-end: #289371; // gradient end |
||||
|
||||
$dashboard-banner-network-plain-container-background-color: #2ea780; // stats bg |
||||
|
||||
|
||||
// navigation |
||||
.navbar { box-shadow: 0px 0px 30px 0px rgba(21, 53, 80, 0.12); } // header shadow |
||||
$dropdown-menu-item-hover-color: $primary !default; |
||||
$dropdown-menu-item-hover-background: rgba($primary, .1) !default; |
||||
$header-icon-color-hover: $primary; |
||||
$header-icon-border-color-hover: $primary; |
||||
|
||||
// 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 |
||||
$btn-address-card-icon-color: $primary; // btn address color |
||||
|
||||
//links & tile |
||||
$tile-body-a-color: $primary; |
||||
$tile-type-block-color: $primary; |
||||
$tile-type-progress-bar-color: $primary; |
||||
a.tile-title { color: $primary !important; } |
||||
|
||||
// card |
||||
$card-background-1: $primary; |
||||
$card-tab-active: $primary; |
||||
|
||||
.layout-container { |
||||
.dashboard-banner-container { |
||||
background-image: linear-gradient( |
||||
to bottom, |
||||
$dashboard-banner-gradient-start, |
||||
$dashboard-banner-gradient-end |
||||
); |
||||
} |
||||
} |
||||
|
||||
// Badges |
||||
$badge-neutral-color: $primary; |
||||
$badge-neutral-background-color: rgba($primary, .1); |
||||
$api-text-monospace-color: $primary; |
||||
|
||||
// Tokens dropdown |
||||
.token-balance-dropdown[aria-labelledby="dropdown-tokens"] { |
||||
.dropdown-items .dropdown-item:hover { |
||||
color: $primary !important; |
||||
} |
||||
} |
||||
|
||||
// Dark theme |
||||
$dark-primary: #2b9f7a; |
||||
$dark-secondary: #20745a; |
||||
$dark-primary-alternate: #2b9f7a; |
||||
|
||||
.dark-theme-applied .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(1)::before { |
||||
background-color: white!important; |
||||
} |
||||
|
||||
.dark-theme-applied .dashboard-banner-chart-legend .dashboard-banner-chart-legend-item:nth-child(2)::before { |
||||
background-color: $primary!important; |
||||
} |
||||
|
||||
.dark-theme-applied .tile .tile-body a, .dark-theme-applied .tile span[data-address-hash] { |
||||
color: #2b9f7a; |
||||
} |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 584 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,89 @@ |
||||
defmodule Explorer.ChainSpec.POA.Importer do |
||||
@moduledoc """ |
||||
Imports emission reward range for POA chain. |
||||
""" |
||||
|
||||
require Logger |
||||
|
||||
alias Explorer.Chain.Wei |
||||
alias Explorer.Repo |
||||
alias Explorer.SmartContract.Reader |
||||
alias Explorer.Chain.Block.{EmissionReward, Range} |
||||
alias Explorer.ChainSpec.GenesisData |
||||
|
||||
@block_reward_amount_abi %{ |
||||
"type" => "function", |
||||
"stateMutability" => "view", |
||||
"payable" => false, |
||||
"outputs" => [%{"type" => "uint256", "name" => ""}], |
||||
"name" => "blockRewardAmount", |
||||
"inputs" => [], |
||||
"constant" => true |
||||
} |
||||
@block_reward_amount_params %{"blockRewardAmount" => []} |
||||
@emission_funds_amount_abi %{ |
||||
"type" => "function", |
||||
"stateMutability" => "view", |
||||
"payable" => false, |
||||
"outputs" => [%{"type" => "uint256", "name" => ""}], |
||||
"name" => "emissionFundsAmount", |
||||
"inputs" => [], |
||||
"constant" => true |
||||
} |
||||
@emission_funds_amount_params %{"emissionFundsAmount" => []} |
||||
@emission_funds_block_start 5_098_087 |
||||
|
||||
def import_emission_rewards do |
||||
if is_nil(rewards_contract_address()) do |
||||
Logger.warn(fn -> "No rewards contract address is defined" end) |
||||
else |
||||
block_reward = block_reward_amount() |
||||
emission_funds = emission_funds_amount() |
||||
|
||||
rewards = [ |
||||
%{ |
||||
block_range: %Range{from: 0, to: @emission_funds_block_start}, |
||||
reward: %Wei{value: block_reward} |
||||
}, |
||||
%{ |
||||
block_range: %Range{from: @emission_funds_block_start + 1, to: :infinity}, |
||||
reward: %Wei{value: Decimal.add(block_reward, emission_funds)} |
||||
} |
||||
] |
||||
|
||||
{_, nil} = Repo.delete_all(EmissionReward) |
||||
{_, nil} = Repo.insert_all(EmissionReward, rewards) |
||||
end |
||||
end |
||||
|
||||
def block_reward_amount do |
||||
call_contract(rewards_contract_address(), @block_reward_amount_abi, @block_reward_amount_params) |
||||
end |
||||
|
||||
def emission_funds_amount do |
||||
call_contract(rewards_contract_address(), @emission_funds_amount_abi, @emission_funds_amount_params) |
||||
end |
||||
|
||||
defp rewards_contract_address do |
||||
Application.get_env(:explorer, GenesisData)[:rewards_contract_address] |
||||
end |
||||
|
||||
defp call_contract(address, abi, params) do |
||||
abi = [abi] |
||||
|
||||
method_name = |
||||
params |
||||
|> Enum.map(fn {key, _value} -> key end) |
||||
|> List.first() |
||||
|
||||
Reader.query_contract(address, abi, params) |
||||
|
||||
value = |
||||
case Reader.query_contract(address, abi, params) do |
||||
%{^method_name => {:ok, [result]}} -> result |
||||
_ -> 0 |
||||
end |
||||
|
||||
Decimal.new(value) |
||||
end |
||||
end |
@ -0,0 +1,7 @@ |
||||
defmodule Explorer.Repo.Migrations.CreateIndexesForBlockNumberInTokenTransfersAndTransactions do |
||||
use Ecto.Migration |
||||
|
||||
def change do |
||||
create_if_not_exists(index(:token_transfers, [:block_number])) |
||||
end |
||||
end |