Skip to content

Commit

Permalink
Use solc internally to resolve inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Nov 7, 2024
1 parent 138651b commit 27821a6
Show file tree
Hide file tree
Showing 11 changed files with 2,403 additions and 1,848 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: checks

on:
pull_request:
push:
branches: [main]
pull_request:
push:
branches: [main]

env:
CI: true
CI: true

jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Use cached node_modules
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Use cached node_modules
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn install --immutable
- name: Install
run: yarn install --immutable

- name: Lint
run: yarn lint
- name: Lint
run: yarn lint

- name: Test
run: yarn test
- name: Test
run: yarn test
78 changes: 39 additions & 39 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: NPM Release

on:
release:
types: [released]
release:
types: [released]

env:
CI: true
CI: true

jobs:
publish:
name: Build & Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x

- name: Install
run: yarn install --immutable

- name: Build
run: yarn build

- name: Set version
run: npm version --no-git-tag-version ${{github.event.release.tag_name}}

- name: npm pack
run: npm pack

- uses: actions/upload-artifact@v3
with:
name: package
path: "parity-revive-*.tgz"

- uses: octokit/[email protected]
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
publish:
name: Build & Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x

- name: Install
run: yarn install --immutable

- name: Build
run: yarn build

- name: Set version
run: npm version --no-git-tag-version ${{github.event.release.tag_name}}

- name: npm pack
run: npm pack

- uses: actions/upload-artifact@v3
with:
name: package
path: 'parity-revive-*.tgz'

- uses: octokit/[email protected]
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
22 changes: 22 additions & 0 deletions fixtures/token.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";

contract MyToken is ERC20, Ownable, ERC20Permit {
constructor(address initialOwner)
ERC20("MyToken", "MTK")
Ownable(initialOwner)
ERC20Permit("MyToken")
{
_mint(msg.sender, 100 * 10 ** decimals());
}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}

Loading

0 comments on commit 27821a6

Please sign in to comment.