sideprotocol / ibcswap Goto Github PK
View Code? Open in Web Editor NEWImplementations of IBC-based inter-blockchain swap application protocols, built and maintained by Side Labs
License: Apache License 2.0
Implementations of IBC-based inter-blockchain swap application protocols, built and maintained by Side Labs
License: Apache License 2.0
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:
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
}
This results in users being able to successfully swap without having a sufficient balance.
This attack can be done by any user who does not have sufficient balance.
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.
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
MultiAsset Broadcast message Withdraw
create-pool Broadcast message CreatePool
deposit Broadcast message Deposit
swap Broadcast message Swap
Cancel Pool Create and Add Liquidity On GO
We need to implement a demo, following the spec
https://github.com/liangping/ibc/tree/interchain-swap/spec/app/ics-101-interchain-swap
Tasks:
buf
Here is main task to do that. we can create separate issue for each of these tasks.
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.
REF:
#8
Parent issue: #1
Create .proto file according to the definitions in ics-100-atomic-swap.
We need to implement a demo, following the spec
https://github.com/liangping/ibc/tree/atomic-swap/spec/app/ics-100-atomic-swap
Tasks:
buf
Here is main task to do that. we can create separate issue for each of these tasks.
Things to be done:
ibc_module_test
and <module_name>_test
tests pass.simapp
in ./testing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.