Use Pink Extension

Introduction

All the unique capabilities of Phat Contract are implemented in pink-extension. Informally speaking:

PhatĀ Contract=ink!+PinkĀ ExtensionPhat\ 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

FunctionalityFunction NameQuery SupportTransaction 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.

Last updated

Logo

COPYRIGHT Ā© 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!