Skip to content

Commit

Permalink
deploy on testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekard0 committed Jan 17, 2025
1 parent 0d6e999 commit 021a78c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ packages/subgraph/tests/helpers/extended-schema.ts
artifacts-zk
cache-zk
deployments-zk
deployments
12 changes: 11 additions & 1 deletion packages/contracts/deploy/10_create_repo/11_create_repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
PluginRepo__factory,
PluginRepoFactory__factory,
} from '@aragon/osx-ethers';
import {defaultAbiCoder} from '@ethersproject/abi';
import {ethers} from 'hardhat';
import {DeployFunction} from 'hardhat-deploy/types';
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import path from 'path';
Expand Down Expand Up @@ -73,8 +75,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
`PluginRepo '${pluginEnsDomain(hre)}' deployed at '${pluginRepo.address}'.`
);

const ERC1967_IMPLEMENTATION_SLOT =
'0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';
const implementationAddress = await ethers.provider
.getStorageAt(pluginRepo.address, ERC1967_IMPLEMENTATION_SLOT)
.then(encoded => defaultAbiCoder.decode(['address'], encoded)[0]);

console.log('implementationAddress', implementationAddress);

hre.aragonToVerifyContracts.push({
address: pluginRepo.address,
address: implementationAddress,
args: [],
});
};
Expand Down
12 changes: 8 additions & 4 deletions packages/contracts/deploy/20_new_version/22_setup_conclude.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {PLUGIN_SETUP_CONTRACT_NAME} from '../../plugin-settings';
import {AdminSetup__factory, Admin__factory} from '../../typechain';
import {isZkSync} from '../../utils/zkSync';
import {DeployFunction} from 'hardhat-deploy/types';
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import path from 'path';
Expand Down Expand Up @@ -29,10 +30,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
address: setup.address,
args: setupDeployment.args,
});
hre.aragonToVerifyContracts.push({
address: implementation.address,
args: [],
});
// for zkSync we deploy from the setup as new so we don't implementation address
if (!isZkSync(hre.network.name)) {
hre.aragonToVerifyContracts.push({
address: implementation.address,
args: [],
});
}
};

export default func;
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"devDependencies": {
"@aragon/osx": "1.3.0",
"@aragon/osx-v1.3.0": "npm:@aragon/[email protected]",
"@aragon/osx-commons-configs": "0.4.0",
"@aragon/osx-ethers": "1.4.0-alpha.0",
"@aragon/osx-commons-sdk": "0.0.1-alpha.11",
Expand Down
10 changes: 7 additions & 3 deletions packages/contracts/plugin-settings.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import buildMetadata from './src/build-metadata.json';
import releaseMetadata from './src/release-metadata.json';
import {isZkSync} from './utils/zkSync';
import {VersionTag} from '@aragon/osx-commons-sdk';
import hre from 'hardhat';

export const PLUGIN_CONTRACT_NAME = 'Admin';
export const PLUGIN_SETUP_CONTRACT_NAME = 'AdminSetup';
export const PLUGIN_REPO_ENS_SUBDOMAIN_NAME = 'admin'; // 'admin.plugin.dao.eth'
export const PLUGIN_SETUP_CONTRACT_NAME = isZkSync(hre.network.name)
? 'AdminSetupZkSync'
: 'AdminSetup';
export const PLUGIN_REPO_ENS_SUBDOMAIN_NAME = 'test-admin-6'; // 'admin.plugin.dao.eth'

// Specify the version of your plugin that you are currently working on. The first version is v1.1.
// For more details, visit https://devs.aragon.org/docs/osx/how-it-works/framework/plugin-management/plugin-repo.
export const VERSION: VersionTag = {
release: 1, // Increment this number ONLY if breaking/incompatible changes were made. Updates between releases are NOT possible.
build: 2, // Increment this number if non-breaking/compatible changes were made. Updates to newer builds are possible.
build: 1, // Increment this number if non-breaking/compatible changes were made. Updates to newer builds are possible.
};

export const METADATA = {
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/mocks/Migration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pragma solidity ^0.8.8;
/* solhint-disable no-unused-import */

import {DAO} from "@aragon/osx/core/dao/DAO.sol";
import {PluginRepo} from "@aragon/osx-v1.3.0/framework/plugin/repo/PluginRepo.sol";
import {ProxyFactory} from "@aragon/osx-commons-contracts/src/utils/deployment/ProxyFactory.sol";

/* solhint-enable no-unused-import */
9 changes: 9 additions & 0 deletions packages/contracts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
dependencies:
ethers "^5.6.2"

"@aragon/osx-v1.3.0@npm:@aragon/[email protected]":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@aragon/osx/-/osx-1.3.0.tgz#eee59963546016bb3b41b7c7a9b7c41d33b37de2"
integrity sha512-ziLmnhWEoFS/uthxAYfI9tSylesMLTDe69XggKP9LK/tIOKAhyYjfAJ2mbhWZcH558c9o0gzAEErkDhqh/wdog==
dependencies:
"@ensdomains/ens-contracts" "0.0.11"
"@openzeppelin/contracts" "4.8.1"
"@openzeppelin/contracts-upgradeable" "4.8.1"

"@aragon/[email protected]":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@aragon/osx/-/osx-1.3.0.tgz#eee59963546016bb3b41b7c7a9b7c41d33b37de2"
Expand Down

0 comments on commit 021a78c

Please sign in to comment.