This project implements a get price action using Solidity. Users can get ethusd prices from chainlink oracle.
- getPrice get price
- Interact using Ethers.js.
git clone https://github.com/chang96/chainlinkdata
cd chainlinkdatanpm installCreate a .env file in the root directory and add:
SEPOLIA_RPC_URL=""
PRIVATE_KEY=""
CONTRACT_ADDRESS=""To deploy the contract to a testnet (e.g., Sepolia):
npx hardhat run scripts/deploy.ts --network sepoliaUse Ethers.js to interact with the contract. The functions are located in etherjs-sample.ts.
- getPrice:
getPrice()
MIT