Commit 5e16de60 authored by Eugene Mishura's avatar Eugene Mishura

factored out set_transfer_hook from FA2 interface

parent f8e48c7f
Pipeline #116672378 passed with stage
in 2 minutes and 25 seconds
......@@ -15,7 +15,7 @@
type entry_points =
| Allowances of fa2_allowances_config_entry_points
| Tokens_transferred_hook of hook_param
| Register_with_fa2 of fa2_entry_points contract
| Register_with_fa2 of fa2_with_hook_entry_points contract
(**
This will not work with babylon/LIGO since `allowance_key` is a composite
......
......@@ -10,7 +10,7 @@ Any address can be a recipient of the token transfer
type entry_points =
| Tokens_transferred_hook of hook_param
| Register_with_fa2 of fa2_entry_points contract
| Register_with_fa2 of fa2_with_hook_entry_points contract
let main (param, s : entry_points * unit) : (operation list) * unit =
match param with
......
......@@ -15,7 +15,7 @@
type entry_points =
| Operators of fa2_operators_config_entry_points
| Tokens_transferred_hook of hook_param
| Register_with_fa2 of fa2_entry_points contract
| Register_with_fa2 of fa2_with_hook_entry_points contract
(* owner -> operator set*)
......
......@@ -14,7 +14,7 @@ MUST fail.
type entry_points =
| Whitelist of fa2_whitelist_config_entry_points
| Tokens_transferred_hook of hook_param
| Register_with_fa2 of fa2_entry_points contract
| Register_with_fa2 of fa2_with_hook_entry_points contract
type whitelist = address set
......
#include "../fa2_interface.mligo"
#include "../fa2_hook.mligo"
let get_hook (hook_contract : address) : address =
let hook_entry : hook_param contract =
......@@ -7,7 +7,7 @@ let get_hook (hook_contract : address) : address =
let create_register_hook_op
(fa2 : fa2_entry_points contract) (config : permission_policy_config list) : operation =
(fa2 : fa2_with_hook_entry_points contract) (config : permission_policy_config list) : operation =
let hook : address = get_hook Current.self_address in
let pp : set_hook_param = {
hook = hook;
......
#include "fa2_interface.mligo"
type hook_transfer = {
from_ : address option;
to_ : address option;
token_id : token_id;
amount : nat;
}
type hook_param = {
batch : hook_transfer list;
operator : address;
}
type set_hook_param = {
hook : address;
config : permission_policy_config list;
}
type fa2_with_hook_entry_points =
| Fa2 of fa2_entry_points
| Set_transfer_hook of set_hook_param
\ No newline at end of file
......@@ -64,32 +64,12 @@ type token_descriptor_param = {
token_descriptor_view : (token_descriptor_response list) contract
}
type hook_transfer = {
from_ : address option;
to_ : address option;
token_id : token_id;
amount : nat;
}
type hook_param = {
batch : hook_transfer list;
operator : address;
}
type set_hook_param = {
hook : address;
config : permission_policy_config list;
}
type fa2_entry_points =
| Transfer of transfer_param
| Balance_of of balance_of_param
| Total_supply of total_supply_param
| Token_descriptor of token_descriptor_param
| Get_permissions_policy of permission_policy_config
(* Recommended design pattern. Not part of FA2 standard. *)
| Set_transfer_hook of set_hook_param
(** Different permissioning policy interfaces *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment