Skip to content

Commit

Permalink
Add magicdrop-types package and setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
channing-magiceden committed Sep 30, 2024
1 parent 577383f commit 0183432
Show file tree
Hide file tree
Showing 17 changed files with 721 additions and 28 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ on:
jobs:
unit_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js '18.x'
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: cd cosign-server && npm ci
- run: npm run build
- run: npm run lint
node-version: "18.x"
- name: Install dependencies
run: npm ci
- name: Install Cosign Server dependencies
run: cd cosign-server && npm ci
- name: Build
run: npm run build
- name: Run lint
run: npm run lint
- name: Run Coverage and Upload to CodeCov
run: |
npm run coverage; \
Expand Down
42 changes: 36 additions & 6 deletions .github/workflows/deploy_npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,48 @@ on:
release:
types: [published]
jobs:
build:
publish_magicdrop_types:
environment: publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./magicdrop-types
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Use Node.js '18.x'
uses: actions/setup-node@v2
with:
node-version: "16.x"
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish --access public
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish_magicdrop:
environment: publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js '18.x'
uses: actions/setup-node@v2
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 4 additions & 5 deletions contracts/ERC1155M.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./utils/Constants.sol";

import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "./IERC1155M.sol";
import "../magicdrop-types/contracts/IERC1155M.sol";

/**
* @title ERC1155M
Expand Down
2 changes: 1 addition & 1 deletion contracts/ERC721CM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "./creator-token-standards/ERC721ACQueryable.sol";
import "./IERC721M.sol";
import "./utils/Constants.sol";
import "../magicdrop-types/contracts/IERC721M.sol";

/**
* @title ERC721CM
Expand Down
2 changes: 1 addition & 1 deletion contracts/ERC721CMInitializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./creator-token-standards/ERC721ACQueryableInitializable.sol";
import "./access/OwnableInitializable.sol";
import "./IERC721MInitializable.sol";
import "./utils/Constants.sol";
import "../magicdrop-types/contracts/IERC721MInitializable.sol";

/**
* @title ERC721CMInitializable
Expand Down
2 changes: 1 addition & 1 deletion contracts/ERC721M.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "./IERC721M.sol";
import "./utils/Constants.sol";
import "../magicdrop-types/contracts/IERC721M.sol";

/**
* @title ERC721M
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;


interface IERC1155M {
error CannotIncreaseMaxMintableSupply();
error CosignerNotSet();
Expand Down
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions magicdrop-types/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'dotenv/config';

Check failure on line 1 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"dotenv" is extraneous

import "@nomicfoundation/hardhat-verify";

Check failure on line 3 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"@nomicfoundation/hardhat-verify" is extraneous
import '@nomiclabs/hardhat-waffle';

Check failure on line 4 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"@nomiclabs/hardhat-waffle" is extraneous
import '@typechain/hardhat';

Check failure on line 5 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"@typechain/hardhat" is extraneous
import 'hardhat-contract-sizer';

Check failure on line 6 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"hardhat-contract-sizer" is extraneous
import 'hardhat-gas-reporter';

Check failure on line 7 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"hardhat-gas-reporter" is extraneous
import 'hardhat-watcher';

Check failure on line 8 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"hardhat-watcher" is extraneous
import { HardhatUserConfig, task, types } from 'hardhat/config';

Check failure on line 9 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"hardhat" is extraneous
import 'solidity-coverage';

Check failure on line 10 in magicdrop-types/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / unit_test

"solidity-coverage" is extraneous

const config: HardhatUserConfig = {
solidity: {
version: '0.8.20',
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 20,
details: {
yulDetails: {
optimizerSteps: "dhfoD[xarrscLMcCTU]uljmul",
},
},
},
},
},
paths: {
artifacts: './artifacts',
cache: './cache',
sources: './contracts',
tests: './test',
},
};


export default config;
Loading

0 comments on commit 0183432

Please sign in to comment.