You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The XCallManager contract manages cross-chain protocols, whitelists actions, and handles cross-chain calls.
(define-traitxcall-manager-trait
(
;; Only callable once, sets up the initial state of the contract
(initialize
(principalprincipal (string-ascii64) principal
(list100 (string-ascii64)) (list100 (string-ascii64)))
(responsebooluint)
)
;; Set a new admin address;; Can only be called by the current admin;; The new admin must accept the role separately
(set-admin (principal) (responsebooluint))
;; Accept the admin role;; Must be called by the address set as the new admin
(accept-admin-role () (responsebooluint))
;; Update the list of approved source and destination protocols;; Can only be called by the admin or through a whitelisted cross-chain message
(set-protocols
((list100 (string-ascii64)) (list100 (string-ascii64)))
(responsebooluint)
)
;; Propose the removal of a specific protocol;; Can only be called by the admin;; Allows for a grace period before removal takes effect
(propose-removal ((string-ascii64)) (responsebooluint))
;; Add an action to the whitelist;; Can only be called by the admin;; Whitelisted actions are allowed to be executed when received as cross-chain messages
(whitelist-action ((buff1024)) (responsebooluint))
;; Remove an action from the whitelist;; Can only be called by the admin;; Prevents a previously approved action from being executed
(remove-action ((buff1024)) (responsebooluint))
;; Process an incoming cross-chain message;; Can only be called by the xCall service;; Verifies the message source, protocols, and executes whitelisted actions
(handle-call-message
((string-ascii64) (buff1024) (list100 (string-ascii64)))
(responsebooluint)
)
;; Retrieve the current list of approved protocols;; Read-only function, can be called by anyone
(get-protocols ()
(response
(tuple
(sources (list100 (string-ascii64)))
(destinations (list100 (string-ascii64)))
)
uint
)
)
;; Check if a given list of protocols matches the approved list;; Read-only function, used to validate protocol usage
(verify-protocols ((list100 (string-ascii64))) (response bool uint))
;; Check if a specific action is currently whitelisted;; Read-only function, can be used to verify action status before sending cross-chain
(is-action-whitelisted ((buff 1024)) (response bool uint))
;; Get the current admin address;; Read-only function, provides transparency on who controls admin functions
(get-admin () (response principal uint))
;; Get the address of the xCall service contract;; Read-only function, allows verification of the authorized caller for handle-call-message
(get-x-call () (response principal uint))
)
)
The text was updated successfully, but these errors were encountered:
Overview
The XCallManager contract manages cross-chain protocols, whitelists actions, and handles cross-chain calls.
The text was updated successfully, but these errors were encountered: