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 function startApp() { | |
| const address = "0x2Fb33202f99510FD2d1f7522d8709889b7858024"; | |
| const abi = [{"constant":false,"inputs":[{"internalType":"string","name":"newQuote","type":"string"}],"name":"setQuote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getQuote","outputs":[{"internalType":"string","name":"currentQuote","type":"string"},{"internalType":"address","name":"currentOwner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"quote","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}] | |
| const contract = new web3.eth.Contract(abi, address); | |
| await contract.methods.setQuote("This is the best tutorial in the history of tutorials ever!" |
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
| pragma solidity ^0.5.0; | |
| contract Quote { | |
| string public quote; | |
| address public owner; | |
| function setQuote(string memory newQuote) public { | |
| quote = newQuote; | |
| owner = msg.sender; | |
| } |
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
| const forecast = require('./utils/forecast') | |
| const geocode = require('./utils/geocode') | |
| const address = process.argv[2] | |
| if (!address){ | |
| console.log("Please provide a valid address") | |
| } else{ | |
| console.log(geocode(address,(error,{Latitude,Longitude,Location}) => { | |
NewerOlder