ZCN S.C.
ZCN Smart Contract Functions
NewZCNSmartContract
Creates a new instance of the ZCN Smart Contract.
InitSC
Initializes smart contract functions within the ZCN Smart Contract, associating each function with a key.
Key Functions
Configuration
update-global-config
: Updates the global configuration of the smart contract.update-authorizer-config
: Configures specific authorizers for the smart contract.
Bridge-Related
mint
: Mints new ZCN tokens.burn
: Burns ZCN tokens, typically used for cross-chain interactions.
Authorizer Management
add-authorizer
: Adds a new authorizer.delete-authorizer
: Removes an existing authorizer.authorizer-health-check
: Conducts a health check on an authorizer.
Delegate Pools
add-to-delegate-pool
: Adds tokens to the delegate pool for staking.delete-from-delegate-pool
: Removes tokens from the delegate pool.update-authorizer-stake-pool
: Updates the stake pool for an authorizer.
Execution Statistics
ZCN Smart Contract records metrics for each major function to track performance:
Function Name | Description |
---|---|
| Tracks time taken to add a new authorizer. |
| Monitors time taken to delete an authorizer. |
| Tracks time taken to update the global configuration. |
| Tracks time taken to update an authorizer's configuration. |
| Measures the time taken for minting tokens. |
| Measures the time taken for burning tokens. |
| Tracks the time taken to add to the delegate pool. |
| Tracks the time taken to remove from the delegate pool. |
Core Functions
Execute
Executes a specified function within the ZCN Smart Contract based on the provided method name and input data.
Function Signature:
Parameters:
Field | Description |
---|---|
| Transaction to be executed. |
| Name of the method to execute within the smart contract. |
| Input data for the method in byte format. |
| Blockchain state context interface. |
Returns:
string
- Result of the function execution.error
- Error if the execution fails.
Cost Table Retrieval
GetCostTable
Retrieves the cost table for the smart contract, containing configuration costs associated with each operation.
Function Signature:
Parameters:
Field | Description |
---|---|
| Blockchain state context interface used to retrieve global costs. |
Returns:
map[string]int
- A map containing the cost configuration for each function.error
- Error if retrieval fails.
Last updated