-
Notifications
You must be signed in to change notification settings - Fork 9
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
UI for smart contract deployment #44
Conversation
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 compiled TestContract, but the Deploy Contract UI still reads "No compiled contracts (*.avm files) were found in the current workspace." even after I refresh and/or reopen the deploy contract UI
This has already been done but you'll need to build NEON yourself in the short term to get it. |
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.
Originally, I had a build issue that was preventing the panel from displaying correctly. After cleaning my repo and rebuilding both the extension and the test contract, the panel displays correctly but it still can't find the .avm file in the folder
Should we also have a way to right click on an AVM file to initiate deployment (probably do this in a separate task) |
From Discord: |
Still hitting error finding .avm files on windows. I went in and manually removed the prefix slash from fullpath parameter in Contract constructor and it worked fine.
|
FIxed now. I need to remember to use the fsPath property on Uri objects (instead of path); path works by accident on *nix systems but fsPath is the propery way of getting the corresponding file system path for a file:// URI. |
This is a known limitation of the watch script. You need to restart it whenever new panels are added. This is probably Ok because adding a panel is rare, but we can open a separate issue if we want the watch script to be more intelligent. |
Opened #56 |
Done |
Opened #57 |
Opened #58 |
// | ||
const sb = neon.default.create.scriptBuilder(); | ||
const script = sb | ||
.emitPush(neon.default.u.str2hexstring('')) // description |
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.
Contract metadata should be in the abi.json file as of NEON v2.6. If the metadata property is missing, using empty strings is a fine default, but these should be using abi.json if possible
.emitPush(neon.default.u.str2hexstring('')) // author | ||
.emitPush(neon.default.u.str2hexstring('')) // code_version | ||
.emitPush(neon.default.u.str2hexstring('')) // name | ||
.emitPush(0x01) // storage: {none: 0x00, storage: 0x01, dynamic: 0x02, storage+dynamic:0x03} |
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.
storage and dynamic is part of the aformentioned contract metadata. If the metadata property is missing, prompt the user instead of assuming contracts use storage but arent dynamic
.emitPush(neon.default.u.str2hexstring('')) // code_version | ||
.emitPush(neon.default.u.str2hexstring('')) // name | ||
.emitPush(0x01) // storage: {none: 0x00, storage: 0x01, dynamic: 0x02, storage+dynamic:0x03} | ||
.emitPush('05') // return type - see https://docs.neo.org/docs/en-us/sc/deploy/Parameter.html |
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.
This information is in the abi.json file. If the abi.json file is missing, fail deployment rather than assuming return/parameter types
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.
Are you planning on reading the abi.json file before completing this PR?
After. I've already got issues created for the follow-on items (see above). |
These need to get done before we ship, but totally cool to separate out into multiple tasks |
Allows any AVM file in the active workspace to be deployed to any Neo Express instance.
Some limitations: