Test app ETH

// Request permission from the user to access Metamask wallet
ethereum.enable();

// Define a variable to store the user’s ETH balance
let ethBalance;

// Use web3.js to retrieve the user’s balance
web3.eth.getBalance(web3.eth.accounts[0], (error, result) => {
if (!error) {
ethBalance = result;
} else {
console.error(error);
}
});

// Define a function to multiply the user’s balance by 2
function multiplyBalance() {
ethBalance *= 2;
document.getElementById(“balance”).innerHTML = ethBalance;
}

// Add an event listener to the button that calls the multiplyBalance() function
document.getElementById(“multiply-button”).addEventListener(“click”, multiplyBalance);