Giter Site home page Giter Site logo

Comments (8)

cmichi avatar cmichi commented on June 14, 2024 1

@jacogr We would be very grateful if you could tackle this soonish. The context is that we're about to release ink! 5.0 and just now realized that polkadot-js/api needs to be updated.

from api.

cmichi avatar cmichi commented on June 14, 2024

I'm uploading a zip with two contracts here: erc20-4.0-vs-5.0.zip. It contains:

  • ERC-20 with ink! 4.0
  • ERC-20 with ink! 5.0

The diff comes down to

    "events": [
      {
        "args": [ ... ],
        "docs": [ ... ],
        "label": "...",
+       "module_path": "erc20::erc20",
+       "signature_topic": "0xb5b61a3e6a21a16be4f044b517c28ac692492f73c5bfd3f60178ad98c767f4cb"
      },
      ...
  ]

from api.

peetzweg avatar peetzweg commented on June 14, 2024

@ascjones Is this actually ink! specific? Would ask! and solang compiled contract emit events in the same way?

from api.

ascjones avatar ascjones commented on June 14, 2024

@ascjones Is this actually ink! specific? Would ask! and solang compiled contract emit events in the same way?

I'm not sure what the current state is, but we would expect them to emit events in this way in the future i.e. have the first topic be the signature topic and include that in the metadata. /cc @xermicus

from api.

peetzweg avatar peetzweg commented on June 14, 2024

Would be a bit of a hassle to not only treat contract compiled with different ink version differently but also languages. Is there something like an language overarching specification how pallet-contracts wasm contracts should behave?

from api.

cmichi avatar cmichi commented on June 14, 2024

That's basically the ink! metadata. Solang & co just implement the same metadata format as ink!, Solang also uses the ink! crates for parts of that. I think Solang is still on the Metadata v4.

When interpreting the metadata there should be no language-specific logic needed.

from api.

xermicus avatar xermicus commented on June 14, 2024

Yes as soon as ink! 5.0 is released I'll keep Solang up and make a new release. As for the events, this shouldn't be any issue to adapt.

In general the metadata is mostly compatible. The only compromise so far is about how Solang Solidity contracts make use of lang_error, because the concepts of errors and error handling is fundamentally different between Solidity and ink!. We might be able to solve this by changing ink! metadata. Maybe it's also just way more pragramatic to just have some "special cases" instead of trying to make the ink! metadata format too generic (I don't have a hard opinion). But this is the status quo already and not related to events, which I should be able to adapt in solang without problems.

from api.

Related Issues (20)

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.