Restructure files a bit.

This commit is contained in:
Jacques Wagener 2019-06-27 18:23:21 +02:00
parent b13f970f96
commit 26c44fbf54
No known key found for this signature in database
GPG Key ID: C294D1025DA0E923
7 changed files with 4 additions and 37 deletions

View File

@ -1,30 +0,0 @@
version = "0.1.0"
author = "Status Research & Development GmbH"
description = "Ethereum smart contracts in Nim"
license = "Apache License 2.0"
skipDirs = @["examples"]
# Dependencies
requires "nim >= 0.18.1", "stint", "nimcrypto"
proc buildExample(name: string) =
exec "nim c -d:release --out:examples/" & name & ".wasm examples/" & name
exec "./postprocess.sh examples/" & name & ".wasm"
proc buildTool(name: string) =
exec "nim c -d:release --out:tools/" & name & " tools/" & name
task examples, "Build examples":
# buildExample("wrc20")
buildExample("wrc202")
# buildExample("hello")
# buildExample("hello2")
# buildExample("hello3")
task tools, "Build tools":
buildTool("abi_gen")
buildTool("k256_sig")

View File

@ -1,7 +1,7 @@
## ewasm “WRC20” token contract coding challenge
## https://gist.github.com/axic/16158c5c88fbc7b1d09dfa8c658bc363
import ../eth_contracts, endians
import ../nimplay/ewasm_eei, endians
proc do_balance() =
if getCallDataSize() != 24:

View File

@ -1,5 +1,5 @@
import ../eth_contracts
import ../eth_macros
import ../nimplay/ewasm_eei
import ../nimplay/nimplay_macros
import math

View File

@ -40,7 +40,7 @@ proc generate_method_sig*(func_sig: FunctionSignature, v2_sig: bool = false): st
proc getKHash(inp: string): string {.compileTime.} =
let exec_string = "tools/k256_sig \"" & inp & "\""
let exec_string = "../tools/k256_sig \"" & inp & "\""
let outp_shell = staticExec(exec_string)
return outp_shell

View File

@ -154,8 +154,6 @@ proc handle_contract_interface(stmts: NimNode): NimNode =
discard
# raise newException(ParserError, ">> Invalid stmt \"" & getTypeInst(child) & "\" not supported in contract block")
echo function_signatures
if filter(function_signatures, proc(x: FunctionSignature): bool = x.is_private).len == 0:
raise newException(
ParserError,
@ -204,7 +202,6 @@ proc handle_contract_interface(stmts: NimNode): NimNode =
for func_sig in function_signatures:
if func_sig.is_private:
echo "!!!"
continue
echo "Building " & func_sig.method_sig
var call_and_copy_block = nnkStmtList.newTree()