Support for CREATE, CLONE and BYTECODE_HASH

This commit is contained in:
radrow
2021-04-07 08:41:54 +02:00
parent d82b42518e
commit 0bea3030bc
50 changed files with 247 additions and 157 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
contract Identity =
function main (x:int) = x
function main_fun (x:int) = x
function __call() = 12
+2 -2
View File
@@ -1,5 +1,5 @@
contract Remote =
entrypoint main : (int) => unit
contract interface Remote =
entrypoint main_fun : (int) => unit
contract AddrChain =
type o_type = oracle(string, map(string, int))
+1 -1
View File
@@ -1,5 +1,5 @@
contract Remote =
contract interface Remote =
entrypoint foo : () => unit
contract AddressLiterals =
+1 -1
View File
@@ -1,5 +1,5 @@
contract Remote =
contract interface Remote =
entrypoint foo : () => unit
contract AddressLiterals =
+1 -1
View File
@@ -1,4 +1,4 @@
contract Remote =
contract interface Remote =
entrypoint id : int => int
contract ProtectedCall =
+1 -1
View File
@@ -1,3 +1,3 @@
function square(x) = x ^ 2
contract Main =
entrypoint main() = square(10)
entrypoint main_fun() = square(10)
@@ -5,5 +5,5 @@ contract BadAENSresolve =
function fail() : t(int) =
AENS.resolve("foo.aet", "whatever")
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -3,4 +3,4 @@ contract MapAsMapKey =
function foo(m) : t(int => int) = {[m] = 0}
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -2,4 +2,4 @@ contract HigherOrderQueryType =
stateful function foo(o) : oracle_query(_, string ) =
Oracle.query(o, (x) => x + 1, 100, RelativeTTL(100), RelativeTTL(100))
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -2,4 +2,4 @@ contract HigherOrderResponseType =
stateful function foo(o, q : oracle_query(string, _)) =
Oracle.respond(o, q, (x) => x + 1)
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -1,2 +0,0 @@
namespace LastDeclarationIsNotAContract =
function add(x, y) = x + y
@@ -1,3 +1,3 @@
contract MissingDefinition =
entrypoint foo : int => int
entrypoint main() = foo(0)
entrypoint main_fun() = foo(0)
@@ -3,5 +3,5 @@ contract PolymorphicAENSresolve =
function fail() : option('a) =
AENS.resolve("foo.aet", "whatever")
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -3,4 +3,4 @@ contract MapAsMapKey =
function foo(m) : t('a) = {[m] = 0}
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -2,4 +2,4 @@ contract PolymorphicQueryType =
stateful function is_oracle(o) =
Oracle.check(o)
entrypoint main() = ()
entrypoint main_fun() = ()
@@ -2,4 +2,4 @@ contract PolymorphicResponseType =
function is_oracle(o : oracle(string, 'r)) =
Oracle.check(o)
entrypoint main(o : oracle(string, int)) = is_oracle(o)
entrypoint main_fun(o : oracle(string, int)) = is_oracle(o)
@@ -1,4 +1,4 @@
contract Remote =
contract interface Remote =
entrypoint foo : int => int
contract UnappliedContractCall =
@@ -1,5 +1,5 @@
contract UnappliedNamedArgBuiltin =
// Allowed in FATE, but not AEVM
stateful entrypoint main(s) =
stateful entrypoint main_fun(s) =
let reg = Oracle.register
reg(signature = s, Contract.address, 100, RelativeTTL(100)) : oracle(int, int)
+1 -1
View File
@@ -1,5 +1,5 @@
contract Remote =
contract interface Remote =
entrypoint up_to : (int) => list(int)
entrypoint sum : (list(int)) => int
entrypoint some_string : () => string
+1 -1
View File
@@ -1,4 +1,4 @@
contract Foo =
contract interface Foo =
entrypoint foo : () => int
contract Fail =
+1 -1
View File
@@ -1,6 +1,6 @@
// Testing primitives for accessing the block chain environment
contract Interface =
contract interface Interface =
entrypoint contract_address : () => address
entrypoint call_origin : () => address
entrypoint call_caller : () => address
+1 -1
View File
@@ -1,4 +1,4 @@
contract Remote =
contract interface Remote =
entrypoint dummy : () => unit
contract Events =
+1 -1
View File
@@ -1,6 +1,6 @@
// An implementation of the factorial function where each recursive
// call is to another contract. Not the cheapest way to compute factorial.
contract FactorialServer =
contract interface FactorialServer =
entrypoint fac : (int) => int
contract Factorial =
+2 -3
View File
@@ -1,3 +1,2 @@
contract Identity =
entrypoint main (x:int) = x
main contract Identity =
entrypoint main_fun (x:int) = x
+1 -1
View File
@@ -16,7 +16,7 @@ contract LHSMatching =
let null(_ :: _) = false
!null(xs)
entrypoint main() =
entrypoint main_fun() =
from_some(Some([0]))
++ append([length([true]), 2, 3], [4, 5, 6])
++ [7 | if (local_match([false]))]
+1 -1
View File
@@ -1,3 +1,3 @@
contract MissingEventType =
entrypoint main() =
entrypoint main_fun() =
Chain.event("MAIN")
+6 -4
View File
@@ -1,5 +1,7 @@
contract ContractOne =
entrypoint foo() = "foo"
contract Child =
entrypoint
add2 : int => int
add2(x) = x + 2
contract ContractTwo =
entrypoint bar() = "bar"
main contract Main =
entrypoint add4(x, c : Child) = c.add2(x) + 2
+1 -1
View File
@@ -1,4 +1,4 @@
contract C1 =
contract interface C1 =
entrypoint f : int
contract C =
+1 -1
View File
@@ -1,4 +1,4 @@
contract Remote =
contract interface Remote =
entrypoint id : int => int
contract ProtectedCall =
+5 -5
View File
@@ -1,18 +1,18 @@
contract Remote1 =
entrypoint main : (int) => int
contract interface Remote1 =
entrypoint main_fun : (int) => int
contract Remote2 =
contract interface Remote2 =
entrypoint call : (Remote1, int) => int
contract Remote3 =
contract interface Remote3 =
entrypoint get : () => int
entrypoint tick : () => unit
contract RemoteCall =
stateful entrypoint call(r : Remote1, x : int) : int =
r.main(gas = 10000, value = 10, x)
r.main_fun(gas = 10000, value = 10, x)
entrypoint staged_call(r1 : Remote1, r2 : Remote2, x : int) =
r2.call(r1, x)
+1 -1
View File
@@ -1,5 +1,5 @@
contract SpendContract =
contract interface SpendContract =
entrypoint withdraw : (int) => int
contract SpendTest =
+1 -1
View File
@@ -1,5 +1,5 @@
include "String.aes"
contract Remote =
contract interface Remote =
record rstate = { i : int, s : string, m : map(int, int) }
entrypoint look_at : (rstate) => unit
+1 -1
View File
@@ -1,5 +1,5 @@
contract Remote =
contract interface Remote =
stateful entrypoint remote_spend : (address, int) => unit
entrypoint remote_pure : int => int
+1 -1
View File
@@ -95,7 +95,7 @@ contract Identity =
function s(n) = (f,x)=>f(n(f,x))
function add(m,n) = (f,x)=>m(f,n(f,x))
entrypoint main() =
entrypoint main_fun() =
let three=s(s(s(z)))
add(three,three)
(((i)=>i+1),0)
+1 -1
View File
@@ -1,5 +1,5 @@
contract Remote =
contract interface Remote =
type themap = map(int, string)
entrypoint foo : () => themap
+1 -1
View File
@@ -9,7 +9,7 @@
// Oracle.extend
include "String.aes"
contract UnappliedBuiltins =
entrypoint main() = ()
entrypoint main_fun() = ()
type o = oracle(int, int)
type t = list(int * string)
type m = map(int, int)