2018-04-13 22:50:22 +03:00
|
|
|
/- constitution, ethereum
|
2018-04-18 00:11:59 +03:00
|
|
|
/+ ethereum
|
|
|
|
=> [^constitution ethereum]
|
2018-04-13 22:50:22 +03:00
|
|
|
|%
|
2018-04-18 01:32:02 +03:00
|
|
|
++ event-log-to-hull-diffs
|
|
|
|
::=, ships-events
|
|
|
|
=> [ships-events .]
|
|
|
|
|= log=event-log
|
|
|
|
^- (list (pair ship diff-hull))
|
|
|
|
~? ?=(~ mined.log) %processing-unmined-event
|
|
|
|
::
|
|
|
|
?: =(event.log transferred)
|
2018-04-18 02:26:22 +03:00
|
|
|
=+ ^- [who=@ wer=address] ::TODO should we make @p work here?
|
2018-04-18 01:32:02 +03:00
|
|
|
(decode-results data.log ~[%uint %address])
|
|
|
|
[who %owner wer]~
|
|
|
|
::
|
|
|
|
?: =(event.log activated)
|
2018-04-18 02:26:22 +03:00
|
|
|
=+ ^- [who=@ wer=address]
|
2018-04-18 01:32:02 +03:00
|
|
|
(decode-results data.log ~[%uint %address])
|
2018-04-19 00:18:17 +03:00
|
|
|
:* ^- (pair ship diff-hull)
|
2018-04-18 01:32:02 +03:00
|
|
|
:+ who %full
|
|
|
|
%*(. *hull owner wer, sponsor (sein:title who))
|
|
|
|
::
|
2018-04-19 00:18:17 +03:00
|
|
|
?: =(%czar (clan:title who)) ~
|
|
|
|
:_ ~
|
2018-04-18 01:32:02 +03:00
|
|
|
^- (pair ship diff-hull)
|
|
|
|
[(sein:title who) %spawned who]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
?: =(event.log escape-requested)
|
|
|
|
=+ ^- [who=@ wer=@]
|
|
|
|
(decode-results data.log ~[%uint %uint])
|
|
|
|
[who %escape `wer]~
|
|
|
|
::
|
|
|
|
?: =(event.log escape-canceled)
|
|
|
|
=/ who=@ (decode-results data.log ~[%uint])
|
|
|
|
[who %escape ~]~
|
|
|
|
::
|
|
|
|
?: =(event.log escape-accepted)
|
|
|
|
=+ ^- [who=@ wer=@]
|
|
|
|
(decode-results data.log ~[%uint %uint])
|
|
|
|
[who %sponsor wer]~
|
|
|
|
::
|
|
|
|
?: =(event.log changed-keys)
|
|
|
|
=+ ^- [who=@ enc=octs aut=octs rev=@ud]
|
|
|
|
%+ decode-results data.log
|
|
|
|
~[%uint [%bytes-n 32] [%bytes-n 32] %uint]
|
|
|
|
?> &(=(p.enc 32) =(p.aut 32)) :: sanity
|
|
|
|
[who %keys q.enc q.aut rev]~
|
2018-04-18 02:25:37 +03:00
|
|
|
::
|
|
|
|
?: =(event.log changed-spawn-proxy)
|
2018-04-18 02:26:22 +03:00
|
|
|
=+ ^- [who=@ sox=address]
|
2018-04-18 02:25:37 +03:00
|
|
|
(decode-results data.log ~[%uint %address])
|
|
|
|
[who %spawn-proxy sox]~
|
|
|
|
::
|
|
|
|
?: =(event.log changed-transfer-proxy)
|
2018-04-18 02:26:22 +03:00
|
|
|
=+ ^- [who=@ tox=address]
|
2018-04-18 02:25:37 +03:00
|
|
|
(decode-results data.log ~[%uint %address])
|
|
|
|
[who %transfer-proxy tox]~
|
|
|
|
::
|
2018-04-18 01:32:02 +03:00
|
|
|
::NOTE 0x8be0...57e0 is Owneable's OwnershipTransferred(address,address).
|
|
|
|
:: changed-dns is handled separately since it doesn't affect hulls.
|
|
|
|
~& [%unimplemented-event event.log]
|
|
|
|
~
|
|
|
|
::
|
2018-04-18 01:34:26 +03:00
|
|
|
++ apply-hull-diff
|
|
|
|
|= [hul=hull dif=diff-hull]
|
|
|
|
^- hull
|
|
|
|
?- -.dif
|
|
|
|
%full new.dif
|
|
|
|
%owner hul(owner new.dif)
|
|
|
|
%spawned =+ (~(put in spawned.hul) who.dif)
|
|
|
|
hul(spawn-count +(spawn-count.hul), spawned -)
|
2018-04-19 00:18:17 +03:00
|
|
|
%keys %_ hul
|
|
|
|
encryption-key enc.dif
|
|
|
|
authentication-key aut.dif
|
|
|
|
key-revision rev.dif
|
|
|
|
==
|
2018-04-18 01:34:26 +03:00
|
|
|
%sponsor hul(sponsor new.dif, escape ~)
|
|
|
|
%escape hul(escape new.dif)
|
2018-04-18 02:25:37 +03:00
|
|
|
%spawn-proxy hul(spawn-proxy new.dif)
|
|
|
|
%transfer-proxy hul(transfer-proxy new.dif)
|
2018-04-18 01:34:26 +03:00
|
|
|
==
|
|
|
|
::
|
2018-04-13 22:50:22 +03:00
|
|
|
++ parse-id
|
|
|
|
|= id=@t
|
2018-04-18 00:11:59 +03:00
|
|
|
^- ships:function
|
2018-04-13 22:50:22 +03:00
|
|
|
|^
|
2018-04-19 00:50:32 +03:00
|
|
|
~| id
|
2018-04-13 22:50:22 +03:00
|
|
|
%+ rash id
|
|
|
|
;~ pose
|
|
|
|
(function %ships 'ships' shipname)
|
|
|
|
(function %get-spawned 'getSpawned' shipname)
|
2018-04-19 00:50:32 +03:00
|
|
|
(function %dns-domains 'dnsDomains' dem:ag)
|
2018-04-13 22:50:22 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ function
|
|
|
|
|* [tag=@tas fun=@t rul=rule]
|
|
|
|
;~(plug (cold tag (jest fun)) (ifix [pel per] rul))
|
|
|
|
::
|
|
|
|
++ shipname
|
|
|
|
;~(pfix sig fed:ag)
|
|
|
|
--
|
2018-04-18 15:03:34 +03:00
|
|
|
::
|
|
|
|
++ function-to-call
|
|
|
|
|%
|
|
|
|
++ ships
|
|
|
|
|= cal=ships:function
|
|
|
|
^- [id=@t dat=call-data]
|
|
|
|
?- -.cal
|
|
|
|
%ships
|
|
|
|
:- (crip "ships({(scow %p who.cal)})")
|
|
|
|
['ships(uint32)' ~[uint+`@`who.cal]]
|
|
|
|
::
|
|
|
|
%get-spawned
|
|
|
|
:- (crip "getSpawned({(scow %p who.cal)})")
|
|
|
|
['getSpawned(uint32)' ~[uint+`@`who.cal]]
|
|
|
|
::
|
|
|
|
%dns-domains
|
|
|
|
:- (crip "dnsDomains({(scow %ud ind.cal)})")
|
2018-05-01 02:47:14 +03:00
|
|
|
['dnsDomains(uint256)' ~[uint+ind.cal]]
|
2018-04-18 15:03:34 +03:00
|
|
|
==
|
|
|
|
--
|
2018-04-13 22:50:22 +03:00
|
|
|
--
|