Initial
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
@compiler == 9.0.0
|
||||
|
||||
include "String.aes"
|
||||
|
||||
contract Resolver =
|
||||
record state =
|
||||
{ips : list(string),
|
||||
port : int,
|
||||
salt : bytes(),
|
||||
ids : list(address)}
|
||||
|
||||
stateful entrypoint init(ips : list(string), port : int, salt : string, ids : list(address)) : state =
|
||||
{ips = ips,
|
||||
port = port,
|
||||
salt = String.to_bytes(salt),
|
||||
ids = ids}
|
||||
|
||||
public stateful entrypoint ips(ips : list(string)) : unit =
|
||||
require(Call.caller == Contract.creator, "Unauthorized")
|
||||
put(state{ips = ips})
|
||||
|
||||
public stateful entrypoint port(port : int) : unit =
|
||||
require(Call.caller == Contract.creator, "Unauthorized")
|
||||
put(state{port = port})
|
||||
|
||||
public stateful entrypoint salt(salt : string) : unit =
|
||||
require(Call.caller == Contract.creator, "Unauthorized")
|
||||
put(state{salt = String.to_bytes(salt)})
|
||||
|
||||
public stateful entrypoint ids(ids : list(address)) : unit =
|
||||
require(Call.caller == Contract.creator, "Unauthorized")
|
||||
put(state{ids = ids})
|
||||
|
||||
public entrypoint resolve() : list(string) * int * bytes() * list(address) =
|
||||
(state.ips, state.port, state.salt, state.ids)
|
||||
Reference in New Issue
Block a user