forked from aragon/osx-plugin-template-hardhat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
860 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Aragon OSx Commons Artifacts | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
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.4.0 | ||
|
||
## Added | ||
|
||
- Add admin plugin's contracts artifacts of version 1.2. |
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,31 @@ | ||
# Artifacts Package for Admin Plugin | ||
|
||
This package is responsible for generating and storing ABIs for smart contracts. It checks out the specified branch, compiles the contracts, and saves the ABIs in the `src/abis/` directory. The package can then be published to NPM for use in other projects. | ||
|
||
## Installation | ||
|
||
Run the following command to install dependencies: | ||
```sh | ||
yarn install | ||
``` | ||
|
||
## Usage | ||
### Generate ABIs | ||
Run: | ||
```sh | ||
yarn generate | ||
``` | ||
This will: | ||
1. Check out the `packages/contracts`. | ||
2. Install dependencies. | ||
3. Compile contracts using Hardhat. | ||
4. Generate ABIs using Wagmi. | ||
5. Save the ABIs in `src/abis/`. | ||
|
||
## Publishing | ||
|
||
To publish the package to NPM, run: | ||
```sh | ||
yarn publish --access public | ||
``` | ||
Ensure the package version is updated in `package.json` before publishing. |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit on error | ||
|
||
# Define directories | ||
CONTRACTS_DIR="../contracts" | ||
GENERATED_ABIS="../contracts/generated/abis.ts" | ||
OUTPUT_ABIS_DIR="src/abis" | ||
|
||
# Move into contracts package and install dependencies | ||
cd $CONTRACTS_DIR | ||
|
||
yarn install | ||
|
||
yarn build | ||
|
||
yarn wagmi:generate | ||
|
||
# Move back to artifacts package | ||
cd - | ||
|
||
# Ensure the output directory exists | ||
mkdir -p "$OUTPUT_ABIS_DIR" | ||
|
||
# Copy the generated ABIs to the output directory | ||
if [ -f "$GENERATED_ABIS" ]; then | ||
cp "$GENERATED_ABIS" "$OUTPUT_ABIS_DIR/abis.ts" | ||
else | ||
echo "Warning: generated/abis.ts not found." | ||
fi | ||
|
||
echo "ABI generation complete. ABIs are stored in $OUTPUT_ABIS_DIR." |
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/admin-plugin-artifacts", | ||
"author": "Aragon X", | ||
"version": "1.4.0", | ||
"license": "AGPL-3.0-or-later", | ||
"description": "The Aragon OSx Solidity contracts ABIs", | ||
"typings": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"generate": "bash generateAbis.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,10 @@ | ||
{ | ||
"network": { | ||
"mainnet": { | ||
"pluginRepo":"" | ||
}, | ||
"polygon": { | ||
"pluginRepo":"" | ||
} | ||
} | ||
} |
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 @@ | ||
export * from './abis/abis'; |
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,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "./dist" | ||
}, | ||
"include": ["src"] | ||
} |
Oops, something went wrong.