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

refactor: remove Aragon plugins from the OSx core repository #588

Merged
merged 45 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
10be7d4
f: updated the schema to use transaction actions and update the ids
jordaniza Apr 4, 2024
75a77cd
feat: tests pass for the TransactionAction and Action but fail on Tra…
jordaniza Apr 5, 2024
1af09f3
tests: added support for dao_v1_0_0 handler
jordaniza Apr 5, 2024
dc156ef
f: updated transfer events to use transactionActions and updated 1.3.…
jordaniza Apr 5, 2024
989eaaf
f: added dao_v1_0_0 tests
jordaniza Apr 5, 2024
bdd3747
lint: silenced warnings in files changed
jordaniza Apr 5, 2024
3637ebc
chore: updated changelog
jordaniza Apr 5, 2024
d1ea038
fix: re-ordered ids to use caller first, then daoAddress
jordaniza Apr 9, 2024
6fac89b
test: added tests for deterministic ids
jordaniza Apr 9, 2024
689f621
Update packages/subgraph/src/dao/dao_v1_0_0.ts
jordaniza Apr 9, 2024
54f6835
fix: removed dead code and change comment
jordaniza Apr 9, 2024
ee65068
Merge branch 'f/split-transaction-actions' of https://github.com/arag…
jordaniza Apr 9, 2024
af9a23f
fix: minor suggestions from codereview
jordaniza Apr 9, 2024
2edf6ef
Update CHANGELOG.md
jordaniza Apr 9, 2024
cbe67a1
f: removed start and end date from tx actions and made entities immut…
jordaniza Apr 9, 2024
e000d2f
lint: fixed eslint subgraph warnings
jordaniza Apr 9, 2024
f3a8f2d
lint: fixed prettier on root
jordaniza Apr 9, 2024
9991e2c
lint: fix prettier warnings on root with node 16
jordaniza Apr 9, 2024
1826f06
lint: replaced throw with warn to not introduce breaking change
jordaniza Apr 9, 2024
1a9427d
revert: tsconfig changes
jordaniza Apr 9, 2024
f9e5497
Merge pull request #568 from aragon/f/split-linting
jordaniza Apr 10, 2024
146903c
Merge pull request #569 from aragon/f/split-immutable-transactionAction
jordaniza Apr 10, 2024
9bb498d
Update packages/subgraph/src/dao/utils.ts
jordaniza Apr 10, 2024
1aa9cb4
fix: typo
jordaniza Apr 10, 2024
f1049ff
Merge pull request #562 from aragon/f/split-transaction-actions
jordaniza Apr 10, 2024
b7b99b8
f: split schema now builds
jordaniza Apr 11, 2024
55fbd73
tests: tests pass for the subgraph
jordaniza Apr 11, 2024
23560fb
mv: rename transactionActions to actionBatch
jordaniza Apr 11, 2024
ef716d6
Update CHANGELOG.md
jordaniza Apr 11, 2024
c04f65a
f: small changes to documentation and removed some constants
jordaniza Apr 11, 2024
0025821
Merge branch 'f/split-subgraph-remove-plugins' of https://github.com/…
jordaniza Apr 11, 2024
a19ddc1
Apply suggestions from code review
jordaniza Apr 12, 2024
40a12bb
Merge pull request #571 from aragon/f/split-subgraph-remove-plugins
jordaniza Apr 12, 2024
faa120c
feat: bump osx commons contracts (#549)
heueristik Apr 12, 2024
0800423
Merge branch 'f/split' of https://github.com/aragon/osx into f/split
jordaniza Apr 12, 2024
dc68083
Merge pull request #570 from aragon/f/split-subgraph
jordaniza Apr 12, 2024
75ef618
feat: remove plugin-related contracts (#551)
heueristik Apr 12, 2024
e12e9b8
feature: modify deploy script for more flexibility (#573)
novaknole Apr 12, 2024
0326057
chore: bump osx-commons and OpenZepplin dependencies (#576)
heueristik Apr 23, 2024
ce9dd2e
docs: improve code comment in the `PluginSetupProcessor` (#577)
heueristik Apr 24, 2024
ffbfb44
merge: 'develop' into f/split
jordaniza May 1, 2024
014a7d4
Merge branch 'develop' into f/split
jordaniza May 3, 2024
24d4542
chore: bump contract dependencies
heueristik May 3, 2024
39b5abd
Merge pull request #591 from aragon/feature/bump-deps
jordaniza May 3, 2024
0cf22ee
Update packages/contracts/hardhat.config.ts
jordaniza May 3, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"description": "Aragon DAO Framework",
"repository": "https://github.com/aragon/osx",
"author": "Aragon Association",
"author": "Aragon X",
"license": "AGPL-3.0-or-later",
"private": true,
"workspaces": {
Expand Down
9 changes: 7 additions & 2 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Use `ProxyLib` and `PluginUpgradeableSetup` from `osx-commons-contracts`.
- Added `VersionComparisonLib` to compare semantic versioning numbers.
- Inherit `ProtocolVersion` in `Plugin`, `PluginCloneable`, `PluginUUPSUpgradeable`, `PluginSetup`, `PermissionCondition`, `PermissionConditionUpgradeable` `PluginSetupProcessor`, `PluginRepoRegistry`, `DAORegistry`, and `ENSSubdomainRegistrar`.
- Added the `FunctionDeprecated` error to `DAO`.
Expand All @@ -17,15 +18,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changed the solidity compiler pragma from `0.8.17` to `^0.8.8` for all files.
- Improved type safety by using `abi.encodeCall` instead of `abi.encodeWithSelector` and the more explicit bracket syntax for permissions.
- Bumped OpenZeppelin dependencies to `4.9.3`.
- Bumped OpenZeppelin dependencies to `4.9.6`.
- Refactored the fallback in the `isGranted` function in `PermissionManager` to make conditions mutually exclusive: Specific conditions answering `false` do not fall back to generic caller conditions (`_who: ANY_ADDR`) or generic target conditions (`_where: ANY_ADDR`).
- Renamed the `signatureValidator` variable in `DAO` to `__removed0`.
- Use the DAOs permission manager functionality to validate signatures.
- Renamed `managingDAO` during deployment to `managmentDAO`.
- Renamed `managingDAO` during deployment to `managementDAO`.
- Aligned contract names during deployment with the names given in `@aragon/osx-commons-configs`.

### Removed

- Deleted `AddresslistVoting`, `AddresslistVotingSetup` and related metadata.
- Moved `TokenVoting`, `TokenVotingSetup` and related metadata to the [aragon/token-voting-plugin](https://github.com/aragon/token-voting-plugin) repo.
- Moved `Multisig`, `MultisigSetup` and related metadata to the [aragon/multisig-plugin](https://github.com/aragon/multisig-plugin) repo.
- Moved `Admin`, `AdminSetup` and related metadata to the [aragon/admin-plugin](https://github.com/aragon/admin-plugin) repo.
- Moved

- interfaces `IDAO`, `IPermissionCondition`, `IPlugin`, `IMembership`, `IProposal`, `IPluginSetup`, `IProtocolVersion`,
Expand Down
203 changes: 0 additions & 203 deletions packages/contracts/deploy/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ export const ENS_PUBLIC_RESOLVERS: {[key: string]: string} = {
sepolia: '0x8FADE66B79cC9f707aB26799354482EB93a5B7dD',
};

export const MANAGEMENT_DAO_METADATA = {
name: 'Aragon Management DAO',
description:
'Aragon OSx includes a group of global smart contracts that allow for a DAO ecosystem to be built on top. These contracts will require future improvements and general maintenance. The Management DAO is intended to perform such maintenance tasks and holds the permissions to deliver any new capabilities that are added in the future.',
avatar:
'https://ipfs.eth.aragon.network/ipfs/QmVyy3ci7F2zHG6JUJ1XbcwLKuxWrQ6hqNvSnjmDmdYJzP/',
links: [
{
name: 'Web site',
url: 'https://www.aragon.org',
},
{
name: 'Developer Portal',
url: 'https://devs.aragon.org/',
},
],
};

export const DAO_PERMISSIONS = [
'ROOT_PERMISSION',
'UPGRADE_DAO_PERMISSION',
Expand Down Expand Up @@ -158,170 +140,6 @@ export async function detemineDeployerNextAddress(
return futureAddress;
}

export async function createPluginRepo(
hre: HardhatRuntimeEnvironment,
pluginName: string,
subdomain: string
): Promise<void> {
const {network} = hre;
const signers = await ethers.getSigners();

const pluginDomain = pluginDomainEnv(network);
if (
await isENSDomainRegistered(
`${subdomain}.${pluginDomain}`,
await getENSAddress(hre),
signers[0]
)
) {
// not beeing able to register the plugin repo means that something is not right with the framework deployment used.
// Either a frontrun happened or something else. Thus we abort here
throw new Error(`${subdomain} is already present! Aborting...`);
}

const pluginRepoFactoryAddress = await getContractAddress(
'PluginRepoFactory',
hre
);

const pluginRepoFactoryFactory = new PluginRepoFactory__factory(signers[0]);
const pluginRepoFactoryContract = pluginRepoFactoryFactory.attach(
pluginRepoFactoryAddress
);

const {deployer} = await hre.getNamedAccounts();

const tx = await pluginRepoFactoryContract.createPluginRepo(
subdomain,
deployer
);
console.log(
`Creating & registering repo for ${pluginName} with tx ${tx.hash}`
);
await tx.wait();

const event = await findEventTopicLog<PluginRepoRegisteredEvent>(
tx,
PluginRepoRegistry__factory.createInterface(),
'PluginRepoRegistered'
);
const repoAddress = event.args.pluginRepo;

hre.aragonPluginRepos[pluginName] = repoAddress;

console.log(
`Created & registered repo for ${pluginName} at address: ${repoAddress}` //, with contentURI ${ethers.utils.toUtf8String(releaseMetadata)}`
);
}

export async function createVersion(
pluginRepoContract: string,
pluginSetupContract: string,
releaseNumber: number,
releaseMetadata: string,
buildMetadata: string
): Promise<void> {
const signers = await ethers.getSigners();

const PluginRepo = new PluginRepo__factory(signers[0]);
const pluginRepo = PluginRepo.attach(pluginRepoContract);

const tx = await pluginRepo.createVersion(
releaseNumber,
pluginSetupContract,
buildMetadata,
releaseMetadata
);

console.log(`Creating build for release ${releaseNumber} with tx ${tx.hash}`);

await tx.wait();

const versionCreatedEvent = await findEvent<VersionCreatedEvent>(
tx,
'VersionCreated'
);

console.log(
`Created build ${versionCreatedEvent.args.build} for release ${
versionCreatedEvent.args.release
} with setup address: ${
versionCreatedEvent.args.pluginSetup
}, with build metadata ${ethers.utils.toUtf8String(
buildMetadata
)} and release metadata ${ethers.utils.toUtf8String(releaseMetadata)}`
);
}

export type LatestVersion = {
versionTag: VersionTag;
pluginSetupContract: string;
releaseMetadata: string;
buildMetadata: string;
};

function isSorted(latestVersions: LatestVersion[]): boolean {
// The list of latest versions has to start with the first release, otherwise something is wrong and we must stop.
if (latestVersions[0].versionTag[0] != 1) {
return false;
}

for (let i = 0; i < latestVersions.length - 1; i++) {
if (
!(
latestVersions[i + 1].versionTag[0] ==
latestVersions[i].versionTag[0] + 1
)
) {
return false;
}
}
return true;
}

export async function populatePluginRepo(
hre: HardhatRuntimeEnvironment,
pluginRepoName: string,
latestVersions: LatestVersion[]
): Promise<void> {
// make sure that the latestVersions array is sorted by version tag
if (!isSorted(latestVersions)) {
throw new Error(`${latestVersions} is not sorted in ascending order`);
}

for (const latestVersion of latestVersions) {
const releaseNumber = latestVersion.versionTag[0];
const latestBuildNumber = latestVersion.versionTag[1];

const placeholderSetup = await getContractAddress('PlaceholderSetup', hre);

const emptyJsonObject = ethers.utils.hexlify(
ethers.utils.toUtf8Bytes('{}')
);

for (let i = 1; i < latestBuildNumber; i++) {
await createVersion(
hre.aragonPluginRepos[pluginRepoName],
placeholderSetup,
releaseNumber,
emptyJsonObject,
ethers.utils.hexlify(
ethers.utils.toUtf8Bytes(`ipfs://${hre.placeholderBuildCIDPath}`)
)
);
}

// create latest builds
await createVersion(
hre.aragonPluginRepos[pluginRepoName],
latestVersion.pluginSetupContract,
releaseNumber,
latestVersion.releaseMetadata,
latestVersion.buildMetadata
);
}
}

export async function checkSetManagementDao(
contract: Contract,
expectedDaoAddress: string
Expand Down Expand Up @@ -567,26 +385,5 @@ export async function transferSubnodeChain(
}
}

/**
* Returns the management DAO' multisig address defined in the environment variables. Throws if not found
*
* @export
* @param {HardhatRuntimeEnvironment} hre
* @return {string}
*/
export function getManagementDAOMultisigAddress(
hre: HardhatRuntimeEnvironment
): string {
const {network} = hre;
const address =
process.env[`${network.name.toUpperCase()}_MANAGEMENT_DAO_MULTISIG`];
if (!address) {
throw new Error(
`Failed to find management DAO multisig address in env variables for ${network.name}`
);
}
return address;
}

// hh-deploy cannot process files without default exports
export default async () => {};
15 changes: 15 additions & 0 deletions packages/contracts/deploy/management-dao-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Aragon Management DAO",
"description": "Aragon OSx includes a group of global smart contracts that allow for a DAO ecosystem to be built on top. These contracts will require future improvements and general maintenance. The Management DAO is intended to perform such maintenance tasks and holds the permissions to deliver any new capabilities that are added in the future.",
"avatar": "https://ipfs.eth.aragon.network/ipfs/QmVyy3ci7F2zHG6JUJ1XbcwLKuxWrQ6hqNvSnjmDmdYJzP/",
"links": [
{
"name": "Web site",
"url": "https://www.aragon.org"
},
{
"name": "Developer Portal",
"url": "https://devs.aragon.org/"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
deployer
);

// grant the deployer execute permissions during deployment. This will be revoked in 40_finalize-management-dao/40_revoke-permissions
// grant the deployer execute permissions.
await managePermissions(managementDaoContract, [
{
operation: Operation.Grant,
Expand Down
Loading
Loading