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

fix metadata #303

Merged
merged 2 commits into from
Feb 28, 2023
Merged
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
9 changes: 1 addition & 8 deletions packages/contracts/deploy/00_managing-dao/00_managing-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
` At the final step when Multisig is available, it will be installed on managingDAO and all roles for the Deployer will be revoked.`
);

const metadataCIDPath = await uploadToIPFS(
JSON.stringify(MANAGING_DAO_METADATA),
network.name
);

const initializeParams = {
metadata: ethers.utils.hexlify(
ethers.utils.toUtf8Bytes(`ipfs://${metadataCIDPath}`)
),
metadata: '0x',
initialOwner: deployer,
trustedForwarder: ethers.constants.AddressZero,
daoURI: '0x',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
who: {name: 'Deployer', address: deployer},
permission: 'APPLY_INSTALLATION_PERMISSION',
},
{
operation: Operation.Grant,
where: {name: 'DAO', address: managingDAOAddress},
who: {name: 'Deployer', address: deployer},
permission: 'SET_METADATA_PERMISSION',
},
];
await managePermissions(managingDaoContract, grantPermissions);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
getContractAddress,
getENSAddress,
isENSDomainRegistered,
MANAGING_DAO_METADATA,
uploadToIPFS,
} from '../helpers';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
Expand Down Expand Up @@ -53,6 +55,21 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
console.log(
`Registered the (managingDAO: ${managingDAOAddress}) on (DAORegistry: ${daoRegistryAddress}), see (tx: ${registerTx.hash})`
);

// Set Metadata for the Managing DAO
const managingDaoContract = await ethers.getContractAt(
'DAO',
managingDAOAddress
);

const metadataCIDPath = await uploadToIPFS(
JSON.stringify(MANAGING_DAO_METADATA),
network.name
);

await managingDaoContract.setMetadata(
ethers.utils.hexlify(ethers.utils.toUtf8Bytes(`ipfs://${metadataCIDPath}`))
);
};
export default func;
func.tags = ['RegisterManagingDAO'];
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
who: {name: 'Deployer', address: deployer},
permission: 'ROOT_PERMISSION',
},
{
operation: Operation.Revoke,
where: {name: 'DAO', address: managingDAOAddress},
who: {name: 'Deployer', address: deployer},
permission: 'SET_METADATA_PERMISSION',
},
];
await managePermissions(managingDaoContract, revokePermissions);

Expand Down