Skip to content

Commit 5d69197

Browse files
committed
feat: initial import
0 parents  commit 5d69197

File tree

14 files changed

+4979
-0
lines changed

14 files changed

+4979
-0
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
BASH_ENV: ~/.profile
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./scripts
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: curl https://get.volta.sh | bash
20+
- run: npm i ci
21+
- run: npm run test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.idea/
2+
/node_modules/
3+
/dist/
4+
tmp/

LICENSE

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Solidity preprocessor
2+
3+
[![test](https://github.com/andreas-timm/solidity-preprocessor/actions/workflows/test.yml/badge.svg)](https://github.com/andreas-timm/solidity-preprocessor/actions/workflows/test.yml)
4+
5+
## Motivation
6+
7+
8+
## Usage
9+
```solidity
10+
// TestNft1155.sol
11+
// SPDX-License-Identifier: UNLICENSED
12+
13+
pragma solidity ^0.8.25;
14+
15+
import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
16+
17+
contract TestNft1155 is ERC1155 {
18+
constructor(string memory uri_) ERC1155(uri_) {
19+
_mint(address(0), 1, 100, "");
20+
}
21+
}
22+
```
23+
24+
```ts
25+
import { preprocessor } from "@andreas-timm/solidity-preprocessor";
26+
27+
const res = await preprocessor({path: 'contracts/TestNft1155.sol', replace: [
28+
['_mint(address(0), 1, 100, "")', '_mint(0x630C6C3180d3b4B6912644D046f6769dA3e54843, 1, 10000, "")']
29+
]});
30+
31+
console.log(res.bytecode);
32+
```
33+
34+
## License
35+
[![CC BY 4.0][cc-by-shield]][cc-by]
36+
37+
This work is licensed under a [Creative Commons Attribution 4.0 International License][cc-by].
38+
39+
[![CC BY 4.0][cc-by-image]][cc-by]
40+
41+
[cc-by]: http://creativecommons.org/licenses/by/4.0/
42+
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
43+
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
44+
45+
- [LICENSE](https://github.com/andreas-timm//blob/main/LICENSE)
46+
- Author: [Andreas Timm](https://github.com/andreas-timm)

contracts/TestNft1155.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
3+
pragma solidity ^0.8.25;
4+
5+
import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
6+
7+
contract TestNft1155 is ERC1155 {
8+
constructor(string memory uri_) ERC1155(uri_) {
9+
_mint(address(0), 1, 100, "");
10+
_mint(address(1), 1, 100, "");
11+
}
12+
}

hardhat.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { HardhatUserConfig } from 'hardhat/config'
2+
3+
const hardhatConfig: HardhatUserConfig = {}
4+
5+
// noinspection JSUnusedGlobalSymbols
6+
export default hardhatConfig

0 commit comments

Comments
 (0)