Skip to content

WarrenPanDDDD/Week1-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Week 1 Assignment

assignment 1: To get latest BTC/USD price from Cronos Oracle. Plz check out app/read-btc-price.js

assignment 2: To post weather data to smart contract. Plz check out app/post-weather-data.js

addtional task 1-2: Write in text, plz check out ./Assignment 1 additional

addtional task 3: To make multicall in ONE call. Plz check out app/post-weather-data.js

Description

assignment 1: Get latest BTC/USD price from Cronos Oracle, log out in console every minute.

assignment 2: Get weather data for cities from https://goweather.herokuapp.com/weather/, then post the temperatures to smart contract WeatherRecord. I manage nonces manually to avoid nonce conflicts when sending multiple txs at the same time

addtional task 3: I deployed a MultiCall contract at 0x170832DF067101a2Cc2f273a75fbff34EbbD712E, use this contract to relay my calls to WeatherRecord contract

Getting Started

Dependencies

  • nodejs
  • ethers
  • dotenv
  • node-fetch

Installing

npm install

Executing program

execute assignment 1:

cd app

node read-btc-price.js 

execute assignment 2 & addtional task 3:

cd app

node post-weather-data.js 

License

This project is licensed under the [ISC] License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published