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
# Nix | |
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then | |
# if PATH does *not* contain `~/.nix-profile/bin` | |
if [ -n "${PATH##*.nix-profile/bin*}" ]; then | |
# If this flag is set, `nix-daemon.sh` returns early | |
# https://issueexplorer.com/issue/NixOS/nix/5298 | |
unset __ETC_PROFILE_NIX_SOURCED | |
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' | |
fi |
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
sudo sshfs -o allow_other,default_permissions [name]@[ip]:[remote-dir] [local-dir] |
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
lsblk | |
sudo mkfs -t ext4 /dev/nvme1n1 | |
sudo mkdir ~/.data | |
sudo mount /dev/nvme1n1 ~/.data | |
sudo chmod 666 ~/.data |
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
var proxy = require('express-http-proxy'); | |
var app = require('express')(); | |
var cors = require('cors') | |
var morgan = require('morgan') | |
app.use(cors()) | |
app.use(morgan('combined')) | |
app.use('/', proxy('google.com')); | |
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
$ ganache-cli --mnemonic "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" | |
Ganache CLI v6.9.1 (ganache-core: 2.10.2) | |
Available Accounts | |
================== | |
(0) 0x627306090abaB3A6e1400e9345bC60c78a8BEf57 (100 ETH) | |
(1) 0xf17f52151EbEF6C7334FAD080c5704D77216b732 (100 ETH) | |
(2) 0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef (100 ETH) | |
(3) 0x821aEa9a577a9b44299B9c15c88cf3087F3b5544 (100 ETH) | |
(4) 0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2 (100 ETH) |
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("hardhat"); | |
const { provider } = ethers; | |
const { parseUnits, formatUnits } = ethers.utils; | |
const FiatTokenV1ABI = JSON.parse( | |
'[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint8"},{"name":"_masterMinter","type":"address"},{"name":"_pauser","type":"address"},{"name":"_blacklister","type":"address"},{"name":"_owner","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenAddress","type":"address"}],"name":"reclaimToken","outputs":[],"payable |
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 path = require('path') | |
const fs = require('fs') | |
const { parseEther, formatEther } = ethers.utils | |
const { critical, info } = require('./logging') | |
const fetch = require('node-fetch') | |
const { | |
BOND_EVENT_DAO, | |
BOND_EVENT_LP, | |
UNBOND_EVENT, |
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
[ | |
{ | |
"constant": false, | |
"inputs": [ | |
{ "internalType": "address", "name": "to", "type": "address" }, | |
{ "internalType": "uint256", "name": "amount", "type": "uint256" } | |
], | |
"name": "mint", | |
"payable": true, | |
"stateMutability": "payable", |
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
if(${CURVE} STREQUAL "BN128") | |
include_directories(ate-pairing/include) | |
include_directories(xbyak) | |
add_library( | |
zm | |
SHARED | |
ate-pairing/src/zm.cpp | |
ate-pairing/src/zm2.cpp | |
) |
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
{ | |
"language": "Solidity", | |
"sources": { | |
"contracts/CloseShortDAI.sol": { | |
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0 <0.7.0;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\nimport \"./weth/WETH.sol\";\n\nimport \"./dydx/DydxFlashloanBase.sol\";\nimport \"./dydx/IDydx.sol\";\n\nimport \"./maker/IDssCdpManager.sol\";\nimport \"./maker/IDssProxyActions.sol\";\nimport \"./maker/DssActionsBase.sol\";\n\nimport \"./curve/ICurveFiCurve.sol\";\n\nimport \"./Constants.sol\";\n\ncontract CloseShortDAI is ICallee, DydxFlashloanBase, DssActionsBase {\n struct CSDParams {\n uint256 cdpId; // CdpId to close\n address curvePool; // Which curve pool to use\n uint256 mintAmountDAI; // Amount of DAI to mint\n uint256 withdrawAmountUSDC; // Amount of USDC to withdraw from vault\n uint256 flashloanAmountWETH; // Amount of WETH flashloaned\n }\n\n function callFunction(\n address sender,\n |
NewerOlder