diff --git a/gitlab-pages/docs/reference/current.md b/gitlab-pages/docs/reference/current.md index 0b5cd7265..45e3c6f35 100644 --- a/gitlab-pages/docs/reference/current.md +++ b/gitlab-pages/docs/reference/current.md @@ -321,6 +321,37 @@ let main = (p : unit) : address => Tezos.self_address; +## Self + +Typecast the currently running contract with an entrypoint annotation. +If your are using entrypoints: use "%Bar" for constructor Bar +If you are not using entrypoints: use "%Default" + + + +```pascaligo +function main (const p : unit) : contract(unit) is block { + const c : contract(unit) = Tezos.self("%Default") ; +} with c +``` + + + + +```cameligo +let main (p : unit) : unit contract = + (Tezos.self("%Default") : unit contract) +``` + + + + +```reasonligo +let main = (p: unit) : contract(unit) => + (Tezos.self("%Default") : contract(unit)); +``` + + ## Implicit Account