GithubHelp home page GithubHelp logo

sideprotocol / ibcswap Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 9.0 2.17 MB

Implementations of IBC-based inter-blockchain swap application protocols, built and maintained by Side Labs

License: Apache License 2.0

Go 97.09% Makefile 2.71% Dockerfile 0.04% Shell 0.16%
atomic-swap cosmos ibc swap

ibcswap's People

Contributors

dedicateddev avatar emilgeorgiev avatar liangping avatar luckiester avatar menniti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ibcswap's Issues

Small test about two side deposit

Similar to ICA, write a interchain tx demo, Sending an ibc packet from chain A, which wraps a transaction(sending token) to be executed on chain B

a tx structure will similar to this:

{
     sender: "Achain1xxxxxxxxx",
     source_channel: "channel-2",
     source_port: 'ibc-execute",
     tx_to_executed_on_dest: {
           sender: "Bchain1xxxxxxxxx",
           messages: [{ ... }],
           signature: "",
      }
}

steps:

  1. construct a tx on chain A
  2. sending to from chain A
  3. relayer tx
  4. received tx on Chain B, unwrap the sub tx, validating the sub tx, and execute the subtx.
  5. return execution result to ack
  6. acknowledged on chain A

Need Error Handling for SendCoinsFromAccountToModule Function

Credit to : HelloBloc

@liangping

Description

In the following code content, the error handling of x.bankKeeper.SendCoins is missing, which will result in a malicious user being able to set the status without cost.

	//lock swap-in token to the swap module
	escrowAddr := types.GetEscrowAddress(pool.EncounterPartyPort, pool.EncounterPartyChannel)
	k.bankKeeper.SendCoinsFromAccountToModule(ctx, sdk.MustAccAddressFromBech32(msg.Sender), escrowAddr.String(), sdk.NewCoins(*msg.TokenIn))

	//constructs the IBC data packet
	rawMsgData, err := json.Marshal(msg)
	if err != nil {
		return nil, err
	}

Impact

This results in users being able to successfully swap without having a sufficient balance.

Likelihood

This attack can be done by any user who does not have sufficient balance.

Related links

Related-Code

REF

REF

Ethics

Sorry for using github to report this vul, as I didn't find your security channle and all the effective ways to report it at that time. However, I have observed that your main-net was not online at that time, so reported the issue via github. Hope you don't mind.

Add timeout argument to commands

We have to input timeout parameters sometime.

raw_log: 'failed to execute message; message index: 0: receiving chain block height
  >= packet timeout height (2-825 >= 1-71613): packet timeout'

we need add --packet-timeout-height string and --packet-timeout-timestamp uint

ICS101: Cancel Pool Create and Add Liquidity

Cancel Pool Create and Add Liquidity On GO

  • Front-end Integration
    • Cancel the creation of a fund pool Front-end page UI
    • Cancel the creation of a fund pool Logic
    • Cancel multilateral pledge Front page UI
    • Cancel multilateral pledge Front Logic
  • Backend
  • Deploy Relayer

Interchain Swap Demo implementation

We need to implement a demo, following the spec
https://github.com/liangping/ibc/tree/interchain-swap/spec/app/ics-101-interchain-swap

Tasks:

  • Create .proto file according the definitions in ics-101-interchain-swap.
  • Generate go files from proto using buf
  • Implement IBC Interchain Swap module and unit tests
  • Using ibctest for module functional tests
  • Integrate Interchain Swap module to Simapp
  • make a docker image for ibctest e2e test and upload to github.
  • done e2e test.

Here is main task to do that. we can create separate issue for each of these tasks.

Atomic Demo Implementation

We need to implement a demo, following the spec
https://github.com/liangping/ibc/tree/atomic-swap/spec/app/ics-100-atomic-swap

Tasks:

  • Create .proto file according the definitions in ics-100-atomic-swap.
  • Generate go files from proto using buf
  • Implement IBC Atomic Swap module and unit tests
  • Using ibctest for module functional tests
  • Integrate Atomic module to Simapp
  • make a docker image for ibctest e2e test and upload to github.
  • done e2e test.

Here is main task to do that. we can create separate issue for each of these tasks.

Reset testnet

Things to be done:

  • 1. Setup relayer.
  • 2. add ICS restful api to Swagger UI.
  • 3. Reset Blockscout.
  • 4. Use CI/CD to deploy testnet

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.