This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prompt the user for the username and website | |
read -p "Enter the username: " USERNAME | |
read -p "Enter the website (e.g., example.com): " WEBSITE | |
# Define variables | |
USER_HOME="/home/$USERNAME" | |
PUBLIC_HTML="$USER_HOME/public" | |
APACHE_CONF="/etc/apache2/sites-available/$WEBSITE.conf" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const Token = '0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82'; | |
const abi = [{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},] | |
const web3 = new Web3(Web3.givenProvider); | |
const contract = new web3.eth.Contract(abi, '0x10ed43c718714eb63d5aa57b78b54704e256024e'); | |
const result = await contract.methods.getAmountsOut((10 ** 18) + '', [Token, '0xe9e7cea3dedca5984780bafc599bd69add087d56']).call(); | |
const price = result[1] / (10 ** 18); | |
console.log('$' + price.toFixed(2) ); | |
})(); |