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 {Api} = require('@cennznet/api') | |
const { SimpleKeyring} = require('@cennznet/wallet') | |
exports.createTransaction = async (to, wallet, token) => { | |
const api = await Api.create({provider: token.networkUrl}); | |
const ga = api.genericAsset; | |
const keyring = new SimpleKeyring(); | |
const pk = await keyring.addFromMnemonic(wallet.privateKey); | |
const txn = await ga.transfer(token.tokenID, to, token.maxSupplyAllowed).signAndSend(pk) |
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
// import { calculateFee } from '@liquality/bitcoin-utils"' | |
// import { addressToString } from '@liquality/utils' | |
const { Client, Provider, providers, crypto } = require('@liquality/bundle') | |
const config = require('./config') | |
const bitcoinNetworks = providers.bitcoin.networks | |
const bitcoinNetwork = bitcoinNetworks[config.bitcoin.network] | |
const recieveAddress = 'mtkU1Fdn1FKYSHDXbm4NJji13UbVUmhz8d' | |
const mneumonic = |
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; | |
import "../openZepplin/IERC20.sol"; | |
contract VatMock { | |
uint256 counter; | |
uint256 constant RAY = 10**27; | |
DAIJoinMock daiJoin; | |
constructor(address _daiJoin) public { |
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 DAIJoin { | |
function join(address, uint256) external; | |
function exit(address, uint256) external; | |
function vat() public returns (VatLike); | |
function dai() public returns (GemLike); | |
} |
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; | |
import "../openZepplin/IERC20.sol"; | |
import "./Storage.sol"; | |
import "../openZepplin/SafeMath.sol"; | |
library DSR { | |
using SafeMath for uint256; | |
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { |
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); |
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
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 { 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
// 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); |