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 { MockContract, smockit } from "@eth-optimism/smock" | |
import { ethers, waffle } from "hardhat" | |
import { | |
AccountBalance, | |
BaseToken, | |
// ChainlinkPriceFeed, | |
ClearingHouse, | |
ClearingHouseConfig, | |
Exchange, | |
InsuranceFund, |
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.8.7; | |
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; | |
contract AATranche is ERC20Upgradeable { | |
function __AA__ERC20_init(string memory name_, string memory symbol_) internal { | |
__ERC20_init(name_, symbol_); | |
} |
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: Apache-2.0 | |
/** | |
* @title: Idle Token interface | |
* @author: Idle Labs Inc., idle.finance | |
*/ | |
pragma solidity 0.8.7; | |
import "./IERC20Detailed.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: GPL-2.0-or-later | |
pragma solidity ^0.8.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; | |
/** | |
* a contract must implement this interface in order to support relayed transaction. | |
* It is better to inherit the BaseRelayRecipient as its implementation. | |
*/ |
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 approveBiconomySwapperV3 = async () => { | |
let maxValue = | |
"115792089237316195423570985008687907853269984665640564039457584007913129639935"; | |
let domainData | |
let tokenPermitOptions | |
let permitTx | |
let WETHTokenContractInstance = new web3.eth.Contract( | |
DAI_kovan_contract.abi, | |
'0xd0A1E359811322d97991E03f863a0C30C2cF029C' // WETH |
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.8.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol"; | |
interface ISafeEngine { | |
function transferInternalCoins(address src, address dst, uint256 rad) external; | |
} | |
contract LiquidationPool is ReentrancyGuard { |
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.8.0; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
import "hardhat/console.sol"; | |
interface ISafeEngine { | |
function transferInternalCoins(address src, address dst, uint256 rad) external; | |
function coinBalance(address src) external view returns(uint256); | |
function approveSAFEModification(address account) external; |
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 getFlashBotProvider = async () => { | |
const provider = new ethers.providers.JsonRpcProvider({ url: 'https://goerli.infura.io/v3/<<Key>>' }) | |
const authSigner = new ethers.Wallet('private-key') | |
const wallet = Wallet.createRandom().connect(provider) | |
const targetBlockNumber = (await provider.getBlockNumber()) + 2 | |
const flashbotsProvider = await FlashbotsBundleProvider.create(provider, authSigner, 'https://relay-goerli.epheph.com/') | |
console.log('flashbotsProvider-: ', flashbotsProvider); |
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.2; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; | |
library SafeMath { | |
function add(uint256 a, uint256 b) internal pure returns (uint256) { | |
uint256 c = a + b; |
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
/** | |
* @title: BackStop DAI wrapper | |
* @summary: Used for interacting with Backstop Protocol. Has | |
* a common interface with all other protocol wrappers. | |
* This contract holds assets only during a tx, after tx it should be empty | |
* @author: Idle Labs Inc., idle.finance | |
*/ | |
pragma solidity 0.5.16; | |
pragma experimental ABIEncoderV2; |