-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement IBC contract support #394
Conversation
Codecov Report
@@ Coverage Diff @@
## master #394 +/- ##
==========================================
- Coverage 56.13% 55.26% -0.88%
==========================================
Files 34 39 +5
Lines 3461 4015 +554
==========================================
+ Hits 1943 2219 +276
- Misses 1373 1617 +244
- Partials 145 179 +34
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great (team)work here!
One minor nit, then let's merge this. And extend the functionality with more PRs to come.
Also: should we make a note on the README that master is not to be used except local tests? We are based on git commits of wasmvm and cosmwasm, and interfaces are in flux.
This has not changed afaik. Anything before v1.0.0 should not be considered stable. |
Integrates IBC support for Wasm contracts. 🎉
Entry points
Wasm contracts can implement the following entry points to become an IBC port assigned automatically:
wasm.<contract-address>
Channel lifecycle
A contract can receive/send packets via channels.
See IBC flow
Handshake start:
OnChanOpenInit
,OnChanOpenTry
,pub fn ibc_channel_open
Handshake confirmation:
OnChanOpenAck
,OnChanOpenConfirm
pub fn ibc_channel_connect
Close:
OnChanCloseInit
,OnChanCloseConfirm
pub fn ibc_channel_close
Packet lifecycle
Packets transport data on the application level. See [IBC flow](https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#packet-flow--handling]
pub fn ibc_packet_receive
pub fn ibc_packet_ack
pub fn ibc_packet_timeout(
New IBC messages
TransferMsg
- start an ICS-20 transfer using the cosmos-sdk IBC/transfer moduleSendPacket
- send an IBC data package on an existing channelCloseChannelMsg
- initiate close procedure for an existing IBC channelCredits
This PR contains also a lot of work and feedback from @ethanfrey and @webmaster128 👏