Skip to content
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

NEP-10 incompatibility: supportedStandards() needs to return an array of strings - not a simple string #3

Open
mwherman2000 opened this issue Nov 1, 2018 · 4 comments

Comments

@mwherman2000
Copy link

mwherman2000 commented Nov 1, 2018

The error is in line: https://github.com/neo-ngd/CNEO-Contract/blob/master/NeoContract/CNEO.cs#L267

NEP-10 Specification: https://github.com/neo-project/proposals/blob/master/nep-10.mediawiki
NEP-10 Specification sample code: neo-project/proposals#40 (comment)

Was this SC code reviewed? Was it tested?

@chenzhitong
Copy link
Collaborator

The SC code has been code-audited at the beginning of August, except for the NEP-10 sample code. We wrote it according to the examples in the NEP-10 documentation. @mwherman2000

@mwherman2000
Copy link
Author

mwherman2000 commented Nov 2, 2018

It appears that you neither read the spec nor read the referenced sample code. Both are very explicit that supportedStandards() returns an array of strings. Your implementation is not compliant with the spec or the sample code.

From the standard:

  • Syntax: public static string[] supportedStandards()
  • Operation: "supportedStandards"
  • Remarks: This operation and method expects no parameters and returns an array of string values.

From the sample code referenced in the standard:

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;
using System;
using System.Numerics;

namespace SupportedStandards1
{
    public class Contract1 : SmartContract
    {
        public static object Main(string operation, params object[] args)
        {
            object result = false;

            if (operation == "supportedStandards")
            {
                result = (object)supportedStandards();
            }
            else if (...)
            {
                ...
            }
            ...

            return result;
        }

        **public static string[] supportedStandards()
        {
            string[] result = { "NEP-5", "NEP-10", "NEP-1234" };

            return result;
        }**
    }
}

@chenzhitong
Copy link
Collaborator

To be honest, I did not read the NEP-10 specification carefully and this code was added by the security auditor. There are already a lot of people using CGAS and we are not going to redeploy. In addition, I created a new project, where I used the correct nep-10 method. neo-project/examples#26 @mwherman2000

@mwherman2000
Copy link
Author

So what do you think NEO Global Development's response was (the NEO blockchain core development team)?

"To be honest, I did not read the NEP-10 specification carefully and this code was added by the security auditor. There are already a lot of people using CGAS and we are not going to redeploy." (#3 (comment))

#thisishowblockchainprojectsdie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants