Code Monkey home page Code Monkey logo

yui-ibc-solidity's Introduction

ibc-solidity

banner

IBC implementations in Solidity.

IBC compatibility: v8

This is available not only for Ethereum and Hyperledger Besu, but also for Polygon PoS and other EVM-compatible chains.

DISCLAIMER: This project is still under development and has not been audited.

Features

Documents

Supported Light Client

You can deploy a Light Client that implements the ILightClient interface to integrate with ibc-solidity.

Here are some such examples:

IBC relayer support

Related projects

For Developers

Unit test

$ make test

E2E test

Launch two Hyperledger Besu chains(ethereum-compatible) with the contracts deployed with the following command:

$ make network-e2e

After launch the chains, execute the following command:

$ make e2e-test

E2E-test with IBC-Relayer

An example of E2E with IBC-Relayer(yui-relayer) can be found here:

solidity-protobuf

To generate the proto encoders and decoders in solidity from proto files, you need to use the code generator solidity-protobuf

Currently, v0.1.0 is required.

If you edit the proto definitions, you should execute the following command:

$ make SOLPB_DIR=/path/to/solidity-protobuf proto-sol

Maintainers

yui-ibc-solidity's People

Contributors

3100 avatar bluele avatar dependabot[bot] avatar jinankjain avatar nadeemb53 avatar ryjones avatar siburu avatar yoshidan avatar

Stargazers

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

Watchers

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

yui-ibc-solidity's Issues

Goals for this project?

Hi y'all. I have a few questions about this. It's very interesting.

  • Does Interchain Foundation support this project?
  • How much maintenance is expected on this project once it reaches the current state of the IBC protocol? Will it need to be updated regularly, and are there transition plans in place for folks who use the smart contract as the contract implementation may change?
  • Which blockchains would be good targets for usage with a smart contract implementation of IBC?

Cheers! Let me know if these questions are best answered elsewhere as well. Feel free to tag any relevant parties.

Add link to a tutorial

We are preparing a tutorial for developing a sample IBC application using yui-ibc-solidity. The hyperlink of the tutorial will be added to README.

IBCHandler::sendMessage method accepting google protobuf ``Any`` to dispatch messages

there should be a general entry point able to receive an Any protobuf message to collect and dispatch all the messages sent to the IBC Handler by a relayer, as the cosmos client has.
Just to give a few references, looking at hermes, one of the most trending ibc relayer implementation:
https://docs.rs/ibc-relayer/0.8.0/ibc_relayer/chain/trait.ChainEndpoint.html#tymethod.send_messages_and_wait_commit
https://docs.rs/ibc-relayer/0.8.0/src/ibc_relayer/chain/cosmos.rs.html#874-928

Stop compile-time warnings

Stop warnings related to:

  • Function state mutability
  • public modifiers of constructors
  • Unused function parameter
  • Variable shadowing

forge test is failing to compile

The following error message is reported:

❯ forge test
[⠒] Compiling...
[⠢] Unable to resolve imports:
      "openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
      "openzeppelin-solidity/contracts/utils/Address.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
      "openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/src/MockApp.sol"
      "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/SimpleToken.sol"
      "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
      "openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Transfer.sol"
      "openzeppelin-solidity/contracts/access/AccessControl.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
with remappings:
      ds-test/=/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/lib/forge-std/lib/ds-test/src/
      forge-std/=/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/lib/forge-std/src/
[⠰] Compiling 41 files with 0.8.17
[⠔] Solc 0.8.17 finished in 76.26ms
Error:
Compiler run failed
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
 --> contracts/app/ICS20Bank.sol:4:1:
  |
4 | import "openzeppelin-solidity/contracts/utils/Context.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/access/AccessControl.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
 --> contracts/app/ICS20Bank.sol:5:1:
  |
5 | import "openzeppelin-solidity/contracts/access/AccessControl.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
 --> contracts/app/ICS20Bank.sol:6:1:
  |
6 | import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
 --> contracts/app/ICS20Bank.sol:7:1:
  |
7 | import "openzeppelin-solidity/contracts/utils/Address.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
  --> contracts/app/ICS20Transfer.sol:12:1:
   |
12 | import "openzeppelin-solidity/contracts/utils/Context.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
 --> contracts/app/SimpleToken.sol:4:1:
  |
4 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
  --> tests/foundry/src/MockApp.sol:11:1:
   |
11 | import "openzeppelin-solidity/contracts/utils/Context.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

encountered an error while attempting to update latest block

when i exec NO_GEN_CODE=1 ./scripts/setup.sh testtwochainz :

> Compilation skipped because --compile-none option was passed.

/Users/binny/go/src/yui-ibc-solidity/node_modules/eth-block-tracker/src/polling.js:51
        const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${err.stack}`)
                       ^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
    at PollingBlockTracker._performSync (/Users/binny/go/src/yui-ibc-solidity/node_modules/eth-block-tracker/src/polling.js:51:24)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

checkout proto files from ibc-go

ibc-solidity places a high priority on compatibility with ibc-go. By using a tool like submodule to check out proto files for IBC, we can clarify supported version and simplify operations when updating ibc version.

Received unexpected error: when i exec `chains_test.go`

This is where things go wrong:
image

blockNumber =====  0x33af
address =====  e6d8ff7eddb380c99b898c04b78edda4a92cc966
hashes =====  []
blockNumber =====  0x93130
    chains_test.go:186: delay for ack@chainA 15.430340792s
    chains_test.go:216: 
        	Error Trace:	/Users/binny/go/src/yui-ibc-solidity/tests/e2e/chains_test.go:216
        	Error:      	Received unexpected error:
        	            	All attempts fail:
        	            	#1: failed to execute a transaction: &{{[] 0 232807 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [] 0x09c8f5d14efcd2eb8ada8121154a872f8186ba458e0b081738f29c74f9d5f010 0x0000000000000000000000000000000000000000 232807 0xdeb835b13d51e2bbb3f2737eb7ffedbb81dc28eac41f10c2387c19c109ccc669 13273 0} []}
        	Test:       	TestChainTestSuite/TestChannel
    --- FAIL: TestChainTestSuite/TestChannel (154.75s)


FAIL

Debugger finished with the exit code 0

Add mock client support

Currently, we support only the IBFT2 client as IBC Client, so many features of IBC will only work on Besu. There is a concern that this will increase the cost of development. Therefore, we wanted to run our implementation except for the IBC Client on ganache, which is more suitable for contract development. This is expected to be achieved by supporting a mock IBC Client.

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.