forked from aragon/osx-plugin-template-hardhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ABI generation for NPM * Automated JSON generation * Minor improvements * Improved readme * Ignoring autogenerated files * Generating typescript files "as const" * Minor edits * Convenience link to the addresses.json file without NPM * minor * Minor edits * Leaner addresses.json file * Leaner addresses.json file * add addresses * change json format * add empty line * Ignoring NPM postinstall scripts * Improved readme * Update packages/artifacts/CHANGELOG.md Co-authored-by: Claudia Barcelo <[email protected]> * Update packages/artifacts/README.md Co-authored-by: Claudia Barcelo <[email protected]> * Minor edit * Minor edit * Adding PUB_PINATA_JWT to .env.example * add artifacts publish github flow * Removing the unneeded undici dependency * add alpha * Adding the Pinata JWT env var to the contract tests --------- Co-authored-by: Rekard0 <[email protected]> Co-authored-by: Claudia Barcelo <[email protected]>
- Loading branch information
1 parent
fc3c38e
commit 1142edb
Showing
17 changed files
with
261 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Publish NPM Artifacts | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-artifacts-to-npm: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org/' | ||
|
||
- name: Configure NPM for Scoped Package | ||
run: | | ||
cd packages/artifacts | ||
SCOPE=$(jq -r '.name' package.json | cut -d'/' -f1) | ||
echo "$SCOPE:registry=https://registry.npmjs.org/" > ~/.npmrc | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||
- name: Get Version from package.json | ||
id: get_version | ||
run: | | ||
cd packages/artifacts | ||
VERSION=$(jq -r '.version' package.json) | ||
TAG_VERSION="v$VERSION" | ||
echo "VERSION=$TAG_VERSION" >> $GITHUB_ENV | ||
- name: Create Git Tag | ||
run: | | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git tag $VERSION | ||
git push origin $VERSION | ||
- name: Install Dependencies | ||
run: | | ||
cd packages/artifacts | ||
yarn install | ||
- name: Build Package | ||
env: | ||
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} | ||
run: | | ||
cd packages/artifacts | ||
yarn build | ||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
cd packages/artifacts | ||
if [[ "$VERSION" == *"-alpha"* ]]; then | ||
npm publish --tag alpha --access public | ||
else | ||
npm publish --tag latest --access public | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Multisig Plugin artifacts | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## v1.3.0 | ||
|
||
### Added | ||
|
||
- First NPM release of the Plugin's ABI (release 1, build 3) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Multisig Plugin artifacts | ||
|
||
This package contains the ABI of the Multisig Plugin for OSx, as well as the address of its plugin repository on each supported network. Install it with: | ||
|
||
```sh | ||
yarn add @aragon/multisig-plugin-artifacts | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
// ABI definitions | ||
import { | ||
MultisigABI, | ||
IMultisigABI, | ||
ListedCheckConditionABI, | ||
MultisigSetupABI | ||
} from "@aragon/multisig-plugin-artifacts"; | ||
|
||
// Plugin Repository addresses per-network | ||
import { addresses } from "@aragon/multisig-plugin-artifacts"; | ||
``` | ||
|
||
You can also open [addresses.json](./src/addresses.json) directly. | ||
|
||
## Development | ||
|
||
### Building the package | ||
|
||
Install the dependencies and generate the local ABI definitions. | ||
|
||
```sh | ||
yarn --ignore-scripts | ||
yarn build | ||
``` | ||
|
||
The `build` script will: | ||
1. Move to `packages/contracts`. | ||
2. Install its dependencies. | ||
3. Compile the contracts using Hardhat. | ||
4. Generate their ABI. | ||
5. Extract their ABI and embed it into on `src/abi.ts`. | ||
|
||
## Documentation | ||
|
||
You can find all documentation regarding how to use this plugin in [Aragon's documentation here](https://docs.aragon.org/multisig/1.x/index.html). | ||
|
||
## Contributing | ||
|
||
If you like what we're doing and would love to support, please review our `CONTRIBUTING_GUIDE.md` [here](https://github.com/aragon/multisig-plugin/blob/main/CONTRIBUTIONS.md). We'd love to build with you. | ||
|
||
## Security | ||
|
||
If you believe you've found a security issue, we encourage you to notify us. We welcome working with you to resolve the issue promptly. | ||
|
||
Security Contact Email: [email protected] | ||
|
||
Please do not use the issue tracker for security issues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@aragon/multisig-plugin-artifacts", | ||
"author": "Aragon X", | ||
"version": "1.3.0-alpha", | ||
"license": "AGPL-3.0-or-later", | ||
"description": "The Multisig Plugin ABI definition", | ||
"typings": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "yarn prepare-abi && rm -Rf dist && tsc -p tsconfig.json", | ||
"prepare-abi": "bash prepare-abi.sh" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit on error | ||
set -e | ||
|
||
# Constants | ||
CONTRACTS_FOLDER="../contracts" | ||
TARGET_ABI_FILE="./src/abi.ts" | ||
|
||
# Move into contracts package and install dependencies | ||
cd $CONTRACTS_FOLDER | ||
|
||
yarn --ignore-scripts && yarn build | ||
|
||
# Move back to artifacts package | ||
cd - > /dev/null | ||
|
||
# Wipe the destination file | ||
echo "// NOTE: Do not edit this file. It is generated automatically." > $TARGET_ABI_FILE | ||
|
||
# Extract the abi field and create a TS file | ||
for SRC_CONTRACT_FILE in $(ls $CONTRACTS_FOLDER/src/*.sol ) | ||
do | ||
SRC_FILE_NAME=$(basename $(echo $SRC_CONTRACT_FILE)) | ||
SRC_FILE_PATH=$CONTRACTS_FOLDER/artifacts/src/$SRC_FILE_NAME/${SRC_FILE_NAME%".sol"}.json | ||
|
||
ABI=$(node -e "console.log(JSON.stringify(JSON.parse(fs.readFileSync(\"$SRC_FILE_PATH\").toString()).abi))") | ||
CONTRACT_NAME=${SRC_FILE_NAME%".sol"} | ||
|
||
echo "const ${CONTRACT_NAME}ABI = $ABI as const;" >> $TARGET_ABI_FILE | ||
echo "export {${CONTRACT_NAME}ABI};" >> $TARGET_ABI_FILE | ||
echo "" >> $TARGET_ABI_FILE | ||
done | ||
|
||
echo "ABI prepared: $TARGET_ABI_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"pluginRepo": { | ||
"mainnet": "0x8c278e37D0817210E18A7958524b7D0a1fAA6F7b", | ||
"sepolia": "0x9e7956C8758470dE159481e5DD0d08F8B59217A2", | ||
"holesky": "0xde1414F52A885cb9b899870f85bDCdb2Dec7C5dd", | ||
"devSepolia": "0xA0901B5BC6e04F14a9D0d094653E047644586DdE", | ||
"polygon": "0x5A5035E7E8aeff220540F383a9cf8c35929bcF31", | ||
"mumbai": "0x2c4690b8be39adAd4F15A69340d5035aC6E53eEF", | ||
"base": "0xcDC4b0BC63AEfFf3a7826A19D101406C6322A585", | ||
"baseSepolia": "0x9e7956C8758470dE159481e5DD0d08F8B59217A2", | ||
"arbitrum": "0x7553E6Fb020c5740768cF289e603770AA09b7aE2", | ||
"arbitrumSepolia": "0x9e7956C8758470dE159481e5DD0d08F8B59217A2", | ||
"linea": "0x2667636E0f5eA63c771509e1d3377177E9Da056D", | ||
"lineaSepolia": "0x86B433017Ce556ED93e6D34d6Ba0e3a9EB19015C", | ||
"zksync": "0x83f88d380073c8F929fAB649F3d016649c101D3A", | ||
"zksyncSepolia": "0x2cae809b6ca149b49cBcA8B887Da2805174052F3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from "./abi"; | ||
|
||
import * as addresses from "./addresses.json"; | ||
export {addresses}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "./dist", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
typescript@^5.5.4: | ||
version "5.7.3" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" | ||
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,24 +31,23 @@ | |
"@openzeppelin/contracts-upgradeable": "^4.9.6" | ||
}, | ||
"devDependencies": { | ||
"@aragon/osx": "^1.4.0", | ||
"@aragon/osx-commons-configs": "^0.8.0", | ||
"@aragon/osx-commons-sdk": "^0.2.0", | ||
"@aragon/osx-ethers": "^1.4.0", | ||
"@aragon/osx": "^1.4.0", | ||
"@aragon/osx-v1.0.0": "npm:@aragon/[email protected]", | ||
"@aragon/osx-v1.3.0": "npm:@aragon/[email protected]", | ||
"@matterlabs/hardhat-zksync-deploy": "0.8", | ||
"@matterlabs/hardhat-zksync-node": "0.1.0", | ||
"@matterlabs/hardhat-zksync-solc": "1.2.5", | ||
"@matterlabs/hardhat-zksync-upgradable": "0.4.0", | ||
"@matterlabs/hardhat-zksync-verify": "0.7.0", | ||
"@matterlabs/hardhat-zksync-ethers": "0.0.1-beta.2", | ||
"zksync-ethers": "5.7.0", | ||
"@ethersproject/abi": "5.7.0", | ||
"@ethersproject/abstract-signer": "5.7.0", | ||
"@ethersproject/bignumber": "5.7.0", | ||
"@ethersproject/bytes": "5.7.0", | ||
"@ethersproject/providers": "5.7.2", | ||
"@matterlabs/hardhat-zksync-deploy": "0.8", | ||
"@matterlabs/hardhat-zksync-ethers": "0.0.1-beta.2", | ||
"@matterlabs/hardhat-zksync-node": "0.1.0", | ||
"@matterlabs/hardhat-zksync-solc": "1.2.5", | ||
"@matterlabs/hardhat-zksync-upgradable": "0.4.0", | ||
"@matterlabs/hardhat-zksync-verify": "0.7.0", | ||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6", | ||
"@nomicfoundation/hardhat-network-helpers": "^1.0.8", | ||
"@nomicfoundation/hardhat-toolbox": "^2.0.2", | ||
|
@@ -77,6 +76,6 @@ | |
"ts-node": "^10.9.1", | ||
"typechain": "^8.3.2", | ||
"typescript": "^5.2.2", | ||
"undici": "^6.11.1" | ||
"zksync-ethers": "5.7.0" | ||
} | ||
} |
Oops, something went wrong.