← Back to home

All my 🦄 read on L1

Solidity

our project leverages the L1SLOAD precompile of the Scroll L2 in uniswap v4 hooks, to enable new possibilities on L2

Screenshots

All my 🦄 read on L1 screenshot 1
All my 🦄 read on L1 screenshot 2
All my 🦄 read on L1 screenshot 3

Problem Statement

Our project leverages the L1SLOAD precompile of the Scroll L2 in a Uniswap v4 hook to enable new possibilities in the way Scroll users interact with AMMs. The idea is to relate on L1 data while interacting with the AMM, for example to use uniswap v3 pairs as oracle both for swappers and for LPs to protect themselves.

Solution

Scroll L1Sload devnetL1SLOAD Opcode: This precompile allows Scroll contracts to read state storage slots on L1.Uniswap v4 Hook Integration:AfterSwap Hook: We integrated a Uniswap v4 hook that uses the L1SLOAD opcode. This hook is designed to detect price variation between scroll network and ethereum mainnet. If the price difference is greater than a defined slippage the hook will automatically revert the swap on Scroll, preventing potential exploitations and ensuring the security of the transactions.Stack:Smart Contracts: Written in SolidityDeploy uniswap on scrollUniswap v4 Hooks: to include the flashloan detection mechanism.

Hackathon

ETHGlobal Brussels

2024

Prizes

  • 🏆

    Best Build Reading L1 State with L1SLOAD

    Scroll

  • 🏆

    Hooks, Hooks, and Hooks3rd place

    Uniswap Foundation

Contributors