Comments (4)
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.
was facing the same, reverted back to 0.2.1
for the time being.
from neo-boa.
This should be fixed in the new version of the compiler, v0.3.3
from neo-boa.
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)
- 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
- Smart Contract Migration results in different return value HOT 1
- 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.