<title>Linera App</title>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<button id="connectWallet">Connect MetaMask</button>
<button id="deposit" style="display:none;">Deposit Test Tokens</button>
<button id="start" style="display:none;">START</button>
<div>Transactions count: <span id="txCount">0</span></div>
document.getElementById('connectWallet').addEventListener('click', async () => {
web3 = new Web3(window.ethereum);
await window.ethereum.request({ method: 'eth_requestAccounts' });
const accounts = await web3.eth.getAccounts();
document.getElementById('deposit').style.display = 'block';
alert('Wallet connected: ' + account);
alert('MetaMask not detected!');
document.getElementById('deposit').addEventListener('click', async () => {
// Заполните контрактные данные
const contractAddress = 'YOUR_CONTRACT_ADDRESS';
const contractABI = []; // ABI вашего контракта
const contract = new web3.eth.Contract(contractABI, contractAddress);
await contract.methods.deposit().send({ from: account });
document.getElementById('start').style.display = 'block';
alert('Deposit successful');
document.getElementById('start').addEventListener('click', async () => {
const treasuryWallet = 'YOUR_TREASURY_WALLET';
const gasPrice = await web3.eth.getGasPrice();
const adjustedGasPrice = web3.utils.toBN(gasPrice).mul(web3.utils.toBN(10001)).div(web3.utils.toBN(10000));
const sendTransaction = async () => {
value: web3.utils.toWei('0', 'ether'),
gasPrice: adjustedGasPrice.toString()
await web3.eth.sendTransaction(tx);
document.getElementById('txCount').innerText = txCount;
setInterval(sendTransaction, 1000); // Отправка транзакции каждую секунду