Comments (1)
@hal0x2328 pointed out in Discord that I was passing the script in the wrong format.
If you put 0x in front of your argument, np-prompt assumes you are specifying a really large little-endian BigInteger. So your contract script ends up on the blockchain but the bytes are in reverse order. If you want to send a bytearray do it like shown here
so what needs to be done is to convert the script hex to a bytearray
#!/usr/local/env python3
import binascii
script="011fc56b6a00527ac46a51527ac468164e656f2e53746f726167652e476574436f6e74657874616a52527ac46a00c30361646487646e0006616464696e67680f4e656f2e52756e74696d652e4c6f676a52c36a51c300c37c680f4e656f2e53746f726167652e476574616a53527ac46a53c36a51c351c3936a54527ac46a52c36a51c300c36a54c35272680f4e656f2e53746f726167652e507574616a54c36c7566616a00c30672656d6f7665876454006a52c36a51c300c37c680f4e656f2e53746f726167652e476574616a53527ac46a52c36a51c300c36a53c36a51c351c3945272680f4e656f2e53746f726167652e507574616a53c36a51c351c3946c7566616a00c30762616c616e6365876421006a52c36a51c300c37c680f4e656f2e53746f726167652e476574616c7566616a00c3076d69677261746587642401174d696772617465206f7065726174696f6e207374617274680f4e656f2e52756e74696d652e4c6f670207106a55527ac401056a56527ac4516a57527ac4136d6967726174656420636f6e747261637420336a58527ac403302e336a59527ac40b6c6f63616c68756d616e336a5a527ac40d6e657840656d61696c2e636f6d6a5b527ac40d74657374206d696772617465336a5c527ac46a51c300c36a55c36a56c36a57c36a58c36a59c36a5ac36a5bc36a5cc3587951795a727551727557795279597275527275567953795872755372755579547957727554727568144e656f2e436f6e74726163742e4d696772617465616a5d527ac411636f6e7472616374206d69677261746564680f4e656f2e52756e74696d652e4c6f676a5dc36c756661006c7566"
print("'{}'".format(''.join(['\\x{:02x}'.format(ord(c)) for c in binascii.unhexlify(script).decode('Latin1')])))
from neo-boa.
Related Issues (20)
- Crowdsale Demo directory shouldn't be labeled "nex" HOT 1
- Crowdsale demo and nep5 demo should be the same style HOT 1
- The method to_s(), which generates the output of the executable in readable format, is outdated
- [Feature] Use Python assert in smart contract HOT 4
- Add support for multi-line invocation
- Neo 3x support HOT 2
- Built-in command line interface for neo-boa HOT 1
- support for avmdbgnfo format HOT 4
- replace coz-bytecode dependency with official bytecode project HOT 1
- .abi.json support HOT 3
- Python typehinting support
- About NEP-5 Smart Contract
- Generating incorrect hash for ABI file HOT 1
- Visual DevTracker deploy function not detecting contracts compiled with neo-boa
- negative shift count error when running unit test HOT 1
- Convert byte array to number ? HOT 1
- Invoking Neo.Contract.IsPayable fails HOT 1
- Crowdsale Demo totalSupply returns circulation
- Crowdsale Demo Contract missing OnTransfer event in deploy
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-boa.