Skip to content

Commit b399976

Browse files
committed
Init
1 parent 2629fd2 commit b399976

File tree

11 files changed

+9543
-0
lines changed

11 files changed

+9543
-0
lines changed

.github/workflows/slither.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Slither Analysis
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.sol'
7+
pull_request:
8+
paths:
9+
- '**/*.sol'
10+
11+
permissions:
12+
contents: read
13+
statuses: write
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Run Slither
24+
uses: crytic/slither-action@v0.4.1
25+
id: slither
26+
with:
27+
sarif: results.sarif
28+
fail-on: medium
29+
30+
- name: Upload SARIF file (only on main branch push or PR targeting main)
31+
if: |
32+
github.event_name == 'push' && github.ref == 'refs/heads/main' ||
33+
github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
34+
uses: github/codeql-action/upload-sarif@v3
35+
with:
36+
sarif_file: ${{ steps.slither.outputs.sarif }}

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.sol'
7+
pull_request:
8+
paths:
9+
- '**/*.sol'
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
- name: Use Node.js 18
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
- name: Install dependencies
22+
run: npm ci
23+
- name: Run tests
24+
run: npx hardhat test

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules
2+
.env
3+
4+
# Hardhat files
5+
/cache
6+
/artifacts
7+
8+
# TypeChain files
9+
/typechain
10+
/typechain-types
11+
12+
# solidity-coverage files
13+
/coverage
14+
/coverage.json
15+
16+
# Hardhat Ignition default folder for deployments against a local node
17+
ignition/deployments/chain-31337

contracts/RaffleFactory.sol

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.28;
3+
4+
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
5+
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
6+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
7+
8+
contract RaffleFactory is Initializable, UUPSUpgradeable, OwnableUpgradeable {
9+
function initialize() public initializer {
10+
__Ownable_init(msg.sender);
11+
__UUPSUpgradeable_init();
12+
}
13+
14+
constructor() {
15+
_disableInitializers();
16+
}
17+
18+
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
19+
}

contracts/RaffleNFT.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.28;
3+
4+
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
5+
6+
contract RaffleNFT is ERC721 {
7+
constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {}
8+
}

hardhat.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require("@nomicfoundation/hardhat-toolbox");
2+
require('@openzeppelin/hardhat-upgrades');
3+
4+
/** @type import('hardhat/config').HardhatUserConfig */
5+
module.exports = {
6+
solidity: {
7+
version: "0.8.28",
8+
settings: {
9+
optimizer: {
10+
enabled: true,
11+
runs: 1000,
12+
},
13+
},
14+
},
15+
};

ignition/modules/Factory.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This setup uses Hardhat Ignition to manage smart contract deployments.
2+
// Learn more about it at https://hardhat.org/ignition
3+
4+
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");
5+
6+
module.exports = buildModule("FactoryModule", (m) => {
7+
// TODO: Add contract deployment logic
8+
return {};
9+
});

0 commit comments

Comments
 (0)