Skip to content

Commit

Permalink
Update blockchains: Evm (Blast mainnet) and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-skripnik committed Mar 1, 2024
1 parent b1d4760 commit c5f39f9
Show file tree
Hide file tree
Showing 19 changed files with 115 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ RewriteCond %{HTTP_HOST} ^(www\.)?viz\.dpos\.space$ [NC]
RewriteCond %{REQUEST_URI} !^/viz-manual/
RewriteRule ^(.*)$ viz-manual/$1 [L]

#редрект для поддомена mgswap
RewriteCond %{HTTP_HOST} ^(www\.)?mgswap\.dpos\.space$ [NC]
RewriteCond %{REQUEST_URI} !^/mgswap/
RewriteRule ^(.*)$ mgswap/$1 [L]

#Редирект на https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]
Expand Down Expand Up @@ -71,6 +76,8 @@ RedirectMatch 301 ^/post/(.*) https://dpos.space/$1/post
RedirectMatch 301 ^/backup/(.*) https://dpos.space/$1/backup
RedirectMatch 301 ^/profiles/(.*)/(.*) https://dpos.space/$2/profiles/$1/
RedirectMatch 301 ^/golos/profiles/(.*)/sp https://dpos.space/golos/profiles/$1/gp
RedirectMatch 301 ^/golos/api/(.*).php https://dpos.space/golos/api/$1
RedirectMatch 301 ^/golos/api/get_uia-top https://dpos.space/golos/api/uia-top
RedirectMatch 301 ^/minter/long/survays https://dpos.space/minter/long/surveys
RewriteCond %{QUERY_STRING} chain=(.*) [NC]
RewriteCond %{QUERY_STRING} block1=(.*) [NC]
Expand Down
4 changes: 2 additions & 2 deletions api/viz/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"main.css": "static/css/main.173761dc.css",
"main.css.map": "static/css/main.173761dc.css.map",
"main.js": "static/js/main.ccd184a3.js",
"main.js.map": "static/js/main.ccd184a3.js.map",
"main.js": "static/js/main.afeb7326.js",
"main.js.map": "static/js/main.afeb7326.js.map",
"static\\media\\ad.svg": "static/media/ad.2f0263e0.svg",
"static\\media\\ae.svg": "static/media/ae.d038b7ed.svg",
"static\\media\\af.svg": "static/media/af.14c45ecc.svg",
Expand Down
2 changes: 1 addition & 1 deletion api/viz/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"><link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"><link rel="manifest" href="/viz/manifest.json"><link rel="shortcut icon" href="/viz/favicon.ico"><title>React App</title><link href="/viz/static/css/main.173761dc.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/viz/static/js/main.ccd184a3.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"><link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"><link rel="manifest" href="/viz/manifest.json"><link rel="shortcut icon" href="/viz/favicon.ico"><title>React App</title><link href="/viz/static/css/main.173761dc.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/viz/static/js/main.afeb7326.js"></script></body></html>
2 changes: 1 addition & 1 deletion api/viz/service-worker.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/viz/static/js/main.afeb7326.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/viz/static/js/main.afeb7326.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/viz/static/js/main.ccd184a3.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions blockchains/evm/apps/blast-bridge/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Мост Blast testnet",
"description": "Мост в и из Blast testnet.",
"in_menu": "Мост Blast testnet",
"category": "no_category"
}
11 changes: 11 additions & 0 deletions blockchains/evm/apps/blast-bridge/content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php if (!defined('NOTLOAD')) exit('No direct script access allowed');
return '<div>
<h2>2. Перевод</h2>
<form>
<p><label for="eth_amount">Сумма в ETH</label><br>
<input type="number" min = "0" id = "eth_amount"><br>
<input type="button" onclick="setMaxAmount()" value="Максимум"></p>
<p><button id="run_send" onclick="sendEth()">Перевести в <span id="chain_name"></span></button></p>
</form>
</div>';
?>
2 changes: 2 additions & 0 deletions blockchains/evm/apps/blast-bridge/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php if (!defined('NOTLOAD')) exit('No direct script access allowed');
?>
49 changes: 49 additions & 0 deletions blockchains/evm/apps/blast-bridge/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const contracts = {
"11155111": "0xc644cc19d2A9388b71dd1dEde07cFFC73237Dca8"
}

let contract;

var toAddress = contracts[chain_id];

async function sendEth() {
toAddress = contracts[chain_id];
const ethAmountInput = document.getElementById("eth_amount");
const ethAmount = ethAmountInput.value;

if (!ethAmount || ethAmount <= 0) {
alert("Введите корректную сумму ETH");
return;
}

try {
const transaction = await signer.sendTransaction({
to: toAddress,
value: ethers.utils.parseEther(ethAmount),
});

console.log("Transaction hash:", transaction.hash);
alert("Транзакция отправлена. Хеш: " + transaction.hash);

// Очистить поле ввода после успешной транзакции
ethAmountInput.value = "";
} catch (error) {
console.error("Error:", error.message);
alert("Ошибка при отправке транзакции: " + error.message);
}
}

async function setMaxAmount() {

// Получить баланс аккаунта
const balance = await signer.getBalance();

// Оценить предполагаемую комиссию (может потребоваться подбирать значение в зависимости от условий сети)
const gasPrice = await provider.getGasPrice();
const estimatedGasLimit = 21000; // Стандартный лимит газа для перевода
const estimatedGasCost = gasPrice.mul(estimatedGasLimit);
const maxAmount = ethers.utils.formatEther(balance.sub(estimatedGasCost));

// Установить максимальную сумму в поле ввода
document.getElementById("eth_amount").value = maxAmount;
}
3 changes: 2 additions & 1 deletion blockchains/evm/apps/create-token/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const contracts = {
"80085": "0x0f96E331b1DC1DbbC1B8526F391C52B5C8f0d7F4",
"168587773": "0x02fE9E2595147CC7963141F3e15928c88Be83F47",
"9999": "0xbc05Cc40eC89554ae9067426d12Cc087b377084C",
"81457": "0xcc10645534c0601c03f0a06d56071db67207aeda",
"9999": "0xbc05Cc40eC89554ae9067426d12Cc087b377084C",
"111000": "0xF4f212ebD63864726e6A666b1B6d9368E38086C7",
"534352": "0xc5076e7470e7bb1b16a84142f79f6fcba83fb9fd",
"167005": "0x9257437b986b989EE791331a69Dfb7Bd1aEFeF21",
Expand Down
2 changes: 1 addition & 1 deletion blockchains/evm/apps/rockPaperScissors/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const contracts = {
"80085": "0x5C38198fcDb7e5e685f419c5A7f892007ff9641f",
"168587773": "0x389C942d852dD1831583101897F798608C16Cf5e",
"168587773": "0x3b762E781879e7f73Db95C4eed2b04Fd19075683",
"9999": "0xc5076e7470e7bb1B16A84142F79F6fCbA83fb9fD",
"167005": "0x73C9F6e1B870a9447E329a3d6D20360D56988A0f",
"111000": "0xE42bdd2AE5A7A9BAB6496D479a2c0C0E737ba2e3",
Expand Down
1 change: 1 addition & 0 deletions blockchains/evm/apps/token-miner/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const contracts = {
"80085": "0x28bDeb1d7d17fA67aE1652A25aB0744Bc883322C",
"168587773": "0x1891159aB15416c45fFbfa4448428D34E9bF8C16",
"81457": "0xe42bdd2ae5a7a9bab6496d479a2c0c0e737ba2e3",
"9999": "0xC7E932d75f9C317c8900D4c21187b6a1961CFe55",
"111000": "0xbc05Cc40eC89554ae9067426d12Cc087b377084C",
"534352": "0xbc05cc40ec89554ae9067426d12cc087b377084c",
Expand Down
8 changes: 8 additions & 0 deletions blockchains/evm/js/blockchain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const networks = {
"80085": "Berachain-Artio",
"168587773": "Blast Sepolia Testnet",
"81457": "Blast mainnet",
"11155111": "Ethereum Sepolia",
"9999": "Meganet RC",
"111000": "Siberium Testnet",
"534352": "Scroll mainnet",
Expand All @@ -16,6 +18,8 @@ const networks = {
const tokens = {
"80085": "BERA",
"168587773": "ETH",
"81457": "ETH",
"11155111": "ETH",
"9999": "MEGA",
"111000": "SIBR",
"534352": "ETH",
Expand All @@ -31,6 +35,8 @@ const tokens = {
const explorers = {
"80085": "https://testnet.beratrail.io",
"168587773": "https://testnet.blastscan.io",
"81457": "https://blastscan.io",
"11155111": "https://sepolia.etherscan.io",
"9999": "https://scan.metagarden.io",
"111000": "https://explorer.test.siberium.net",
"534352": "https://blockscout.scroll.io",
Expand Down Expand Up @@ -110,6 +116,8 @@ $(document).ready(function() {
$('input[type=radio][name=network]').change(function() {
if (document.getElementById("nativeToken") !== null) document.getElementById('nativeToken').innerHTML = tokens[chain_id]
if (document.getElementById("smartContractAddress") !== null) document.getElementById('smartContractAddress').innerHTML = contracts[chain_id]
if (document.getElementById("chain_name") !== null && chain_id === "11155111") document.getElementById('chain_name').innerHTML = networks["168587773"]
if (document.getElementById("chain_name") !== null && chain_id === "168587773") document.getElementById('chain_name').innerHTML = networks["11155111"]
if (document.getElementById("faucetBlock") !== null && chain_id !== '3333') document.getElementById('faucetBlock').style.display = 'none';
$(':button').prop('disabled', false);
}) // end change.
Expand Down
3 changes: 2 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function to_menu($blockchain, $permlink, $ankor, $category = 'no_category') {
$taskList[$blockchain]['services'][$category]['name'] = $categories[$category];
$taskList[$blockchain]['services'][$category][$permlink] = $ankor;
}
file_put_contents(__DIR__.'/menu.json', json_encode($taskList, JSON_UNESCAPED_UNICODE));
// file_put_contents(__DIR__.'/menu.json', json_encode($taskList, JSON_UNESCAPED_UNICODE));
unset($taskList);
}
}
Expand Down Expand Up @@ -310,6 +310,7 @@ function getPage($url) {
if (strpos($url, 'cbr.ru') !== false && time() - filemtime($cache_file) > 43200) {
$cache = file_get_contents($url);
$t=explode("<Sell>", $cache);
if (count($t) < 2) return;
$t=explode("</Sell>", $t[1]);
$count = count($t);
if (isset($t) && $t[0]<>0 || $count > 14) {
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function myHandler($level, $message, $file, $line, $context) {

if (file_exists($api_file)) {
require_once($api_file);
return;
} else {
$data = get404Page();
}
Expand Down
2 changes: 1 addition & 1 deletion menu.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"evm":{"name":"EVM","services":{"games":{"name":"Игры","rockPaperScissors":"Камень, ножницы, бумага"},"no_category":{"name":"","create-token":"Создать токен","token-miner":"Токен-майнеры"}}},"rubic":{"name":"Кроссчейн обмен", "services": {}},"steem":{"name":"Steem","services":{"no_category":{"name":"","wallet":"Кошелёк","profiles":"Профили","accounts":"Аккаунты","manage":"Управление","explorer":"Explorer","help":"Справка","post":"Редактор"},"tools":{"name":"Инструменты","swap":"Swap","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ"}}},"minter":{"services":{"no_category":{"name":"","long":"LONG","explorer":"Explorer","wallet":"кошелёк","accounts":"Аккаунты","help":"Справка","my-coin":"Моя монета","profiles":"Профили","randomblockchain":"ГСЧ","swap":"Swap","validators":"Валидаторы"},"tools":{"name":"Инструменты","broadcast":"Broadcast"}},"name":"Minter"},"viz":{"services":{"reytings":{"name":"Рейтинги","witnesses-rewards":"Делегаты","top":"Пользователи"},"no_category":{"name":"","accounts":"Аккаунты","profiles":"Профили","projects":"Проекты","wallet":"Кошелёк"},"tools":{"name":"Инструменты","awards":"Награждение","calc":"Калькулятор","custom-generator":"JSON-генератор","manage":"Управление","polls":"Опросы","randomblockchain":"ГСЧ","search":"Viz-links","vmp":"vmp","voice-import":"Импорт в Voice"},"info":{"name":"Информация","analytics":"Аналитика","exchanges":"Обмен VIZ","explorer":"Explorer","help":"Справка"}}},"hive":{"name":"Hive","services":{"no_category":{"name":"","accounts":"Аккаунты","manage":"Управление","post":"Редактор","profiles":"Профили","wallet":"Кошелёк"},"tools":{"name":"Инструменты","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ","swap":"Swap"}}},"cyber":{"name":"Cyber","services":{"no_category":{"name":"","accounts":"Аккаунты","explorer":"Explorer","profiles":"Профили","validators":"Валидаторы","wallet":"Кошелёк","help":"Справка"},"tools":{"name":"Инструменты","ipfs":"IPFS","linker":"Линкер","randomblockchain":"ГСЧ"}}},"decimal":{"services":{"no_category":{"name":"","wallet":"кошелёк","accounts":"Аккаунты","explorer":"Explorer","profiles":"Профили","randomblockchain":"ГСЧ","validators":"Валидаторы"}},"name":"decimal"},"golos":{"services":{"tools":{"name":"Инструменты","post":"Редактор","api":"API","backup":"Бекап постов","calc":"Калькулятор","donate":"Донат","escrow":"Escrow","import":"Импорт статьи","instant-view":"Instant view","manage":"Управление","polls":"Опросы","randomblockchain":"ГСЧ","swap":"Swap"},"no_category":{"name":"","profiles":"Профили","accounts":"Аккаунты","explorer":"Explorer","help":"Справка","wallet":"кошелёк"},"reytings":{"name":"Рейтинги","activities":"Активность","donates":"Донаты","referrers":"Рефереры","top":"Пользователи","witnesses-rewards":"Делегаты"},"games":{"name":"Игры","stakebot":"Stake_bot"}},"name":"Golos"},"serey":{"services":{"no_category":{"name":"","wallet":"Кошелёк","accounts":"Аккаунты","manage":"Управление","profiles":"Профили"},"reytings":{"name":"Рейтинги","activities":"Активность","top":"Пользователи","witnesses-rewards":"Делегаты"},"tools":{"name":"Инструменты","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ"}}}}
{"evm":{"name":"EVM","services":{"games":{"name":"Игры","rockPaperScissors":"Камень, ножницы, бумага"},"no_category":{"name":"","create-token":"Создать токен","token-miner":"Токен-майнеры","blast-bridge":"Мост Blast sepolia"}}},"rubic":{"name":"Кроссчейн обмен", "services": {}},"steem":{"name":"Steem","services":{"no_category":{"name":"","wallet":"Кошелёк","profiles":"Профили","accounts":"Аккаунты","manage":"Управление","explorer":"Explorer","help":"Справка","post":"Редактор"},"tools":{"name":"Инструменты","swap":"Swap","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ"}}},"minter":{"services":{"no_category":{"name":"","long":"LONG","explorer":"Explorer","wallet":"кошелёк","accounts":"Аккаунты","help":"Справка","my-coin":"Моя монета","profiles":"Профили","randomblockchain":"ГСЧ","swap":"Swap","validators":"Валидаторы"},"tools":{"name":"Инструменты","broadcast":"Broadcast"}},"name":"Minter"},"viz":{"services":{"reytings":{"name":"Рейтинги","witnesses-rewards":"Делегаты","top":"Пользователи"},"no_category":{"name":"","accounts":"Аккаунты","profiles":"Профили","projects":"Проекты","wallet":"Кошелёк"},"tools":{"name":"Инструменты","awards":"Награждение","calc":"Калькулятор","custom-generator":"JSON-генератор","manage":"Управление","polls":"Опросы","randomblockchain":"ГСЧ","search":"Viz-links","vmp":"vmp","voice-import":"Импорт в Voice"},"info":{"name":"Информация","analytics":"Аналитика","exchanges":"Обмен VIZ","explorer":"Explorer","help":"Справка"}}},"hive":{"name":"Hive","services":{"no_category":{"name":"","accounts":"Аккаунты","manage":"Управление","post":"Редактор","profiles":"Профили","wallet":"Кошелёк"},"tools":{"name":"Инструменты","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ","swap":"Swap"}}},"cyber":{"name":"Cyber","services":{"no_category":{"name":"","accounts":"Аккаунты","explorer":"Explorer","profiles":"Профили","validators":"Валидаторы","wallet":"Кошелёк","help":"Справка"},"tools":{"name":"Инструменты","ipfs":"IPFS","linker":"Линкер","randomblockchain":"ГСЧ"}}},"decimal":{"services":{"no_category":{"name":"","wallet":"кошелёк","accounts":"Аккаунты","explorer":"Explorer","profiles":"Профили","randomblockchain":"ГСЧ","validators":"Валидаторы"}},"name":"decimal"},"golos":{"services":{"tools":{"name":"Инструменты","post":"Редактор","api":"API","backup":"Бекап постов","calc":"Калькулятор","donate":"Донат","escrow":"Escrow","import":"Импорт статьи","instant-view":"Instant view","manage":"Управление","polls":"Опросы","randomblockchain":"ГСЧ","swap":"Swap"},"no_category":{"name":"","profiles":"Профили","accounts":"Аккаунты","explorer":"Explorer","help":"Справка","wallet":"кошелёк"},"reytings":{"name":"Рейтинги","activities":"Активность","donates":"Донаты","referrers":"Рефереры","top":"Пользователи","witnesses-rewards":"Делегаты"},"games":{"name":"Игры","stakebot":"Stake_bot"}},"name":"Golos"},"serey":{"services":{"no_category":{"name":"","wallet":"Кошелёк","accounts":"Аккаунты","manage":"Управление","profiles":"Профили"},"reytings":{"name":"Рейтинги","activities":"Активность","top":"Пользователи","witnesses-rewards":"Делегаты"},"tools":{"name":"Инструменты","backup":"Бекап постов","calc":"Калькулятор","randomblockchain":"ГСЧ"}}}}
17 changes: 16 additions & 1 deletion template/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
<script src="<?= $conf['siteUrl']; ?>template/js/jquery.fancybox.min.js"></script>
<?= ($data['scripts'] ?? $data['scripts'] ?? "") ?>
<?= ($data['styles'] ?? $data['styles'] ?? "") ?>
<script>
function openGoogleForm() {
$.fancybox.open('<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSceyPgY4TV0CljtoRDqdERJBFqJC0QzmL8drDcCT1CHl0VgdA/viewform?embedded=true" width="700" height="520" frameborder="0" marginheight="0" marginwidth="0">Загрузка…</iframe>');
}
$(document).ready(function() {
let survey = localStorage.getItem('survey');
if (!survey || survey === 'true' || survey < 2) {
openGoogleForm();
let plus_survey = 1;
if (survey !== 'true') plus_survey += survey;
localStorage.setItem('survey', plus_survey);
}
});
</script>
</head>

<body class="body">
Expand All @@ -44,7 +58,8 @@
</div>
<ul class="nav-list hidden">
<li class="nav-link"><a href="<?= $conf['siteUrl']; ?>" class="nav-item">ГЛАВНАЯ</a></li>
<?= ($data['menu'] ?? $data['menu'] ?? "") ?>
<li class="nav-link"><a color="red" onclick="openGoogleForm()" class="nav-item">ВАЖНЫЙ ОПРОС</a></li>
<?= ($data['menu'] ?? $data['menu'] ?? "") ?>
</ul>
<div class="tpl_hamburger show" id="sandwichmenu">
<svg viewBox="0 0 800 600">
Expand Down

0 comments on commit c5f39f9

Please sign in to comment.