Giter Site home page Giter Site logo

prettyirrelevant / bridgebloc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 993 KB

Experience hassle-free token movement across EVM compatible chains

Home Page: https://bridgebloc.vercel.app

License: MIT License

Makefile 0.32% Python 25.85% Solidity 19.77% TypeScript 43.68% Procfile 0.04% HTML 0.10% SCSS 10.24%
arbitrum avalanche cctp circle lxly polygon

bridgebloc's People

Contributors

jaybee020 avatar prettyirrelevant avatar tee-py avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

dmitro3

bridgebloc's Issues

add LxLy bridge implementation for backend

Overview

#8 has the boilerplate code for EVMAggregator and EVMClient so you can reuse that for your LxLy implementation.

Things to Note

  1. The serializer, LxLyTokenConversionInitialisationSerializer that validates the tx_hash and chain of the bridging process.
  2. An enum that represent the steps of the LxLy bridging process. Use CircleAPIConversionStepType as inspiration.
  3. The background jobs to monitor every step of the bridging.

Hints

For the serializer part, here are certain checks.

  • check from

  • check source chain

  • check source token

  • check destination chain

  • check destination token

  • check the address is the contract deployed by us

  • To verify that an event exists for a tx receipt

        cross_chain_bridge_contract = client.get_contract(
            name='CrossChainBridge',
            address='0x0a992d191DEeC32aFe36203Ad87D7d289a738F81',
        )
        token_messenger_contract = client.get_contract(
            name='TokenMessenger',
            address='0x0a992d191DEeC32aFe36203Ad87D7d289a738F81',
        )

        found_bridge_events = cross_chain_bridge_contract.events.BridgeDepositReceived().process_receipt(
            receipt, errors=DISCARD
        )
        if len(found_bridge_events) == 0 or len(found_bridge_events) > 1:
            raise serializers.ValidationError(
                f'Expected just one `BridgeDepositReceived` event, got {len(found_bridge_events)}'
            )
  • To get the EVMClient for a particular chain
evm_client = EVMAggregator().get_client(chain)
  • Helpful env variables
SECRET_KEY="django-insecure-0i*m8syiir!bcgzas#5riq8&pic+m*jbiex&(zi^gnb@(xf^&g"
DATABASE_URL=sqlite:///db.sqlite3
HUEY_REDIS_URL=redis://localhost:6379
HUEY_IMMEDIATE=0
DJANGO_SETTINGS_MODULE=bridgebloc.conf.settings
DEBUG=1
ALLOWED_HOSTS=localhost,127.0.0.1
CIRCLE_SANDBOX_API_KEY=SAND_API_KEY:e2afe1f631722927b89ee5282fa6e559:3c1309e4a895933c679b5afe10fd91d5
CIRCLE_SANDBOX_BASE_URL=https://api-sandbox.circle.com
CIRCLE_LIVE_API_KEY=live-key
CIRCLE_LIVE_BASE_URL=https://api.circle.com
CIRCLE_MASTER_WALLET_ID=1016603050
ETHEREUM_RPC_NODES=https://eth.llamarpc.com
AVALANCHE_RPC_NODES=https://avalanche-c-chain.publicnode.com
POLYGON_POS_RPC_NODES=https://polygon.llamarpc.com
ARBITRUM_ONE_RPC_NODES=https://arbitrum-one.publicnode.com
POLYGON_ZKEVM_RPC_NODES=https://zkevm-rpc.com
ETHEREUM_TESTNET_RPC_NODES=https://ethereum-goerli.publicnode.com
AVALANCHE_TESTNET_RPC_NODES=https://avalanche-fuji-c-chain.publicnode.com
POLYGON_POS_TESTNET_RPC_NODES=https://polygon-mumbai-bor.publicnode.com
ARBITRUM_ONE_TESTNET_RPC_NODES=https://arbitrum-goerli.publicnode.com
POLYGON_ZKEVM_TESTNET_RPC_NODES=https://rpc.public.zkevm-test.net

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.