# Stored variables:
#
# Last known block
# 10: version
# 11: hashPrevBlock
# 12: hashMerkleRoot
# 13: time
# 14: bits
# 15: nonce
# 16: blockHash / lastKnownBlock
# 17: score
#

shared:
    TWO_POW_24 = 2 ^ 24

init:
    self.storage[16] = 0x00000000000000000cfdd50d917943949fa708829ab70108c98cdb9f7d62339d

code:
    def storeBlockHeader(version, hashPrevBlock, hashMerkleRoot, time, bits, nonce):
        exp = bits / TWO_POW_24
        mant = bits & 0xffffff
        target = mant * slt(1, (8*(exp - 3)))

    # shift left
    def slt(n, x):
        return(n * 2^x)

@@ -175,14 +175,20 @@
 %0A#%0A%0A
+def 
 shared
+()
 :%0A  
@@ -214,12 +214,18 @@
 24%0A%0A
+def 
 init
+()
 :%0A  
@@ -317,18 +317,36 @@
 9d%0A%0A
+def 
 code
+()
 :%0A    
+return(-1)%0A%0A
 def 
@@ -426,20 +426,16 @@
 e):%0A    
-   
- 
 exp = bi
@@ -454,20 +454,16 @@
 _24%0A    
-  
-  
 mant = b
@@ -481,20 +481,16 @@
 fff%0A    
- 
-   
 target =
@@ -520,20 +520,16 @@
 - 3)))%0A%0A
-    
 # shift 
@@ -533,20 +533,16 @@
 ft left%0A
-    
 def slt(
@@ -548,20 +548,16 @@
 (n, x):%0A
-    
     retu

update to poc7 syntax