Skip to content

Commit

Permalink
Added new vault endpoint call into Batcher for adding rewards to the …
Browse files Browse the repository at this point in the history
…vault
  • Loading branch information
glottologist committed Oct 24, 2023
1 parent 08834cc commit 55ace34
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
7 changes: 2 additions & 5 deletions batcher/batcher.mligo
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,18 @@ let is_within_limit

end




module Treasury = struct

type storage = Storage.t


[@inline]
let resolve_fees_to_mms
(to_mms: (address,tez) map)
(token_ops: operation list): operation list =
let pay_mms (ops, (addr, amt) : operation list * (address * tez)) : operation list =
if amt > 0mutez then
Treasury_Utils.transfer_fee addr amt :: ops
let op = send_add_reward amt addr in
op :: ops
else
ops
in
Expand Down
11 changes: 5 additions & 6 deletions batcher/michelson/batcher-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -3244,12 +3244,11 @@
DUP 3 ;
COMPARE ;
GT ;
IF { DIG 2 ;
SWAP ;
CONTRACT unit ;
IF_NONE
{ SWAP ; DROP ; PUSH nat 102 ; FAILWITH }
{ DIG 2 ; UNIT ; TRANSFER_TOKENS } ;
IF { CONTRACT %addreward mutez ;
IF_NONE { PUSH nat 157 ; FAILWITH } {} ;
DUP 2 ;
DIG 2 ;
TRANSFER_TOKENS ;
CONS }
{ DROP 2 } } ;
PUSH mutez 0 ;
Expand Down
10 changes: 10 additions & 0 deletions batcher/utils.mligo
Original file line number Diff line number Diff line change
Expand Up @@ -1045,3 +1045,13 @@ let send_liquidity_injection_request
in
Tezos.transaction liq_request 0mutez liq_req_ent

[@inline]
let send_add_reward
(amount: tez)
(vault:address) : operation =
let rew_req_ent = match Tezos.get_entrypoint_opt "%addreward" vault with
| Some ep -> ep
| None -> failwith entrypoint_does_not_exist
in
Tezos.transaction amount amount rew_req_ent

0 comments on commit 55ace34

Please sign in to comment.