GithubHelp home page GithubHelp logo

Comments (4)

brianlenz avatar brianlenz commented on July 18, 2024

It's worth pointing out that the GetTimestamp error is triggered by a static now() method in the crowdsale.py. If we use that method in a simplified contract, it does not give the same GetTimestamp error:

from boa.blockchain.vm.Neo.Blockchain import GetHeight,GetHeader
from boa.blockchain.vm.Neo.Transaction import Transaction, GetReferences, GetOutputs

class Test():
    def Main(self):
        return 0


    @staticmethod
    def now():
        height = GetHeight()
        current_block = GetHeader(height)
        return current_block.Timestamp

This results in the GetUnspentCoins error from above. This code does compile successfully on the aad18d8 changeset, so it seems to be pretty clear that those module import optimizations are the culprit.

Note: I realize that the Transaction import isn't actually used in the code, but it's what reproduces the issue.

(venv) neo-boa brian$ git checkout 2c6e01ad89b398092610cff89a23f11484b3bfb1
Previous HEAD position was aad18d8... Merge branch 'development' of github.com:CityOfZion/neo-boa into development
HEAD is now at 2c6e01a... Blockchain no longer imports other modules
(venv) neo-boa brian$ python compile.test.py 
Traceback (most recent call last):
  File "compile.test.py", line 3, in <module>
    Compiler.load_and_save('../tokensale-neo-smartcontract/test.py')
  File ".../neo-boa/boa/compiler.py", line 105, in load_and_save
    data = compiler.write()
  File ".../neo-boa/boa/compiler.py", line 81, in write
    out_bytes = bytes(module.write())
  File ".../neo-boa/boa/code/module.py", line 403, in write
    self.link_methods()
  File ".../neo-boa/boa/code/module.py", line 462, in link_methods
    raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method GetUnspentCoins not found
(venv) neo-boa brian$ git checkout aad18d8c47a9b3f99ec15bfdb7653c673f4691c3
Previous HEAD position was 2c6e01a... Blockchain no longer imports other modules
HEAD is now at aad18d8... Merge branch 'development' of github.com:CityOfZion/neo-boa into development
(venv) neo-boa brian$ python compile.test.py 
(venv) neo-boa brian$

from neo-boa.

ixje avatar ixje commented on July 18, 2024

was facing the same, reverted back to 0.2.1 for the time being.

from neo-boa.

localhuman avatar localhuman commented on July 18, 2024

This should be fixed in the new version of the compiler, v0.3.3

from neo-boa.

adarshaJha avatar adarshaJha commented on July 18, 2024

when i try to compile neo-ico-template , using command :-
sc build_run /home/adarsh.jha/Documents/neoproject/neo-ico-template/compile
.py True False False '' 02 ''
i get this error : -
from boa.compiler import Compiler
^
IndentationError: unexpected indent

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.