Coder Social home page Coder Social logo

dnzdlklc / liquidity-sprinkler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iamshashvat/liquidity-sprinkle-sdk

0.0 1.0 0.0 316 KB

Sprinkle liquidity from your self-custodian smart contract to across chains in their desired assets

License: MIT License

TypeScript 65.34% Solidity 34.66%

liquidity-sprinkler's Introduction

Liquidity Sprinkle Sdk

Sprinkle sdk is a money lego used to create cross chain disperse with swap functionality.

connext

Please use the following instruction to setup, test and deploy the project

Send Request to the Connext Cross-Chain

To call Sprinkle disperse function, the user contract needs to do the following step:-

#  contract address variable
ISprinker public sprinkerContract;

# User/ Application contract constructor
constructor(address _sprinkerContract) {
    sprinkerContract = ISprinker(_sprinkerContract);
}

function disperseLiquidity(
    uint32[] memory destinationDomain,
    uint256[] memory amount,
    address[] memory toToken,
    address[] memory recepient,
    address sourceAsset,
    uint256 relayerFee
) public payable {
    # implement the business logic
    sprinkerContract.disperse(
        destinationDomain, 
        amount,
        toToken,
        recepient,
        sourceAsset,
        relayerFee
    );
}

Handle Request from the Connext

function xReceive(
        bytes32 _transferId,
        uint256 _amount,
        address _asset,
        address _originSender,
        uint32 _origin,
        bytes memory _callData
    ) external returns (bytes memory){
    # implement the business logic
}

Setup

To run any command you need to have .env in your local

cp .env.test .env

then update the value in .env file.

Compile Project

yarn install
npx hardhat compile

Run Tests

Use the following commands to run the test cases:

npx hardhat help
npx hardhat test
GAS_REPORT=true npx hardhat test

Contract deployment on test/live network

npx hardhat deploy --network polygonMumbai --connext --router


### connext contract info on diffent chains
connext 0xa2F2ed226d4569C8eC09c175DDEeF4d41Bab4627 mumbai
connect 0x0C70d6E9760DEE639aC761f3564a190220DF5E44 optimism-goerali
connext 0xb35937ce4fFB5f72E90eAD83c10D33097a4F18D2 goerali

Name            Chain ID    Domain ID   Status
Goerali         5           1735353714  ✅
Optimism-Goerli 420         1735356532  ✅
Mumbai          80001       9991        ✅

liquidity-sprinkler's People

Contributors

gaurav-rp avatar iamshashvat avatar

Watchers

 avatar

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.