Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questionnaire functionality split #1221

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ contract Questionnaires is

/// @notice Initializes the contract
/// @dev Uses the initializer modifier to to ensure the contract is only initialized once
function initialize() public initializer {
function initialize(string[] calldata cids) public initializer {
__AccessControl_init();
_addDomain("snickerdoodle.com");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to grant caller the DEFAULT_ADMIN_ROLE

Copy link
Contributor

@seansing9 seansing9 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint numCIDs = cids.length;
for (uint i = 0; i < numCIDs; i++) {
questionnaires.push(cids[i]);
}
}

/// @notice Gets the array of questionnaires
Expand Down
18 changes: 18 additions & 0 deletions packages/contracts/scripts/deploy-factory-and-consent.cts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ async function main() {
"Consent Factory deployed to:",
await consentFactory.getAddress(),
);

// deploy the questionnaire proxy contract
const questionnaireCIDs = [
"QmRo7nJCWrUbEqJ9ui8tmhvrQGmsEA7XvLuhqiYSzAyHc6",
"QmSjJbS1UQacA4QMmHz8doqNE1Z1SyVQL7bdQKjbusGDRR",
"QmZb6HFzES3nvGFWWcvzwtLEdbx7aenjpuViQx6sTf4ADL",
"QmW4wgvPKJFpk8K6enhDZYsSb9YkpuSGNqyCMm3vfnihHt",
"QmRNvefcakLqaUcnBuVnCk1NnvwHb7PGsD5M9vRnSLBjz6",
"QmUbJYtBRuFQQM6R48yhGSzSZPiuXwLnpWxATzSqUjKy1J",
"QmNpJv17oX1vj3pAEu1zFwX1PfyiCN8CUgouw3Pj52mQHK",
"QmXSSQ8pD7KNGm1sa8wsqcCHqfYFKZ3femRpQRn3XckYPg",
];
const Questionnaires = await ethers.getContractFactory("Questionnaires");
const questionnaires = await upgrades.deployProxy(Questionnaires, [
questionnaireCIDs,
]);
await questionnaires.waitForDeployment();
console.log("Questionnaires deployed to:", await questionnaires.getAddress());
}

// We recommend this pattern to be able to use async/await everywhere
Expand Down
Loading