Skip to content

Commit

Permalink
Modify add metadata part in chapter fa2, fix exercise, update tzip-12
Browse files Browse the repository at this point in the history
  • Loading branch information
OCTO-FRAH committed Jul 10, 2020
1 parent 0687603 commit 8e00f39
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ let updateOperators = ((updateOperatorsParameter, storage): (updateOperatorsPara
(([]: list(operation)), storage)
}

let tokenMetadataRegistry = ((tokenMetadataRegistryParameter, storage): (tokenMetadataRegistryParameter, storage)): entrypointReturn => {
let callbackTarget = tokenMetadataRegistryParameter;
let callbackOperation: operation = Tezos.transaction(Tezos.self_address, 0tez, callbackTarget);
([callbackOperation], storage);
}

let main = ((parameter, storage): entrypointParameter): entrypointReturn => {
switch (parameter) {
| Fa2 fa2 => {
Expand All @@ -236,12 +242,13 @@ let main = ((parameter, storage): entrypointParameter): entrypointReturn => {
| Balance_of(balanceOfParameterMichelson) => balanceOf((balanceOfParameterMichelson, storage))
| Permissions_descriptor(permissionsDescriptorParameter) => permissionsDescriptor((permissionsDescriptorParameter, storage))
| Update_operators(updateOperatorsParameter) => updateOperators((updateOperatorsParameter, storage))
| Token_metadata_registry(tokenMetadataRegistryParameter) => tokenMetadataRegistry((tokenMetadataRegistryParameter, storage))
}
}
| Asset ast => {
switch (ast) {
| Mint(mintParameter) => (([]: list(operation)), storage) //mint(mintParameter)
| Burn(burnParameter) => (([]: list(operation)), storage) //burn(burnParameter)
| Mint(mintParameter) => (([]: list(operation)), storage)
| Burn(burnParameter) => (([]: list(operation)), storage)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ let updateOperators = ((updateOperatorsParameter, storage): (updateOperatorsPara
(([]: list(operation)), storage)
}

let tokenMetadataRegistry = ((tokenMetadataRegistryParameter, storage): (tokenMetadataRegistryParameter, storage)): entrypointReturn => {
let callbackTarget = tokenMetadataRegistryParameter;
let callbackOperation: operation = Tezos.transaction(Tezos.self_address, 0tez, callbackTarget);
([callbackOperation], storage);
}

let main = ((parameter, storage): entrypointParameter): entrypointReturn => {
switch (parameter) {
| Fa2 fa2 => {
Expand All @@ -243,12 +249,13 @@ let main = ((parameter, storage): entrypointParameter): entrypointReturn => {
| Balance_of(balanceOfParameterMichelson) => balanceOf((balanceOfParameterMichelson, storage))
| Permissions_descriptor(permissionsDescriptorParameter) => permissionsDescriptor((permissionsDescriptorParameter, storage))
| Update_operators(updateOperatorsParameter) => updateOperators((updateOperatorsParameter, storage))
| Token_metadata_registry(tokenMetadataRegistryParameter) => tokenMetadataRegistry((tokenMetadataRegistryParameter, storage))
}
}
| Asset ast => {
switch (ast) {
| Mint(mintParameter) => (([]: list(operation)), storage) //mint(mintParameter)
| Burn(burnParameter) => (([]: list(operation)), storage) //burn(burnParameter)
| Mint(mintParameter) => (([]: list(operation)), storage)
| Burn(burnParameter) => (([]: list(operation)), storage)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ type permissionsDescriptorMichelson = michelson_pair_right_comb(permissionsDescr

type permissionsDescriptorParameter = contract(permissionsDescriptorMichelson);


/////////////////////////////// METADATA ///////////////////
type tokenMetadataRegistryTarget = address;
type tokenMetadataRegistryParameter = contract(tokenMetadataRegistryTarget);


/////////////////////////////// ENTRYPOINTS ///////////////////
type parameter =
| Transfer(transferParameter)
| Balance_of(balanceOfParameterMichelson)
| Permissions_descriptor(permissionsDescriptorParameter)
| Update_operators(updateOperatorsParameter)
| Update_operators(updateOperatorsParameter)
| Token_metadata_registry(tokenMetadataRegistryParameter)

0 comments on commit 8e00f39

Please sign in to comment.