Comments (7)
Please @devhawk , Take a look to #161
from neo-devpack-dotnet.
@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.
@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.
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.
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.
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.
@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)
- "\xff" is parsed as weird bytes HOT 1
- Make `Runtime.ScriptContainer` return a Transaction object HOT 8
- Map.toString() throwing Exception: An unhandled exception was thrown. Key not found in Map HOT 18
- Add support to Array.Empty HOT 1
- `BigInteger` comparer for `ByteString` HOT 17
- Move TestClasses into a separate project
- UTs are not working on macOS / VSCode
- Automatically include "Debug" event when building in debug mode
- How can we avoid problems with different .NET versions? What's the best way to distribute the compiler? HOT 9
- Create a TestEngine HOT 21
- StoredAttribute default value when integer is not working
- Release workflow doesn't work HOT 2
- Use github packages without user and password HOT 7
- Neo submodule issue HOT 6
- Release workflow may not work HOT 2
- Fix hardcoded version for packing
- Update neo submodule
- TestEngine: Coverage and test current smart contracts
- Allow to compile a cs files without a project
- Avoid reuse the same namespace in devpack HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo-devpack-dotnet.