Skip to content

Instantly share code, notes, and snippets.

@tinybike
Created August 8, 2015 06:30
Show Gist options
  • Select an option

  • Save tinybike/3ead56b5ea9573651501 to your computer and use it in GitHub Desktop.

Select an option

Save tinybike/3ead56b5ea9573651501 to your computer and use it in GitHub Desktop.
Load an array into memory from contract data
# loads an array from contract data
# $a: array
# $n: array length
macro fetch($a, $n):
with $memarray = array($n):
with $i = 0:
while $i < $n:
$memarray[$i] = $a[$i]
$i += 1
$memarray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment