This file contains 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
use serde::{Deserialize, Serialize}; | |
use serde_json::to_string; | |
#[derive(Debug, Deserialize, Serialize, Clone)] | |
pub struct UnsafeQuery { | |
pub key: String, | |
pub value: Vec<u8>, | |
} | |
impl UnsafeQuery { |
This file contains 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
// taken and modified from here https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a#file-reason-js | |
// This is universal, works with Infura -- set provider accordingly | |
const ethers = require('ethers') | |
const { TEAMS_ENDPOINT } = require("./credentials.js") | |
const provider = new ethers.providers.JsonRpcProvider(); | |
// const provider = new ethers.getDefaultProvider("rinkeby") |
This file contains 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
library Storage { | |
struct Structing { | |
uint256 this; | |
mapping (uint256 => bool) that; | |
} // this does not require linking and is therefore embedding in contract demo? | |
function bePublic () public { | |
} // with this function library should not embed, yet it does not seem to work | |
} | |
contract demo { |
This file contains 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 ethers = require('ethers'); | |
const { TEAMS_ENDPOINT } = require("./credentials.js") | |
const provider = new ethers.providers.JsonRpcProvider(TEAMS_ENDPOINT); | |
const block = async () => { | |
const blockNumber = await provider.getBlock("latest") | |
console.log(blockNumber) | |
} |
This file contains 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 ethers = require('ethers'); | |
const {TEAMS_API, BOT_PRIVATE_KEY} = require("./credentials") | |
const provider = new ethers.providers.JsonRpcProvider(TEAMS_API); | |
const wallet = new ethers.Wallet(BOT_PRIVATE_KEY, provider); | |
const transaction = async () => { | |
let value = ethers.utils.parseEther('0.000000001'); |
This file contains 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
// taken and modified from here https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a#file-reason-js | |
// This is universal, works with Infura -- set provider accordingly | |
const ethers = require('ethers') | |
const { TEAMS_ENDPOINT } = require("./credentials.js") | |
const provider = new ethers.providers.JsonRpcProvider(TEAMS_ENDPOINT); |
This file contains 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 ethers = require('ethers'); | |
const { MNEUMONIC } = require("./credentials.js") | |
// increment the last digit by 1 to get a new wallet | |
let path = "m/44'/60'/0'/0/0"; | |
const wallets = ethers.Wallet.fromMnemonic(MNEUMONIC, path) | |
console.log(wallets) |
This file contains 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 ethers = require('ethers'); | |
const {LOCAL_API, BOT_PRIVATE_KEY} = require("./credentials") | |
const provider = new ethers.providers.JsonRpcProvider(LOCAL_API); | |
const wallet = new ethers.Wallet(BOT_PRIVATE_KEY, provider); | |
const transaction = async () => { | |
let value = ethers.utils.parseEther('0.000000001'); |
This file contains 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 ethers = require('ethers'); | |
const {LOCAL_ADDRESS, LOCAL_ABI} = require("./chinalinkCredentials.js") | |
const {LOCAL_API, LOCAL_PRIVATE_KEY} = require("./credentials") | |
const provider = new ethers.providers.JsonRpcProvider(LOCAL_API); | |
const wallet = new ethers.Wallet(LOCAL_PRIVATE_KEY, provider); | |
const contract = new ethers.Contract(LOCAL_ADDRESS, LOCAL_ABI, provider) | |
const chainlink = contract.connect(wallet) |
This file contains 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.11; | |
contract Aggregator { | |
int256 price; | |
int256[] Answers; | |
uint256[] timestamp; | |
uint256 roundId; | |
constructor() public { | |
Answers.push(9900000000); |
NewerOlder