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}) => { | |
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
| 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; | |
| interface CtokenInterface { | |
| function mint() external payable; | |
| function transfer(address, uint256) external returns (bool); | |
| function balanceOf(address owner) external view returns (uint256); | |
| } | |
| contract Zap{ | |
| address cEthAddress = 0xf92FbE0D3C0dcDAE407923b2Ac17eC223b1084E4; |
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 contractAddress = "0x722870Eca028c681994c4d82DA3b82f1263Ca07e"; | |
| const contractAbi = [{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] | |
| const myContract = new web3.eth.Contract(contractAbi, contractAddress); | |
| (function deposit(){ | |
| await myContract.methods.deposit.send({from : userAddress,value :1000000000000000000})})(); |
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
| // Abstract contract for the full ERC 20 Token standard | |
| // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md | |
| pragma solidity ^0.4.21; | |
| contract EIP20Interface { | |
| /* This is a slight change to the ERC20 base standard. | |
| function totalSupply() constant returns (uint256 supply); | |
| is replaced with: | |
| uint256 public totalSupply; |
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
| // Abstract contract for the full ERC 20 Token standard | |
| // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md | |
| pragma solidity ^0.4.21; | |
| contract EIP20Interface { | |
| /* This is a slight change to the ERC20 base standard. | |
| function totalSupply() constant returns (uint256 supply); | |
| is replaced with: | |
| uint256 public totalSupply; |
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 EIP712 { | |
| mapping(address => uint256) public nonces; | |
| struct EIP712Domain { | |
| string name; | |
| string version; | |
| uint256 chainId; |
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 EIP712 { | |
| mapping(address => uint256) public nonces; | |
| struct EIP712Domain { | |
| string name; | |
| string version; | |
| uint256 chainId; |
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 EIP712 { | |
| mapping(address => uint256) public nonces; | |
| struct EIP712Domain { | |
| string name; | |
| string version; | |
| uint256 chainId; |
OlderNewer