Giter VIP home page Giter VIP logo

Comments (7)

shargon avatar shargon commented on June 29, 2024 1

Please @devhawk , Take a look to #161

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024 1

@shargon I have https://github.com/devhawk/neo-devpack-dotnet/tree/devhawk/FeaturesAttribute ready to go, but I will wait on submitting that for PR until #154 goes thru.

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

@shargon I'd appreciate your thoughts on this issue. I started to do this, but I ran into a few incompatibilities:

  • FeaturesAttribute is applied to a class while all of the contract attributes I added are applied to the assembly. As far as I understand, NEON doesn't support multiple contracts in a single managed dll - at least for 2.x. If that's the same for NEON 3.x, should FeaturesAttribute be applied to the assembly not the class? Or should all the 2.x attributes apply to class instead of assembly.
    • My preference is to attach these attributes to assembly not class. What does it mean to attach these attributes to classes other than the main contract class?
  • FeaturesAttribute uses the ContractFeatures enum, but the 2.x branch already has the ContractPropertyState enum. I don't think we should define to enums with the same values and we can't change the existing ContractPropertyState enum without breaking code. I'm thinking the 2.x branch version of FeaturesAttribute should just take a ContractPropertyState value in its constructor, even though it's not 100% compatible with 3.x branch.

from neo-devpack-dotnet.

shargon avatar shargon commented on June 29, 2024

should FeaturesAttribute be applied to the assembly not the class?

Yes, I think so. But is not more comfortable for the developer in a class?

even though it's not 100% compatible with 3.x branch.

Don't worry about that, it's ok for me

from neo-devpack-dotnet.

shargon avatar shargon commented on June 29, 2024

Seems weird to me with smart contracts with one file.

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;

[assembly: Features(ContractFeatures.HasStorage)]

namespace Neo.Compiler.MSIL.TestClasses
{
    class Contract_Storage : SmartContract.Framework.SmartContract
    {

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

Not all contracts are a single file: https://github.com/Moonlight-io/moonlight-ico-template
What would it mean for you to apply the features attribute to the NEP5 class but not the main entrypoint class?

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

@shargon I like #161. Note also that I have a task open to add these attributes for the neo contract templates. So developers starting from scratch will know how to add them.

from neo-devpack-dotnet.

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.