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

chore: merge develop into main #38

Merged
merged 108 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
e749c39
feat: copied files from the simple-storage-example-plugin repo into p…
heueristik Jun 1, 2023
bf0b457
set monorepo package.json
Rekard0 Jun 1, 2023
bce3b5b
fix: CI/CD
heueristik Jun 1, 2023
d84d365
init subgraph
Rekard0 Jun 1, 2023
a515d75
fix: CI/CD
heueristik Jun 2, 2023
005882a
feat: CI/CD improvements
heueristik Jun 2, 2023
b390e17
feat: cleaned devDependencies
heueristik Jun 2, 2023
37b7adb
feat: improve CI step description
heueristik Jun 2, 2023
8b98b95
subgraph bare bone (WIP)
Rekard0 Jun 2, 2023
44d795d
feat: add subpackages and cleaned dependencies
heueristik Jun 2, 2023
187372a
feat: temporary readme
heueristik Jun 2, 2023
c2b3e36
feat: move packages
heueristik Jun 2, 2023
e177a48
fix: wrong path
heueristik Jun 2, 2023
8ca275f
add post install
Rekard0 Jun 13, 2023
55d81e2
plugin repo only
heueristik Jun 15, 2023
a75aca8
switch to osx-ethers
Rekard0 Jun 16, 2023
0cdbdc8
fix missing dir issue
Rekard0 Jun 16, 2023
2cfdc44
make it build
Rekard0 Jun 16, 2023
7019544
build 1
heueristik Jun 19, 2023
1da6159
Merge remote-tracking branch 'origin/main' into prepare-repo
heueristik Jun 19, 2023
5ec6a55
chore: cleaning
heueristik Jun 19, 2023
38f76d8
feat: deleted contracts-versions
heueristik Jun 19, 2023
3c7aa8a
feat: refactoring
heueristik Jun 19, 2023
0e90148
feat: refactoring
heueristik Jun 19, 2023
d5785cb
feat: improvements
heueristik Jun 20, 2023
10852bc
Merge branch 'prepare-repo' into main
heueristik Jun 20, 2023
ee6c9b7
feat: refactoring
heueristik Jun 20, 2023
6183940
fix: linting and prettier
heueristik Jun 20, 2023
b5ec888
feat: print more infos, remove unused function
heueristik Jun 20, 2023
6e267cd
fix: print more info
heueristik Jun 20, 2023
6a288f0
More infos
heueristik Jun 20, 2023
0ffd7b7
Renaming
heueristik Jun 20, 2023
23a0440
More info
heueristik Jun 20, 2023
f78c6ed
fix: test failing because of wrong default test network
heueristik Jun 20, 2023
5439c74
Merge pull request #3 from aragon/prepare-repo
heueristik Jun 20, 2023
a3d394e
feature: add subgraph workflow
heueristik Jun 20, 2023
5b7d2e3
fix: rename flows
heueristik Jun 20, 2023
e929ed6
fix: adapt triggers
heueristik Jun 20, 2023
a891df2
fix: install packages first
heueristik Jun 20, 2023
a14ebb6
fix: triggers
heueristik Jun 20, 2023
be78c1f
feat: one .env file
heueristik Jun 20, 2023
6d46014
fix: .env paths
heueristik Jun 20, 2023
a759395
fix: remove redundant checkout
heueristik Jun 20, 2023
6309fec
debug: print info
heueristik Jun 20, 2023
03c3ee7
debug: attempt fix
heueristik Jun 20, 2023
3885283
fix: missing env variable
heueristik Jun 20, 2023
bb9f1ea
fix: triggers
heueristik Jun 20, 2023
db98da3
Merge pull request #4 from aragon/feature/ci-cd
heueristik Jun 20, 2023
791da1d
Removed summaries
heueristik Jun 21, 2023
5791520
WIP
heueristik Jun 21, 2023
1661786
improvements
heueristik Jun 21, 2023
4e71d84
fix: path
heueristik Jun 21, 2023
40eb7a3
fix: empty json handling
heueristik Jun 21, 2023
21fe6e1
fix: lint warnings
heueristik Jun 22, 2023
e2dabff
Merge pull request #5 from aragon/feature/ci-cd
heueristik Jun 22, 2023
746aa6b
add psp and pluginRepos related mapping WIP
Rekard0 Jun 23, 2023
c6683dd
refactor PSP handlers (WIP)
Rekard0 Jun 26, 2023
ecd5d9b
refactor PSP handlers (WIP)
Rekard0 Jul 4, 2023
3b6dc63
refactor PSP handlers (WIP)
Rekard0 Jul 6, 2023
c6063db
refactor PSP handlers (WIP)
Rekard0 Jul 10, 2023
82380c4
clean up
Rekard0 Jul 11, 2023
9f00d58
create common id functions
Rekard0 Jul 12, 2023
066c53a
clean up
Rekard0 Jul 14, 2023
70b6b7e
Feature: Add js client (#2)
josemarinas Jul 18, 2023
1f5f31e
fix subgraph build
Rekard0 Jul 19, 2023
bf0c676
fix lint
Rekard0 Jul 19, 2023
bc91488
map 1 event
Rekard0 Jul 19, 2023
2c0d1e4
chore: bump package versions
heueristik Jul 27, 2023
598e0c2
feat: added event, tests, and improved signer, renamed plugin
heueristik Jul 27, 2023
a545bd1
fix: linting and formatting errors
heueristik Jul 27, 2023
cdb285b
feature: support base goerli network
heueristik Aug 1, 2023
a0b5db8
Merge pull request #6 from aragon/feature/base-goerli-support
heueristik Aug 1, 2023
8bb3d8f
Add missing migration import for setup processing
brickpop Aug 24, 2023
7477f69
Merge pull request #8 from aragon/fix/add-missing-migration-import
heueristik Aug 24, 2023
3ff241a
feat: added sepolia and base support and fix IPFS returning empty str…
heueristik Oct 18, 2023
2b066ca
OS-593: refactors repo for linting and linting during workflows (#11)
mathewmeconry Oct 19, 2023
6b3bb1c
docs: added readme (#13)
heueristik Oct 20, 2023
e8948ee
Os 782 remove the contracts ethers and do rollup in mini sdk (#12)
mathewmeconry Oct 25, 2023
8bd3457
refactor: renamed and refactored files
heueristik Nov 8, 2023
1003777
refactor: skip repo creation if ENS name is already taken
heueristik Nov 8, 2023
143aa08
docs: added usage guide and improved comments
heueristik Nov 8, 2023
014d732
ci: fix workflow by removing outdated lint
heueristik Nov 8, 2023
dd08774
ci: formatting & linting on every push
heueristik Nov 8, 2023
1cf2894
docs: improve migration file comment
heueristik Nov 8, 2023
a4ef1d5
ci: fix linting workflow
heueristik Nov 8, 2023
610c1e1
build: use the same typescript version everywhere
heueristik Nov 8, 2023
fd0e7a5
docs: improve usage guide
heueristik Nov 8, 2023
7e00454
docs: improved usage guide
heueristik Nov 8, 2023
fa55216
Merge pull request #16 from aragon/feature/usage-guide
pythonpete32 Nov 13, 2023
a4a768b
OS-754 : re-organize entity relations & add testing (#15)
Rekard0 Nov 14, 2023
da4da85
fix(js-client): exclude dist from tsconfig.json (#20)
mathewmeconry Nov 15, 2023
d2394e6
chore: added arbitrum and arbitrumGoerli (#18)
heueristik Nov 20, 2023
5ee399b
build(js-client): replaces tsdx with dts-cli (#21)
mathewmeconry Nov 27, 2023
1f4af1f
chore: bump OZ dependency (#22)
heueristik Nov 27, 2023
cb673e0
docs: add readme and usage guide
heueristik Nov 28, 2023
d3af915
Merge pull request #23 from aragon/feature/OS-786-subgraph-readme
pythonpete32 Nov 29, 2023
145b252
OS-888 fix: Import Repo address from plugin-info (#26)
Rekard0 Dec 19, 2023
61a2172
build: clean-up of dependecy and commands (#19)
heueristik Dec 20, 2023
7de41f2
Feature: Add Subgraph step-by-step guide (#25)
josemarinas Dec 21, 2023
7dc7cdb
feat: use `osx-commons-contracts` and `osx-commons-configs` (#28)
heueristik Feb 8, 2024
d86bd53
refactor: improve folder structure (#30)
heueristik Feb 8, 2024
c17721c
build: remove js client (#31)
heueristik Feb 13, 2024
d02b165
ci: clean GH flows and remove gitpod (#32)
heueristik Feb 13, 2024
ebeef5e
docs: update README.md (#33)
heueristik Feb 13, 2024
bed129b
feat: use commons subgraph (#29)
josemarinas Feb 14, 2024
8a35842
build: improve package.json files (#34)
heueristik Feb 14, 2024
8bdff80
feat: improvements surfaced from the admin plugin (#36)
heueristik Feb 28, 2024
85ec99c
Merge branch 'main' into develop
heueristik Feb 28, 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
1 change: 1 addition & 0 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ jobs:
- name: 'Test the contracts and generate the coverage report'
run: 'yarn coverage'
env:
NETWORK_NAME: ${{ vars.NETWORK_NAME }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/osx-plugin-template",
"description": "A template to fork from when developing an Aragon OSx plugin",
"version": "0.0.1-alpha.0",
"version": "0.0.1-alpha.1",
"license": "AGPL-3.0-or-later",
"author": {
"name": "Aragon",
Expand Down
6 changes: 5 additions & 1 deletion packages/contracts/deploy/00_info/01_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
isLocal,
} from '../../utils/helpers';
import {getNetworkByNameOrAlias} from '@aragon/osx-commons-configs';
import {UnsupportedNetworkError} from '@aragon/osx-commons-sdk';
import {DeployFunction} from 'hardhat-deploy/types';
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import path from 'path';
Expand All @@ -26,7 +27,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

// Fork the network provided in the `.env` file
const networkConfig = getNetworkByNameOrAlias(productionNetworkName)!;
const networkConfig = getNetworkByNameOrAlias(productionNetworkName);
if (networkConfig === null) {
throw new UnsupportedNetworkError(productionNetworkName);
}
await hre.network.provider.request({
method: 'hardhat_reset',
params: [
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/deploy/10_create_repo/11_create_repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

console.log(
`'${pluginEnsDomain(hre)}' PluginRepo deployed at: ${pluginRepo.address}.`
`PluginRepo '${pluginEnsDomain(hre)}' deployed at '${pluginRepo.address}'.`
);

hre.aragonToVerifyContracts.push({
Expand Down
6 changes: 5 additions & 1 deletion packages/contracts/deploy/20_new_version/21_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deploy} = deployments;
const {deployer} = await getNamedAccounts();

await deploy(PLUGIN_SETUP_CONTRACT_NAME, {
const res = await deploy(PLUGIN_SETUP_CONTRACT_NAME, {
from: deployer,
args: [],
log: true,
});

console.log(
`Deployed '${PLUGIN_SETUP_CONTRACT_NAME}' contract at '${res.address}'`
);
};

export default func;
Expand Down
31 changes: 24 additions & 7 deletions packages/contracts/deploy/30_upgrade_repo/31_upgrade_repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {
getLatestNetworkDeployment,
getNetworkNameByAlias,
} from '@aragon/osx-commons-configs';
import {PLUGIN_REPO_PERMISSIONS} from '@aragon/osx-commons-sdk';
import {
PLUGIN_REPO_PERMISSIONS,
UnsupportedNetworkError,
} from '@aragon/osx-commons-sdk';
import {PluginRepo__factory} from '@aragon/osx-ethers';
import {BytesLike} from 'ethers';
import {DeployFunction} from 'hardhat-deploy/types';
Expand All @@ -15,6 +18,14 @@ type SemVer = [number, number, number];
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const [deployer] = await hre.ethers.getSigners();
const productionNetworkName: string = getProductionNetworkName(hre);
const network = getNetworkNameByAlias(productionNetworkName);
if (network === null) {
throw new UnsupportedNetworkError(productionNetworkName);
}
const networkDeployments = getLatestNetworkDeployment(network);
if (networkDeployments === null) {
throw `Deployments are not available on network ${network}.`;
}

// Get PluginRepo
const {pluginRepo, ensDomain} = await findPluginRepo(hre);
Expand All @@ -28,8 +39,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

// Get the latest `PluginRepo` implementation as the upgrade target
const latestPluginRepoImplementation = PluginRepo__factory.connect(
getLatestNetworkDeployment(getNetworkNameByAlias(productionNetworkName)!)!
.PluginRepoBase.address,
networkDeployments.PluginRepoBase.address,
deployer
);

Expand All @@ -53,11 +63,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// Re-initialization will happen through a call to `function initializeFrom(uint8[3] calldata _previousProtocolVersion, bytes calldata _initData)`
// that Aragon might add to the `PluginRepo` contract once it's required.
/*
// Define the `initData` arguments that
// Define the `_initData` arguments
const initData: BytesLike[] = [];
// Encode the call to `function initializeFrom(uint8[3] calldata _previousProtocolVersion, bytes calldata _initData)` with `initData`
const initializeFromCalldata =
newPluginRepoImplementation.interface.encodeFunctionData('initializeFrom', [
latestPluginRepoImplementation.interface.encodeFunctionData('initializeFrom', [
current,
initData,
]);
Expand Down Expand Up @@ -102,11 +112,18 @@ func.skip = async (hre: HardhatRuntimeEnvironment) => {

const [deployer] = await hre.ethers.getSigners();
const productionNetworkName: string = getProductionNetworkName(hre);
const network = getNetworkNameByAlias(productionNetworkName);
if (network === null) {
throw new UnsupportedNetworkError(productionNetworkName);
}
const networkDeployments = getLatestNetworkDeployment(network);
if (networkDeployments === null) {
throw `Deployments are not available on network ${network}.`;
}

// Get the latest `PluginRepo` implementation as the upgrade target
const latestPluginRepoImplementation = PluginRepo__factory.connect(
getLatestNetworkDeployment(getNetworkNameByAlias(productionNetworkName)!)!
.PluginRepoBase.address,
networkDeployments.PluginRepoBase.address,
deployer
);

Expand Down
53 changes: 35 additions & 18 deletions packages/contracts/test/10_unit-testing/12_plugin-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type FixtureResult = {
alice: SignerWithAddress;
bob: SignerWithAddress;
pluginSetup: MyPluginSetup;
prepareInstallationInputs: string;
prepareUninstallationInputs: string;
daoMock: DAOMock;
};

Expand All @@ -32,24 +34,36 @@ async function fixture(): Promise<FixtureResult> {
const daoMock = await new DAOMock__factory(deployer).deploy();
const pluginSetup = await new MyPluginSetup__factory(deployer).deploy();

return {deployer, alice, bob, pluginSetup, daoMock};
const prepareInstallationInputs = ethers.utils.defaultAbiCoder.encode(
getNamedTypesFromMetadata(
buildMetadata.pluginSetup.prepareInstallation.inputs
),
[defaultInitData.number]
);

const prepareUninstallationInputs = ethers.utils.defaultAbiCoder.encode(
getNamedTypesFromMetadata(
buildMetadata.pluginSetup.prepareUninstallation.inputs
),
[]
);

return {
deployer,
alice,
bob,
pluginSetup,
prepareInstallationInputs,
prepareUninstallationInputs,
daoMock,
};
}

describe(PLUGIN_SETUP_CONTRACT_NAME, function () {
describe('prepareInstallation', async () => {
let initData: string;

before(async () => {
initData = ethers.utils.defaultAbiCoder.encode(
getNamedTypesFromMetadata(
buildMetadata.pluginSetup.prepareInstallation.inputs
),
[defaultInitData.number]
);
});

it('returns the plugin, helpers, and permissions', async () => {
const {deployer, pluginSetup, daoMock} = await loadFixture(fixture);
const {deployer, pluginSetup, prepareInstallationInputs, daoMock} =
await loadFixture(fixture);

const nonce = await ethers.provider.getTransactionCount(
pluginSetup.address
Expand All @@ -64,7 +78,7 @@ describe(PLUGIN_SETUP_CONTRACT_NAME, function () {
preparedSetupData: {helpers, permissions},
} = await pluginSetup.callStatic.prepareInstallation(
daoMock.address,
initData
prepareInstallationInputs
);

expect(plugin).to.be.equal(anticipatedPluginAddress);
Expand All @@ -80,7 +94,10 @@ describe(PLUGIN_SETUP_CONTRACT_NAME, function () {
],
]);

await pluginSetup.prepareInstallation(daoMock.address, initData);
await pluginSetup.prepareInstallation(
daoMock.address,
prepareInstallationInputs
);
const myPlugin = new MyPlugin__factory(deployer).attach(plugin);

// initialization is correct
Expand All @@ -91,17 +108,17 @@ describe(PLUGIN_SETUP_CONTRACT_NAME, function () {

describe('prepareUninstallation', async () => {
it('returns the permissions', async () => {
const {pluginSetup, daoMock} = await loadFixture(fixture);
const {pluginSetup, daoMock, prepareUninstallationInputs} =
await loadFixture(fixture);

const dummyAddr = ADDRESS.ZERO;
const emptyData = '0x';

const permissions = await pluginSetup.callStatic.prepareUninstallation(
daoMock.address,
{
plugin: dummyAddr,
currentHelpers: [],
data: emptyData,
data: prepareUninstallationInputs,
}
);

Expand Down
34 changes: 22 additions & 12 deletions packages/contracts/test/20_integration-testing/21_deployment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {METADATA} from '../../plugin-settings';
import {METADATA, VERSION} from '../../plugin-settings';
import {getProductionNetworkName, findPluginRepo} from '../../utils/helpers';
import {
getLatestNetworkDeployment,
Expand All @@ -8,6 +8,7 @@ import {
DAO_PERMISSIONS,
PERMISSION_MANAGER_FLAGS,
PLUGIN_REPO_PERMISSIONS,
UnsupportedNetworkError,
toHex,
uploadToIPFS,
} from '@aragon/osx-commons-sdk';
Expand Down Expand Up @@ -66,13 +67,13 @@ describe(`Deployment on network '${productionNetworkName}'`, function () {
const {pluginRepo} = await loadFixture(fixture);

await pluginRepo['getVersion((uint8,uint16))']({
release: 1,
build: 1,
release: VERSION.release,
build: VERSION.build,
});

const results = await pluginRepo['getVersion((uint8,uint16))']({
release: 1,
build: 1,
release: VERSION.release,
build: VERSION.build,
});

const buildMetadataURI = `ipfs://${await uploadToIPFS(
Expand All @@ -97,17 +98,26 @@ async function fixture(): Promise<FixtureResult> {

const [deployer] = await ethers.getSigners();

// Plugin repo registry
const pluginRepoRegistry = PluginRepoRegistry__factory.connect(
getLatestNetworkDeployment(getNetworkNameByAlias(productionNetworkName)!)!
.PluginRepoRegistryProxy.address,
deployer
);

// Plugin Repo
const {pluginRepo, ensDomain} = await findPluginRepo(env);
if (pluginRepo === null) {
throw `PluginRepo '${ensDomain}' does not exist yet.`;
}

const network = getNetworkNameByAlias(productionNetworkName);
if (network === null) {
throw new UnsupportedNetworkError(productionNetworkName);
}
const networkDeployments = getLatestNetworkDeployment(network);
if (networkDeployments === null) {
throw `Deployments are not available on network ${network}.`;
}

// Plugin repo registry
const pluginRepoRegistry = PluginRepoRegistry__factory.connect(
networkDeployments.PluginRepoRegistryProxy.address,
deployer
);

return {deployer, pluginRepo, pluginRepoRegistry};
}
Loading
Loading