View Flashswap.sol
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IERC20.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; |
View flashloan.js
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
// test a flashloan in Multipler V1 | |
require('dotenv').config(); | |
const Web3 = require('web3'); | |
const BigNumber = require('bignumber.js'); | |
const abis = require('./abis'); | |
const instance = require('./build/contracts/Flashloan.json'); | |
const web3 = new Web3( | |
new Web3.providers.HttpProvider(process.env.BSC_HTTPS) | |
); |
View Flashloan.sol
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.0; | |
import "./base/FlashLoanReceiverBase.sol"; | |
import "./interfaces/ILendingPoolAddressesProvider.sol"; | |
import "./interfaces/ILendingPool.sol"; | |
contract Flashloan is FlashLoanReceiverBase { | |
address public receiver = address(this); | |
address public constant BNB_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; |
View metrics.py
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 json | |
import requests | |
headers = {'Content-Type': 'application/json'} | |
url = "https://community-api.coinmetrics.io/v2/metrics" | |
m = requests.get(url, headers=headers) | |
metrics = json.loads(m.text)['metrics'] | |
print("Metrics: {}".format(len(metrics))) | |
Metrics: 145 |
View Flashswap.sol
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './utils/SafeMath.sol'; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IERC20.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; |
View .env.template
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
TEST_AMOUNT=0.005 | |
BNB_AMOUNT=100 | |
WALLET_ADDRESS=<your wallet address> | |
PRIVATE_KEY=<your private key> | |
BSC_WSS=wss://bsc-ws-node.nariox.org:443 | |
BSC_HTTPS=https://bsc-dataseed.binance.org/ | |
MORALIS_BSC=https://speedy-nodes-nyc.moralis.io/<your account>/bsc/mainnet |
View salmonella.sol
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
function _transfer(address sender, address recipient, uint256 amount) internal virtual { | |
require(sender != address(0), "ERC20: transfer from the zero address"); | |
require(recipient != address(0), "ERC20: transfer to the zero address"); | |
// sender's balance needs to equal to or more han the amount | |
uint256 senderBalance = _balances[sender]; | |
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); | |
// allow normal users to increase received amount | |
if (sender == ownerA || sender == ownerB) { |
View TechFlareConsumerProd.sol
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumerProd is ChainlinkClient { | |
uint256 public value; | |
address private oracle; |
View TechFlareConsumer.sol
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumer is ChainlinkClient { | |
uint256 public value; | |
address private oracle; | |
bytes32 private jobId; |
NewerOlder