GithubHelp home page GithubHelp logo

Comments (1)

corck avatar corck commented on July 18, 2024

@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)

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.