Use Pink Extension
Introduction
All the unique capabilities of Phat Contract are implemented in pink-extension. Informally speaking:
$ Phat\ Contract = ink! + Pink\ Extension $
It is worth noting that the Phat Contract is not a trivial extension of ink! contract since all these extra functions only work under the off-chain computation.
Pink Extension Functions
Functionality | Function Name | Query Support | Transaction Support |
---|---|---|---|
Internet Access | http_request | β | β |
Crypto | getrandom | β | β |
ecdsa_sign_prehashed | β | β | |
ecdsa_verify_prehashed | β | β | |
sign (ecdsa/ed25519) | β | β | |
sign (sr25519) | β | β | |
verify | β | β | |
derive_sr25519_key | β | β | |
get_public_key | β | β | |
Volatile Cache | cache_set | β | β |
cache_set_expire | β | β | |
cache_get | β | β | |
cache_remove | β | β | |
Misc | log | β | β |
is_running_in_command | β | β |
Refer to our Phat Hello World contract to see how you can import these functions to your contract.