-
Notifications
You must be signed in to change notification settings - Fork 224
Conversation
Wait for neo-project/neo-devpack-dotnet#55 |
Perfect, my friend. |
I don't know ... (readme and docs?) |
That is true! |
@shargon, please double check this last merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything else we need?
We need neo-project/neo#903. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to remove the NEF header before deploy.
neo-cli/Shell/MainService.cs
Outdated
} | ||
|
||
byte[] script = File.ReadAllBytes(nvmFilePath); | ||
byte[] script = File.ReadAllBytes(nefFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use the NefFile class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shargon, you mean something like:
- get the
nefFilePath
- serialize the data into the class
- get the script from it and just call the
InteropService.Neo_Contract_Create
with everything?
So that would also remove the NEF header before deploy, as @erikzhang affirmed.
Where the header will be stored?
Can you help to proceed with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to decide and count the NEF bytes... this is the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess they did a nice summary on other PR, Vitor:
https://github.com/neo-project/neo/pull/903/files
/// +------------+-----------+------------------------------------------------------------+
/// | Field | Length | Comment |
/// +------------+-----------+------------------------------------------------------------+
/// | Magic | 4 bytes | Magic header |
/// | Compiler | 32 bytes | Compiler used |
/// | Version | 16 bytes | Compiler version (Mayor, Minor, Build, Version) |
/// | ScriptHash | 20 bytes | ScriptHash for the script |
/// +------------+-----------+------------------------------------------------------------+
/// | Checksum | 4 bytes | Sha256 of the header (CRC) |
/// +------------+-----------+------------------------------------------------------------+
/// | Script | Var bytes | Var bytes for the payload |
/// +------------+-----------+------------------------------------------------------------+
I think it's 76bytes + script... on script, it's important to load it as ReadVarBytes, so its "header" (byte count) is also automatically removed.
ReadAllBytes could read more bytes than expected
closes https://github.com/neo-project/neo-compiler/issues/149