Giter Site home page Giter Site logo

non-native-contracts's People

Contributors

annashaleva avatar cloud8little avatar erikzhang avatar shargon avatar superboyiii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

non-native-contracts's Issues

Better edge cases and exceptions handling for NNS contract

Problem

NNS contract aborts VM execution in case if getAllRecords is requested for unexisting name:
https://github.com/neo-project/non-native-contracts/blob/8d72b92e5e5705d763232bcc24784ced0fb8fc87/src/NameService/NameService.cs#L378C42-L378C60

Tested on test contract invocations. The engine's FAULT exception itself looks like this if C# node handles invokefunction RPC call:

One of the identified items was in an invalid format.

and if Go node handles invokefunstion RPC call, then exception looks like the following:

at instruction 57 (SYSCALL): invalid conversion: Null/ByteString

The reason is in fact that if nameMap[tokenKey] doesn't contain provided tokenKey then Null stackitem will be returned from this call. And then this Null is being passed to (NameState)StdLib.Deserialize which has an offset 57 (according to native StdLib manifest):

               {
                  "offset" : 56,
                  "name" : "deserialize",
                  "returntype" : "Any",
                  "parameters" : [
                     {
                        "type" : "ByteArray",
                        "name" : "data"
                     }
                  ],
                  "safe" : true
               },

As a result, StdLib tries to convert provided Null to ByteString and fails.

Suggestion

The problem itself is in the fact that NNS doesn't properly handle this error and returns it to the user "as is". From this error it's not clear what happens on the contract side and why getAllRecords FAULTs execution. I'd suggest to return some meaningful exceptions from NNS in similar cases.

Also, for this particular case I'd suggest to return empty iterator since there are no suitable records. Not FAULT the execution.

process of expired name

So do we remove the deletion logic of the expired date? Is it possible to provide Storage.FindRange method to find items in certain range?

NeoNS - improve handling of expired names

Based on the current code, once a domain expired, anyone can register it again, which effectively creates a new NFT.

While this works fine, this means we will end up with 2 (or more) NFT of the same domain, some expired and one not expired, with all the expired one basically useless (can not even be moved).

ENS handles that by burning the old one, during a registration if the old one exists and has expired, is this something we could add? I think this would be cleaner and would avoid ending up with tons of NFT which can not even be moved.

Is this the NNS deployed to MainNet?

Hi,

Is it possible to call this smart contract on main net? Where can we get the hash of it? Also, where are you guys planning to store these non native contracts script hashes?

Were these contracts deployed on MainNet?

Hi,

Is it possible to call this smart contract on main net? Where can we get the hash of it? Also, where are you guys planning to store these non native contracts script hashes?
What about TestNet? What is the hash? Thanks!

Reverse Lookup

Hey all ๐Ÿ‘‹

It's beyond my understanding why the "reverse lookup" feature was left behind in NNS. Someone pointed me to the (old) PR #15, which was not merged into the NNS initial release.

Basically, right now, no dApp can display blah.neo when pairing its wallet, exactly because we don't have a way to reverse and "find" the name associated with that address.

References:
https://eips.ethereum.org/EIPS/eip-181

NNS Contracts Hashes

I am adding NNS to the neo-cli node. I need to know these contract hashes for

  • Network 894710606 (seed1t5.neo.org)
  • Network 91414437 (morph1.fs.neo.org)
  • Network 91466898 (morph01.testnet.fs.neo.org)

Maybe you guys know or know someone? @shargon @superboyiii

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.