github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/core/wavm/tests/register/wasm/program.wat (about)

     1  (module
     2   (type $FUNCSIG$i (func (result i32)))
     3   (type $FUNCSIG$j (func (result i64)))
     4   (type $FUNCSIG$ji (func (param i32) (result i64)))
     5   (type $FUNCSIG$vij (func (param i32 i64)))
     6   (type $FUNCSIG$ij (func (param i64) (result i32)))
     7   (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
     8   (type $FUNCSIG$ii (func (param i32) (result i32)))
     9   (type $FUNCSIG$vii (func (param i32 i32)))
    10   (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
    11   (type $FUNCSIG$v (func))
    12   (import "env" "Register" (func $Register (param i32 i32)))
    13   (import "env" "GetOrigin" (func $GetOrigin (result i32)))
    14   (import "env" "GetSender" (func $GetSender (result i32)))
    15   (import "env" "GetValue" (func $GetValue (result i64)))
    16   (import "env" "GetContractValue" (func $GetContractValue (result i64)))
    17   (import "env" "GetContractAddress" (func $GetContractAddress (result i32)))
    18   (import "env" "GetBalanceFromAddress" (func $GetBalanceFromAddress (param i32) (result i64)))
    19   (import "env" "SendFromContract" (func $SendFromContract (param i32 i64)))
    20   (import "env" "GetBlockHash" (func $GetBlockHash (param i64) (result i32)))
    21   (import "env" "GetDifficulty" (func $GetDifficulty (result i64)))
    22   (import "env" "GetBlockNumber" (func $GetBlockNumber (result i64)))
    23   (import "env" "GetTimestamp" (func $GetTimestamp (result i64)))
    24   (import "env" "GetCoinBase" (func $GetCoinBase (result i32)))
    25   (import "env" "GetGas" (func $GetGas (result i64)))
    26   (import "env" "GetGasLimit" (func $GetGasLimit (result i64)))
    27   (import "env" "StorageRead" (func $StorageRead (param i32) (result i32)))
    28   (import "env" "GenerateKey" (func $GenerateKey (param i32 i32 i32) (result i32)))
    29   (import "env" "StorageWrite" (func $StorageWrite (param i32 i32)))
    30   (import "env" "SHA3" (func $SHA3 (param i32) (result i32)))
    31   (import "env" "FromI64" (func $FromI64 (param i64) (result i32)))
    32   (import "env" "FromU64" (func $FromU64 (param i64) (result i32)))
    33   (import "env" "ToI64" (func $ToI64 (param i32) (result i64)))
    34   (import "env" "ToU64" (func $ToU64 (param i32) (result i64)))
    35   (import "env" "Concat" (func $Concat (param i32 i32) (result i32)))
    36   (table 24 24 anyfunc)
    37   (elem (i32.const 0) $__wasm_nullptr $__importThunk_GetOrigin $__importThunk_GetSender $__importThunk_GetValue $__importThunk_GetContractValue $__importThunk_GetContractAddress $__importThunk_GetBalanceFromAddress $__importThunk_SendFromContract $__importThunk_GetBlockHash $__importThunk_GetDifficulty $__importThunk_GetBlockNumber $__importThunk_GetTimestamp $__importThunk_GetCoinBase $__importThunk_GetGas $__importThunk_GetGasLimit $__importThunk_StorageRead $__importThunk_GenerateKey $__importThunk_StorageWrite $__importThunk_SHA3 $__importThunk_FromI64 $__importThunk_FromU64 $__importThunk_ToI64 $__importThunk_ToU64 $__importThunk_Concat)
    38   (memory $0 1)
    39   (data (i32.const 16) "a\00")
    40   (data (i32.const 24) "\00\00\00\00\00\00\00\00")
    41   (data (i32.const 32) "b\00")
    42   (data (i32.const 36) "\00\00\00\00")
    43   (data (i32.const 48) "c\00")
    44   (data (i32.const 56) "\00\00\00\00\00\00\00\00")
    45   (export "memory" (memory $0))
    46   (export "getmsg" (func $getmsg))
    47   (export "getcontract" (func $getcontract))
    48   (export "getblock" (func $getblock))
    49   (export "getutils" (func $getutils))
    50   (export "contractname" (func $contractname))
    51   (export "querya" (func $querya))
    52   (export "queryb" (func $queryb))
    53   (export "queryc" (func $queryc))
    54   (func $getmsg (; 24 ;) (param $0 i32)
    55    (i32.store offset=4
    56     (get_local $0)
    57     (i32.const 1)
    58    )
    59    (i32.store
    60     (get_local $0)
    61     (i32.const 2)
    62    )
    63    (i32.store offset=8
    64     (get_local $0)
    65     (i32.const 3)
    66    )
    67   )
    68   (func $getcontract (; 25 ;) (param $0 i32)
    69    (i32.store offset=4
    70     (get_local $0)
    71     (i32.const 4)
    72    )
    73    (i32.store
    74     (get_local $0)
    75     (i32.const 5)
    76    )
    77    (i32.store offset=8
    78     (get_local $0)
    79     (i32.const 6)
    80    )
    81    (i32.store offset=12
    82     (get_local $0)
    83     (i32.const 7)
    84    )
    85   )
    86   (func $getblock (; 26 ;) (param $0 i32)
    87    (i32.store offset=4
    88     (get_local $0)
    89     (i32.const 8)
    90    )
    91    (i32.store
    92     (get_local $0)
    93     (i32.const 9)
    94    )
    95    (i32.store offset=8
    96     (get_local $0)
    97     (i32.const 10)
    98    )
    99    (i32.store offset=12
   100     (get_local $0)
   101     (i32.const 11)
   102    )
   103    (i32.store offset=16
   104     (get_local $0)
   105     (i32.const 12)
   106    )
   107    (i32.store offset=20
   108     (get_local $0)
   109     (i32.const 13)
   110    )
   111    (i32.store offset=24
   112     (get_local $0)
   113     (i32.const 14)
   114    )
   115   )
   116   (func $getutils (; 27 ;) (param $0 i32)
   117    (i32.store offset=4
   118     (get_local $0)
   119     (i32.const 15)
   120    )
   121    (i32.store
   122     (get_local $0)
   123     (i32.const 16)
   124    )
   125    (i32.store offset=8
   126     (get_local $0)
   127     (i32.const 17)
   128    )
   129    (i32.store offset=12
   130     (get_local $0)
   131     (i32.const 18)
   132    )
   133    (i32.store offset=16
   134     (get_local $0)
   135     (i32.const 19)
   136    )
   137    (i32.store offset=20
   138     (get_local $0)
   139     (i32.const 20)
   140    )
   141    (i32.store offset=24
   142     (get_local $0)
   143     (i32.const 21)
   144    )
   145    (i32.store offset=28
   146     (get_local $0)
   147     (i32.const 22)
   148    )
   149    (i32.store offset=32
   150     (get_local $0)
   151     (i32.const 23)
   152    )
   153   )
   154   (func $contractname (; 28 ;) (param $0 i64) (param $1 i32) (param $2 i64)
   155    (call $Register
   156     (i32.const 16)
   157     (i32.load offset=24
   158      (i32.const 0)
   159     )
   160    )
   161    (call $Register
   162     (i32.const 32)
   163     (i32.load offset=36
   164      (i32.const 0)
   165     )
   166    )
   167    (call $Register
   168     (i32.const 48)
   169     (i32.load offset=56
   170      (i32.const 0)
   171     )
   172    )
   173    (i32.store offset=36
   174     (i32.const 0)
   175     (get_local $1)
   176    )
   177    (i64.store offset=24
   178     (i32.const 0)
   179     (get_local $0)
   180    )
   181    (i64.store offset=56
   182     (i32.const 0)
   183     (get_local $2)
   184    )
   185   )
   186   (func $querya (; 29 ;) (result i64)
   187    (call $Register
   188     (i32.const 16)
   189     (i32.load offset=24
   190      (i32.const 0)
   191     )
   192    )
   193    (i64.load offset=24
   194     (i32.const 0)
   195    )
   196   )
   197   (func $queryb (; 30 ;) (result i32)
   198    (call $Register
   199     (i32.const 32)
   200     (i32.load offset=36
   201      (i32.const 0)
   202     )
   203    )
   204    (i32.load offset=36
   205     (i32.const 0)
   206    )
   207   )
   208   (func $queryc (; 31 ;) (result i64)
   209    (call $Register
   210     (i32.const 48)
   211     (i32.load offset=56
   212      (i32.const 0)
   213     )
   214    )
   215    (i64.load offset=56
   216     (i32.const 0)
   217    )
   218   )
   219   (func $__wasm_nullptr (; 32 ;) (type $FUNCSIG$v)
   220    (unreachable)
   221   )
   222   (func $__importThunk_GetOrigin (; 33 ;) (type $FUNCSIG$i) (result i32)
   223    (call $GetOrigin)
   224   )
   225   (func $__importThunk_GetSender (; 34 ;) (type $FUNCSIG$i) (result i32)
   226    (call $GetSender)
   227   )
   228   (func $__importThunk_GetValue (; 35 ;) (type $FUNCSIG$j) (result i64)
   229    (call $GetValue)
   230   )
   231   (func $__importThunk_GetContractValue (; 36 ;) (type $FUNCSIG$j) (result i64)
   232    (call $GetContractValue)
   233   )
   234   (func $__importThunk_GetContractAddress (; 37 ;) (type $FUNCSIG$i) (result i32)
   235    (call $GetContractAddress)
   236   )
   237   (func $__importThunk_GetBalanceFromAddress (; 38 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64)
   238    (call $GetBalanceFromAddress
   239     (get_local $0)
   240    )
   241   )
   242   (func $__importThunk_SendFromContract (; 39 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
   243    (call $SendFromContract
   244     (get_local $0)
   245     (get_local $1)
   246    )
   247   )
   248   (func $__importThunk_GetBlockHash (; 40 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
   249    (call $GetBlockHash
   250     (get_local $0)
   251    )
   252   )
   253   (func $__importThunk_GetDifficulty (; 41 ;) (type $FUNCSIG$j) (result i64)
   254    (call $GetDifficulty)
   255   )
   256   (func $__importThunk_GetBlockNumber (; 42 ;) (type $FUNCSIG$j) (result i64)
   257    (call $GetBlockNumber)
   258   )
   259   (func $__importThunk_GetTimestamp (; 43 ;) (type $FUNCSIG$j) (result i64)
   260    (call $GetTimestamp)
   261   )
   262   (func $__importThunk_GetCoinBase (; 44 ;) (type $FUNCSIG$i) (result i32)
   263    (call $GetCoinBase)
   264   )
   265   (func $__importThunk_GetGas (; 45 ;) (type $FUNCSIG$j) (result i64)
   266    (call $GetGas)
   267   )
   268   (func $__importThunk_GetGasLimit (; 46 ;) (type $FUNCSIG$j) (result i64)
   269    (call $GetGasLimit)
   270   )
   271   (func $__importThunk_StorageRead (; 47 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
   272    (call $StorageRead
   273     (get_local $0)
   274    )
   275   )
   276   (func $__importThunk_GenerateKey (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
   277    (call $GenerateKey
   278     (get_local $0)
   279     (get_local $1)
   280     (get_local $2)
   281    )
   282   )
   283   (func $__importThunk_StorageWrite (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
   284    (call $StorageWrite
   285     (get_local $0)
   286     (get_local $1)
   287    )
   288   )
   289   (func $__importThunk_SHA3 (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
   290    (call $SHA3
   291     (get_local $0)
   292    )
   293   )
   294   (func $__importThunk_FromI64 (; 51 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
   295    (call $FromI64
   296     (get_local $0)
   297    )
   298   )
   299   (func $__importThunk_FromU64 (; 52 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
   300    (call $FromU64
   301     (get_local $0)
   302    )
   303   )
   304   (func $__importThunk_ToI64 (; 53 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64)
   305    (call $ToI64
   306     (get_local $0)
   307    )
   308   )
   309   (func $__importThunk_ToU64 (; 54 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64)
   310    (call $ToU64
   311     (get_local $0)
   312    )
   313   )
   314   (func $__importThunk_Concat (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
   315    (call $Concat
   316     (get_local $0)
   317     (get_local $1)
   318    )
   319   )
   320  )