This file contains hidden or 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 asyncio | |
import logging | |
from flask import Blueprint, Flask, request, render_template, g | |
from flask_graphql import GraphQLView | |
from google.cloud import logging as glogging | |
#from graphql.execution.executors.asyncio import AsyncioExecutor | |
from web3 import Web3, HTTPProvider | |
from werkzeug.serving import run_simple | |
from graphql import ( | |
graphql, |
This file contains hidden or 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 "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import "@uniswap/v3-core/contracts/libraries/TickMath.sol"; | |
import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol"; | |
import "@uniswap/v3-core/contracts/libraries/FullMath.sol"; | |
contract TwapGetter { | |
function getSqrtTwapX96(address uniswapV3Pool, uint32 twapInterval) public view returns (uint160 sqrtPriceX96) { | |
if (twapInterval == 0) { | |
// return the current price if twapInterval == 0 | |
(sqrtPriceX96, , , , , , ) = IUniswapV3Pool(uniswapV3Pool).slot0(); |
This file contains hidden or 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/proxy/utils/Initializable.sol"; | |
contract Ship is Initializable { | |
string public name; | |
uint256 public fuel; | |
function initialize(string memory _name, uint256 _fuel) external initializer { | |
name = _name; |