Skip to content

Instantly share code, notes, and snippets.

View gitpusha's full-sized avatar
🍦
Buidling on Ethereum

Luis Schliesske gitpusha

🍦
Buidling on Ethereum
View GitHub Profile
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
abstract contract Gelatofied {
using SafeERC20 for IERC20;
address public constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
@gitpusha
gitpusha / GelatoNftRushWrapper.sol
Created August 11, 2021 09:33
Wrapper that allows seascapeAdmin to operate all functions via the fallback and that allows the Wrapper to also call certain functions on the protocol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../interfaces/INftRush.sol";
import "../gelato/Gelatofied.sol";
contract GelatoNftRushWrapper is Ownable, Gelatofied {
using SafeERC20 for IERC20;
@gitpusha
gitpusha / aave-gelato.md
Last active June 16, 2021 14:32
Gelato's rapid grant application to the Aave Grants Program for Automated Health Factor Maintenance

gelato-aave

Automated Health Factor Maintenance - Rapid Grant Application

Main Applicants

interface IUniswapV2Pair {
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event Transfer(address indexed from, address indexed to, uint256 value);
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0;
contract MockGelatoGasPriceOracle {
uint256 public gasPrice;
constructor(uint256 _gasPrice) {
gasPrice = _gasPrice;
}
module.exports = async (hre) => {
const { deployments } = hre;
const { deploy } = deployments;
const { deployer } = await hre.getNamedAccounts();
// the following will only deploy "MockGelatoGasPriceOracle"
// if the contract was never deployed or if the code changed since last deployment
await deploy("MockGelatoGasPriceOracle", {
from: deployer,
args: [hre.ethers.utils.parseUnits("40", "gwei")],
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0;
contract TaskEmitter {
event LogTaskSubmitted(address indexed service, bytes task);
modifier isListed {
// Make some call to Gelato governance whitelist and check if service
// trying to submit a Task is whitelisted.
_;
@gitpusha
gitpusha / no-bug-on-hardhat.js
Created October 27, 2020 14:32
Where buidler-ganache has an invalid opcode bug for gelatoCore.unstakeExecutor(), hardhat has none
// running `npx hardhat run` automatically makes use of buidler-waffle plugin
const hre = require("hardhat");
const { ethers } = hre;
const GelatoCoreLib = require("@gelatonetwork/core");
const { sleep } = GelatoCoreLib;
(async function main() {
if (hre.network.name !== "hardhat") {
console.error("Test Suite is meant to be run on hardhat only");
process.exit(1);
@gitpusha
gitpusha / ganache-bug.js
Created October 27, 2020 14:27
a small script to showcase a buidler-ganache invalid opcode bug
// running `npx buidler run` automatically makes use of buidler-waffle plugin
// => only dependency we need is "chai"
const bre = require("@nomiclabs/buidler");
const { ethers } = bre;
const GelatoCoreLib = require("@gelatonetwork/core");
const { sleep } = GelatoCoreLib;
(async function main() {
if (bre.network.name !== "ganache") {
console.error("Test Suite is meant to be run on ganache only");
@gitpusha
gitpusha / FileImportBug.sol
Created October 20, 2020 14:52
a contract that has file import bug with solc 0.7 version and buidler 1.4.7
// "SPDX-License-Identifier: UNLICENSED"
pragma solidity 0.7.4;
pragma experimental ABIEncoderV2;
/// yarn add -D @gelatonetwork/core v1.0.0
import {
GelatoProviderModuleStandard
} from "@gelatonetwork/core/contracts/provider_modules/GelatoProviderModuleStandard.sol";
contract ProviderModuleDSA is GelatoProviderModuleStandard {