Tax Processing Contract Functions¶
- Contract / Module:
taxes
This module manages tax-related operations, including updating costs, processing payments, and managing accounts within the Kadena blockchain environment.
Main Functions¶
update-costs¶
Updates the cost associated with a specific year.
Parameters: -
year: The tax year as a string. -cost: The cost associated with the year, as a decimal.Returns:
stringindicating the update status.
pact> (update-costs "2023" 100.00)
"Write succeeded"
get-costs¶
Retrieves all cost entries.
Returns: A list of objects of type
cost-schema, each representing a year and its associated cost.
pact> (get-costs)
[
{"cost": 10.0,"year": "2019"}
{"cost": 10.0,"year": "2020"}
{"cost": 10.0,"year": "2021"}
{"cost": 10.0,"year": "2022"}
{"cost": 10.0,"year": "2023"}
{"cost": 10.0,"year": "2024"}
]
process-payment¶
Processes a tax payment for a specific year and account, transferring the required funds.
Parameters: -
year: The tax year as a string. -account: The account name as a string. -guard: The guard associated with the account.Returns:
boolindicating success or failure of the payment processing.
pact> (process-payment "2023" "alice" (read-keyset "alice-guard"))
true
process-secondary-payment¶
Processes a payment for a secondary account for tax purposes.
Parameters: -
year: The tax year as a string. -account: The primary account name as a string. -guard: The guard associated with the primary account. -secondaryAccount: The secondary account name as a string.Returns:
boolindicating success or failure of the secondary payment processing.
pact> (process-secondary-payment "2023" "alice" (read-keyset "alice-guard") "alice-secondary")
true
get-payment-amount¶
Retrieves the payment amount for a specific year.
Parameters: -
year: The tax year as a string.Returns:
decimalrepresenting the cost for the specified year.
pact> (get-payment-amount "2023")
10.0
transfer-funds¶
Transfers funds from a designated BANK account to a specified account.
Parameters: -
account: The account name to transfer funds to, as a string. -guard: The guard associated with the account. -amount: The amount to transfer, as a decimal.Returns:
stringindicating the transfer status.
pact> (transfer-funds "alice" (read-keyset "alice-guard") 50.00)
"Write succeeded"