Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2c96cf1
fix: update action contracts and types
whoabuddy Apr 7, 2025
4d1034d
fix: update trait refs to -v3, deploy link in commit details
whoabuddy Apr 7, 2025
3b15ba6
feat: Update DAO templates with upstream contract changes
whoabuddy Apr 7, 2025
99e6ab6
fix: add new extensions, remove old singletons
whoabuddy Apr 7, 2025
9b76dc6
fix: add latest core proposal templates matching contracts
whoabuddy Apr 7, 2025
bc379c4
chore: abc's in order
whoabuddy Apr 7, 2025
e301f4c
refactor: Split registry files into categorized arrays for improved r…
whoabuddy Apr 7, 2025
7ebf58a
fix: update subcategories based on new extensions
whoabuddy Apr 7, 2025
f8795d8
fix: reorder extensions, add new payments and timed vault entries
whoabuddy Apr 7, 2025
ae6570f
fix: update contract registry with latest
whoabuddy Apr 8, 2025
99505df
fix: bootstrap template var names
whoabuddy Apr 8, 2025
119019b
fix: update core proposal registry with latest
whoabuddy Apr 8, 2025
7e048d9
fix: separate registry into its own folder
whoabuddy Apr 9, 2025
9c95dbe
refactor: separate const defs for contract registry
whoabuddy Apr 9, 2025
fe7464c
refactor: organize by folder for each registry file
whoabuddy Apr 9, 2025
b57f482
refactor: separate core proposals by target contract
whoabuddy Apr 9, 2025
80415f7
fix: pull template var to top
whoabuddy Apr 9, 2025
02e83ce
fix: missed a save
whoabuddy Apr 9, 2025
771d949
fix: remove legacy proposal contracts
whoabuddy Apr 9, 2025
35d2356
fix: update template placeholders in contracts
whoabuddy Apr 9, 2025
9564f26
refactor: Update contract registry keys and template paths for timed …
whoabuddy Apr 9, 2025
b7fb038
refactor: Remove duplicate messaging_contract entry in actions.ts
whoabuddy Apr 9, 2025
24ba4aa
refactor: Update contract registry with token contract references
whoabuddy Apr 9, 2025
3a42bcf
feat: Centralize deployment order with visualization and validation t…
whoabuddy Apr 9, 2025
824c0ad
feat: Add deployment order registry for DAO contract deployment sequence
whoabuddy Apr 9, 2025
ef3fd0f
feat: Add support for generating multiple numbered contract copies
whoabuddy Apr 9, 2025
459e1f2
feat: Add multiple timed vault contract extensions to DAO initialization
whoabuddy Apr 9, 2025
d0ea265
refactor: Remove duplicate ContractCopyConfig and move generateTimedV…
whoabuddy Apr 9, 2025
9c3df35
feat: Add multiple contract copy support for timed vault contracts in…
whoabuddy Apr 9, 2025
1e65831
fix: Update timed vault contract variable name in bootstrap initializ…
whoabuddy Apr 9, 2025
fb53acb
fix: use it prefix in templates, general formatting
whoabuddy Apr 9, 2025
ca39896
fix: remove examples dir
whoabuddy Apr 9, 2025
09eac72
refactor: rename folder to match registry name
whoabuddy Apr 9, 2025
0915088
feat: Update DAO core proposal registry with correct paths and missin…
whoabuddy Apr 9, 2025
7dc6fc1
fix: move deployment order into contract registry
whoabuddy Apr 9, 2025
458158a
fix: undefined dao token
whoabuddy Apr 10, 2025
d208728
fix: use addr ref for sbtc contract
whoabuddy Apr 10, 2025
8fe1451
fix: remaining undefined template refs
whoabuddy Apr 10, 2025
080d99b
refactor: Dynamically generate numbered contract references in bootst…
whoabuddy Apr 10, 2025
be85cdd
fix: cleanup and formatting
whoabuddy Apr 10, 2025
57217ca
fix: resolve bootstrap def conflict
whoabuddy Apr 10, 2025
d7c5d42
fix: reduce to single timed vault for testnet deployment
whoabuddy Apr 10, 2025
7d684fa
refactor: Separate template functions from template variables to reso…
whoabuddy Apr 10, 2025
64d7bb9
feat: Add contract copies config and deployment order validation
whoabuddy Apr 10, 2025
91260b7
fix: revert to single timed vaults for now
whoabuddy Apr 10, 2025
7b44abf
fix: match new return type in upstream
whoabuddy Apr 10, 2025
feb7e6d
fix: add more delay between deploys
whoabuddy Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions src/aibtc-dao/deploy-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import { validateStacksAddress } from "@stacks/transactions";
import {
DeployedContractRegistryEntry,
GeneratedContractRegistryEntry,
} from "./services/dao-contract-registry";
validateContractDeploymentOrder,
} from "./registries/dao-contract-registry";
import { DaoContractGenerator } from "./services/dao-contract-generator";
import { DaoContractDeployer } from "./services/dao-contract-deployer";
import { ExpectedContractGeneratorArgs } from "./types/dao-types";
import {
ContractCopyConfig,
ExpectedContractGeneratorArgs,
} from "./types/dao-types";
import {
aibtcCoreRequestBody,
CONFIG,
Expand Down Expand Up @@ -106,7 +110,28 @@ async function main(): Promise<ToolResponse<DeployedContractRegistryEntry[]>> {

// Step 1 - generate dao-related contracts

// generate dao contracts
// Define which contracts need multiple copies
/* removing temporarily while we troubleshoot action config
const contractCopies: ContractCopyConfig[] = [
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_DAO",
count: 5,
},
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_SBTC",
count: 5,
},
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_STX",
count: 5,
},
];
*/

// generate dao contracts with multiple copies
const daoContracts = contractGenerator.generateContracts(args);
generatedContracts.push(...Object.values(daoContracts));

Expand Down Expand Up @@ -163,7 +188,26 @@ async function main(): Promise<ToolResponse<DeployedContractRegistryEntry[]>> {
});
}

// Step 4 - deploy contracts
// Step 4 - validate and deploy contracts

// Validate deployment order
const isValidDeploymentOrder = validateContractDeploymentOrder();
if (!isValidDeploymentOrder) {
throw new Error("Invalid contract deployment order detected");
}

// Sort contracts by deployment order for logging
const sortedContracts = [...generatedContracts].sort(
(a, b) => a.deploymentOrder - b.deploymentOrder
);

// Log deployment order for debugging
console.log("Deployment order:");
sortedContracts.forEach((contract, index) => {
console.log(
`${index + 1}. ${contract.name} (${contract.type}/${contract.subtype})`
);
});

//console.log(`Deploying ${generatedContracts.length} contracts...`);
//console.log(`- address: ${address}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from "fs";
import * as path from "path";
import { getContractName } from "../../services/dao-contract-registry";
import { DeployedCoreProposalRegistryEntry } from "../../services/dao-core-proposal-registry";
import { getContractName } from "../../registries/dao-contract-registry";
import { DeployedCoreProposalRegistryEntry } from "../../registries/dao-core-proposal-registry";
import { DaoCoreProposalGenerator } from "../../services/dao-core-proposal-generator";
import { DaoCoreProposalDeployer } from "../../services/dao-core-proposal-deployer";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "fs";
import * as path from "path";
import { GeneratedCoreProposalRegistryEntry } from "../../services/dao-core-proposal-registry";
import { GeneratedCoreProposalRegistryEntry } from "../../registries/dao-core-proposal-registry";
import { DaoCoreProposalGenerator } from "../../services/dao-core-proposal-generator";
import {
CONFIG,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "fs";
import * as path from "path";
import { GeneratedCoreProposalRegistryEntry } from "../../services/dao-core-proposal-registry";
import { GeneratedCoreProposalRegistryEntry } from "../../registries/dao-core-proposal-registry";
import { DaoCoreProposalGenerator } from "../../services/dao-core-proposal-generator";
import {
CONFIG,
Expand Down
28 changes: 26 additions & 2 deletions src/aibtc-dao/generate-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import * as fs from "fs";
import * as path from "path";
import { validateStacksAddress } from "@stacks/transactions";
import { DaoContractGenerator } from "./services/dao-contract-generator";
import { GeneratedContractRegistryEntry } from "./services/dao-contract-registry";
import { ExpectedContractGeneratorArgs } from "./types/dao-types";
import { GeneratedContractRegistryEntry } from "./registries/dao-contract-registry";
import {
ContractCopyConfig,
ExpectedContractGeneratorArgs,
} from "./types/dao-types";
import {
CONFIG,
convertStringToBoolean,
Expand Down Expand Up @@ -100,6 +103,27 @@ async function main(): Promise<ToolResponse<GeneratedContractRegistryEntry[]>> {

// Step 1 - generate dao contracts

// Define which contracts need multiple copies
/* removing temporarily while we troubleshoot action config
const contractCopies: ContractCopyConfig[] = [
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_DAO",
count: 5,
},
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_SBTC",
count: 5,
},
{
type: "EXTENSIONS",
subtype: "TIMED_VAULT_STX",
count: 5,
},
];
*/

const daoContracts = contractGenerator.generateContracts(args);
generatedContracts.push(...Object.values(daoContracts));

Expand Down
Loading