Skip to content

Commit 6a26ba2

Browse files
intersectmattgitbook-bot
authored andcommitted
GITBOOK-1023: Smart Contracts Detail - Required for legal contracts to point to
1 parent 7e9199f commit 6a26ba2

File tree

7 files changed

+169
-1
lines changed

7 files changed

+169
-1
lines changed

SUMMARY.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@
5656
* [Multi-Stage Task for Constitutional Committee Applicants](cardano-facilitation-services/cardano-governance/2025-constitutional-committee-elections/multi-stage-task-for-constitutional-committee-applicants.md)
5757
* [Guidelines for Participation in a Constitutional Committee Election](cardano-facilitation-services/cardano-governance/2025-constitutional-committee-elections/guidelines-for-participation-in-a-constitutional-committee-election.md)
5858
* [2025 CC Election - Results](cardano-facilitation-services/cardano-governance/2025-constitutional-committee-elections/2025-cc-election-results.md)
59-
* [Cardano Budget](cardano-facilitation-services/cardano-budget/README.md)
59+
* [Administrating Treasury funding](cardano-facilitation-services/cardano-budget/README.md)
6060
* [Intersect Administration Services](cardano-facilitation-services/cardano-budget/intersect-administration-services/README.md)
6161
* [Intersect as an Administrator](cardano-facilitation-services/cardano-budget/intersect-administration-services/intersect-as-an-administrator.md)
62+
* [Smart contracts as part of our Administration](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/README.md)
63+
* [Smart contract types](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/smart-contract-types.md)
64+
* [Treasury contract partitions](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/treasury-contract-partitions.md)
65+
* [Oversight](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/oversight.md)
66+
* [End-to-end process](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/end-to-end-process.md)
67+
* [Considerations and feature backlog](cardano-facilitation-services/cardano-budget/intersect-administration-services/smart-contracts-as-part-of-our-administration/considerations-and-feature-backlog.md)
6268
* [2025 Request For Proposal (RFP)](cardano-facilitation-services/cardano-budget/intersect-administration-services/2025-apply-for-tender/README.md)
6369
* [Open RFPs](cardano-facilitation-services/cardano-budget/intersect-administration-services/2025-apply-for-tender/open-tenders/README.md)
6470
* [Technical Steering Commitee](cardano-facilitation-services/cardano-budget/intersect-administration-services/2025-apply-for-tender/open-tenders/technical-steering-commitee.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Smart contracts as part of our Administration
2+
3+
## Smart Contracts 
4+
5+
Following our introduction to [Smart Contracts and Cardano budgets](https://www.intersectmbo.org/news/%EF%B8%8F-smart-contracts-and-cardano-budgets), this knowledge base article aims to outline how they will be utilized from the perspectives of the ecosystem, proposal vendors, as part of Intersect’s administration.
6+
7+
Ultimately, treasury funds withdrawn as part of an Intersect treasury withdrawal governance action will, wherever possible and applicable, use multi-signature controlled smart contracts to safeguard treasury funds and make the use of treasury funds transparent on-chain. 
8+
9+
Smart contracts will hold treasury funds and vendor payments transparently on-chain, effectively in escrow. These smart contracts can be partitioned into themes and specific project contracts, enhancing community visibility and transparency. 
10+
11+
These smart contracts have been built with a specific, limited set of permissions, each of which is authorized through keys and, should they be executed, would be transparent and auditable on-chain. Each partitioned theme or grouping of treasury funds can have its own unique set of permissions. We refer to this group of permissions as an oversight committee.
12+
13+
The following sections of the knowledge base outline the composite parts of the smart contract framework and how they may initially be used. 
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Considerations and feature backlog
2+
3+
## Considerations
4+
5+
Given the novel decentralized approach to oversight and the constitutional requirement for traditional written contracts, several considerations must be understood. 
6+
7+
* Most importantly, it should be understood that these smart contracts effectively hold money in a transparent on-chain ‘escrow.’ When held in these smart contracts, the treasury funds are never initially in an Intersect account or wallet. These smart contracts lock the ability to stake and delegate. 
8+
* Vendors must be aware of how oversight works before signing any contract and how it may affect disbursement or modification. They are consulted before the oversight committee agrees on their particular partition/treasury contract and/or vendor contract. 
9+
* Vendors have representation in smart contracts. Not all smart contract actions can be unilaterally undertaken against a vendor. There needs to be a mutual agreement with vendors before smart contracts can be agreed upon, funded, and modified. Some specific actions require a vendor signature via a key before they can be enacted.
10+
* Each escrow environment or treasury contract may have a unique oversight committee makeup and unique permissions. This allows for a level of future-proofing. These smart contracts enable more unique use cases as needed, which can be legally permitted over time.  
11+
12+
## Feature Backlog
13+
14+
These smart contracts, designed to manage treasury funding are new. The team already have plenty of ideas for additional features and use cases.
15+
16+
You can contribute to this feature backlog at the following Intersect repository:
17+
18+
[https://github.com/IntersectMBO/budget-management](https://github.com/IntersectMBO/budget-management)
19+
20+
## Credit
21+
22+
Sundae Labs has developed the smart contracts outlined with support from Input Output Engineering and Intersect. Additional auditing has been commissioned and completed by TxPipe and MLabs. 
23+
24+
[https://github.com/SundaeSwap-finance/treasury-contracts](https://github.com/SundaeSwap-finance/treasury-contracts) 
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# End-to-end process
2+
3+
## Proposed Intersect end-to-end process
4+
5+
Within the context of the budget process to date, the following flowchart illustrates an indicative, high-level end-to-end process for smart contracting, administration, and the oversight committee.
6+
7+
<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcnyO-fsOayAJ9AoI5ubAQGXXQNSwUq-anLgtBJqIiOXPVdrvUAQ6rDI3q-sL_bve5PctpaLkgMwjyBZ9LpjX_PBScfcCsDPxcYLhFq4MYa7wk7p_VBFZJ05pW_sMYTfwQU49uv?key=5CTbYNvoouuip-dWreQBqg" alt=""><figcaption><p>Figure 5. Process overview</p></figcaption></figure>
8+
9+
### Bulleted explanation
10+
11+
1. Treasury Withdrawal governance action outlines several proposals to receive funding. Treasury Contracts and oversight committee(s) are created with permissions to control them.
12+
2. Funds are distributed into these holding Treasury Contracts based on the success of the Treasury Withdrawal governance action.
13+
3. Written legal contracts are pursued and agreed upon with prospective vendors off-chain (constitutionally, these are required)&#x20;
14+
4. On-chain Vendor Contracts are created once the governance action passes, and a written legal contract is signed.&#x20;
15+
5. Vendor commences delivery as per the schedule in the contract
16+
6. As per the schedule, the vendor provides attestation of milestone completion to Intersect and on-chain.&#x20;
17+
7. Intersect undertakes its role as the administrator of the oversight committee, and as permissioned, provides necessary checks and balances on the administrator.&#x20;
18+
8. Once a milestone matures and reaches its due date, the vendor can withdraw the funds associated with that milestone. They may specify where the funds go.
19+
20+
### Narrative explanation
21+
22+
Following or during the on-chain Treasury Withdrawal governance action (1), a number of Treasury Contracts will be defined (2). These will outline the budgets or funding themes requested within the original on-chain action. This allows the partitioning of smart contract funds, assisting transparency on-chain.
23+
24+
Partitioning the Treasury Withdrawal has several benefits; it enhances community observability by breaking funds down into more manageable and meaningful groupings, allowing for different sets or granularities of oversight committee permissions between partitions, and improving security by not having all of the total budget in one transaction or account.&#x20;
25+
26+
The treasury funds stay here until Vendor Contracts are agreed upon. At this point, the funds are held in the smart contract and cannot be delegated or staked, which satisfies provisions within the constitution.&#x20;
27+
28+
Required by many vendors and to satisfy constitutional requirements, legal contracts (3) will be created between the CDH and the vendors whose proposals have been approved by DReps in the treasury withdrawal governance action.
29+
30+
Following the signing of the written legal contracts, Intersect, as the administrator, will create a back-to-back smart Vendor Contract for individual projects (4).&#x20;
31+
32+
At this stage, the vendor has a legally written contract that contains constitutional requirements, such as dispute resolution, and a tailored Vendor Contract for the specific project. The vendor now delivers according to the agreed-upon project schedule (5).
33+
34+
Defined by the milestones within a Vendor Contract, the vendor submits and attests milestone acceptance to the community and Intersect (6). Tooling will be configured to link these attestations to the on-chain milestone.
35+
36+
As per the permissions outlined in the Treasury Contract, which is associated with the Vendor Contract, the oversight committee will undertake oversight capabilities for Intersect, the previously described Fund, Modify, and Disperse (7). This assures that in these circumstances, Intersect cannot act unilaterally. As needed, once the ‘M-of-N’ permissions associated with these actions are met, they are enacted and recorded transparently on-chain.&#x20;
37+
38+
Once a milestone date has matured or reached its due date, the vendor can withdraw the specified milestone amount (8). The process ‘fails open’ to protect vendors should the oversight committee fail in any way. The vendor withdrawal is captured on-chain, so it becomes auditable.&#x20;
39+
40+
Timeouts are configured so that, at the end of a contract, any unclaimed or locked funds ultimately return to the Cardano Treasury, allowing on-chain governance to decide their use again.&#x20;
41+
42+
The Treasury Contract and permissions, the Vendor Contracts and permissions, milestones, and vendor payment withdrawals are all captured, transparent, visible, and auditable on the chain
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Oversight
2+
3+
## Oversight Committees
4+
5+
Each Treasury Reserve Contract can, as needed, be permissioned independently. Each action outlined above is subject to a required multi-signature to enact. These actions can also be permissioned individually or in groupings. As stated, the Vendor Contracts associated with a Treasury Contract inherit these permissions. Permissions can only be set when creating the Treasury Contract.\
6+
7+
8+
<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdcKPNJf21VmzYsDYGC8FqMhi5jzFKhmxXsrBLuFyAb9QDYnxva-6VnOQVafCYZ8erR1rEzpKfTkgkB-sMnmvexIhmyNAeQbC0_wFhCftDofCNXBPjLXwwkuQFKLK1tuj9h_tJlPQ?key=5CTbYNvoouuip-dWreQBqg" alt=""><figcaption><p>Figure 4. Smart contracts and multi-signatures</p></figcaption></figure>
9+
10+
As the administrator, Intersect may legally require sole accountability for specific actions, such as Pause and Resume; however, Intersect, as practically possible and feasible, will continue to investigate the decentralization of additional controls for future implementations. Additional keys may be added for redundancy.&#x20;
11+
12+
As mentioned previously, the oversight is a check and balance on Intersect's administrative duties rather than a hands-on vendor of proposal management. All of the smart contract permissions require Intersect to initiate the action through its various key configurations, and then the oversight provides a check and balance. Actions initiated by oversight members fail the conditions of the permission, which means oversight members cannot unilaterally make changes to Intersect-administered contracts.
13+
14+
Ultimately, when designing oversight committee permissions, a balance must be struck between legal requirements, functionality, simplicity, and scalability.
15+
16+
## Smart Contract Permission Rationale
17+
18+
Initially, the smart contract permissions – Fund, Modify, Disperse, and Reorganize – will require additional signatures from the oversight committees before being used by Intersect. Effective oversight ensures that Intersect acts appropriately as an administrator, with checks and balances, rather than direct oversight of individual proposals.
19+
20+
This ensures that Intersect only creates smart contracts for vendors and proposals that DReps have approved in the corresponding info and governance actions. Multi-signatories will be required to initially fund these smart contracts. Oversight also protects proposal benefits or outcomes from diminishing over time due to poor change control or modifications to vendor contracts. Modify controls also requires oversight.&#x20;
21+
22+
Secondly, should Intersect be required to use the Disperse or Reorganise action, multiple signatories will be needed to approve such an action. The process will ensure that appropriate reason and rationale are provided and that Intersect is not acting unilaterally.&#x20;
23+
24+
The remaining smart contract permissions currently need to reside with Intersect as the administrator to ensure that the liability of Intersect and the Oversight Committee is managed appropriately. Additional rationale and explanation are provided below.
25+
26+
* **Fund** - This permission allows the creation of a Vendor Contract. Oversight ensures that this Vendor Contract aligns with the original scope and value of the DRep-approved governance action. Intersect initiates the action as the administrator, which is then cross-checked and approved by oversight.&#x20;
27+
* **Modify** - This permits a change to a Vendor Contract. Oversight ensures that any modified data is correct, consistent and that explanations have been attached as metadata . Intersect initiates a change request as the administrator, and then it is approved by oversight. The vendor must also sign a consent form to proceed with this action.&#x20;
28+
* **Disburse** - This action allows funds to be removed from a smart contract. If required, this action is initiated by Intersect as the administrator but requires approval from oversight before it is enacted.&#x20;
29+
* **Pause** and **Resume** - Following off-chain processes to verify the completeness of milestones and delivery, Intersect, at its discretion, may pause and resume vendor payments as necessary. Where applicable, rationale can be provided as metadata.
30+
* **SweepTreasury** - This action is also enacted via a configurable timeout at an agreed-upon period after the treasury reserve contract has been completed. However, as the administrator, Intersect can undertake this action sooner should the need arise. It is permissioned at a higher level due to the potential effect it may have, effectively ensuring it is operated by two-person control to prevent erroneous actions.
31+
* **Reorganize** - This administrative action is undertaken by Intersect and requires oversight to checks before enactment, administering back-end management of the UTXOs which underpin the smart contracts. This permission does not affect funds.&#x20;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Smart contract types
2+
3+
## Smart Contract Types
4+
5+
There are two types of smart contracts initially designed for managing treasury funds: a Treasury Reserve Contract (formally referred to in specifications as a Treasury Reserve Smart Contract (TRSC)) and a Vendor Contract (officially referred to in specifications as a Project-Specific Smart Contract (PSSC)). For clarity and ease, we will refer to these as Treasury Contracts and Vendor Contracts from here on.
6+
7+
### Treasury Contract
8+
9+
One or more smart contract instances on-chain will hold funds from the Cardano Treasury in a reserve account. These funds will be allocated to projects that have been approved and budgeted by the community. Funds will be held in ada. Funds can only be transferred to another Treasury Contract instance, a Vendor Contract instance, swept back to the Cardano Treasury, or moved temporarily to an exchange for conversion purposes. Each Treasury Contract will be permissioned as to who can undertake the defined actions within the smart contract. The following permissions are available within a Treasury Contract:
10+
11+
<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdRe9DMbA46BKRfTP93QNJAnf5LontLCgptjvOXGiut-U0IvhgYOD52XldvB5salPB-zAjtmY8-70p_1TAjE9DbLjoOVri5UL1gXoYYYXufVSkRDB5XTz6_NtO6XdAWMzMbnWR0oQ?key=5CTbYNvoouuip-dWreQBqg" alt=""><figcaption><p>Figure 1: Treasury fund permissions</p></figcaption></figure>
12+
13+
Actions defined:
14+
15+
* **Fund** - Treasury Reserve contract can be used to fund a new Vendor Contract
16+
* **Disburse** - Funds can be disbursed to arbitrary destinations (should require a high many-of-a-number (MofN) signatory, metadata rationale should be provided if used)&#x20;
17+
* **Reorganize** - UTXOs at the treasury address can be reorganized, such as splitting or merging them
18+
* **SweepTreasury** - Funds can be swept back to the treasury before a mandatory expiration.
19+
20+
Prohibited actions:
21+
22+
* Participation in staking
23+
* Participation in governance
24+
25+
### Vendor Contract&#x20;
26+
27+
A Vendor Contract is one or more smart contract instances on-chain with a descriptive project name, a project code, a specified vendor, a payment schedule, and a budget. A transfer from a Treasury Contract funds the budget for a Vendor Contract. The Vendor Contract is intrinsically linked to a Treasury Contract. The permissions of a Vendor Contract are inherited from the Treasury Contract to which it is associated. The following permissions are available within a Vendor Contract.\
28+
29+
30+
<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc5k7akfyLz0SEWGIzdUUgmt8zvqtEldqUz3dGSo4M3YY_VUiL9fSW0Kc8k77hEXZUr8_Eo7DaTztsVFQc3YdG3yor7woUxKdQBFM4xbcqzwJehqz4Yacpq9OvKlf-7g21MYZm6Lg?key=5CTbYNvoouuip-dWreQBqg" alt=""><figcaption><p>Figure 2. Vendor contract permissions</p></figcaption></figure>
31+
32+
Actions defined:
33+
34+
* **Pause** - The oversight committee can pause a payment milestone (milestones can be paused independently of each other)&#x20;
35+
* **Resume** - The oversight committee can un-pause a specific milestone&#x20;
36+
* **Modify** - The vendor and the oversight committee can agree to modify or cancel a project, such as extending the deadline for a milestone.
37+
38+
Two additional actions can be either inherited from the Treasury Contract or configured during the creation of the Vendor Contract.&#x20;
39+
40+
* **SweepVendor** - After an expiration, all paused, unmatured funds can be swept back to the Treasury Contract (and thus back to the Cardano treasury)
41+
* **Malformed** - If a UTXO is malformed, such as when someone sends funds to the vendor contract directly without a Plutus datum, we don't want those to be locked. Therefore, we allow them to be swept back to the treasury contract.

0 commit comments

Comments
 (0)