Coder Social home page Coder Social logo

Comments (3)

birchmd avatar birchmd commented on June 22, 2024

This is an interesting example @Scofield-04-21-076 . Conceptually it might make sense that Solidity's address type should map onto NEAR's AccountId type. However this minimum viable version of the compiler does make any kind of conceptual mapping; it verbatim executes the code as it would on Ethereum. Therefore, the reason for the failure is because the input account1.testnet is not a valid address (20 bytes). If you make the call with a valid input then it does work as expected, for example

$ near --networkId testnet --accountId birchmd.testnet call dev-1663014663747-27418521013742 multiply '{"addr": "0x0000000000000deadbeef0000000000000000000"}'
Scheduling a call: dev-1663014663747-27418521013742.multiply({"addr": "0x0000000000000deadbeef0000000000000000000"})

Doing account.functionCall()
Transaction Id Hh6bgj4kkWEQNKrtDDKR2Ux5eoHe6fFcpKvQUNKoTCVu
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/Hh6bgj4kkWEQNKrtDDKR2Ux5eoHe6fFcpKvQUNKoTCVu
{
  output: '0x0000000000000deadbeef0000000000000000000',
  status: 'SUCCESS'
}

We could certainly improve the error message here to give something more helpful than "unreachable", but I don't really think the quality of the error message is what you are worried about here.

from evm2near.

Scofield-04-21-076 avatar Scofield-04-21-076 commented on June 22, 2024

But addresses in the NEAR Protocol usually look like: alice.testnet, bob.testnet, carl.testnet, alice.near or dev-1663014663747-27418521013742.

  1. Can they be converted as in the case of TRON?

  2. Should the user create an account with similar names as "0x0000000000000deadbeef0000000000000000000"? But in the case of the testnet it will look like this: "0x0000000000000deadbeef0000000000000000000.testnet". How to provide testing of contracts in such a case?

from evm2near.

birchmd avatar birchmd commented on June 22, 2024

Yes, as I said, it would make sense conceptually to map Solidity's address type to NEAR's AccountId type. However, the implementation for this is non-obvious. As you pointed out, there could be multiple ways of doing this, depending on how faithfully you want to represent NEAR's accounts.

Solving this kind of design problem is unfortunately out of scope for the project currently because we have limited resources for maintaining it. However, if you are interested in seeing this feature pushed forward then you are absolutely welcome to submit a proposal for the design, and work on the implementation if the design looks good.

from evm2near.

Related Issues (6)

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.