Starknet Tokenbound
  • Starknet Tokenbound
    • Introduction to Tokenbound
    • 📘Glossary
    • 💡Frequently Asked Questions
  • SDK
    • Installation
    • ⚡API Reference
  • Toolings
    • 🔗Tokenbound Connectkit
    • 🖼️Tokenbound iFrame
  • Contracts
    • AccountV3
    • Registry
    • Components
      • 📔Account
      • 🔒Lockable
      • Permissionable
      • ✍️Signatory
      • Upgradeable
    • 📔Deployed Addresses
Powered by GitBook
On this page
  • Functions
  • _base_signer_validation
  • _permissioned_signer_validation
  • _is_valid_signature
  1. Contracts
  2. Components

Signatory

PreviousPermissionableNextUpgradeable

Last updated 6 months ago

The Signatory Component primarily controls signer/signature validation. It gives developers the flexibility to define who they want to be a valid signer.

The full contract code of the SignatoryComponent can be found .

Functions

_base_signer_validation

fn _base_signer_validation(
  self: @ComponentState<TContractState>, 
  signer: ContractAddress
) -> bool;

This function implements a simple signer validation where only the NFT owner is a valid signer.

Parameters

Name
Type
Description

signer

ContractAddress

This is the address that is attempting to sign or perform actions on the TBA.

Returns

bool: Returnstrue if the signer is same as the owner and false otherwise.

_permissioned_signer_validation

This function implements a more complex signer validation where NFT owner, root owner, and permissioned addresses are valid signers.

fn _permissioned_signer_validation(
    self: @ComponentState<TContractState>, signer: ContractAddress
) -> bool;

Parameters

Name
Type
Description

signer

ContractAddress

This is the address that is attempting to sign or perform actions on the TBA.

Returns

bool: Returns true if the signer is either the owner, the root owner, or a permissioned address, returns false otherwise.

_is_valid_signature

This function checks whether a given digital signature is valid.

fn _is_valid_signature(
   self: @ComponentState<TContractState>, hash: felt252, signature: Span<felt252>
) -> felt252;

Returns

felt252: It returns VALIDATED If the signature is valid.

✍️
here